@gadgetinc/ggt 1.0.4 → 1.0.6

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 (220) hide show
  1. package/dist/add-JIIVAOWH.js +84 -0
  2. package/dist/add-JIIVAOWH.js.map +7 -0
  3. package/dist/build-4BGA4IZE.js +3 -0
  4. package/dist/build-4BGA4IZE.js.map +7 -0
  5. package/dist/chunk-57XALM2W.js +2 -0
  6. package/dist/chunk-57XALM2W.js.map +7 -0
  7. package/dist/chunk-5WC5D4WL.js +2 -0
  8. package/dist/chunk-5WC5D4WL.js.map +7 -0
  9. package/dist/chunk-APHXRHNI.js +8 -0
  10. package/dist/chunk-APHXRHNI.js.map +7 -0
  11. package/dist/chunk-AQRCAWW4.js +24 -0
  12. package/dist/chunk-AQRCAWW4.js.map +7 -0
  13. package/dist/chunk-BOQUW6DS.js +33 -0
  14. package/dist/chunk-BOQUW6DS.js.map +7 -0
  15. package/dist/chunk-BSCZOMV4.js +2 -0
  16. package/dist/chunk-BSCZOMV4.js.map +7 -0
  17. package/dist/chunk-CKSTMUDN.js +17 -0
  18. package/dist/chunk-CKSTMUDN.js.map +7 -0
  19. package/dist/chunk-D2K5XPNJ.js +2 -0
  20. package/dist/chunk-D2K5XPNJ.js.map +7 -0
  21. package/dist/chunk-ERYUXLYS.js +11 -0
  22. package/dist/chunk-ERYUXLYS.js.map +7 -0
  23. package/dist/chunk-F3EZ4KS3.js +2 -0
  24. package/dist/chunk-F3EZ4KS3.js.map +7 -0
  25. package/{lib/commands/push.js → dist/chunk-GACF5GYF.js} +7 -48
  26. package/dist/chunk-GACF5GYF.js.map +7 -0
  27. package/dist/chunk-GBCD37US.js +57 -0
  28. package/dist/chunk-GBCD37US.js.map +7 -0
  29. package/dist/chunk-GOBNB5VT.js +2 -0
  30. package/dist/chunk-GOBNB5VT.js.map +7 -0
  31. package/dist/chunk-HKBXEZNF.js +2 -0
  32. package/dist/chunk-HKBXEZNF.js.map +7 -0
  33. package/dist/chunk-P2XPMNL6.js +183 -0
  34. package/dist/chunk-P2XPMNL6.js.map +7 -0
  35. package/dist/chunk-PSRZ5JH5.js +27 -0
  36. package/dist/chunk-PSRZ5JH5.js.map +7 -0
  37. package/dist/chunk-Q5N5L6H3.js +6 -0
  38. package/dist/chunk-Q5N5L6H3.js.map +7 -0
  39. package/dist/chunk-RJOIQTYZ.js +126 -0
  40. package/dist/chunk-RJOIQTYZ.js.map +7 -0
  41. package/dist/chunk-XCHCCJJZ.js +2 -0
  42. package/dist/chunk-XCHCCJJZ.js.map +7 -0
  43. package/dist/deploy-KMGAGIDE.js +30 -0
  44. package/dist/deploy-KMGAGIDE.js.map +7 -0
  45. package/dist/dev-VHJ52BEA.js +57 -0
  46. package/dist/dev-VHJ52BEA.js.map +7 -0
  47. package/dist/esm-BL3OM5UJ.js +33 -0
  48. package/dist/esm-BL3OM5UJ.js.map +7 -0
  49. package/dist/list-5E3R22IC.js +11 -0
  50. package/dist/list-5E3R22IC.js.map +7 -0
  51. package/dist/login-3DL45WY7.js +2 -0
  52. package/dist/login-3DL45WY7.js.map +7 -0
  53. package/dist/logout-HX6MM4S6.js +7 -0
  54. package/dist/logout-HX6MM4S6.js.map +7 -0
  55. package/dist/main.js +45 -0
  56. package/dist/main.js.map +7 -0
  57. package/dist/open-GEEWPSF4.js +74 -0
  58. package/dist/open-GEEWPSF4.js.map +7 -0
  59. package/{lib/commands/pull.js → dist/pull-T2Q4M4UN.js} +7 -48
  60. package/dist/pull-T2Q4M4UN.js.map +7 -0
  61. package/dist/push-LUW25FYF.js +2 -0
  62. package/dist/push-LUW25FYF.js.map +7 -0
  63. package/dist/status-5VZH3KXH.js +14 -0
  64. package/dist/status-5VZH3KXH.js.map +7 -0
  65. package/dist/version-OF4TQ2K6.js +11 -0
  66. package/dist/version-OF4TQ2K6.js.map +7 -0
  67. package/dist/whoami-V3XD27QH.js +7 -0
  68. package/dist/whoami-V3XD27QH.js.map +7 -0
  69. package/package.json +73 -75
  70. package/lib/__generated__/graphql.js +0 -78
  71. package/lib/__generated__/graphql.js.map +0 -1
  72. package/lib/commands/add.js +0 -385
  73. package/lib/commands/add.js.map +0 -1
  74. package/lib/commands/deploy.js +0 -287
  75. package/lib/commands/deploy.js.map +0 -1
  76. package/lib/commands/dev.js +0 -374
  77. package/lib/commands/dev.js.map +0 -1
  78. package/lib/commands/list.js +0 -47
  79. package/lib/commands/list.js.map +0 -1
  80. package/lib/commands/login.js +0 -96
  81. package/lib/commands/login.js.map +0 -1
  82. package/lib/commands/logout.js +0 -20
  83. package/lib/commands/logout.js.map +0 -1
  84. package/lib/commands/open.js +0 -159
  85. package/lib/commands/open.js.map +0 -1
  86. package/lib/commands/pull.js.map +0 -1
  87. package/lib/commands/push.js.map +0 -1
  88. package/lib/commands/root.js +0 -110
  89. package/lib/commands/root.js.map +0 -1
  90. package/lib/commands/status.js +0 -56
  91. package/lib/commands/status.js.map +0 -1
  92. package/lib/commands/version.js +0 -18
  93. package/lib/commands/version.js.map +0 -1
  94. package/lib/commands/whoami.js +0 -23
  95. package/lib/commands/whoami.js.map +0 -1
  96. package/lib/ggt.js +0 -65
  97. package/lib/ggt.js.map +0 -1
  98. package/lib/main.js +0 -5
  99. package/lib/main.js.map +0 -1
  100. package/lib/services/app/api/api.js +0 -191
  101. package/lib/services/app/api/api.js.map +0 -1
  102. package/lib/services/app/api/operation.js +0 -23
  103. package/lib/services/app/api/operation.js.map +0 -1
  104. package/lib/services/app/app.js +0 -95
  105. package/lib/services/app/app.js.map +0 -1
  106. package/lib/services/app/arg.js +0 -28
  107. package/lib/services/app/arg.js.map +0 -1
  108. package/lib/services/app/client.js +0 -182
  109. package/lib/services/app/client.js.map +0 -1
  110. package/lib/services/app/edit/edit.js +0 -191
  111. package/lib/services/app/edit/edit.js.map +0 -1
  112. package/lib/services/app/edit/operation.js +0 -155
  113. package/lib/services/app/edit/operation.js.map +0 -1
  114. package/lib/services/app/error.js +0 -65
  115. package/lib/services/app/error.js.map +0 -1
  116. package/lib/services/command/arg.js +0 -55
  117. package/lib/services/command/arg.js.map +0 -1
  118. package/lib/services/command/command.js +0 -47
  119. package/lib/services/command/command.js.map +0 -1
  120. package/lib/services/command/context.js +0 -209
  121. package/lib/services/command/context.js.map +0 -1
  122. package/lib/services/config/config.js +0 -133
  123. package/lib/services/config/config.js.map +0 -1
  124. package/lib/services/config/env.js +0 -22
  125. package/lib/services/config/env.js.map +0 -1
  126. package/lib/services/config/package-json.js +0 -9
  127. package/lib/services/config/package-json.js.map +0 -1
  128. package/lib/services/filesync/changes.js +0 -134
  129. package/lib/services/filesync/changes.js.map +0 -1
  130. package/lib/services/filesync/conflicts.js +0 -140
  131. package/lib/services/filesync/conflicts.js.map +0 -1
  132. package/lib/services/filesync/directory.js +0 -269
  133. package/lib/services/filesync/directory.js.map +0 -1
  134. package/lib/services/filesync/error.js +0 -137
  135. package/lib/services/filesync/error.js.map +0 -1
  136. package/lib/services/filesync/file.js +0 -3
  137. package/lib/services/filesync/file.js.map +0 -1
  138. package/lib/services/filesync/filesync.js +0 -791
  139. package/lib/services/filesync/filesync.js.map +0 -1
  140. package/lib/services/filesync/hashes.js +0 -172
  141. package/lib/services/filesync/hashes.js.map +0 -1
  142. package/lib/services/filesync/strategy.js +0 -59
  143. package/lib/services/filesync/strategy.js.map +0 -1
  144. package/lib/services/filesync/sync-json.js +0 -475
  145. package/lib/services/filesync/sync-json.js.map +0 -1
  146. package/lib/services/http/auth.js +0 -70
  147. package/lib/services/http/auth.js.map +0 -1
  148. package/lib/services/http/http.js +0 -136
  149. package/lib/services/http/http.js.map +0 -1
  150. package/lib/services/output/confirm.js +0 -149
  151. package/lib/services/output/confirm.js.map +0 -1
  152. package/lib/services/output/footer.js +0 -22
  153. package/lib/services/output/footer.js.map +0 -1
  154. package/lib/services/output/log/field.js +0 -3
  155. package/lib/services/output/log/field.js.map +0 -1
  156. package/lib/services/output/log/format/format.js +0 -8
  157. package/lib/services/output/log/format/format.js.map +0 -1
  158. package/lib/services/output/log/format/json.js +0 -37
  159. package/lib/services/output/log/format/json.js.map +0 -1
  160. package/lib/services/output/log/format/pretty.js +0 -158
  161. package/lib/services/output/log/format/pretty.js.map +0 -1
  162. package/lib/services/output/log/level.js +0 -41
  163. package/lib/services/output/log/level.js.map +0 -1
  164. package/lib/services/output/log/logger.js +0 -53
  165. package/lib/services/output/log/logger.js.map +0 -1
  166. package/lib/services/output/log/structured.js +0 -52
  167. package/lib/services/output/log/structured.js.map +0 -1
  168. package/lib/services/output/notify.js +0 -27
  169. package/lib/services/output/notify.js.map +0 -1
  170. package/lib/services/output/output.js +0 -197
  171. package/lib/services/output/output.js.map +0 -1
  172. package/lib/services/output/print.js +0 -31
  173. package/lib/services/output/print.js.map +0 -1
  174. package/lib/services/output/problems.js +0 -84
  175. package/lib/services/output/problems.js.map +0 -1
  176. package/lib/services/output/prompt.js +0 -185
  177. package/lib/services/output/prompt.js.map +0 -1
  178. package/lib/services/output/report.js +0 -190
  179. package/lib/services/output/report.js.map +0 -1
  180. package/lib/services/output/select.js +0 -198
  181. package/lib/services/output/select.js.map +0 -1
  182. package/lib/services/output/spinner.js +0 -141
  183. package/lib/services/output/spinner.js.map +0 -1
  184. package/lib/services/output/sprint.js +0 -44
  185. package/lib/services/output/sprint.js.map +0 -1
  186. package/lib/services/output/symbols.js +0 -23
  187. package/lib/services/output/symbols.js.map +0 -1
  188. package/lib/services/output/table.js +0 -98
  189. package/lib/services/output/table.js.map +0 -1
  190. package/lib/services/output/timestamp.js +0 -12
  191. package/lib/services/output/timestamp.js.map +0 -1
  192. package/lib/services/output/update.js +0 -99
  193. package/lib/services/output/update.js.map +0 -1
  194. package/lib/services/user/session.js +0 -54
  195. package/lib/services/user/session.js.map +0 -1
  196. package/lib/services/user/user.js +0 -76
  197. package/lib/services/user/user.js.map +0 -1
  198. package/lib/services/util/assert.js +0 -11
  199. package/lib/services/util/assert.js.map +0 -1
  200. package/lib/services/util/boolean.js +0 -15
  201. package/lib/services/util/boolean.js.map +0 -1
  202. package/lib/services/util/collection.js +0 -38
  203. package/lib/services/util/collection.js.map +0 -1
  204. package/lib/services/util/function.js +0 -153
  205. package/lib/services/util/function.js.map +0 -1
  206. package/lib/services/util/is.js +0 -97
  207. package/lib/services/util/is.js.map +0 -1
  208. package/lib/services/util/json.js +0 -33
  209. package/lib/services/util/json.js.map +0 -1
  210. package/lib/services/util/number.js +0 -27
  211. package/lib/services/util/number.js.map +0 -1
  212. package/lib/services/util/object.js +0 -104
  213. package/lib/services/util/object.js.map +0 -1
  214. package/lib/services/util/paths.js +0 -36
  215. package/lib/services/util/paths.js.map +0 -1
  216. package/lib/services/util/promise.js +0 -74
  217. package/lib/services/util/promise.js.map +0 -1
  218. package/lib/services/util/types.js +0 -5
  219. package/lib/services/util/types.js.map +0 -1
  220. package/npm-shrinkwrap.json +0 -29545
@@ -0,0 +1,24 @@
1
+ import{B as W,E as _s,F as ws,G as ke,H as ie,I as ee,J as Fe,M as Qt,N as Es,a as ms,b as ys,g as gs,h as bt,x as bs,z as ue}from"./chunk-GBCD37US.js";import{a as H,c as L,e as X,g as u}from"./chunk-5WC5D4WL.js";var xs=L((_u,Ss)=>{u();var Ce=1e3,Pe=Ce*60,Ae=Pe*60,ge=Ae*24,no=ge*7,io=ge*365.25;Ss.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return oo(t);if(r==="number"&&isFinite(t))return e.long?co(t):ao(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function oo(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]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return r*io;case"weeks":case"week":case"w":return r*no;case"days":case"day":case"d":return r*ge;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ae;case"minutes":case"minute":case"mins":case"min":case"m":return r*Pe;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function ao(t){var e=Math.abs(t);return e>=ge?Math.round(t/ge)+"d":e>=Ae?Math.round(t/Ae)+"h":e>=Pe?Math.round(t/Pe)+"m":e>=Ce?Math.round(t/Ce)+"s":t+"ms"}function co(t){var e=Math.abs(t);return e>=ge?_t(t,e,ge,"day"):e>=Ae?_t(t,e,Ae,"hour"):e>=Pe?_t(t,e,Pe,"minute"):e>=Ce?_t(t,e,Ce,"second"):t+" ms"}function _t(t,e,r,s){var n=e>=r*1.5;return Math.round(t/r)+" "+s+(n?"s":"")}});var Rs=L((Xt,Zt)=>{u();(function(t,e){typeof Xt=="object"&&typeof Zt<"u"?Zt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Xt,function(){"use strict";var t=1e3,e=6e4,r=36e5,s="millisecond",n="second",i="minute",o="hour",a="day",l="week",d="month",y="quarter",R="year",g="date",S="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|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,A={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(k){var E=["th","st","nd","rd"],b=k%100;return"["+k+(E[(b-20)%10]||E[b]||E[0])+"]"}},_=function(k,E,b){var T=String(k);return!T||T.length>=E?k:""+Array(E+1-T.length).join(b)+k},j={s:_,z:function(k){var E=-k.utcOffset(),b=Math.abs(E),T=Math.floor(b/60),w=b%60;return(E<=0?"+":"-")+_(T,2,"0")+":"+_(w,2,"0")},m:function k(E,b){if(E.date()<b.date())return-k(b,E);var T=12*(b.year()-E.year())+(b.month()-E.month()),w=E.clone().add(T,d),C=b-w<0,P=E.clone().add(T+(C?-1:1),d);return+(-(T+(b-w)/(C?w-P:P-w))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:d,y:R,w:l,d:a,D:g,h:o,m:i,s:n,ms:s,Q:y}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},x="en",D={};D[x]=A;var U="$isDayjsObject",z=function(k){return k instanceof yt||!(!k||!k[U])},Q=function k(E,b,T){var w;if(!E)return x;if(typeof E=="string"){var C=E.toLowerCase();D[C]&&(w=C),b&&(D[C]=b,w=C);var P=E.split("-");if(!w&&P.length>1)return k(P[0])}else{var I=E.name;D[I]=E,w=I}return!T&&w&&(x=w),w||!T&&x},M=function(k,E){if(z(k))return k.clone();var b=typeof E=="object"?E:{};return b.date=k,b.args=arguments,new yt(b)},v=j;v.l=Q,v.i=z,v.w=function(k,E){return M(k,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var yt=function(){function k(b){this.$L=Q(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[U]=!0}var E=k.prototype;return E.parse=function(b){this.$d=function(T){var w=T.date,C=T.utc;if(w===null)return new Date(NaN);if(v.u(w))return new Date;if(w instanceof Date)return new Date(w);if(typeof w=="string"&&!/Z$/i.test(w)){var P=w.match(O);if(P){var I=P[2]-1||0,B=(P[7]||"0").substring(0,3);return C?new Date(Date.UTC(P[1],I,P[3]||1,P[4]||0,P[5]||0,P[6]||0,B)):new Date(P[1],I,P[3]||1,P[4]||0,P[5]||0,P[6]||0,B)}}return new Date(w)}(b),this.init()},E.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},E.$utils=function(){return v},E.isValid=function(){return this.$d.toString()!==S},E.isSame=function(b,T){var w=M(b);return this.startOf(T)<=w&&w<=this.endOf(T)},E.isAfter=function(b,T){return M(b)<this.startOf(T)},E.isBefore=function(b,T){return this.endOf(T)<M(b)},E.$g=function(b,T,w){return v.u(b)?this[T]:this.set(w,b)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(b,T){var w=this,C=!!v.u(T)||T,P=v.p(b),I=function(ye,Y){var he=v.w(w.$u?Date.UTC(w.$y,Y,ye):new Date(w.$y,Y,ye),w);return C?he:he.endOf(a)},B=function(ye,Y){return v.w(w.toDate()[ye].apply(w.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(Y)),w)},F=this.$W,G=this.$M,Z=this.$D,Te="set"+(this.$u?"UTC":"");switch(P){case R:return C?I(1,0):I(31,11);case d:return C?I(1,G):I(0,G+1);case l:var me=this.$locale().weekStart||0,Me=(F<me?F+7:F)-me;return I(C?Z-Me:Z+(6-Me),G);case a:case g:return B(Te+"Hours",0);case o:return B(Te+"Minutes",1);case i:return B(Te+"Seconds",2);case n:return B(Te+"Milliseconds",3);default:return this.clone()}},E.endOf=function(b){return this.startOf(b,!1)},E.$set=function(b,T){var w,C=v.p(b),P="set"+(this.$u?"UTC":""),I=(w={},w[a]=P+"Date",w[g]=P+"Date",w[d]=P+"Month",w[R]=P+"FullYear",w[o]=P+"Hours",w[i]=P+"Minutes",w[n]=P+"Seconds",w[s]=P+"Milliseconds",w)[C],B=C===a?this.$D+(T-this.$W):T;if(C===d||C===R){var F=this.clone().set(g,1);F.$d[I](B),F.init(),this.$d=F.set(g,Math.min(this.$D,F.daysInMonth())).$d}else I&&this.$d[I](B);return this.init(),this},E.set=function(b,T){return this.clone().$set(b,T)},E.get=function(b){return this[v.p(b)]()},E.add=function(b,T){var w,C=this;b=Number(b);var P=v.p(T),I=function(G){var Z=M(C);return v.w(Z.date(Z.date()+Math.round(G*b)),C)};if(P===d)return this.set(d,this.$M+b);if(P===R)return this.set(R,this.$y+b);if(P===a)return I(1);if(P===l)return I(7);var B=(w={},w[i]=e,w[o]=r,w[n]=t,w)[P]||1,F=this.$d.getTime()+b*B;return v.w(F,this)},E.subtract=function(b,T){return this.add(-1*b,T)},E.format=function(b){var T=this,w=this.$locale();if(!this.isValid())return w.invalidDate||S;var C=b||"YYYY-MM-DDTHH:mm:ssZ",P=v.z(this),I=this.$H,B=this.$m,F=this.$M,G=w.weekdays,Z=w.months,Te=w.meridiem,me=function(Y,he,ze,gt){return Y&&(Y[he]||Y(T,C))||ze[he].slice(0,gt)},Me=function(Y){return v.s(I%12||12,Y,"0")},ye=Te||function(Y,he,ze){var gt=Y<12?"AM":"PM";return ze?gt.toLowerCase():gt};return C.replace(f,function(Y,he){return he||function(ze){switch(ze){case"YY":return String(T.$y).slice(-2);case"YYYY":return v.s(T.$y,4,"0");case"M":return F+1;case"MM":return v.s(F+1,2,"0");case"MMM":return me(w.monthsShort,F,Z,3);case"MMMM":return me(Z,F);case"D":return T.$D;case"DD":return v.s(T.$D,2,"0");case"d":return String(T.$W);case"dd":return me(w.weekdaysMin,T.$W,G,2);case"ddd":return me(w.weekdaysShort,T.$W,G,3);case"dddd":return G[T.$W];case"H":return String(I);case"HH":return v.s(I,2,"0");case"h":return Me(1);case"hh":return Me(2);case"a":return ye(I,B,!0);case"A":return ye(I,B,!1);case"m":return String(B);case"mm":return v.s(B,2,"0");case"s":return String(T.$s);case"ss":return v.s(T.$s,2,"0");case"SSS":return v.s(T.$ms,3,"0");case"Z":return P}return null}(Y)||P.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(b,T,w){var C,P=this,I=v.p(T),B=M(b),F=(B.utcOffset()-this.utcOffset())*e,G=this-B,Z=function(){return v.m(P,B)};switch(I){case R:C=Z()/12;break;case d:C=Z();break;case y:C=Z()/3;break;case l:C=(G-F)/6048e5;break;case a:C=(G-F)/864e5;break;case o:C=G/r;break;case i:C=G/e;break;case n:C=G/t;break;default:C=G}return w?C:v.a(C)},E.daysInMonth=function(){return this.endOf(d).$D},E.$locale=function(){return D[this.$L]},E.locale=function(b,T){if(!b)return this.$L;var w=this.clone(),C=Q(b,T,!0);return C&&(w.$L=C),w},E.clone=function(){return v.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},k}(),ps=yt.prototype;return M.prototype=ps,[["$ms",s],["$s",n],["$m",i],["$H",o],["$W",a],["$M",d],["$y",R],["$D",g]].forEach(function(k){ps[k[1]]=function(E){return this.$g(E,k[0],k[1])}}),M.extend=function(k,E){return k.$i||(k(E,yt,M),k.$i=!0),M},M.locale=Q,M.isDayjs=z,M.unix=function(k){return M(1e3*k)},M.en=D[x],M.Ls=D,M.p={},M})});var $s=L((Hu,Hs)=>{u();function Cs(t){return Array.isArray(t)?t:[t]}var nr="",Ps=" ",rr="\\",po=/^\s+$/,mo=/(?:[^\\]|^)\\$/,yo=/^\\!/,go=/^\\#/,bo=/\r?\n/g,_o=/^\.*\/|^\.+$/,sr="/",Ls="node-ignore";typeof Symbol<"u"&&(Ls=Symbol.for("node-ignore"));var As=Ls,wo=(t,e,r)=>Object.defineProperty(t,e,{value:r}),Eo=/([0-z])-([0-z])/g,js=()=>!1,So=t=>t.replace(Eo,(e,r,s)=>r.charCodeAt(0)<=s.charCodeAt(0)?e:nr),xo=t=>{let{length:e}=t;return t.slice(0,e-e%2)},Ro=[[/^\uFEFF/,()=>nr],[/\\?\s+$/,t=>t.indexOf("\\")===0?Ps:nr],[/\\\s/g,()=>Ps],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let s=r.replace(/\\\*/g,"[^\\/]*");return e+s}],[/\\\\\\(?=[$.|*+(){^])/g,()=>rr],[/\\\\/g,()=>rr],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,s,n)=>e===rr?`\\[${r}${xo(s)}${n}`:n==="]"&&s.length%2===0?`[${So(r)}${s}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],Ds=Object.create(null),Oo=(t,e)=>{let r=Ds[t];return r||(r=Ro.reduce((s,n)=>s.replace(n[0],n[1].bind(t)),t),Ds[t]=r),e?new RegExp(r,"i"):new RegExp(r)},ar=t=>typeof t=="string",To=t=>t&&ar(t)&&!po.test(t)&&!mo.test(t)&&t.indexOf("#")!==0,ko=t=>t.split(bo),ir=class{constructor(e,r,s,n){this.origin=e,this.pattern=r,this.negative=s,this.regex=n}},Co=(t,e)=>{let r=t,s=!1;t.indexOf("!")===0&&(s=!0,t=t.substr(1)),t=t.replace(yo,"!").replace(go,"#");let n=Oo(t,e);return new ir(r,t,s,n)},Po=(t,e)=>{throw new e(t)},oe=(t,e,r)=>ar(t)?t?oe.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),vs=t=>_o.test(t);oe.isNotRelative=vs;oe.convert=t=>t;var or=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:s=!1}={}){wo(this,As,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=s,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[As]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(To(e)){let r=Co(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,Cs(ar(e)?ko(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let s=!1,n=!1;return this._rules.forEach(i=>{let{negative:o}=i;if(n===o&&s!==n||o&&!s&&!n&&!r)return;i.regex.test(e)&&(s=!o,n=o)}),{ignored:s,unignored:n}}_test(e,r,s,n){let i=e&&oe.convert(e);return oe(i,e,this._allowRelativePaths?js:Po),this._t(i,r,s,n)}_t(e,r,s,n){if(e in r)return r[e];if(n||(n=e.split(sr)),n.pop(),!n.length)return r[e]=this._testOne(e,s);let i=this._t(n.join(sr)+sr,r,s,n);return r[e]=i.ignored?i:this._testOne(e,s)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return Cs(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},wt=t=>new or(t),Ao=t=>oe(t&&oe.convert(t),t,js);wt.isPathValid=Ao;wt.default=wt;Hs.exports=wt;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");oe.convert=t;let e=/^[a-z]:\//i;oe.isNotRelative=r=>e.test(r)||vs(r)}});var Ns=L((Iu,Is)=>{u();Is.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var r=t.length;if(r<=1)return t;var s="";if(r>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),s="//")}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),s+i.join("/")}});var Ws=L((fr,pr)=>{"use strict";u();Object.defineProperty(fr,"__esModule",{value:!0});function ea(t){return t.encrypted}var dr=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let s=typeof r.connect=="function",n=typeof r.secureConnect=="function",i=typeof r.close=="function",o=()=>{s&&r.connect(),ea(t)&&n&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),i&&t.once("close",r.close)};t.writable&&!t.connecting?o():t.connecting?t.once("connect",o):t.destroyed&&i&&r.close(t._hadError)};fr.default=dr;pr.exports=dr;pr.exports.default=dr});var Qs=L((ml,Ys)=>{"use strict";u();var{PassThrough:ha}=H("stream");Ys.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,s=r==="buffer",n=!1;e?n=!(r||s):r=r||"utf8",s&&(r=null);let i=new ha({objectMode:n});r&&i.setEncoding(r);let o=0,a=[];return i.on("data",l=>{a.push(l),n?o=a.length:o+=l.length}),i.getBufferedValue=()=>e?a:s?Buffer.concat(a,o):a.join(""),i.getBufferedLength=()=>o,i}});var br=L((gl,Ye)=>{"use strict";u();var{constants:ua}=H("buffer"),la=H("stream"),{promisify:da}=H("util"),fa=Qs(),pa=da(la.pipeline),kt=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function gr(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,s=fa(e);return await new Promise((n,i)=>{let o=a=>{a&&s.getBufferedLength()<=ua.MAX_LENGTH&&(a.bufferedData=s.getBufferedValue()),i(a)};(async()=>{try{await pa(t,s),n()}catch(a){o(a)}})(),s.on("data",()=>{s.getBufferedLength()>r&&o(new kt)})}),s.getBufferedValue()}Ye.exports=gr;Ye.exports.buffer=(t,e)=>gr(t,{...e,encoding:"buffer"});Ye.exports.array=(t,e)=>gr(t,{...e,array:!0});Ye.exports.MaxBufferError=kt});var Zs=L((wl,Xs)=>{"use strict";u();var ma=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),ya=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),ga=new Set([500,502,503,504]),ba={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},_a={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function be(t){let e=parseInt(t,10);return isFinite(e)?e:0}function wa(t){return t?ga.has(t.status):!0}function _r(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let s of r){let[n,i]=s.split(/=/,2);e[n.trim()]=i===void 0?!0:i.trim().replace(/^"|"$/g,"")}return e}function Ea(t){let e=[];for(let r in t){let s=t[r];e.push(s===!0?r:r+"="+s)}if(e.length)return e.join(", ")}Xs.exports=class{constructor(e,r,{shared:s,cacheHeuristic:n,immutableMinTimeToLive:i,ignoreCargoCult:o,_fromObject:a}={}){if(a){this._fromObject(a);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=s!==!1,this._cacheHeuristic=n!==void 0?n:.1,this._immutableMinTtl=i!==void 0?i:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=_r(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=_r(e.headers["cache-control"]),o&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":Ea(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&ya.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||ma.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=_r(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let s of r)if(e.headers[s]!==this._reqHeaders[s])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let s in e)ba[s]||(r[s]=e[s]);if(e.connection){let s=e.connection.trim().split(/\s*,\s*/);for(let n of s)delete r[n]}if(r.warning){let s=r.warning.split(/,/).filter(n=>!/^\s*1[0-9][0-9]/.test(n));s.length?r.warning=s.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return be(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return be(this._rescc["s-maxage"])}if(this._rescc["max-age"])return be(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let s=Date.parse(this._resHeaders.expires);return Number.isNaN(s)||s<r?0:Math.max(e,(s-r)/1e3)}if(this._resHeaders["last-modified"]){let s=Date.parse(this._resHeaders["last-modified"]);if(isFinite(s)&&r>s)return Math.max(e,(r-s)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+be(this._rescc["stale-if-error"]),s=e+be(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,s)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+be(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+be(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let n=r["if-none-match"].split(/,/).filter(i=>!/^\s*W\//.test(i));n.length?r["if-none-match"]=n.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&wa(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let s=!1;if(r.status!==void 0&&r.status!=304?s=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?s=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?s=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?s=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(s=!0),!s)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let n={};for(let o in this._resHeaders)n[o]=o in r.headers&&!_a[o]?r.headers[o]:this._resHeaders[o];let i=Object.assign({},r,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,i,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var en=L(wr=>{u();wr.stringify=function t(e){if(typeof e>"u")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",s=Array.isArray(e);r=s?"[":"{";var n=!0;for(var i in e){var o=typeof e[i]=="function"||!s&&typeof e[i]>"u";Object.hasOwnProperty.call(e,i)&&!o&&(n||(r+=","),n=!1,s?e[i]==null?r+="null":r+=t(e[i]):e[i]!==void 0&&(r+=t(i)+":"+t(e[i])))}return r+=s?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e>"u"?"null":JSON.stringify(e)};wr.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}});var nn=L((Al,sn)=>{"use strict";u();var xa=H("events"),tn=en(),Ra=t=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(H(e[r]))(t)}return new Map},rn=["sqlite","postgres","mysql","mongo","redis","tiered"],Er=class extends xa{constructor(e,{emitErrors:r=!0,...s}={}){if(super(),this.opts={namespace:"keyv",serialize:tn.stringify,deserialize:tn.parse,...typeof e=="string"?{uri:e}:e,...s},!this.opts.store){let i={...this.opts};this.opts.store=Ra(i)}if(this.opts.compression){let i=this.opts.compression;this.opts.serialize=i.serialize.bind(i),this.opts.deserialize=i.deserialize.bind(i)}typeof this.opts.store.on=="function"&&r&&this.opts.store.on("error",i=>this.emit("error",i)),this.opts.store.namespace=this.opts.namespace;let n=i=>async function*(){for await(let[o,a]of typeof i=="function"?i(this.opts.store.namespace):i){let l=await this.opts.deserialize(a);if(!(this.opts.store.namespace&&!o.includes(this.opts.store.namespace))){if(typeof l.expires=="number"&&Date.now()>l.expires){this.delete(o);continue}yield[this._getKeyUnprefix(o),l.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=n(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=n(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return rn.includes(this.opts.store.opts.dialect)||rn.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,r){let{store:s}=this.opts,n=Array.isArray(e),i=n?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(n&&s.getMany===void 0){let o=[];for(let a of i)o.push(Promise.resolve().then(()=>s.get(a)).then(l=>typeof l=="string"?this.opts.deserialize(l):this.opts.compression?this.opts.deserialize(l):l).then(l=>{if(l!=null)return typeof l.expires=="number"&&Date.now()>l.expires?this.delete(a).then(()=>{}):r&&r.raw?l:l.value}));return Promise.allSettled(o).then(a=>{let l=[];for(let d of a)l.push(d.value);return l})}return Promise.resolve().then(()=>n?s.getMany(i):s.get(i)).then(o=>typeof o=="string"?this.opts.deserialize(o):this.opts.compression?this.opts.deserialize(o):o).then(o=>{if(o!=null)return n?o.map((a,l)=>{if(typeof a=="string"&&(a=this.opts.deserialize(a)),a!=null){if(typeof a.expires=="number"&&Date.now()>a.expires){this.delete(e[l]).then(()=>{});return}return r&&r.raw?a:a.value}}):typeof o.expires=="number"&&Date.now()>o.expires?this.delete(e).then(()=>{}):r&&r.raw?o:o.value})}set(e,r,s){let n=this._getKeyPrefix(e);typeof s>"u"&&(s=this.opts.ttl),s===0&&(s=void 0);let{store:i}=this.opts;return Promise.resolve().then(()=>{let o=typeof s=="number"?Date.now()+s:null;return typeof r=="symbol"&&this.emit("error","symbol cannot be serialized"),r={value:r,expires:o},this.opts.serialize(r)}).then(o=>i.set(n,o,s)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let n=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let i=[];for(let o of n)i.push(r.delete(o));return Promise.allSettled(i).then(o=>o.every(a=>a.value===!0))}return Promise.resolve().then(()=>r.deleteMany(n))}let s=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(s))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:s}=this.opts;return Promise.resolve().then(async()=>typeof s.has=="function"?s.has(r):await s.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};sn.exports=Er});var un=L((Jl,hn)=>{"use strict";u();var ja=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];hn.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set(Object.keys(t).concat(ja)),s={};for(let n of r)n in e||(s[n]={get(){let i=t[n];return typeof i=="function"?i.bind(t):i},set(i){t[n]=i},enumerable:!0,configurable:!1});return Object.defineProperties(e,s),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var dn=L((Yl,ln)=>{"use strict";u();var{Transform:va,PassThrough:Ha}=H("stream"),Or=H("zlib"),$a=un();ln.exports=t=>{let e=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return t;let r=e==="br";if(r&&typeof Or.createBrotliDecompress!="function")return t.destroy(new Error("Brotli is not supported on Node.js < 12")),t;let s=!0,n=new va({transform(a,l,d){s=!1,d(null,a)},flush(a){a()}}),i=new Ha({autoDestroy:!1,destroy(a,l){t.destroy(),l(a)}}),o=r?Or.createBrotliDecompress():Or.createUnzip();return o.once("error",a=>{if(s&&!t.readable){i.end();return}i.destroy(a)}),$a(t,i),t.pipe(n).pipe(o).pipe(i),i}});var Ir=L((nf,kn)=>{"use strict";u();var $r=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[s,n]of this.oldCache.entries())this.onEviction(s,n);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};kn.exports=$r});var Nr=L((af,Cn)=>{"use strict";u();Cn.exports=t=>{if(t.listenerCount("error")!==0)return t;t.__destroy=t._destroy,t._destroy=(...r)=>{let s=r.pop();t.__destroy(...r,async n=>{await Promise.resolve(),s(n)})};let e=r=>{Promise.resolve().then(()=>{t.emit("error",r)})};return t.once("error",e),Promise.resolve().then(()=>{t.off("error",e)}),t}});var we=L((hf,vn)=>{"use strict";u();var{URL:Pn}=H("url"),sc=H("events"),nc=H("tls"),ic=H("http2"),oc=Ir(),ac=Nr(),J=Symbol("currentStreamCount"),An=Symbol("request"),K=Symbol("cachedOriginSet"),pe=Symbol("gracefullyClosing"),$t=Symbol("length"),Dn=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],cc=(t,e,r)=>{let s=0,n=t.length;for(;s<n;){let i=s+n>>>1;r(t[i],e)?s=i+1:n=i}return s},hc=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,qr=(t,e)=>{for(let r=0;r<t.length;r++){let s=t[r];s[K].length>0&&s[K].length<e[K].length&&s[K].every(n=>e[K].includes(n))&&s[J]+e[J]<=e.remoteSettings.maxConcurrentStreams&&jn(s)}},Ln=(t,e)=>{for(let r=0;r<t.length;r++){let s=t[r];if(e[K].length>0&&e[K].length<s[K].length&&e[K].every(n=>s[K].includes(n))&&e[J]+s[J]<=s.remoteSettings.maxConcurrentStreams)return jn(e),!0}return!1},jn=t=>{t[pe]=!0,t[J]===0&&t.close()},Ne=class t extends sc{constructor({timeout:e=0,maxSessions:r=Number.POSITIVE_INFINITY,maxEmptySessions:s=10,maxCachedTlsSessions:n=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxEmptySessions=s,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new oc({maxSize:n})}get protocol(){return"https:"}normalizeOptions(e){let r="";for(let s=0;s<Dn.length;s++){let n=Dn[s];r+=":",e&&e[n]!==void 0&&(r+=e[n])}return r}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let e in this.queue)for(let r in this.queue[e]){let s=this.queue[e][r];s.completed||(s.completed=!0,s())}}_isBetterSession(e,r){return e>r}_accept(e,r,s,n){let i=0;for(;i<r.length&&e[J]<e.remoteSettings.maxConcurrentStreams;)r[i].resolve(e),i++;r.splice(0,i),r.length>0&&(this.getSession(s,n,r),r.length=0)}getSession(e,r,s){return new Promise((n,i)=>{Array.isArray(s)&&s.length>0?(s=[...s],n()):s=[{resolve:n,reject:i}];try{if(typeof e=="string")e=new Pn(e);else if(!(e instanceof Pn))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(r){let{servername:y}=r,{hostname:R}=e;if(y&&R!==y)throw new Error(`Origin ${R} differs from servername ${y}`)}}catch(y){for(let R=0;R<s.length;R++)s[R].reject(y);return}let o=this.normalizeOptions(r),a=e.origin;if(o in this.sessions){let y=this.sessions[o],R=-1,g=-1,S;for(let O=0;O<y.length;O++){let f=y[O],A=f.remoteSettings.maxConcurrentStreams;if(A<R)break;if(!f[K].includes(a))continue;let _=f[J];_>=A||f[pe]||f.destroyed||(S||(R=A),this._isBetterSession(_,g)&&(S=f,g=_))}if(S){this._accept(S,s,a,r);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...s);return}}else this.queue[o]={[$t]:0};let l=()=>{o in this.queue&&this.queue[o][a]===d&&(delete this.queue[o][a],--this.queue[o][$t]===0&&delete this.queue[o])},d=async()=>{this._sessionCount++;let y=`${a}:${o}`,R=!1,g;try{let S={...r};S.settings===void 0&&(S.settings=this.settings),S.session===void 0&&(S.session=this.tlsSessionCache.get(y)),g=await(S.createConnection||this.createConnection).call(this,e,S),S.createConnection=()=>g;let f=ic.connect(e,S);f[J]=0,f[pe]=!1;let A=()=>{let{socket:x}=f,D;return x.servername===!1?(x.servername=x.remoteAddress,D=f.originSet,x.servername=!1):D=f.originSet,D},_=()=>f[J]<f.remoteSettings.maxConcurrentStreams;f.socket.once("session",x=>{this.tlsSessionCache.set(y,x)}),f.once("error",x=>{for(let D=0;D<s.length;D++)s[D].reject(x);this.tlsSessionCache.delete(y)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(this._sessionCount--,R){this._emptySessionCount--;let x=this.sessions[o];x.length===1?delete this.sessions[o]:x.splice(x.indexOf(f),1)}else{l();let x=new Error("Session closed without receiving a SETTINGS frame");x.code="HTTP2WRAPPER_NOSETTINGS";for(let D=0;D<s.length;D++)s[D].reject(x)}this._processQueue()});let j=()=>{let x=this.queue[o];if(!x)return;let D=f[K];for(let U=0;U<D.length;U++){let z=D[U];if(z in x){let{listeners:Q,completed:M}=x[z],v=0;for(;v<Q.length&&_();)Q[v].resolve(f),v++;if(x[z].listeners.splice(0,v),x[z].listeners.length===0&&!M&&(delete x[z],--x[$t]===0)){delete this.queue[o];break}if(!_())break}}};f.on("origin",()=>{f[K]=A()||[],f[pe]=!1,Ln(this.sessions[o],f),!(f[pe]||!_())&&(j(),_()&&qr(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(d.destroyed){let x=new Error("Agent has been destroyed");for(let D=0;D<s.length;D++)s[D].reject(x);f.destroy();return}if(f.setLocalWindowSize&&f.setLocalWindowSize(1024*1024*4),f[K]=A()||[],f.socket.encrypted){let x=f[K][0];if(x!==a){let D=new Error(`Requested origin ${a} does not match server ${x}`);for(let U=0;U<s.length;U++)s[U].reject(D);f.destroy();return}}l();{let x=this.sessions;if(o in x){let D=x[o];D.splice(cc(D,f,hc),0,f)}else x[o]=[f]}R=!0,this._emptySessionCount++,this.emit("session",f),this._accept(f,s,a,r),f[J]===0&&this._emptySessionCount>this.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),f.on("remoteSettings",()=>{_()&&(j(),_()&&qr(this.sessions[o],f))})}),f[An]=f.request,f.request=(x,D)=>{if(f[pe])throw new Error("The session is gracefully closing. No new streams are allowed.");let U=f[An](x,D);return f.ref(),f[J]++===0&&this._emptySessionCount--,U.once("close",()=>{if(--f[J]===0&&(this._emptySessionCount++,f.unref(),this._emptySessionCount>this.maxEmptySessions||f[pe])){f.close();return}f.destroyed||f.closed||_()&&!Ln(this.sessions[o],f)&&(qr(this.sessions[o],f),j(),f[J]===0&&this._processQueue())}),U}}catch(S){l(),this._sessionCount--;for(let O=0;O<s.length;O++)s[O].reject(S)}};d.listeners=s,d.completed=!1,d.destroyed=!1,this.queue[o][a]=d,this.queue[o][$t]++,this._processQueue()})}request(e,r,s,n){return new Promise((i,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{let l=a.request(s,n);ac(l),i(l)}catch(l){o(l)}}}])})}async createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let s=e.port||443,n=e.hostname;typeof r.servername>"u"&&(r.servername=n);let i=nc.connect(s,n,r);return r.socket&&(i._peername={family:void 0,address:void 0,port:s}),i}closeEmptySessions(e=Number.POSITIVE_INFINITY){let r=0,{sessions:s}=this;for(let n in s){let i=s[n];for(let o=0;o<i.length;o++){let a=i[o];if(a[J]===0&&(r++,a.close(),r>=e))return r}}return r}destroy(e){let{sessions:r,queue:s}=this;for(let n in r){let i=r[n];for(let o=0;o<i.length;o++)i[o].destroy(e)}for(let n in s){let i=s[n];for(let o in i)i[o].destroyed=!0}this.queue={},this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}};Ne.kCurrentStreamCount=J;Ne.kGracefullyClosing=pe;vn.exports={Agent:Ne,globalAgent:new Ne}});var Br=L((lf,Hn)=>{"use strict";u();var{Readable:uc}=H("stream"),Ur=class extends uc{constructor(e,r){super({emitClose:!1,autoDestroy:!0,highWaterMark:r}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this._dumped=!1}get connection(){return this.socket}set connection(e){this.socket=e}_destroy(e,r){this.readableEnded||(this.aborted=!0),r(),this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};Hn.exports=Ur});var In=L((ff,$n)=>{"use strict";u();$n.exports=(t,e,r)=>{for(let s of r)t.on(s,(...n)=>e.emit(s,...n))}});var ht=L((yf,Nn)=>{"use strict";u();var Ee=(t,e,r)=>{Nn.exports[e]=class extends t{constructor(...n){super(typeof r=="string"?r:r(n)),this.name=`${super.name} [${e}]`,this.code=e}}};Ee(TypeError,"ERR_INVALID_ARG_TYPE",t=>{let e=t[0].includes(".")?"property":"argument",r=t[1],s=Array.isArray(r);return s&&(r=`${r.slice(0,-1).join(", ")} or ${r.slice(-1)}`),`The "${t[0]}" ${e} must be ${s?"one of":"of"} type ${r}. Received ${typeof t[2]}`});Ee(TypeError,"ERR_INVALID_PROTOCOL",t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`);Ee(Error,"ERR_HTTP_HEADERS_SENT",t=>`Cannot ${t[0]} headers after they are sent to the client`);Ee(TypeError,"ERR_INVALID_HTTP_TOKEN",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);Ee(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",t=>`Invalid value "${t[0]} for header "${t[1]}"`);Ee(TypeError,"ERR_INVALID_CHAR",t=>`Invalid character in ${t[0]} [${t[1]}]`);Ee(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")});var Un=L((bf,qn)=>{"use strict";u();qn.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var Mr=L((wf,Bn)=>{"use strict";u();var{ERR_INVALID_HTTP_TOKEN:lc}=ht(),dc=Un(),fc=/^[\^`\-\w!#$%&*+.|~]+$/;Bn.exports=t=>{if(typeof t!="string"||!fc.test(t)&&!dc(t))throw new lc("Header name",t)}});var zr=L((Sf,Mn)=>{"use strict";u();var{ERR_HTTP_INVALID_HEADER_VALUE:pc,ERR_INVALID_CHAR:mc}=ht(),yc=/[^\t\u0020-\u007E\u0080-\u00FF]/;Mn.exports=(t,e)=>{if(typeof e>"u")throw new pc(e,t);if(yc.test(e))throw new mc("header content",t)}});var Vn=L((Rf,Fn)=>{"use strict";u();var{ERR_HTTP2_NO_SOCKET_MANIPULATION:zn}=ht(),gc={has(t,e){let r=t.session===void 0?t:t.session.socket;return e in t||e in r},get(t,e){switch(e){case"on":case"once":case"end":case"emit":case"destroy":return t[e].bind(t);case"writable":case"destroyed":return t[e];case"readable":return t.destroyed?!1:t.readable;case"setTimeout":{let{session:r}=t;return r!==void 0?r.setTimeout.bind(r):t.setTimeout.bind(t)}case"write":case"read":case"pause":case"resume":throw new zn;default:{let r=t.session===void 0?t:t.session.socket,s=r[e];return typeof s=="function"?s.bind(r):s}}},getPrototypeOf(t){return t.session!==void 0?Reflect.getPrototypeOf(t.session.socket):Reflect.getPrototypeOf(t)},set(t,e,r){switch(e){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return t[e]=r,!0;case"setTimeout":{let{session:s}=t;return s===void 0?t.setTimeout=r:s.setTimeout=r,!0}case"write":case"read":case"pause":case"resume":throw new zn;default:{let s=t.session===void 0?t:t.session.socket;return s[e]=r,!0}}}};Fn.exports=gc});var Wr=L((Tf,Qn)=>{"use strict";u();var{URL:Fr,urlToHttpOptions:Gn}=H("url"),bc=H("http2"),{Writable:_c}=H("stream"),{Agent:wc,globalAgent:Ec}=we(),Sc=Br(),xc=In(),{ERR_INVALID_ARG_TYPE:It,ERR_INVALID_PROTOCOL:Rc,ERR_HTTP_HEADERS_SENT:Wn}=ht(),Oc=Mr(),Tc=zr(),kc=Vn(),{HTTP2_HEADER_STATUS:Jn,HTTP2_HEADER_METHOD:Kn,HTTP2_HEADER_PATH:Yn,HTTP2_HEADER_AUTHORITY:ut,HTTP2_METHOD_CONNECT:Cc}=bc.constants,V=Symbol("headers"),qe=Symbol("origin"),lt=Symbol("session"),Vr=Symbol("options"),Nt=Symbol("flushedHeaders"),Ue=Symbol("jobs"),dt=Symbol("pendingAgentPromise"),Gr=class extends _c{constructor(e,r,s){if(super({autoDestroy:!1,emitClose:!1}),typeof e=="string"?e=Gn(new Fr(e)):e instanceof Fr?e=Gn(e):e={...e},typeof r=="function"||r===void 0?(s=r,r=e):r=Object.assign(e,r),r.h2session){if(this[lt]=r.h2session,this[lt].destroyed)throw new Error("The session has been closed already");this.protocol=this[lt].socket.encrypted?"https:":"http:"}else if(r.agent===!1)this.agent=new wc({maxEmptySessions:0});else if(typeof r.agent>"u"||r.agent===null)this.agent=Ec;else if(typeof r.agent.request=="function")this.agent=r.agent;else throw new It("options.agent",["http2wrapper.Agent-like Object","undefined","false"],r.agent);if(this.agent&&(this.protocol=this.agent.protocol),r.protocol&&r.protocol!==this.protocol)throw new Rc(r.protocol,this.protocol);r.port||(r.port=r.defaultPort||this.agent&&this.agent.defaultPort||443),r.host=r.hostname||r.host||"localhost",delete r.hostname;let{timeout:n}=r;r.timeout=void 0,this[V]=Object.create(null),this[Ue]=[],this[dt]=void 0,this.socket=null,this.connection=null,this.method=r.method||"GET",this.method==="CONNECT"&&(r.path==="/"||r.path===void 0)||(this.path=r.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:i}=r;if(i)for(let a in i)this.setHeader(a,i[a]);r.auth&&!("authorization"in this[V])&&(this[V].authorization="Basic "+Buffer.from(r.auth).toString("base64")),r.session=r.tlsSession,r.path=r.socketPath,this[Vr]=r,this[qe]=new Fr(`${this.protocol}//${r.servername||r.host}:${r.port}`);let o=r._reuseSocket;o&&(r.createConnection=(...a)=>o.destroyed?this.agent.createConnection(...a):o,this.agent.getSession(this[qe],this[Vr]).catch(()=>{})),n&&this.setTimeout(n),s&&this.once("response",s),this[Nt]=!1}get method(){return this[V][Kn]}set method(e){e&&(this[V][Kn]=e.toUpperCase())}get path(){let e=this.method==="CONNECT"?ut:Yn;return this[V][e]}set path(e){if(e){let r=this.method==="CONNECT"?ut:Yn;this[V][r]=e}}get host(){return this[qe].hostname}set host(e){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,r,s){if(this._mustNotHaveABody){s(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let n=()=>this._request.write(e,r,s);this._request?n():this[Ue].push(n)}_final(e){this.flushHeaders();let r=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){e();return}this._request.end(e)};this._request?r():this[Ue].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(e,r){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[dt]}catch(s){this.aborted&&(e=s)}r(e)}async flushHeaders(){if(this[Nt]||this.destroyed)return;this[Nt]=!0;let e=this.method===Cc,r=s=>{if(this._request=s,this.destroyed){s.destroy();return}e||xc(s,this,["timeout","continue"]),s.once("error",i=>{this.destroy(i)}),s.once("aborted",()=>{let{res:i}=this;i?(i.aborted=!0,i.emit("aborted"),i.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let n=(i,o,a)=>{let l=new Sc(this.socket,s.readableHighWaterMark);this.res=l,l.url=`${this[qe].origin}${this.path}`,l.req=this,l.statusCode=i[Jn],l.headers=i,l.rawHeaders=a,l.once("end",()=>{l.complete=!0,l.socket=null,l.connection=null}),e?(l.upgrade=!0,this.emit("connect",l,s,Buffer.alloc(0))?this.emit("close"):s.destroy()):(s.on("data",d=>{!l._dumped&&!l.push(d)&&s.pause()}),s.once("end",()=>{this.aborted||l.push(null)}),this.emit("response",l)||l._dump())};s.once("response",n),s.once("headers",i=>this.emit("information",{statusCode:i[Jn]})),s.once("trailers",(i,o,a)=>{let{res:l}=this;if(l===null){n(i,o,a);return}l.trailers=i,l.rawTrailers=a}),s.once("close",()=>{let{aborted:i,res:o}=this;if(o){i&&(o.aborted=!0,o.emit("aborted"),o.destroy());let a=()=>{o.emit("close"),this.destroy(),this.emit("close")};o.readable?o.once("end",a):a();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(s,kc);for(let i of this[Ue])i();this[Ue].length=0,this.emit("socket",this.socket)};if(!(ut in this[V])&&!e&&(this[V][ut]=this[qe].host),this[lt])try{r(this[lt].request(this[V]))}catch(s){this.destroy(s)}else{this.reusedSocket=!0;try{let s=this.agent.request(this[qe],this[Vr],this[V]);this[dt]=s,r(await s),this[dt]=!1}catch(s){this[dt]=!1,this.destroy(s)}}}get connection(){return this.socket}set connection(e){this.socket=e}getHeaderNames(){return Object.keys(this[V])}hasHeader(e){if(typeof e!="string")throw new It("name","string",e);return!!this[V][e.toLowerCase()]}getHeader(e){if(typeof e!="string")throw new It("name","string",e);return this[V][e.toLowerCase()]}get headersSent(){return this[Nt]}removeHeader(e){if(typeof e!="string")throw new It("name","string",e);if(this.headersSent)throw new Wn("remove");delete this[V][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new Wn("set");Oc(e),Tc(e,r);let s=e.toLowerCase();if(s==="connection"){if(r.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${r}`)}s==="host"&&this.method==="CONNECT"?this[V][ut]=r:this[V][s]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let s=()=>this._request.setTimeout(e,r);return this._request?s():this[Ue].push(s),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};Qn.exports=Gr});var Zn=L((Cf,Xn)=>{"use strict";u();var Pc=H("tls");Xn.exports=(t={},e=Pc.connect)=>new Promise((r,s)=>{let n=!1,i,o=async()=>{await l,i.off("timeout",a),i.off("error",s),t.resolveSocket?(r({alpnProtocol:i.alpnProtocol,socket:i,timeout:n}),n&&(await Promise.resolve(),i.emit("timeout"))):(i.destroy(),r({alpnProtocol:i.alpnProtocol,timeout:n}))},a=async()=>{n=!0,o()},l=(async()=>{try{i=await e(t,o),i.on("error",s),i.once("timeout",a)}catch(d){s(d)}})()})});var ti=L((Af,ei)=>{"use strict";u();var{isIP:Ac}=H("net"),Dc=H("assert"),Lc=t=>{if(t[0]==="["){let r=t.indexOf("]");return Dc(r!==-1),t.slice(1,r)}let e=t.indexOf(":");return e===-1?t:t.slice(0,e)};ei.exports=t=>{let e=Lc(t);return Ac(e)?"":e}});var hi=L((Lf,ft)=>{"use strict";u();var{URL:ri,urlToHttpOptions:si}=H("url"),ni=H("http"),Jr=H("https"),jc=Zn(),vc=Ir(),{Agent:Hc,globalAgent:$c}=we(),Ic=Wr(),Nc=ti(),ii=Nr(),oi=new vc({maxSize:100}),qc=new Map,Uc=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let s=()=>{t.emit("free",e,r)};e.on("free",s);let n=()=>{t.removeSocket(e,r)};e.on("close",n);let i=()=>{let{freeSockets:a}=t;for(let l of Object.values(a))if(l.includes(e)){e.destroy();return}};e.on("timeout",i);let o=()=>{t.removeSocket(e,r),e.off("close",n),e.off("free",s),e.off("timeout",i),e.off("agentRemove",o)};e.on("agentRemove",o),t.emit("free",e,r)},ai=(t,e=new Map,r=void 0)=>async s=>{let n=`${s.host}:${s.port}:${s.ALPNProtocols.sort()}`;if(!t.has(n)){if(e.has(n))return{alpnProtocol:(await e.get(n)).alpnProtocol};let{path:i}=s;s.path=s.socketPath;let o=jc(s,r);e.set(n,o);try{let a=await o;return t.set(n,a.alpnProtocol),e.delete(n),s.path=i,a}catch(a){throw e.delete(n),s.path=i,a}}return{alpnProtocol:t.get(n)}},ci=ai(oi,qc);ft.exports=async(t,e,r)=>{if(typeof t=="string"?t=si(new ri(t)):t instanceof ri?t=si(t):t={...t},typeof e=="function"||e===void 0?(r=e,e=t):e=Object.assign(t,e),e.ALPNProtocols=e.ALPNProtocols||["h2","http/1.1"],!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let s=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||Nc(e.headers&&e.headers.host||e.host),e.port=e.port||(s?443:80),e._defaultAgent=s?Jr.globalAgent:ni.globalAgent;let n=e.resolveProtocol||ci,{agent:i}=e;if(i!==void 0&&i!==!1&&i.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(s){e.resolveSocket=!0;let{socket:o,alpnProtocol:a,timeout:l}=await n(e);if(l){o&&o.destroy();let y=new Error(`Timed out resolving ALPN: ${e.timeout} ms`);throw y.code="ETIMEDOUT",y.ms=e.timeout,y}o&&e.createConnection&&(o.destroy(),o=void 0),delete e.resolveSocket;let d=a==="h2";if(i&&(i=d?i.http2:i.https,e.agent=i),i===void 0&&(i=d?$c:Jr.globalAgent),o)if(i===!1)o.destroy();else{let y=(d?Hc:Jr.Agent).prototype.createConnection;i.createConnection===y?d?e._reuseSocket=o:Uc(i,o,e):o.destroy()}if(d)return ii(new Ic(e,r))}else i&&(e.agent=i.http);return e.headers&&(e.headers={...e.headers},e.headers[":authority"]&&(e.headers.host||(e.headers.host=e.headers[":authority"]),delete e.headers[":authority"]),delete e.headers[":method"],delete e.headers[":scheme"],delete e.headers[":path"]),ii(ni.request(e,r))};ft.exports.protocolCache=oi;ft.exports.resolveProtocol=ci;ft.exports.createResolveProtocol=ai});var Kr=L((vf,ui)=>{"use strict";u();var Bc=H("stream"),Mc=H("tls"),zc=new Mc.TLSSocket(new Bc.PassThrough)._handle._parentWrap.constructor;ui.exports=zc});var Qr=L(($f,li)=>{"use strict";u();var Yr=class extends Error{constructor(e,r=""){super(`The proxy server rejected the request with status code ${e} (${r||"empty status message"})`),this.statusCode=e,this.statusMessage=r}};li.exports=Yr});var fi=L((Nf,di)=>{"use strict";u();var Fc=(t,e,r)=>{if(!r.some(n=>typeof n==="string"?typeof e===n:e instanceof n)){let n=r.map(i=>typeof i=="string"?i:i.name);throw new TypeError(`Expected '${t}' to be a type of ${n.join(" or ")}, got ${typeof e}`)}};di.exports=Fc});var Xr=L((Uf,mi)=>{"use strict";u();var{URL:pi}=H("url"),qt=fi();mi.exports=(t,e)=>{qt("proxyOptions",e,["object"]),qt("proxyOptions.headers",e.headers,["object","undefined"]),qt("proxyOptions.raw",e.raw,["boolean","undefined"]),qt("proxyOptions.url",e.url,[pi,"string"]);let r=new pi(e.url);t.proxyOptions={raw:!0,...e,headers:{...e.headers},url:r}}});var Ut=L((Mf,yi)=>{"use strict";u();yi.exports=t=>{let{username:e,password:r}=t.proxyOptions.url;if(e||r){let s=`${e}:${r}`,n=`Basic ${Buffer.from(s).toString("base64")}`;return{"proxy-authorization":n,authorization:n}}return{}}});var Ei=L((Ff,wi)=>{"use strict";u();var Vc=H("tls"),Gc=H("http"),gi=H("https"),Wc=Kr(),{globalAgent:Jc}=we(),Kc=Qr(),bi=Xr(),Yc=Ut(),_i=(t,e,r)=>{(async()=>{try{let{proxyOptions:s}=t,{url:n,headers:i,raw:o}=s,a=await Jc.request(n,s,{...Yc(t),...i,":method":"CONNECT",":authority":`${e.host}:${e.port}`});a.once("error",r),a.once("response",l=>{let d=l[":status"];if(d!==200){r(new Kc(d,""));return}let y=t instanceof gi.Agent;if(o&&y){e.socket=a;let g=Vc.connect(e);g.once("close",()=>{a.destroy()}),r(null,g);return}let R=new Wc(a);R.encrypted=!1,R._handle.getpeername=g=>{g.family=void 0,g.address=void 0,g.port=void 0},r(null,R)})}catch(s){r(s)}})()},Zr=class extends Gc.Agent{constructor(e){super(e),bi(this,e.proxyOptions)}createConnection(e,r){_i(this,e,r)}},es=class extends gi.Agent{constructor(e){super(e),bi(this,e.proxyOptions)}createConnection(e,r){_i(this,e,r)}};wi.exports={HttpOverHttp2:Zr,HttpsOverHttp2:es}});var rs=L((Gf,Si)=>{"use strict";u();var{Agent:Qc}=we(),Xc=Kr(),Zc=Qr(),eh=Xr(),ts=class extends Qc{constructor(e){super(e),eh(this,e.proxyOptions)}async createConnection(e,r){let s=`${e.hostname}:${e.port||443}`,[n,i,o]=await this._getProxyStream(s);if(i!==200)throw new Zc(i,o);if(this.proxyOptions.raw)r.socket=n;else{let a=new Xc(n);return a.encrypted=!1,a._handle.getpeername=l=>{l.family=void 0,l.address=void 0,l.port=void 0},a}return super.createConnection(e,r)}};Si.exports=ts});var Ri=L((Jf,xi)=>{"use strict";u();var{globalAgent:th}=we(),rh=rs(),sh=Ut(),nh=t=>new Promise((e,r)=>{t.once("error",r),t.once("response",s=>{t.off("error",r),e(s[":status"])})}),ss=class extends rh{async _getProxyStream(e){let{proxyOptions:r}=this,s={...sh(this),...r.headers,":method":"CONNECT",":authority":e},n=await th.request(r.url,r,s),i=await nh(n);return[n,i,""]}};xi.exports=ss});var Ti=L((Yf,Oi)=>{"use strict";u();var ih=H("http"),oh=H("https"),ah=rs(),ch=Ut(),hh=t=>new Promise((e,r)=>{let s=(n,i,o)=>{i.unshift(o),t.off("error",r),e([i,n.statusCode,n.statusMessage])};t.once("error",r),t.once("connect",s)}),Bt=class extends ah{async _getProxyStream(e){let{proxyOptions:r}=this,{url:s,headers:n}=this.proxyOptions,o=(s.protocol==="https:"?oh:ih).request({...r,hostname:s.hostname,port:s.port,path:e,headers:{...ch(this),...n,host:e},method:"CONNECT"}).end();return hh(o)}};Oi.exports={Http2OverHttp:Bt,Http2OverHttps:Bt}});var Ci=L((Xf,ki)=>{"use strict";u();var uh=H("http2"),{Agent:lh,globalAgent:dh}=we(),ns=Wr(),fh=Br(),ph=hi(),{HttpOverHttp2:mh,HttpsOverHttp2:yh}=Ei(),gh=Ri(),{Http2OverHttp:bh,Http2OverHttps:_h}=Ti(),wh=Mr(),Eh=zr(),Sh=(t,e,r)=>new ns(t,e,r),xh=(t,e,r)=>{let s=new ns(t,e,r);return s.end(),s};ki.exports={...uh,ClientRequest:ns,IncomingMessage:fh,Agent:lh,globalAgent:dh,request:Sh,get:xh,auto:ph,proxies:{HttpOverHttp2:mh,HttpsOverHttp2:yh,Http2OverHttp2:gh,Http2OverHttp:bh,Http2OverHttps:_h},validateHeaderName:wh,validateHeaderValue:Eh}});u();u();u();import ne from"node:process";function Ve(){return ne.platform!=="win32"?ne.env.TERM!=="linux":!!ne.env.WT_SESSION||!!ne.env.TERMINUS_SUBLIME||ne.env.ConEmuTask==="{cmd::Cmder}"||ne.env.TERM_PROGRAM==="Terminus-Sublime"||ne.env.TERM_PROGRAM==="vscode"||ne.env.TERM==="xterm-256color"||ne.env.TERM==="alacritty"||ne.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Os={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"},Ts={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"},ho={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"},er={...Os,...Ts},uo={...Os,...ho},lo=Ve(),fo=lo?er:uo,ks=fo,Tu=Object.entries(Ts);var tr={...ie.testLike?er:ks};if(Ve()&&ee.windowsOrWsl)for(let t of["tick","cross"])tr[t]+=" ";u();var Yt=X(_s(),1);u();var Ge=X(_s(),1),Us=X($s(),1),cr=X(Ns(),1);import Do from"node:assert";import{createHash as Lo}from"node:crypto";import De from"node:path";import{Transform as jo}from"node:stream";import{pipeline as vo}from"node:stream/promises";var Ho=[".DS_Store","node_modules",".git"],$o=[".gadget/sync.json",".gadget/backup","yarn-error.log"],qs=class t{constructor(e){this.path=e}_ignorer;_isHashing=!1;static async init(e){let r=new t(e);return await r.loadIgnoreFile(),r}relative(e){return De.isAbsolute(e)?De.relative(this.path,e):e}absolute(...e){let r=De.resolve(this.path,...e);return Do(r.startsWith(this.path),`expected ${r} to be within ${this.path}`),r}normalize(e,r){return De.isAbsolute(e)&&(e=this.relative(e)),e=(0,cr.default)(e,!0),r&&(e+="/"),e}async loadIgnoreFile(){this._ignorer=Us.default.default(),this._ignorer.add(Ho);try{let e=await Ge.default.readFile(this.absolute(".ignore"),"utf8");this._ignorer.add(e)}catch(e){Et(e)}}ignores(e){return e=this.relative(e),e===""?!1:e.startsWith("..")||(e=(0,cr.default)(e,!1),this._isHashing&&$o.some(r=>e.startsWith(r)))?!0:this._ignorer.ignores(e)}async*walk({dir:e=this.path}={}){e!==this.path&&(yield this.normalize(e,!0));for await(let r of await Ge.default.opendir(e)){let s=De.join(e,r.name);this.ignores(s)||(r.isDirectory()?yield*this.walk({dir:s}):r.isFile()&&(yield this.normalize(s,!1)))}}async hashes(){try{this._isHashing=!0;let e={};for await(let r of this.walk()){let s=this.absolute(r);e[r]=await No(s)}return e}finally{this._isHashing=!1}}async hasFiles(){return!await this.isEmptyOrNonExistent()}async isEmptyOrNonExistent(){let e=!0;try{for await(let r of this.walk()){e=!1;break}}catch(r){Et(r)}return e}},Io=process.platform==="linux"||process.platform==="darwin",No=async t=>{let e=Lo("sha1");e.update(De.basename(t));let r=await Ge.default.stat(t),s;if(Io&&(s=r.mode&511),r.isDirectory())return{sha1:e.digest("hex"),permissions:s};let n=new jo({transform(i,o,a){if(!i.includes(13)){a(void 0,i);return}let l=Buffer.alloc(i.length),d=0;for(let y of i)y!==13&&(l[d++]=y);a(void 0,l.slice(0,d))}});return await vo(Ge.default.createReadStream(t),n,e),{sha1:e.digest("hex"),permissions:s}},Et=t=>{if(!(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"))throw t};u();u();u();u();u();function hr(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}u();import qo from"node:os";var Uo=()=>qo.homedir().replace(/\\/g,"/"),Bs=Uo;var Ms=/\s+at.*[(\s](.*)\)?/,zs=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;function ur(t,{pretty:e=!1,basePath:r,pathFilter:s}={}){let n=r&&new RegExp(`(file://)?${hr(r.replace(/\\/g,"/"))}/?`,"g"),i=e?Bs():"";if(typeof t=="string")return t.replace(/\\/g,"/").split(`
2
+ `).filter(o=>{let a=o.match(Ms);if(a===null||!a[1])return!0;let l=a[1];return l.includes(".app/Contents/Resources/electron.asar")||l.includes(".app/Contents/Resources/default_app.asar")||l.includes("node_modules/electron/dist/resources/electron.asar")||l.includes("node_modules/electron/dist/resources/default_app.asar")?!1:s?!zs.test(l)&&s(l):!zs.test(l)}).filter(o=>o.trim()!=="").map(o=>(n&&(o=o.replace(n,"")),e&&(o=o.replace(Ms,(a,l)=>a.replace(l,l.replace(i,"~")))),o)).join(`
3
+ `)}u();u();u();var Fs=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Bo(t){return Fs.includes(t)}var Mo=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Fs];function zo(t){return Mo.includes(t)}var Fo=["null","undefined","string","number","bigint","boolean","symbol"];function Vo(t){return Fo.includes(t)}function Le(t){return e=>typeof e===t}var{toString:Go}=Object.prototype,We=t=>{let e=Go.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&c.domElement(t))return"HTMLElement";if(zo(e))return e},$=t=>e=>We(e)===t;function c(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(c.observable(t))return"Observable";if(c.array(t))return"Array";if(c.buffer(t))return"Buffer";let e=We(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}c.undefined=Le("undefined");c.string=Le("string");var Wo=Le("number");c.number=t=>Wo(t)&&!c.nan(t);c.positiveNumber=t=>c.number(t)&&t>0;c.negativeNumber=t=>c.number(t)&&t<0;c.bigint=Le("bigint");c.function_=Le("function");c.null_=t=>t===null;c.class_=t=>c.function_(t)&&t.toString().startsWith("class ");c.boolean=t=>t===!0||t===!1;c.symbol=Le("symbol");c.numericString=t=>c.string(t)&&!c.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));c.array=(t,e)=>Array.isArray(t)?c.function_(e)?t.every(r=>e(r)):!0:!1;c.buffer=t=>t?.constructor?.isBuffer?.(t)??!1;c.blob=t=>$("Blob")(t);c.nullOrUndefined=t=>c.null_(t)||c.undefined(t);c.object=t=>!c.null_(t)&&(typeof t=="object"||c.function_(t));c.iterable=t=>c.function_(t?.[Symbol.iterator]);c.asyncIterable=t=>c.function_(t?.[Symbol.asyncIterator]);c.generator=t=>c.iterable(t)&&c.function_(t?.next)&&c.function_(t?.throw);c.asyncGenerator=t=>c.asyncIterable(t)&&c.function_(t.next)&&c.function_(t.throw);c.nativePromise=t=>$("Promise")(t);var Jo=t=>c.function_(t?.then)&&c.function_(t?.catch);c.promise=t=>c.nativePromise(t)||Jo(t);c.generatorFunction=$("GeneratorFunction");c.asyncGeneratorFunction=t=>We(t)==="AsyncGeneratorFunction";c.asyncFunction=t=>We(t)==="AsyncFunction";c.boundFunction=t=>c.function_(t)&&!t.hasOwnProperty("prototype");c.regExp=$("RegExp");c.date=$("Date");c.error=$("Error");c.map=t=>$("Map")(t);c.set=t=>$("Set")(t);c.weakMap=t=>$("WeakMap")(t);c.weakSet=t=>$("WeakSet")(t);c.weakRef=t=>$("WeakRef")(t);c.int8Array=$("Int8Array");c.uint8Array=$("Uint8Array");c.uint8ClampedArray=$("Uint8ClampedArray");c.int16Array=$("Int16Array");c.uint16Array=$("Uint16Array");c.int32Array=$("Int32Array");c.uint32Array=$("Uint32Array");c.float32Array=$("Float32Array");c.float64Array=$("Float64Array");c.bigInt64Array=$("BigInt64Array");c.bigUint64Array=$("BigUint64Array");c.arrayBuffer=$("ArrayBuffer");c.sharedArrayBuffer=$("SharedArrayBuffer");c.dataView=$("DataView");c.enumCase=(t,e)=>Object.values(e).includes(t);c.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;c.urlInstance=t=>$("URL")(t);c.urlString=t=>{if(!c.string(t))return!1;try{return new URL(t),!0}catch{return!1}};c.truthy=t=>!!t;c.falsy=t=>!t;c.nan=t=>Number.isNaN(t);c.primitive=t=>c.null_(t)||Vo(typeof t);c.integer=t=>Number.isInteger(t);c.safeInteger=t=>Number.isSafeInteger(t);c.plainObject=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};c.typedArray=t=>Bo(We(t));var Ko=t=>c.safeInteger(t)&&t>=0;c.arrayLike=t=>!c.nullOrUndefined(t)&&!c.function_(t)&&Ko(t.length);c.tupleLike=(t,e)=>c.array(e)&&c.array(t)&&e.length===t.length?e.every((r,s)=>r(t[s])):!1;c.inRange=(t,e)=>{if(c.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(c.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var Yo=1,Qo=["innerHTML","ownerDocument","style","attributes","nodeValue"];c.domElement=t=>c.object(t)&&t.nodeType===Yo&&c.string(t.nodeName)&&!c.plainObject(t)&&Qo.every(e=>e in t);c.observable=t=>t?t===t[Symbol.observable]?.()||t===t["@@observable"]?.():!1;c.nodeStream=t=>c.object(t)&&c.function_(t.pipe)&&!c.observable(t);c.infinite=t=>t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY;var Vs=t=>e=>c.integer(e)&&Math.abs(e%2)===t;c.evenInteger=Vs(0);c.oddInteger=Vs(1);c.emptyArray=t=>c.array(t)&&t.length===0;c.nonEmptyArray=t=>c.array(t)&&t.length>0;c.emptyString=t=>c.string(t)&&t.length===0;var Xo=t=>c.string(t)&&!/\S/.test(t);c.emptyStringOrWhitespace=t=>c.emptyString(t)||Xo(t);c.nonEmptyString=t=>c.string(t)&&t.length>0;c.nonEmptyStringAndNotWhitespace=t=>c.string(t)&&!c.emptyStringOrWhitespace(t);c.emptyObject=t=>c.object(t)&&!c.map(t)&&!c.set(t)&&Object.keys(t).length===0;c.nonEmptyObject=t=>c.object(t)&&!c.map(t)&&!c.set(t)&&Object.keys(t).length>0;c.emptySet=t=>c.set(t)&&t.size===0;c.nonEmptySet=t=>c.set(t)&&t.size>0;c.emptyMap=t=>c.map(t)&&t.size===0;c.nonEmptyMap=t=>c.map(t)&&t.size>0;c.propertyKey=t=>c.any([c.string,c.number,c.symbol],t);c.formData=t=>$("FormData")(t);c.urlSearchParams=t=>$("URLSearchParams")(t);var Gs=(t,e,r)=>{if(!c.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};c.any=(t,...e)=>(c.array(t)?t:[t]).some(s=>Gs(Array.prototype.some,s,e));c.all=(t,...e)=>Gs(Array.prototype.every,t,e);var m=(t,e,r,s={})=>{if(!t){let{multipleValues:n}=s,i=n?`received values of types ${[...new Set(r.map(o=>`\`${c(o)}\``))].join(", ")}`:`received value of type \`${c(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${i}.`)}},p={undefined:t=>m(c.undefined(t),"undefined",t),string:t=>m(c.string(t),"string",t),number:t=>m(c.number(t),"number",t),positiveNumber:t=>m(c.positiveNumber(t),"positive number",t),negativeNumber:t=>m(c.negativeNumber(t),"negative number",t),bigint:t=>m(c.bigint(t),"bigint",t),function_:t=>m(c.function_(t),"Function",t),null_:t=>m(c.null_(t),"null",t),class_:t=>m(c.class_(t),"Class",t),boolean:t=>m(c.boolean(t),"boolean",t),symbol:t=>m(c.symbol(t),"symbol",t),numericString:t=>m(c.numericString(t),"string with a number",t),array:(t,e)=>{m(c.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>m(c.buffer(t),"Buffer",t),blob:t=>m(c.blob(t),"Blob",t),nullOrUndefined:t=>m(c.nullOrUndefined(t),"null or undefined",t),object:t=>m(c.object(t),"Object",t),iterable:t=>m(c.iterable(t),"Iterable",t),asyncIterable:t=>m(c.asyncIterable(t),"AsyncIterable",t),generator:t=>m(c.generator(t),"Generator",t),asyncGenerator:t=>m(c.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>m(c.nativePromise(t),"native Promise",t),promise:t=>m(c.promise(t),"Promise",t),generatorFunction:t=>m(c.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>m(c.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>m(c.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>m(c.boundFunction(t),"Function",t),regExp:t=>m(c.regExp(t),"RegExp",t),date:t=>m(c.date(t),"Date",t),error:t=>m(c.error(t),"Error",t),map:t=>m(c.map(t),"Map",t),set:t=>m(c.set(t),"Set",t),weakMap:t=>m(c.weakMap(t),"WeakMap",t),weakSet:t=>m(c.weakSet(t),"WeakSet",t),weakRef:t=>m(c.weakRef(t),"WeakRef",t),int8Array:t=>m(c.int8Array(t),"Int8Array",t),uint8Array:t=>m(c.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>m(c.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>m(c.int16Array(t),"Int16Array",t),uint16Array:t=>m(c.uint16Array(t),"Uint16Array",t),int32Array:t=>m(c.int32Array(t),"Int32Array",t),uint32Array:t=>m(c.uint32Array(t),"Uint32Array",t),float32Array:t=>m(c.float32Array(t),"Float32Array",t),float64Array:t=>m(c.float64Array(t),"Float64Array",t),bigInt64Array:t=>m(c.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>m(c.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>m(c.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>m(c.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>m(c.dataView(t),"DataView",t),enumCase:(t,e)=>m(c.enumCase(t,e),"EnumCase",t),urlInstance:t=>m(c.urlInstance(t),"URL",t),urlString:t=>m(c.urlString(t),"string with a URL",t),truthy:t=>m(c.truthy(t),"truthy",t),falsy:t=>m(c.falsy(t),"falsy",t),nan:t=>m(c.nan(t),"NaN",t),primitive:t=>m(c.primitive(t),"primitive",t),integer:t=>m(c.integer(t),"integer",t),safeInteger:t=>m(c.safeInteger(t),"integer",t),plainObject:t=>m(c.plainObject(t),"plain object",t),typedArray:t=>m(c.typedArray(t),"TypedArray",t),arrayLike:t=>m(c.arrayLike(t),"array-like",t),tupleLike:(t,e)=>m(c.tupleLike(t,e),"tuple-like",t),domElement:t=>m(c.domElement(t),"HTMLElement",t),observable:t=>m(c.observable(t),"Observable",t),nodeStream:t=>m(c.nodeStream(t),"Node.js Stream",t),infinite:t=>m(c.infinite(t),"infinite number",t),emptyArray:t=>m(c.emptyArray(t),"empty array",t),nonEmptyArray:t=>m(c.nonEmptyArray(t),"non-empty array",t),emptyString:t=>m(c.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>m(c.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>m(c.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>m(c.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>m(c.emptyObject(t),"empty object",t),nonEmptyObject:t=>m(c.nonEmptyObject(t),"non-empty object",t),emptySet:t=>m(c.emptySet(t),"empty set",t),nonEmptySet:t=>m(c.nonEmptySet(t),"non-empty set",t),emptyMap:t=>m(c.emptyMap(t),"empty map",t),nonEmptyMap:t=>m(c.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>m(c.propertyKey(t),"PropertyKey",t),formData:t=>m(c.formData(t),"FormData",t),urlSearchParams:t=>m(c.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>m(c.evenInteger(t),"even integer",t),oddInteger:t=>m(c.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>m(c.directInstanceOf(t,e),"T",t),inRange:(t,e)=>m(c.inRange(t,e),"in range",t),any:(t,...e)=>m(c.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>m(c.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(c,{class:{value:c.class_},function:{value:c.function_},null:{value:c.null_}});Object.defineProperties(p,{class:{value:p.class_},function:{value:p.function_},null:{value:p.null_}});var h=c;u();import{EventEmitter as Vh}from"node:events";u();var lr=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},je=class t{static fn(e){return(...r)=>new t((s,n,i)=>{r.push(i),e(...r).then(s,n)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,s)=>{this._reject=s;let n=a=>{(!this._isCanceled||!o.shouldReject)&&(this._isPending=!1,r(a))},i=a=>{this._isPending=!1,s(a)},o=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(n,i,o)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r);return}this._rejectOnCancel&&this._reject(new lr(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(je.prototype,Promise.prototype);u();function Zo(t){return h.object(t)&&"_onResponse"in t}var N=class extends Error{constructor(e,r,s){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=r.code??"ERR_GOT_REQUEST_ERROR",this.input=r.input,Zo(s)?(Object.defineProperty(this,"request",{enumerable:!1,value:s}),Object.defineProperty(this,"response",{enumerable:!1,value:s.response}),this.options=s.options):this.options=s,this.timings=this.request?.timings,h.string(r.stack)&&h.string(this.stack)){let n=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(n).split(`
4
+ `).reverse(),o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
5
+ `).reverse();for(;o.length>0&&o[0]===i[0];)i.shift();this.stack=`${this.stack.slice(0,n)}${i.reverse().join(`
6
+ `)}${o.reverse().join(`
7
+ `)}`}}},St=class extends N{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},le=class extends N{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},xt=class extends N{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},Je=class extends N{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},Rt=class extends N{constructor(e,r,s){super(e.message,e,s),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=r}},Ke=class extends N{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}},Ot=class extends N{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},Tt=class extends N{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}};u();import Hi from"node:process";import{Buffer as as}from"node:buffer";import{Duplex as Nh}from"node:stream";import qh,{ServerResponse as vi}from"node:http";u();var Js=X(Ws(),1);import{errorMonitor as ta}from"events";import{types as ra}from"util";var sa=t=>{if(t.timings)return t.timings;let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=o=>{o.once(ta,()=>{e.error=Date.now(),e.phases.total=e.error-e.start})};r(t);let s=()=>{e.abort=Date.now(),e.phases.total=e.abort-e.start};t.prependOnceListener("abort",s);let n=o=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,ra.isProxy(o))return;let a=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};o.prependOnceListener("lookup",a),(0,Js.default)(o,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(o.removeListener("lookup",a),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?n(t.socket):t.prependOnceListener("socket",n);let i=()=>{e.upload=Date.now(),e.phases.request=e.upload-(e.secureConnect??e.connect)};return t.writableFinished?i():t.prependOnceListener("finish",i),t.prependOnceListener("response",o=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,o.timings=e,r(o),o.prependOnceListener("end",()=>{t.off("abort",s),o.off("aborted",s),!e.phases.total&&(e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start)}),o.prependOnceListener("aborted",s)}),e},Ks=sa;u();import Ta from"node:events";import Pt from"node:url";import ka from"node:crypto";import Ca,{PassThrough as Pa}from"node:stream";u();var na="text/plain",ia="us-ascii",mr=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),oa=new Set(["https:","http:","file:"]),aa=t=>{try{let{protocol:e}=new URL(t);return e.endsWith(":")&&!e.includes(".")&&!oa.has(e)}catch{return!1}},ca=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:s,data:n,hash:i}=r.groups,o=s.split(";");i=e?"":i;let a=!1;o[o.length-1]==="base64"&&(o.pop(),a=!0);let l=o.shift()?.toLowerCase()??"",y=[...o.map(R=>{let[g,S=""]=R.split("=").map(O=>O.trim());return g==="charset"&&(S=S.toLowerCase(),S===ia)?"":`${g}${S?`=${S}`:""}`}).filter(Boolean)];return a&&y.push("base64"),(y.length>0||l&&l!==na)&&y.unshift(l),`data:${y.join(";")},${a?n.trim():n}${i?`#${i}`:""}`};function yr(t,e){if(e={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...e},typeof e.defaultProtocol=="string"&&!e.defaultProtocol.endsWith(":")&&(e.defaultProtocol=`${e.defaultProtocol}:`),t=t.trim(),/^data:/i.test(t))return ca(t,e);if(aa(t))return t;let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let n=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),e.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),e.stripAuthentication&&(n.username="",n.password=""),e.stripHash?n.hash="":e.stripTextFragment&&(n.hash=n.hash.replace(/#?:~:text.*?$/i,"")),n.pathname){let o=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,a=0,l="";for(;;){let y=o.exec(n.pathname);if(!y)break;let R=y[0],g=y.index,S=n.pathname.slice(a,g);l+=S.replace(/\/{2,}/g,"/"),l+=R,a=g+R.length}let d=n.pathname.slice(a,n.pathname.length);l+=d.replace(/\/{2,}/g,"/"),n.pathname=l}if(n.pathname)try{n.pathname=decodeURI(n.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let o=n.pathname.split("/"),a=o[o.length-1];mr(a,e.removeDirectoryIndex)&&(o=o.slice(0,-1),n.pathname=o.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let o of[...n.searchParams.keys()])mr(o,e.removeQueryParameters)&&n.searchParams.delete(o);if(!Array.isArray(e.keepQueryParameters)&&e.removeQueryParameters===!0&&(n.search=""),Array.isArray(e.keepQueryParameters)&&e.keepQueryParameters.length>0)for(let o of[...n.searchParams.keys()])mr(o,e.keepQueryParameters)||n.searchParams.delete(o);if(e.sortQueryParameters){n.searchParams.sort();try{n.search=decodeURIComponent(n.search)}catch{}}e.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,"")),e.removeExplicitPort&&n.port&&(n.port="");let i=t;return t=n.toString(),!e.removeSingleSlash&&n.pathname==="/"&&!i.endsWith("/")&&n.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}var an=X(br(),1),At=X(Zs(),1);u();import{Readable as Sa}from"node:stream";u();function ve(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLowerCase(),r]))}var He=class extends Sa{statusCode;headers;body;url;constructor({statusCode:e,headers:r,body:s,url:n}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(s instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof n!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(s),this.push(null)}}),this.statusCode=e,this.headers=ve(r),this.body=s,this.url=n}};var Qe=X(nn(),1);u();var Oa=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function Sr(t,e){if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set([...Object.keys(t),...Oa]),s={};for(let n of r)n in e||(s[n]={get(){let i=t[n];return typeof i=="function"?i.bind(t):i},set(i){t[n]=i},enumerable:!0,configurable:!1});return Object.defineProperties(e,s),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}u();var Ct=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},ae=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}};var Rr=class{constructor(e,r){this.hooks=new Map,this.request=()=>(s,n)=>{let i;if(typeof s=="string")i=xr(Pt.parse(s)),s={};else if(s instanceof Pt.URL)i=xr(Pt.parse(s.toString())),s={};else{let[g,...S]=(s.path??"").split("?"),O=S.length>0?`?${S.join("?")}`:"";i=xr({...s,pathname:g,search:O})}s={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...s,...La(i)},s.headers=Object.fromEntries(Aa(s.headers).map(([g,S])=>[g.toLowerCase(),S]));let o=new Ta,a=yr(Pt.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),l=`${s.method}:${a}`;s.body&&s.method!==void 0&&["POST","PATCH","PUT"].includes(s.method)&&(s.body instanceof Ca.Readable?s.cache=!1:l+=`:${ka.createHash("md5").update(s.body).digest("hex")}`);let d=!1,y=!1,R=g=>{y=!0;let S=!1,O=()=>{},f=new Promise(_=>{O=()=>{S||(S=!0,_())}}),A=async _=>{if(d){_.status=_.statusCode;let x=At.default.fromObject(d.cachePolicy).revalidatedPolicy(g,_);if(!x.modified){_.resume(),await new Promise(U=>{_.once("end",U)});let D=on(x.policy.responseHeaders());_=new He({statusCode:d.statusCode,headers:D,body:d.body,url:d.url}),_.cachePolicy=x.policy,_.fromCache=!0}}_.fromCache||(_.cachePolicy=new At.default(g,_,g),_.fromCache=!1);let j;g.cache&&_.cachePolicy.storable()?(j=Da(_),(async()=>{try{let x=an.default.buffer(_);await Promise.race([f,new Promise(Q=>_.once("end",Q)),new Promise(Q=>_.once("close",Q))]);let D=await x,U={url:_.url,statusCode:_.fromCache?d.statusCode:_.statusCode,body:D,cachePolicy:_.cachePolicy.toObject()},z=g.strictTtl?_.cachePolicy.timeToLive():void 0;if(g.maxTtl&&(z=z?Math.min(z,g.maxTtl):g.maxTtl),this.hooks.size>0)for(let Q of this.hooks.keys())U=await this.runHook(Q,U,_);await this.cache.set(l,U,z)}catch(x){o.emit("error",new ae(x))}})()):g.cache&&d&&(async()=>{try{await this.cache.delete(l)}catch(x){o.emit("error",new ae(x))}})(),o.emit("response",j??_),typeof n=="function"&&n(j??_)};try{let _=this.cacheRequest(g,A);_.once("error",O),_.once("abort",O),_.once("destroy",O),o.emit("request",_)}catch(_){o.emit("error",new Ct(_))}};return(async()=>{let g=async O=>{await Promise.resolve();let f=O.cache?await this.cache.get(l):void 0;if(f===void 0&&!O.forceRefresh){R(O);return}let A=At.default.fromObject(f.cachePolicy);if(A.satisfiesWithoutRevalidation(O)&&!O.forceRefresh){let _=on(A.responseHeaders()),j=new He({statusCode:f.statusCode,headers:_,body:f.body,url:f.url});j.cachePolicy=A,j.fromCache=!0,o.emit("response",j),typeof n=="function"&&n(j)}else A.satisfiesWithoutRevalidation(O)&&Date.now()>=A.timeToLive()&&O.forceRefresh?(await this.cache.delete(l),O.headers=A.revalidationHeaders(O),R(O)):(d=f,O.headers=A.revalidationHeaders(O),R(O))},S=O=>o.emit("error",new ae(O));if(this.cache instanceof Qe.default){let O=this.cache;O.once("error",S),o.on("error",()=>O.removeListener("error",S)),o.on("response",()=>O.removeListener("error",S))}try{await g(s)}catch(O){s.automaticFailover&&!y&&R(s),o.emit("error",new ae(O))}})(),o},this.addHook=(s,n)=>{this.hooks.has(s)||this.hooks.set(s,n)},this.removeHook=s=>this.hooks.delete(s),this.getHook=s=>this.hooks.get(s),this.runHook=async(s,...n)=>this.hooks.get(s)?.(...n),r instanceof Qe.default?this.cache=r:typeof r=="string"?this.cache=new Qe.default({uri:r,namespace:"cacheable-request"}):this.cache=new Qe.default({store:r,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},Aa=Object.entries,Da=t=>{let e=new Pa({autoDestroy:!1});return Sr(t,e),t.pipe(e)},La=t=>{let e={...t};return e.path=`${t.pathname||"/"}${t.search||""}`,delete e.pathname,delete e.search,e},xr=t=>({protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}),on=t=>{let e=[];for(let r of Object.keys(t))e[r.toLowerCase()]=t[r];return e},cn=Rr;var $i=X(dn(),1);var Ii=X(br(),1);u();u();u();var te=t=>typeof t=="function";var Ia=t=>te(t[Symbol.asyncIterator]);async function*Na(t){let e=t.getReader();for(;;){let{done:r,value:s}=await e.read();if(r)break;yield s}}var fn=t=>{if(Ia(t))return t;if(te(t.getReader))return Na(t);throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")};u();var pn="abcdefghijklmnopqrstuvwxyz0123456789";function mn(){let t=16,e="";for(;t--;)e+=pn[Math.random()*pn.length<<0];return e}u();var Tr=t=>String(t).replace(/\r|\n/g,(e,r,s)=>e==="\r"&&s[r+1]!==`
8
+ `||e===`
9
+ `&&s[r-1]!=="\r"?`\r
10
+ `:e);u();var qa=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function kr(t){if(qa(t)!=="object")return!1;let e=Object.getPrototypeOf(t);return e==null?!0:(e.constructor&&e.constructor.toString())===Object.toString()}u();function yn(t,e){if(typeof e=="string"){for(let[r,s]of Object.entries(t))if(e.toLowerCase()===r.toLowerCase())return s}}var gn=t=>new Proxy(t,{get:(e,r)=>yn(e,r),has:(e,r)=>yn(e,r)!==void 0});u();var $e=t=>!!(t&&te(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&te(t.append)&&te(t.getAll)&&te(t.entries)&&te(t[Symbol.iterator]));u();var Cr=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");u();var de=t=>!!(t&&typeof t=="object"&&te(t.constructor)&&t[Symbol.toStringTag]==="File"&&te(t.stream)&&t.name!=null);var Xe=function(t,e,r,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},q=function(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)},Ze,fe,et,Dt,tt,_e,rt,st,Lt,Pr,bn,Ua={enableAdditionalHeaders:!1},jt={writable:!1,configurable:!1},vt=class{constructor(e,r,s){if(Ze.add(this),fe.set(this,`\r
11
+ `),et.set(this,void 0),Dt.set(this,void 0),tt.set(this,"-".repeat(2)),_e.set(this,new TextEncoder),rt.set(this,void 0),st.set(this,void 0),Lt.set(this,void 0),!$e(e))throw new TypeError("Expected first argument to be a FormData instance.");let n;if(kr(r)?s=r:n=r,n||(n=mn()),typeof n!="string")throw new TypeError("Expected boundary argument to be a string.");if(s&&!kr(s))throw new TypeError("Expected options argument to be an object.");Xe(this,st,Array.from(e.entries()),"f"),Xe(this,Lt,{...Ua,...s},"f"),Xe(this,et,q(this,_e,"f").encode(q(this,fe,"f")),"f"),Xe(this,Dt,q(this,et,"f").byteLength,"f"),this.boundary=`form-data-boundary-${n}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,Xe(this,rt,q(this,_e,"f").encode(`${q(this,tt,"f")}${this.boundary}${q(this,tt,"f")}${q(this,fe,"f").repeat(2)}`),"f");let i={"Content-Type":this.contentType},o=q(this,Ze,"m",bn).call(this);o&&(this.contentLength=o,i["Content-Length"]=o),this.headers=gn(Object.freeze(i)),Object.defineProperties(this,{boundary:jt,contentType:jt,contentLength:jt,headers:jt})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,r]of q(this,st,"f")){let s=de(r)?r:q(this,_e,"f").encode(Tr(r));yield q(this,Ze,"m",Pr).call(this,e,s),yield s,yield q(this,et,"f")}yield q(this,rt,"f")}async*encode(){for(let e of this.values())de(e)?yield*fn(e.stream()):yield e}[(fe=new WeakMap,et=new WeakMap,Dt=new WeakMap,tt=new WeakMap,_e=new WeakMap,rt=new WeakMap,st=new WeakMap,Lt=new WeakMap,Ze=new WeakSet,Pr=function(r,s){let n="";n+=`${q(this,tt,"f")}${this.boundary}${q(this,fe,"f")}`,n+=`Content-Disposition: form-data; name="${Cr(r)}"`,de(s)&&(n+=`; filename="${Cr(s.name)}"${q(this,fe,"f")}`,n+=`Content-Type: ${s.type||"application/octet-stream"}`);let i=de(s)?s.size:s.byteLength;return q(this,Lt,"f").enableAdditionalHeaders===!0&&i!=null&&!isNaN(i)&&(n+=`${q(this,fe,"f")}Content-Length: ${de(s)?s.size:s.byteLength}`),q(this,_e,"f").encode(`${n}${q(this,fe,"f").repeat(2)}`)},bn=function(){let r=0;for(let[s,n]of q(this,st,"f")){let i=de(n)?n:q(this,_e,"f").encode(Tr(n)),o=de(i)?i.size:i.byteLength;if(o==null||isNaN(o))return;r+=q(this,Ze,"m",Pr).call(this,s,i).byteLength,r+=o,r+=q(this,Dt,"f")}return String(r+q(this,rt,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};u();import{Buffer as Ba}from"node:buffer";import{promisify as Ma}from"node:util";u();function nt(t){return h.nodeStream(t)&&h.function_(t.getBoundary)}async function Ar(t,e){if(e&&"content-length"in e)return Number(e["content-length"]);if(!t)return 0;if(h.string(t))return Ba.byteLength(t);if(h.buffer(t))return t.length;if(nt(t))return Ma(t.getLength.bind(t))()}u();function it(t,e,r){let s={};for(let n of r){let i=(...o)=>{e.emit(n,...o)};s[n]=i,t.on(n,i)}return()=>{for(let[n,i]of Object.entries(s))t.off(n,i)}}u();import za from"node:net";u();function Dr(){let t=[];return{once(e,r,s){e.once(r,s),t.push({origin:e,event:r,fn:s})},unhandleAll(){for(let e of t){let{origin:r,event:s,fn:n}=e;r.removeListener(s,n)}t.length=0}}}var _n=Symbol("reentry"),Fa=()=>{},ot=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function Lr(t,e,r){if(_n in t)return Fa;t[_n]=!0;let s=[],{once:n,unhandleAll:i}=Dr(),o=(f,A,_)=>{let j=setTimeout(A,f,f,_);j.unref?.();let x=()=>{clearTimeout(j)};return s.push(x),x},{host:a,hostname:l}=r,d=(f,A)=>{t.destroy(new ot(f,A))},y=()=>{for(let f of s)f();i()};if(t.once("error",f=>{if(y(),t.listenerCount("error")===0)throw f}),e.request!==void 0){let f=o(e.request,d,"request");n(t,"response",A=>{n(A,"end",f)})}if(e.socket!==void 0){let{socket:f}=e,A=()=>{d(f,"socket")};t.setTimeout(f,A),s.push(()=>{t.removeListener("timeout",A)})}let R=e.lookup!==void 0,g=e.connect!==void 0,S=e.secureConnect!==void 0,O=e.send!==void 0;return(R||g||S||O)&&n(t,"socket",f=>{let{socketPath:A}=t;if(f.connecting){let _=!!(A??za.isIP(l??a??"")!==0);if(R&&!_&&f.address().address===void 0){let j=o(e.lookup,d,"lookup");n(f,"lookup",j)}if(g){let j=()=>o(e.connect,d,"connect");_?n(f,"connect",j()):n(f,"lookup",x=>{x===null&&n(f,"connect",j())})}S&&r.protocol==="https:"&&n(f,"connect",()=>{let j=o(e.secureConnect,d,"secureConnect");n(f,"secureConnect",j)})}if(O){let _=()=>o(e.send,d,"send");f.connecting?n(f,"connect",()=>{n(t,"upload-complete",_())}):n(t,"upload-complete",_())}}),e.response!==void 0&&n(t,"upload-complete",()=>{let f=o(e.response,d,"response");n(t,"response",f)}),e.read!==void 0&&n(t,"response",f=>{let A=o(e.read,d,"read");n(f,"end",A)}),y}u();function jr(t){t=t;let e={protocol:t.protocol,hostname:h.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return h.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}u();var at=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e=="object"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};u();var Va=({attemptCount:t,retryOptions:e,error:r,retryAfter:s,computedValue:n})=>{if(r.name==="RetryError")return 1;if(t>e.limit)return 0;let i=e.methods.includes(r.options.method),o=e.errorCodes.includes(r.code),a=r.response&&e.statusCodes.includes(r.response.statusCode);if(!i||!o&&!a)return 0;if(r.response){if(s)return s>n?0:s;if(r.response.statusCode===413)return 0}let l=Math.random()*e.noise;return Math.min(2**(t-1)*1e3,e.backoffLimit)+l},wn=Va;u();import Rh from"node:process";import{promisify as Pi,inspect as Oh}from"node:util";import{checkServerIdentity as Th}from"node:tls";import kh from"node:http";import Ch from"node:https";u();import{V4MAPPED as Ga,ADDRCONFIG as Wa,ALL as Tn,promises as Ja,lookup as Ka}from"node:dns";import{promisify as vr}from"node:util";import Ya from"node:os";var{Resolver:En}=Ja,Ie=Symbol("cacheableLookupCreateConnection"),Hr=Symbol("cacheableLookupInstance"),Sn=Symbol("expires"),Qa=typeof Tn=="number",xn=t=>{if(!(t&&typeof t.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},Xa=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},Rn=()=>{let t=!1,e=!1;for(let r of Object.values(Ya.networkInterfaces()))for(let s of r)if(!s.internal&&(s.family==="IPv6"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},Za=t=>Symbol.iterator in t,Ht=t=>t.catch(e=>{if(e.code==="ENODATA"||e.code==="ENOTFOUND"||e.code==="ENOENT")return[];throw e}),On={ttl:!0},ec={all:!0},tc={all:!0,family:4},rc={all:!0,family:6},ct=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:s=3600,errorTtl:n=.15,resolver:i=new En,lookup:o=Ka}={}){if(this.maxTtl=r,this.errorTtl=n,this._cache=e,this._resolver=i,this._dnsLookup=o&&vr(o),this.stats={cache:0,query:0},this._resolver instanceof En?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=vr(this._resolver.resolve4.bind(this._resolver)),this._resolve6=vr(this._resolver.resolve6.bind(this._resolver))),this._iface=Rn(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=s,s>0){let a=setInterval(()=>{this._hostnamesToFallback.clear()},s*1e3);a.unref&&a.unref(),this._fallbackInterval=a}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,s){if(typeof r=="function"?(s=r,r={}):typeof r=="number"&&(r={family:r}),!s)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(n=>{r.all?s(null,n):s(null,n.address,n.family,n.expires,n.ttl,n.source)},s)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let s=await this.query(e);if(r.family===6){let n=s.filter(i=>i.family===6);r.hints&Ga&&(Qa&&r.hints&Tn||n.length===0)?Xa(s):s=n}else r.family===4&&(s=s.filter(n=>n.family===4));if(r.hints&Wa){let{_iface:n}=this;s=s.filter(i=>i.family===6?n.has6:n.has4)}if(s.length===0){let n=new Error(`cacheableLookup ENOTFOUND ${e}`);throw n.code="ENOTFOUND",n.hostname=e,n}return r.all?s:s[0]}async query(e){let r="cache",s=await this._cache.get(e);if(s&&this.stats.cache++,!s){let n=this._pending[e];if(n)this.stats.cache++,s=await n;else{r="query";let i=this.queryAndCache(e);this._pending[e]=i,this.stats.query++;try{s=await i}finally{delete this._pending[e]}}}return s=s.map(n=>({...n,source:r})),s}async _resolve(e){let[r,s]=await Promise.all([Ht(this._resolve4(e,On)),Ht(this._resolve6(e,On))]),n=0,i=0,o=0,a=Date.now();for(let l of r)l.family=4,l.expires=a+l.ttl*1e3,n=Math.max(n,l.ttl);for(let l of s)l.family=6,l.expires=a+l.ttl*1e3,i=Math.max(i,l.ttl);return r.length>0?s.length>0?o=Math.min(n,i):o=n:o=i,{entries:[...r,...s],cacheTtl:o}}async _lookup(e){try{let[r,s]=await Promise.all([Ht(this._dnsLookup(e,tc)),Ht(this._dnsLookup(e,rc))]);return{entries:[...r,...s],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,s){if(this.maxTtl>0&&s>0){s=Math.min(s,this.maxTtl)*1e3,r[Sn]=Date.now()+s;try{await this._cache.set(e,r,s)}catch(n){this.lookupAsync=async()=>{let i=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw i.cause=n,i}}Za(this._cache)&&this._tick(s)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,ec);let r=await this._resolve(e);r.entries.length===0&&this._dnsLookup&&(r=await this._lookup(e),r.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(e));let s=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,s),r.entries}_tick(e){let r=this._nextRemovalTime;(!r||e<r)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let s=1/0,n=Date.now();for(let[i,o]of this._cache){let a=o[Sn];n>=a?this._cache.delete(i):a<s&&(s=a)}s!==1/0&&this._tick(s-n)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(xn(e),Ie in e)throw new Error("CacheableLookup has been already installed");e[Ie]=e.createConnection,e[Hr]=this,e.createConnection=(r,s)=>("lookup"in r||(r.lookup=this.lookup),e[Ie](r,s))}uninstall(e){if(xn(e),e[Ie]){if(e[Hr]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Ie],delete e[Ie],delete e[Hr]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=Rn(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};var Li=X(Ci(),1);u();function is(t){let e=[],r=t.split(",");for(let s of r){let[n,...i]=s.split(";"),o=n.trim();if(o[0]!=="<"||o[o.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${o}`);let a=o.slice(1,-1),l={};if(i.length===0)throw new Error(`Unexpected end of Link header parameters: ${i.join(";")}`);for(let d of i){let y=d.trim(),R=y.indexOf("=");if(R===-1)throw new Error(`Failed to parse Link header: ${t}`);let g=y.slice(0,R).trim(),S=y.slice(R+1).trim();l[g]=S}e.push({reference:a,parameters:l})}return e}var[Ai,Ph]=Rh.versions.node.split(".").map(Number);function Ah(t){for(let e in t){let r=t[e];p.any([h.string,h.number,h.boolean,h.null_,h.undefined],r)}}var Dh=new Map,Mt,Lh=()=>Mt||(Mt=new ct,Mt),jh={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(t){return t.request.options.responseType==="json"?t.body:JSON.parse(t.body)},paginate({response:t}){let e=t.headers.link;if(typeof e!="string"||e.trim()==="")return!1;let s=is(e).find(n=>n.parameters.rel==="next"||n.parameters.rel==='"next"');return s?{url:new URL(s.reference,t.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!1},vh=t=>{let{hooks:e,retry:r}=t,s={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...r,errorCodes:[...r.errorCodes],methods:[...r.methods],statusCodes:[...r.statusCodes]},timeout:{...t.timeout},hooks:{init:[...e.init],beforeRequest:[...e.beforeRequest],beforeError:[...e.beforeError],beforeRedirect:[...e.beforeRedirect],beforeRetry:[...e.beforeRetry],afterResponse:[...e.afterResponse]},searchParams:t.searchParams?new URLSearchParams(t.searchParams):void 0,pagination:{...t.pagination}};return s.url!==void 0&&(s.prefixUrl=""),s},Hh=t=>{let{hooks:e,retry:r}=t,s={...t};return h.object(t.context)&&(s.context={...t.context}),h.object(t.cacheOptions)&&(s.cacheOptions={...t.cacheOptions}),h.object(t.https)&&(s.https={...t.https}),h.object(t.cacheOptions)&&(s.cacheOptions={...s.cacheOptions}),h.object(t.agent)&&(s.agent={...t.agent}),h.object(t.headers)&&(s.headers={...t.headers}),h.object(r)&&(s.retry={...r},h.array(r.errorCodes)&&(s.retry.errorCodes=[...r.errorCodes]),h.array(r.methods)&&(s.retry.methods=[...r.methods]),h.array(r.statusCodes)&&(s.retry.statusCodes=[...r.statusCodes])),h.object(t.timeout)&&(s.timeout={...t.timeout}),h.object(e)&&(s.hooks={...e},h.array(e.init)&&(s.hooks.init=[...e.init]),h.array(e.beforeRequest)&&(s.hooks.beforeRequest=[...e.beforeRequest]),h.array(e.beforeError)&&(s.hooks.beforeError=[...e.beforeError]),h.array(e.beforeRedirect)&&(s.hooks.beforeRedirect=[...e.beforeRedirect]),h.array(e.beforeRetry)&&(s.hooks.beforeRetry=[...e.beforeRetry]),h.array(e.afterResponse)&&(s.hooks.afterResponse=[...e.afterResponse])),h.object(t.pagination)&&(s.pagination={...t.pagination}),s},$h=t=>{let e=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter(r=>typeof r=="number");if(e.length>0)return Math.min(...e)},Di=(t,e,r)=>{let s=t.hooks?.init;if(s)for(let n of s)n(e,r)},re=class t{constructor(e,r,s){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),p.any([h.string,h.urlInstance,h.object,h.undefined],e),p.any([h.object,h.undefined],r),p.any([h.object,h.undefined],s),e instanceof t||r instanceof t)throw new TypeError("The defaults must be passed as the third argument");this._internals=vh(s?._internals??s??jh),this._init=[...s?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(h.plainObject(e))try{this.merge(e),this.merge(r)}finally{this.url=e.url}else try{this.merge(r)}finally{if(r?.url!==void 0)if(e===void 0)this.url=r.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else e!==void 0&&(this.url=e)}}catch(n){throw n.options=this,n}}merge(e){if(e){if(e instanceof t){for(let r of e._init)this.merge(r);return}e=Hh(e),Di(this,e,this),Di(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let r=!1;for(let s in e){if(s==="mutableDefaults"||s==="handlers"||s==="url")continue;if(!(s in this))throw new Error(`Unexpected option: ${s}`);let n=e[s];n!==void 0&&(this[s]=n,r=!0)}r&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){p.any([h.function_,h.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){p.plainObject(e);for(let r in e){if(!(r in this._internals.agent))throw new TypeError(`Unexpected agent option: ${r}`);p.any([h.object,h.undefined],e[r])}this._merging?Object.assign(this._internals.agent,e):this._internals.agent={...e}}get h2session(){return this._internals.h2session}set h2session(e){this._internals.h2session=e}get decompress(){return this._internals.decompress}set decompress(e){p.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){p.plainObject(e);for(let r in e){if(!(r in this._internals.timeout))throw new Error(`Unexpected timeout option: ${r}`);p.any([h.number,h.undefined],e[r])}this._merging?Object.assign(this._internals.timeout,e):this._internals.timeout={...e}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(e){if(p.any([h.string,h.urlInstance],e),e===""){this._internals.prefixUrl="";return}if(e=e.toString(),e.endsWith("/")||(e+="/"),this._internals.prefixUrl&&this._internals.url){let{href:r}=this._internals.url;this._internals.url.href=e+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=e}get body(){return this._internals.body}set body(e){p.any([h.string,h.buffer,h.nodeStream,h.generator,h.asyncGenerator,$e,h.undefined],e),h.nodeStream(e)&&p.truthy(e.readable),e!==void 0&&(p.undefined(this._internals.form),p.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){p.any([h.plainObject,h.undefined],e),e!==void 0&&(p.undefined(this._internals.body),p.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(p.undefined(this._internals.body),p.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(p.any([h.string,h.urlInstance,h.undefined],e),e===void 0){this._internals.url=void 0;return}if(h.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let r=`${this.prefixUrl}${e.toString()}`,s=new URL(r);if(this._internals.url=s,s.protocol==="unix:"&&(s.href=`http://unix${s.pathname}${s.search}`),s.protocol!=="http:"&&s.protocol!=="https:"){let n=new Error(`Unsupported protocol: ${s.protocol}`);throw n.code="ERR_UNSUPPORTED_PROTOCOL",n}if(this._internals.username&&(s.username=this._internals.username,this._internals.username=""),this._internals.password&&(s.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(s.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),s.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let n=/(?<socketPath>.+?):(?<path>.+)/.exec(`${s.pathname}${s.search}`);if(n?.groups){let{socketPath:i,path:o}=n.groups;this._unixOptions={socketPath:i,path:o,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(p.any([h.object,h.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:r,getCookieString:s}=e;p.function_(r),p.function_(s),r.length===4&&s.length===0?(r=Pi(r.bind(e)),s=Pi(s.bind(e)),this._internals.cookieJar={setCookie:r,getCookieString:s}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){p.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){p.boolean(e),this._internals.ignoreInvalidCookies=e}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new URLSearchParams),this._internals.searchParams)}set searchParams(e){p.any([h.string,h.object,h.undefined],e);let r=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,r&&(r.search="");return}let s=this.searchParams,n;if(h.string(e))n=new URLSearchParams(e);else if(e instanceof URLSearchParams)n=e;else{Ah(e),n=new URLSearchParams;for(let i in e){let o=e[i];o===null?n.append(i,""):o===void 0?s.delete(i):n.append(i,o)}}if(this._merging){for(let i of n.keys())s.delete(i);for(let[i,o]of n)s.append(i,o)}else r?r.search=s.toString():this._internals.searchParams=s}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(e){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(e){p.any([h.function_,h.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){p.any([h.object,h.boolean,h.undefined],e),e===!0?this._internals.dnsCache=Lh():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){p.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){p.object(e);for(let r in e){if(!(r in this._internals.hooks))throw new Error(`Unexpected hook event: ${r}`);let s=r,n=e[s];if(p.any([h.array,h.undefined],n),n)for(let i of n)p.function_(i);if(this._merging)n&&this._internals.hooks[s].push(...n);else{if(!n)throw new Error(`Missing hook event: ${r}`);this._internals.hooks[r]=[...n]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){p.boolean(e),this._internals.followRedirect=e}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(e){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(e){p.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){p.any([h.object,h.string,h.boolean,h.undefined],e),e===!0?this._internals.cache=Dh:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){p.boolean(e),this._internals.throwHttpErrors=e}get username(){let e=this._internals.url,r=e?e.username:this._internals.username;return decodeURIComponent(r)}set username(e){p.string(e);let r=this._internals.url,s=encodeURIComponent(e);r?r.username=s:this._internals.username=s}get password(){let e=this._internals.url,r=e?e.password:this._internals.password;return decodeURIComponent(r)}set password(e){p.string(e);let r=this._internals.url,s=encodeURIComponent(e);r?r.password=s:this._internals.password=s}get http2(){return this._internals.http2}set http2(e){p.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){p.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){p.plainObject(e),this._merging?Object.assign(this._internals.headers,ve(e)):this._internals.headers=ve(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){p.boolean(e),this._internals.methodRewriting=e}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(e){if(e!==void 0&&e!==4&&e!==6)throw new TypeError(`Invalid DNS lookup IP version: ${e}`);this._internals.dnsLookupIpVersion=e}get parseJson(){return this._internals.parseJson}set parseJson(e){p.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){p.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(p.plainObject(e),p.any([h.function_,h.undefined],e.calculateDelay),p.any([h.number,h.undefined],e.maxRetryAfter),p.any([h.number,h.undefined],e.limit),p.any([h.array,h.undefined],e.methods),p.any([h.array,h.undefined],e.statusCodes),p.any([h.array,h.undefined],e.errorCodes),p.any([h.number,h.undefined],e.noise),e.noise&&Math.abs(e.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${e.noise}`);for(let s in e)if(!(s in this._internals.retry))throw new Error(`Unexpected retry option: ${s}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:r}=this._internals;r.methods=[...new Set(r.methods.map(s=>s.toUpperCase()))],r.statusCodes=[...new Set(r.statusCodes)],r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){p.any([h.string,h.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){p.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){p.any([h.function_,h.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){p.plainObject(e),p.any([h.boolean,h.undefined],e.shared),p.any([h.number,h.undefined],e.cacheHeuristic),p.any([h.number,h.undefined],e.immutableMinTimeToLive),p.any([h.boolean,h.undefined],e.ignoreCargoCult);for(let r in e)if(!(r in this._internals.cacheOptions))throw new Error(`Cache option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,e):this._internals.cacheOptions={...e}}get https(){return this._internals.https}set https(e){p.plainObject(e),p.any([h.boolean,h.undefined],e.rejectUnauthorized),p.any([h.function_,h.undefined],e.checkServerIdentity),p.any([h.string,h.object,h.array,h.undefined],e.certificateAuthority),p.any([h.string,h.object,h.array,h.undefined],e.key),p.any([h.string,h.object,h.array,h.undefined],e.certificate),p.any([h.string,h.undefined],e.passphrase),p.any([h.string,h.buffer,h.array,h.undefined],e.pfx),p.any([h.array,h.undefined],e.alpnProtocols),p.any([h.string,h.undefined],e.ciphers),p.any([h.string,h.buffer,h.undefined],e.dhparam),p.any([h.string,h.undefined],e.signatureAlgorithms),p.any([h.string,h.undefined],e.minVersion),p.any([h.string,h.undefined],e.maxVersion),p.any([h.boolean,h.undefined],e.honorCipherOrder),p.any([h.number,h.undefined],e.tlsSessionLifetime),p.any([h.string,h.undefined],e.ecdhCurve),p.any([h.string,h.buffer,h.array,h.undefined],e.certificateRevocationLists);for(let r in e)if(!(r in this._internals.https))throw new Error(`HTTPS option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.https,e):this._internals.https={...e}}get encoding(){return this._internals.encoding}set encoding(e){if(e===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");p.any([h.string,h.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){p.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){p.boolean(e),this._internals.isStream=e}get responseType(){return this._internals.responseType}set responseType(e){if(e===void 0){this._internals.responseType="text";return}if(e!=="text"&&e!=="buffer"&&e!=="json")throw new Error(`Invalid \`responseType\` option: ${e}`);this._internals.responseType=e}get pagination(){return this._internals.pagination}set pagination(e){p.object(e),this._merging?Object.assign(this._internals.pagination,e):this._internals.pagination=e}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(e){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(e){p.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){p.any([h.number,h.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){p.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Oh(this._internals,r)}createNativeRequestOptions(){let e=this._internals,r=e.url,s;r.protocol==="https:"?s=e.http2?e.agent:e.agent.https:s=e.agent.http;let{https:n}=e,{pfx:i}=n;return h.array(i)&&h.plainObject(i[0])&&(i=i.map(o=>({buf:o.buffer,passphrase:o.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:n.alpnProtocols,ca:n.certificateAuthority,cert:n.certificate,key:n.key,passphrase:n.passphrase,pfx:n.pfx,rejectUnauthorized:n.rejectUnauthorized,checkServerIdentity:n.checkServerIdentity??Th,ciphers:n.ciphers,honorCipherOrder:n.honorCipherOrder,minVersion:n.minVersion,maxVersion:n.maxVersion,sigalgs:n.signatureAlgorithms,sessionTimeout:n.tlsSessionLifetime,dhparam:n.dhparam,ecdhCurve:n.ecdhCurve,crl:n.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:s,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?$h(e):void 0,h2session:e.h2session}}getRequestFunction(){let e=this._internals.url,{request:r}=this._internals;return!r&&e?this.getFallbackRequestFunction():r}getFallbackRequestFunction(){let e=this._internals.url;if(e){if(e.protocol==="https:"){if(this._internals.http2){if(Ai<15||Ai===15&&Ph<10){let r=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw r.code="EUNSUPPORTED",r}return Li.default.auto}return Ch.request}return kh.request}}freeze(){let e=this._internals;Object.freeze(e),Object.freeze(e.hooks),Object.freeze(e.hooks.afterResponse),Object.freeze(e.hooks.beforeError),Object.freeze(e.hooks.beforeRedirect),Object.freeze(e.hooks.beforeRequest),Object.freeze(e.hooks.beforeRetry),Object.freeze(e.hooks.init),Object.freeze(e.https),Object.freeze(e.cacheOptions),Object.freeze(e.agent),Object.freeze(e.headers),Object.freeze(e.timeout),Object.freeze(e.retry),Object.freeze(e.retry.errorCodes),Object.freeze(e.retry.methods),Object.freeze(e.retry.statusCodes)}};u();var Be=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304},zt=class extends N{constructor(e,r){let{options:s}=r.request;super(`${e.message} in "${s.url.toString()}"`,e,r.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},os=(t,e,r,s)=>{let{rawBody:n}=t;try{if(e==="text")return n.toString(s);if(e==="json")return n.length===0?"":r(n.toString(s));if(e==="buffer")return n}catch(i){throw new zt(i,t)}throw new zt({message:`Unknown body type '${e}'`,name:"Error"},t)};u();function Ih(t){return t.writable&&!t.writableEnded}var ji=Ih;u();function Ft(t){return t.protocol==="unix:"||t.hostname==="unix"}var{buffer:Uh}=Ii.default,Bh=h.string(Hi.versions.brotli),Mh=new Set(["GET","HEAD"]),cs=new at,zh=new Set([300,301,302,303,304,307,308]),Fh=["socket","connect","continue","information","upgrade"],Vt=()=>{},Se=class t extends Nh{constructor(e,r,s){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_removeListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=Vt,this._triggerRead=!1,this._cancelTimeouts=Vt,this._removeListeners=Vt,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=Vt,this.on("pipe",i=>{i?.headers&&Object.assign(this.options.headers,i.headers)}),this.on("newListener",i=>{if(i==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new re(e,r,s),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(i){let{options:o}=i;o&&(this.options=o),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}let{body:n}=this.options;if(h.nodeStream(n)&&n.once("error",i=>{this._flushed?this._beforeError(new Je(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new Je(i,this))}}),this.options.signal){let i=()=>{this.destroy(new Tt(this))};this.options.signal.aborted?i():(this.options.signal.addEventListener("abort",i),this._removeListeners=()=>{this.options.signal?.removeEventListener("abort",i)})}}async flush(){if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){this._request?.destroy();return}for(let e of this._jobs)e();this._jobs.length=0,this._requestInitialized=!0}catch(e){this._beforeError(e)}}}_beforeError(e){if(this._stopReading)return;let{response:r,options:s}=this,n=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof N||(e=new N(e.message,e,this));let i=e;(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed&&(r.setEncoding(this.readableEncoding),await this._setRawBody(r)&&(r.body=r.rawBody.toString())),this.listenerCount("retry")!==0){let o;try{let a;r&&"retry-after"in r.headers&&(a=Number(r.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(r.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3);let l=s.retry;o=await l.calculateDelay({attemptCount:n,retryOptions:l,error:i,retryAfter:a,computedValue:wn({attemptCount:n,retryOptions:l,error:i,retryAfter:a,computedValue:l.maxRetryAfter??s.timeout.request??Number.POSITIVE_INFINITY})})}catch(a){this._error(new N(a.message,a,this));return}if(o){if(await new Promise(a=>{let l=setTimeout(a,o);this._stopRetry=()=>{clearTimeout(l),a()}}),this.destroyed)return;try{for(let a of this.options.hooks.beforeRetry)await a(i,this.retryCount+1)}catch(a){this._error(new N(a.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,a=>{let l=new t(s.url,a,s);return l.retryCount=this.retryCount+1,Hi.nextTick(()=>{l.flush()}),l});return}}this._error(i)})()}_read(){this._triggerRead=!0;let{response:e}=this;if(e&&!this._stopReading){e.readableLength&&(this._triggerRead=!1);let r;for(;(r=e.read())!==null;){this._downloadedSize+=r.length;let s=this.downloadProgress;s.percent<1&&this.emit("downloadProgress",s),this.push(r)}}}_write(e,r,s){let n=()=>{this._writeRequest(e,r,s)};this._requestInitialized?n():this._jobs.push(n)}_final(e){let r=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(s=>{this._request._writableState?.errored||(s||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(s))})};this._requestInitialized?r():this._jobs.push(r)}_destroy(e,r){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:s}=this.options;h.nodeStream(s)&&s.destroy()}this._request&&this._request.destroy(),e!==null&&!h.undefined(e)&&!(e instanceof N)&&(e=new N(e.message,e,this)),r(e)}pipe(e,r){return e instanceof vi&&this._pipedServerResponses.add(e),super.pipe(e,r)}unpipe(e){return e instanceof vi&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:r}=e,s=!h.undefined(e.form),n=!h.undefined(e.json),i=!h.undefined(e.body),o=Mh.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=o,s||n||i){if(o)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let a=!h.string(r["content-type"]);if(i){if($e(e.body)){let d=new vt(e.body);a&&(r["content-type"]=d.headers["Content-Type"]),"Content-Length"in d.headers&&(r["content-length"]=d.headers["Content-Length"]),e.body=d.encode()}nt(e.body)&&a&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(s){a&&(r["content-type"]="application/x-www-form-urlencoded");let{form:d}=e;e.form=void 0,e.body=new URLSearchParams(d).toString()}else{a&&(r["content-type"]="application/json");let{json:d}=e;e.json=void 0,e.body=e.stringifyJson(d)}let l=await Ar(e.body,e.headers);h.undefined(r["content-length"])&&h.undefined(r["transfer-encoding"])&&!o&&!h.undefined(l)&&(r["content-length"]=String(l))}e.responseType==="json"&&!("accept"in e.headers)&&(e.headers.accept="application/json"),this._bodySize=Number(r["content-length"])||void 0}async _onResponseBase(e){if(this.isAborted)return;let{options:r}=this,{url:s}=r;this._nativeResponse=e,r.decompress&&(e=(0,$i.default)(e));let n=e.statusCode,i=e;i.statusMessage=i.statusMessage??qh.STATUS_CODES[n],i.url=r.url.toString(),i.requestUrl=this.requestUrl,i.redirectUrls=this.redirectUrls,i.request=this,i.isFromCache=this._nativeResponse.fromCache??!1,i.ip=this.ip,i.retryCount=this.retryCount,i.ok=Be(i),this._isFromCache=i.isFromCache,this._responseSize=Number(e.headers["content-length"])||void 0,this.response=i,e.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{this._aborted=!0,e.destroy(),this._beforeError(new Ke(a,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Ke({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(h.object(r.cookieJar)&&o){let a=o.map(async l=>r.cookieJar.setCookie(l,s.toString()));r.ignoreInvalidCookies&&(a=a.map(async l=>{try{await l}catch{}}));try{await Promise.all(a)}catch(l){this._beforeError(l);return}}if(!this.isAborted){if(r.followRedirect&&e.headers.location&&zh.has(n)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=r.maxRedirects){this._beforeError(new St(this));return}this._request=void 0;let a=new re(void 0,void 0,this.options),l=n===303&&a.method!=="GET"&&a.method!=="HEAD",d=n!==307&&n!==308,y=a.methodRewriting&&d;(l||y)&&(a.method="GET",a.body=void 0,a.json=void 0,a.form=void 0,delete a.headers["content-length"]);try{let R=as.from(e.headers.location,"binary").toString(),g=new URL(R,s);if(!Ft(s)&&Ft(g)){this._beforeError(new N("Cannot redirect to UNIX socket",{},this));return}g.hostname!==s.hostname||g.port!==s.port?("host"in a.headers&&delete a.headers.host,"cookie"in a.headers&&delete a.headers.cookie,"authorization"in a.headers&&delete a.headers.authorization,(a.username||a.password)&&(a.username="",a.password="")):(g.username=a.username,g.password=a.password),this.redirectUrls.push(g),a.prefixUrl="",a.url=g;for(let S of a.hooks.beforeRedirect)await S(a,i);this.emit("redirect",a,i),this.options=a,await this._makeRequest()}catch(R){this._beforeError(R);return}return}if(r.isStream&&r.throwHttpErrors&&!Be(i)){this._beforeError(new le(i));return}if(e.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",e);return}this.emit("response",e);for(let a of this._pipedServerResponses)if(!a.headersSent){for(let l in e.headers){let d=r.decompress?l!=="content-encoding":!0,y=e.headers[l];d&&a.setHeader(l,y)}a.statusCode=n}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let r=await Uh(e);if(!this.isAborted)return this.response.rawBody=r,!0}catch{}return!1}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:s,url:n}=r;Ks(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=Lr(e,s,n);let i=r.cache?"cacheableResponse":"response";e.once(i,o=>{this._onResponse(o)}),e.once("error",o=>{this._aborted=!0,e.destroy(),o=o instanceof ot?new Rt(o,this.timings,this):new N(o.message,o,this),this._beforeError(o)}),this._unproxyEvents=it(e,this,Fh),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((r,s)=>{super.write(e,n=>{if(n){s(n);return}r()})})}_sendBody(){let{body:e}=this.options,r=this.redirectUrls.length===0?this:this._request??this;h.nodeStream(e)?e.pipe(r):h.generator(e)||h.asyncGenerator(e)?(async()=>{try{for await(let s of e)await this._asyncWrite(s);super.end()}catch(s){this._beforeError(s)}})():h.undefined(e)?(this._cannotHaveBody||this._noPipe)&&r.end():(this._writeRequest(e,void 0,()=>{}),r.end())}_prepareCache(e){if(!cs.has(e)){let r=new cn((s,n)=>{let i=s._request(s,n);return h.promise(i)&&(i.once=(o,a)=>{if(o==="error")(async()=>{try{await i}catch(l){a(l)}})();else if(o==="abort")(async()=>{try{(await i).once("abort",a)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${o}`);return i}),i},e);cs.set(e,r.request())}}async _createCacheableRequest(e,r){return new Promise((s,n)=>{Object.assign(r,jr(e));let i,o=cs.get(r.cache)(r,async a=>{if(a._readableState.autoDestroy=!1,i){let l=()=>{a.req&&(a.complete=a.req.res.complete)};a.prependOnceListener("end",l),l(),(await i).emit("cacheableResponse",a)}s(a)});o.once("error",n),o.once("request",async a=>{i=a,s(i)})})}async _makeRequest(){let{options:e}=this,{headers:r,username:s,password:n}=e,i=e.cookieJar;for(let d in r)if(h.undefined(r[d]))delete r[d];else if(h.null_(r[d]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${d}\` header`);if(e.decompress&&h.undefined(r["accept-encoding"])&&(r["accept-encoding"]=Bh?"gzip, deflate, br":"gzip, deflate"),s||n){let d=as.from(`${s}:${n}`).toString("base64");r.authorization=`Basic ${d}`}if(i){let d=await i.getCookieString(e.url.toString());h.nonEmptyString(d)&&(r.cookie=d)}e.prefixUrl="";let o;for(let d of e.hooks.beforeRequest){let y=await d(e);if(!h.undefined(y)){o=()=>y;break}}o||(o=e.getRequestFunction());let a=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=o,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let l=e.cache?this._createCacheableRequest:o;try{let d=l(a,this._requestOptions);h.promise(d)&&(d=await d),h.undefined(d)&&(d=e.getFallbackRequestFunction()(a,this._requestOptions),h.promise(d)&&(d=await d)),ji(d)?this._onRequest(d):this.writable?(this.once("finish",()=>{this._onResponse(d)}),this._sendBody()):this._onResponse(d)}catch(d){throw d instanceof ae?new xt(d,this):d}}async _error(e){try{if(!(e instanceof le&&!this.options.throwHttpErrors))for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new N(r.message,r,this)}this.destroy(e)}_writeRequest(e,r,s){!this._request||this._request.destroyed||this._request.write(e,r,n=>{if(!n&&!this._request.destroyed){this._uploadedSize+=as.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}s(n)})}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??void 0}get downloadProgress(){let e;return this._responseSize?e=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?e=1:e=0,{percent:e,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let e;return this._bodySize?e=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?e=1:e=0,{percent:e,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}};u();var Gt=class extends N{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};var Gh=["request","response","redirect","uploadProgress","downloadProgress"];function Wt(t){let e,r,s,n=new Vh,i=new je((a,l,d)=>{d(()=>{e.destroy()}),d.shouldReject=!1,d(()=>{l(new Gt(e))});let y=R=>{d(()=>{});let g=t??new Se(void 0,void 0,s);g.retryCount=R,g._noPipe=!0,e=g,g.once("response",async f=>{let A=(f.headers["content-encoding"]??"").toLowerCase(),_=A==="gzip"||A==="deflate"||A==="br",{options:j}=g;if(_&&!j.decompress)f.body=f.rawBody;else try{f.body=os(f,j.responseType,j.parseJson,j.encoding)}catch(x){if(f.body=f.rawBody.toString(),Be(f)){g._beforeError(x);return}}try{let x=j.hooks.afterResponse;for(let[D,U]of x.entries())if(f=await U(f,async z=>{throw j.merge(z),j.prefixUrl="",z.url&&(j.url=z.url),j.hooks.afterResponse=j.hooks.afterResponse.slice(0,D),new Ot(g)}),!(h.object(f)&&h.number(f.statusCode)&&!h.nullOrUndefined(f.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(x){g._beforeError(x);return}if(r=f,!Be(f)){g._beforeError(new le(f));return}g.destroy(),a(g.options.resolveBodyOnly?f.body:f)});let S=f=>{if(i.isCanceled)return;let{options:A}=g;if(f instanceof le&&!A.throwHttpErrors){let{response:_}=f;g.destroy(),a(g.options.resolveBodyOnly?_.body:_);return}l(f)};g.once("error",S);let O=g.options?.body;g.once("retry",(f,A)=>{t=void 0;let _=g.options.body;if(O===_&&h.nodeStream(_)){A.message="Cannot retry with consumed body stream",S(A);return}s=g.options,y(f)}),it(g,n,Gh),h.undefined(t)&&g.flush()};y(0)});i.on=(a,l)=>(n.on(a,l),i),i.off=(a,l)=>(n.off(a,l),i);let o=a=>{let l=(async()=>{await i;let{options:d}=r.request;return os(r,a,d.parseJson,d.encoding)})();return Object.defineProperties(l,Object.getOwnPropertyDescriptors(i)),l};return i.json=()=>{if(e.options){let{headers:a}=e.options;!e.writableFinished&&!("accept"in a)&&(a.accept="application/json")}return o("json")},i.buffer=()=>o("buffer"),i.text=()=>o("text"),i}var Wh=async t=>new Promise(e=>{setTimeout(e,t)}),Jh=t=>h.function_(t),Kh=["get","post","put","patch","head","delete"],Ni=t=>{t={options:new re(void 0,void 0,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults},Object.defineProperty(t,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let e=(s,n,i=t.options)=>{let o=new Se(s,n,i),a,l=R=>(o.options=R,o._noPipe=!R.isStream,o.flush(),R.isStream?o:(a||(a=Wt(o)),a)),d=0,y=R=>{let S=(t.handlers[d++]??l)(R,y);if(h.promise(S)&&!o.options.isStream&&(a||(a=Wt(o)),S!==a)){let O=Object.getOwnPropertyDescriptors(a);for(let f in O)f in S&&delete O[f];Object.defineProperties(S,O),S.cancel=a.cancel}return S};return y(o.options)};e.extend=(...s)=>{let n=new re(void 0,void 0,t.options),i=[...t.handlers],o;for(let a of s)Jh(a)?(n.merge(a.defaults.options),i.push(...a.defaults.handlers),o=a.defaults.mutableDefaults):(n.merge(a),a.handlers&&i.push(...a.handlers),o=a.mutableDefaults);return Ni({options:n,handlers:i,mutableDefaults:!!o})};let r=async function*(s,n){let i=new re(s,n,t.options);i.resolveBodyOnly=!1;let{pagination:o}=i;p.function_(o.transform),p.function_(o.shouldContinue),p.function_(o.filter),p.function_(o.paginate),p.number(o.countLimit),p.number(o.requestLimit),p.number(o.backoff);let a=[],{countLimit:l}=o,d=0;for(;d<o.requestLimit;){d!==0&&await Wh(o.backoff);let y=await e(void 0,void 0,i),R=await o.transform(y),g=[];p.array(R);for(let O of R)if(o.filter({item:O,currentItems:g,allItems:a})&&(!o.shouldContinue({item:O,currentItems:g,allItems:a})||(yield O,o.stackAllItems&&a.push(O),g.push(O),--l<=0)))return;let S=o.paginate({response:y,currentItems:g,allItems:a});if(S===!1)return;S===y.request.options?i=y.request.options:(i.merge(S),p.any([h.urlInstance,h.undefined],S.url),S.url!==void 0&&(i.prefixUrl="",i.url=S.url)),d++}};e.paginate=r,e.paginate.all=async(s,n)=>{let i=[];for await(let o of r(s,n))i.push(o);return i},e.paginate.each=r,e.stream=(s,n)=>e(s,{...n,isStream:!0});for(let s of Kh)e[s]=(n,i)=>e(n,{...i,method:s}),e.stream[s]=(n,i)=>e(n,{...i,method:s,isStream:!0});return t.mutableDefaults||(Object.freeze(t.handlers),t.options.freeze()),Object.defineProperty(e,"defaults",{value:t,writable:!1,configurable:!1,enumerable:!0}),e},qi=Ni;var Yh={options:new re,handlers:[],mutableDefaults:!1},um=qi(Yh);import{inspect as su}from"node:util";u();u();var Qh=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(t=>[t.name,t]),Xh=new Map(Qh),Ui=Xh;var Zh=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],hs=new WeakSet,eu=t=>{hs.add(t);let e=t.toJSON();return hs.delete(t),e},tu=t=>Ui.get(t)??Error,Mi=({from:t,seen:e,to:r,forceEnumerable:s,maxDepth:n,depth:i,useToJSON:o,serialize:a})=>{if(!r)if(Array.isArray(t))r=[];else if(!a&&Bi(t)){let d=tu(t.name);r=new d}else r={};if(e.push(t),i>=n)return r;if(o&&typeof t.toJSON=="function"&&!hs.has(t))return eu(t);let l=d=>Mi({from:d,seen:[...e],forceEnumerable:s,maxDepth:n,depth:i,useToJSON:o,serialize:a});for(let[d,y]of Object.entries(t)){if(y&&y instanceof Uint8Array&&y.constructor.name==="Buffer"){r[d]="[object Buffer]";continue}if(y!==null&&typeof y=="object"&&typeof y.pipe=="function"){r[d]="[object Stream]";continue}if(typeof y!="function"){if(!y||typeof y!="object"){try{r[d]=y}catch{}continue}if(!e.includes(t[d])){i++,r[d]=l(t[d]);continue}r[d]="[Circular]"}}for(let{property:d,enumerable:y}of Zh)typeof t[d]<"u"&&t[d]!==null&&Object.defineProperty(r,d,{value:Bi(t[d])?l(t[d]):t[d],enumerable:s?!0:y,configurable:!0,writable:!0});return r};function zi(t,e={}){let{maxDepth:r=Number.POSITIVE_INFINITY,useToJSON:s=!0}=e;return typeof t=="object"&&t!==null?Mi({from:t,seen:[],forceEnumerable:!0,maxDepth:r,depth:0,useToJSON:s,serialize:!0}):typeof t=="function"?`[Function: ${t.name||"anonymous"}]`:t}function Bi(t){return!!t&&typeof t=="object"&&"name"in t&&"message"in t&&"stack"in t}u();import Fi from"node:path";var us=Fi.dirname(ws),ru=(...t)=>Fi.join(us,...t),Tm=(...t)=>ru("assets",...t);var vm=(t,e)=>{let r={...t};for(let[s,n]of Object.entries(e))r[s]||(r[s]=n);return r},Hm=(t,e)=>{let r={};for(let s of e)r[s]=t[s];return r};var pt=t=>{Array.isArray(t)&&(t=t[0]);let e=zi(t);return typeof e=="string"&&(e={message:e}),e.stack&&(e.stack=ur(e.stack,{pretty:!0,basePath:us}).replaceAll(/file:\/\/\//g,"")),t instanceof N&&(e.timings=void 0,e.options={method:t.options.method,url:t.options.url instanceof URL?t.options.url.toJSON():t.options.url},e.responseBody=su(t.response?.body)),e};u();var Vi=X(xs(),1);import ls from"node:os";var xe,zm=async t=>{t.args["--telemetry"]&&(xe=await import("./esm-BL3OM5UJ.js"),xe.init({dsn:"https://0c26e0d8afd94e77a88ee1c3aa9e7065@o250689.ingest.sentry.io/6703266",enabled:ie.productionLike&&(t.args["--telemetry"]??!1),release:ke.version,environment:ke.version.includes("experimental")?"experimental":"production"}))},Fm=async(t,e)=>{xe&&(xe.captureException(e,{event_id:e.id,captureContext:{user:t.user&&{id:String(t.user.id),email:t.user.email,username:t.user.name??void 0},tags:{application_id:t.app?.id,arch:ee.arch,bug:e.isBug,environment:ie.value,platform:ee.platform,shell:ee.shell,version:ke.version},contexts:{ctx:{argv:process.argv,args:t.args},cause:e.cause?pt(e.cause):void 0,app:{app_name:ke.name,app_version:ke.version},device:{name:ls.hostname(),family:ls.type(),arch:ls.arch()},runtime:{name:process.release.name,version:process.version}}}}),await xe.flush((0,Vi.default)("2s")))},Gi=t=>{xe&&xe.addBreadcrumb(t)};u();u();var Wi=(t,e,r,s)=>JSON.stringify({level:t,name:e,msg:Qt(r).trim(),fields:Ji(s)})+`
12
+ `,Ji=t=>{let e={};for(let[r,s]of Object.entries(t))e[r]=Ki(s);return e},Ki=t=>(t instanceof Set&&(t=Array.from(t)),Array.isArray(t)?t.map(Ki):(t instanceof Map&&(t=Object.fromEntries(t.entries())),bt(t)?Ji(t):gs(t)?Qt(t).trim():t));u();var Xi=X(Rs(),1);import nu from"node:assert";var Zi=(t,e,r,s)=>`${pu()} ${mu(t)} ${yu(e)}:${gu(r)}${to(s)}${ce}`,se=new ms({level:ie.testLike&&ee.logLevel<W.PRINT?3:ys.level}),iu=se.hex("#86B5F7"),ou=se.hex("#B2D0FA"),Jt=se.hex("#D6D6D6"),au=se.hex("#C2C2C2"),cu=se.hex("#9DE6A4"),hu=se.hex("#BEEEC3"),uu=se.hex("#EEAC78"),Yi=se.hex("#F4C7A4"),lu=se.hex("#FAACB5"),eo=se.hex("#A64E4E"),ds=se.hex("#FFFFFF"),Kt="",Oe=" ",ce=`
13
+ `,du=":",Qi="'",fu=(t,e)=>{let r=t==="error"?eo:Jt,s=[];s.push(ce);for(let n=0;n<e;n++)s.push(Oe);return s.push(r(t)),s.push(du),s.join("")},Re=(t,e,r)=>{let s=t.split(ce);if(s.length===0)return Kt;let n=[],i=s.shift();nu(i),n.push(e(i));for(let o of s)if(o){n.push(ce);for(let a=0;a<r;a++)n.push(Oe);n.push(e(o))}return n.join(Kt)},to=(t,e=2)=>{if(Object.keys(t).length===0)return Kt;let r=[];for(let[s,n]of Object.entries(t)){if(r.push(fu(s,e)),n instanceof Set&&(n=Array.from(n)),Array.isArray(n)){if(n.length===0){r.push(Re(" []",Jt,e));continue}n=Object.fromEntries(n.entries())}if(n instanceof Map&&(n=Object.fromEntries(n)),bt(n)){let i=Object.entries(n);if(i.length===0){r.push(Re(" {}",Jt,e));continue}i.length>10&&ee.logLevel>W.TRACE&&(n=Object.fromEntries([...i.slice(0,10),[tr.ellipsis,`${i.length-10} more`]])),r.push(to(n,e+2));continue}switch(r.push(Oe),typeof n){case"string":r.push(Re(Qi+n.replaceAll(ce,ce+Oe.repeat(e+s.length))+Qi,ou,e));break;case"number":r.push(Re(String(n),Yi,e));break;case"bigint":r.push(Re(String(n)+"n",Yi,e));break;case"boolean":r.push(Re(String(n),hu,e));break;default:r.push(Re(String(n),ds,e));break}}return r.join(Kt)},pu=()=>{let t=(0,Xi.default)().format("hh:mm:ss");return au(t)},mu=t=>{switch(t){case W.PRINT:return Jt("PRINT");case W.TRACE:return iu("TRACE");case W.DEBUG:return uu("DEBUG");case W.INFO:return cu("INFO");case W.WARN:return lu("WARN");case W.ERROR:return eo("ERROR")}},yu=t=>ds(t),gu=t=>{let e=t.split(ce);return e.length===1?Oe+ds(t):ce+e.map(r=>Oe+Oe+r).join(ce)};var ro={pretty:Zi,json:Wi};var so=({name:t,fields:e={},devFields:r={}})=>{let s=n=>(i,o,a)=>{let l=n>=ee.logLevel,d=n>=W.INFO;if(!l&&!d)return;let y={...ue(e),...o};if(ie.developmentOrTestLike&&Object.assign(y,ue(r),a),"error"in y&&(y.error=pt(y.error)),"reason"in y&&(y.reason=pt(y.reason)),l){let R=ro[ee.logFormat];Es.writeStderr(R(n,t,i,y))}d&&Gi({level:"log",message:i,data:y})};return{trace:s(W.TRACE),debug:s(W.DEBUG),info:s(W.INFO),warn:s(W.WARN),error:s(W.ERROR)}};var fs=({name:t,fields:e,devFields:r})=>({...so({name:t,fields:e,devFields:r}),child:({name:s,fields:n,devFields:i})=>fs({name:s||t,fields:()=>({...ue(e),...ue(n)}),devFields:{...ue(r),...ue(i)}})});var mt=fs({name:"session"}),bu=bs(()=>{if(process.env.GGT_SESSION)return mt.debug("reading session from env"),process.env.GGT_SESSION;try{return mt.debug("reading session from disk"),Yt.default.readFileSync(Fe("session.txt"),"utf8")}catch(t){Et(t);return}}),Cy=t=>{bu.clear(),process.env.GGT_SESSION&&(mt.debug("writing session to env",{session:!!t}),process.env.GGT_SESSION=t),mt.debug("writing session to disk",{session:!!t,path:Fe("session.txt")}),t?Yt.default.outputFileSync(Fe("session.txt"),t):Yt.default.removeSync(Fe("session.txt"))},Py=()=>(mt.debug("reading token from env"),process.env.GGT_TOKEN);export{xs as a,Rs as b,tr as c,ur as d,le as e,um as f,us as g,Tm as h,vm as i,Hm as j,pt as k,zm as l,Fm as m,fs as n,qs as o,Io as p,Et as q,bu as r,Cy as s,Py as t};
14
+ /*! Bundled license information:
15
+
16
+ normalize-path/index.js:
17
+ (*!
18
+ * normalize-path <https://github.com/jonschlinkert/normalize-path>
19
+ *
20
+ * Copyright (c) 2014-2018, Jon Schlinkert.
21
+ * Released under the MIT License.
22
+ *)
23
+ */
24
+ //# sourceMappingURL=chunk-AQRCAWW4.js.map