@opencode-ai/cli-darwin-x64 0.0.0-beta-202606050000

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 (137) hide show
  1. package/bin/chunk-01tb5qes.js.map +131 -0
  2. package/bin/chunk-06d8aa69.js.map +10 -0
  3. package/bin/chunk-07w2xsfy.js.map +50 -0
  4. package/bin/chunk-0azwkk9z.js.map +12 -0
  5. package/bin/chunk-0d9ja06r.js.map +9 -0
  6. package/bin/chunk-0qebdpsf.js.map +167 -0
  7. package/bin/chunk-17j53wgt.js.map +11 -0
  8. package/bin/chunk-1jb1dn9p.js.map +10 -0
  9. package/bin/chunk-1paeax4j.js.map +56 -0
  10. package/bin/chunk-1wb39pye.js.map +9 -0
  11. package/bin/chunk-2wqpg9fb.js.map +10 -0
  12. package/bin/chunk-32ewzcjk.js.map +10 -0
  13. package/bin/chunk-3jqjf0hd.js.map +10 -0
  14. package/bin/chunk-3n6vddyq.js.map +73 -0
  15. package/bin/chunk-3r74gwy2.js.map +13 -0
  16. package/bin/chunk-3zmvhepw.js.map +10 -0
  17. package/bin/chunk-4980h0t7.js.map +37 -0
  18. package/bin/chunk-4de8gawx.js.map +10 -0
  19. package/bin/chunk-4q5k6a0e.js.map +10 -0
  20. package/bin/chunk-6ttpn29p.js.map +10 -0
  21. package/bin/chunk-7fvpf4bs.js.map +10 -0
  22. package/bin/chunk-7vb6kdat.js.map +10 -0
  23. package/bin/chunk-84amh6xf.js.map +11 -0
  24. package/bin/chunk-8akfq1ty.js.map +19 -0
  25. package/bin/chunk-8dnkfkds.js.map +10 -0
  26. package/bin/chunk-8rd9r1gb.js.map +11 -0
  27. package/bin/chunk-8x80qvzn.js.map +10 -0
  28. package/bin/chunk-943th5qs.js.map +10 -0
  29. package/bin/chunk-94yf089p.js.map +10 -0
  30. package/bin/chunk-98cxndhz.js.map +9 -0
  31. package/bin/chunk-9f8tmby0.js.map +9 -0
  32. package/bin/chunk-9fbstsnw.js.map +9 -0
  33. package/bin/chunk-9hq8aywf.js.map +10 -0
  34. package/bin/chunk-9vf55fj3.js.map +10 -0
  35. package/bin/chunk-9w9rk9en.js.map +20 -0
  36. package/bin/chunk-9y4hgfns.js.map +10 -0
  37. package/bin/chunk-aag5p1fp.js.map +10 -0
  38. package/bin/chunk-bt0r89ee.js.map +9 -0
  39. package/bin/chunk-c2gsyspz.js.map +10 -0
  40. package/bin/chunk-c8hr0q5n.js.map +10 -0
  41. package/bin/chunk-cab6ccj0.js.map +10 -0
  42. package/bin/chunk-ck4nkjtx.js.map +193 -0
  43. package/bin/chunk-cvm4kr56.js.map +23 -0
  44. package/bin/chunk-cyb9bpgm.js.map +10 -0
  45. package/bin/chunk-d1p8awq6.js.map +10 -0
  46. package/bin/chunk-d6nz1m6v.js.map +10 -0
  47. package/bin/chunk-d7v38w4j.js.map +27 -0
  48. package/bin/chunk-d9g5798m.js.map +81 -0
  49. package/bin/chunk-dcn0azxw.js.map +10 -0
  50. package/bin/chunk-dk4qekzk.js.map +10 -0
  51. package/bin/chunk-dk9tgwkh.js.map +9 -0
  52. package/bin/chunk-dzzhxh1c.js.map +10 -0
  53. package/bin/chunk-efsmps94.js.map +9 -0
  54. package/bin/chunk-fdw7znt6.js.map +11 -0
  55. package/bin/chunk-fs6t8jdg.js.map +10 -0
  56. package/bin/chunk-fzcqzwx5.js.map +10 -0
  57. package/bin/chunk-g4fcmhkj.js.map +11 -0
  58. package/bin/chunk-g4ff66n8.js.map +10 -0
  59. package/bin/chunk-g8mpn6ke.js.map +11 -0
  60. package/bin/chunk-gahs293a.js.map +10 -0
  61. package/bin/chunk-gh9dcqbv.js.map +10 -0
  62. package/bin/chunk-gmc0r6tm.js.map +13 -0
  63. package/bin/chunk-gv6nagng.js.map +10 -0
  64. package/bin/chunk-gyavdmtb.js.map +10 -0
  65. package/bin/chunk-h413ry19.js.map +10 -0
  66. package/bin/chunk-hav16yge.js.map +10 -0
  67. package/bin/chunk-hp5nnq6f.js.map +11 -0
  68. package/bin/chunk-hrcbafh3.js.map +9 -0
  69. package/bin/chunk-hxfsfpek.js.map +10 -0
  70. package/bin/chunk-jcqp2wmf.js.map +10 -0
  71. package/bin/chunk-jt9t8203.js.map +9 -0
  72. package/bin/chunk-k0980eb5.js.map +10 -0
  73. package/bin/chunk-kghptcgb.js.map +9 -0
  74. package/bin/chunk-kjyd3xxc.js.map +113 -0
  75. package/bin/chunk-kkvk5eez.js.map +10 -0
  76. package/bin/chunk-kv0b3sh5.js.map +10 -0
  77. package/bin/chunk-m9md5mth.js.map +10 -0
  78. package/bin/chunk-mf0qqhvb.js.map +10 -0
  79. package/bin/chunk-mfr0xsxw.js.map +9 -0
  80. package/bin/chunk-mkze6twx.js.map +10 -0
  81. package/bin/chunk-mzjs3qj3.js.map +10 -0
  82. package/bin/chunk-n10mj2m3.js.map +17 -0
  83. package/bin/chunk-n2fbt143.js.map +9 -0
  84. package/bin/chunk-n6a0rctn.js.map +9 -0
  85. package/bin/chunk-njn9a3jp.js.map +13 -0
  86. package/bin/chunk-nkhzpsnk.js.map +13 -0
  87. package/bin/chunk-ny5cyeha.js.map +10 -0
  88. package/bin/chunk-p3nkd9t2.js.map +10 -0
  89. package/bin/chunk-p3pr1t3k.js.map +10 -0
  90. package/bin/chunk-p7j7e7hb.js.map +10 -0
  91. package/bin/chunk-p89bk96c.js.map +10 -0
  92. package/bin/chunk-pjbsd0sw.js.map +10 -0
  93. package/bin/chunk-pnkd37ss.js.map +20 -0
  94. package/bin/chunk-q4n12vgf.js.map +388 -0
  95. package/bin/chunk-q6nf6fka.js.map +10 -0
  96. package/bin/chunk-qbpebjh2.js.map +10 -0
  97. package/bin/chunk-qgpzv4wt.js.map +15 -0
  98. package/bin/chunk-qq4f9z8v.js.map +10 -0
  99. package/bin/chunk-r55kafff.js.map +9 -0
  100. package/bin/chunk-rrwp4x01.js.map +10 -0
  101. package/bin/chunk-rt02k446.js.map +11 -0
  102. package/bin/chunk-s39nwv01.js.map +9 -0
  103. package/bin/chunk-s983v0dp.js.map +10 -0
  104. package/bin/chunk-san15sca.js.map +10 -0
  105. package/bin/chunk-sfk73pp2.js.map +10 -0
  106. package/bin/chunk-sjd3wbjd.js.map +10 -0
  107. package/bin/chunk-swbdmja3.js.map +10 -0
  108. package/bin/chunk-tc8tvjey.js.map +33 -0
  109. package/bin/chunk-tcqtz83b.js.map +10 -0
  110. package/bin/chunk-tgxxchfy.js.map +28 -0
  111. package/bin/chunk-tvxakxv2.js.map +10 -0
  112. package/bin/chunk-va2h4xya.js.map +37 -0
  113. package/bin/chunk-vezq3hc4.js.map +9 -0
  114. package/bin/chunk-vmbpvmpg.js.map +10 -0
  115. package/bin/chunk-vs30er58.js.map +10 -0
  116. package/bin/chunk-w7p62pb6.js.map +17 -0
  117. package/bin/chunk-wr4x72qd.js.map +13 -0
  118. package/bin/chunk-x3ywttp7.js.map +10 -0
  119. package/bin/chunk-x988wmrk.js.map +10 -0
  120. package/bin/chunk-x9zjg1f7.js.map +20 -0
  121. package/bin/chunk-xaqrhtz6.js.map +10 -0
  122. package/bin/chunk-xd2mrkwy.js.map +10 -0
  123. package/bin/chunk-xfh2377b.js.map +10 -0
  124. package/bin/chunk-xs0ras4j.js.map +51 -0
  125. package/bin/chunk-xt7ap9fb.js.map +10 -0
  126. package/bin/chunk-xya5qk3h.js.map +16 -0
  127. package/bin/chunk-xzka67m1.js.map +577 -0
  128. package/bin/chunk-yg7w4jgd.js.map +10 -0
  129. package/bin/chunk-yhpv46tb.js.map +20 -0
  130. package/bin/chunk-ymy66kr8.js.map +15 -0
  131. package/bin/chunk-yx4z6xsb.js.map +11 -0
  132. package/bin/chunk-yymwxqpy.js.map +10 -0
  133. package/bin/chunk-z70c75xe.js.map +11 -0
  134. package/bin/chunk-zkqyr3hc.js.map +10 -0
  135. package/bin/index.js.map +12 -0
  136. package/bin/lildax +0 -0
  137. package/package.json +15 -0
@@ -0,0 +1,73 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../node_modules/.bun/extend@3.0.2/node_modules/extend/index.js", "../../node_modules/.bun/gaxios@7.1.4+759ce506b1ed1a42/node_modules/gaxios/build/cjs/src/util.cjs", "../../node_modules/.bun/gaxios@7.1.4+759ce506b1ed1a42/node_modules/gaxios/build/cjs/src/common.js", "../../node_modules/.bun/gaxios@7.1.4+759ce506b1ed1a42/node_modules/gaxios/build/cjs/src/retry.js", "../../node_modules/.bun/gaxios@7.1.4+759ce506b1ed1a42/node_modules/gaxios/build/cjs/src/interceptor.js", "../../node_modules/.bun/gaxios@7.1.4+759ce506b1ed1a42/node_modules/gaxios/build/cjs/src/gaxios.js", "../../node_modules/.bun/gaxios@7.1.4+759ce506b1ed1a42/node_modules/gaxios/build/cjs/src/index.js", "../../node_modules/.bun/bignumber.js@9.3.1/node_modules/bignumber.js/bignumber.js", "../../node_modules/.bun/json-bigint@1.0.0/node_modules/json-bigint/lib/stringify.js", "../../node_modules/.bun/json-bigint@1.0.0/node_modules/json-bigint/lib/parse.js", "../../node_modules/.bun/json-bigint@1.0.0/node_modules/json-bigint/index.js", "../../node_modules/.bun/gcp-metadata@8.1.2+759ce506b1ed1a42/node_modules/gcp-metadata/build/src/gcp-residency.js", "../../node_modules/.bun/google-logging-utils@1.1.3/node_modules/google-logging-utils/build/src/colours.js", "../../node_modules/.bun/google-logging-utils@1.1.3/node_modules/google-logging-utils/build/src/logging-utils.js", "../../node_modules/.bun/google-logging-utils@1.1.3/node_modules/google-logging-utils/build/src/index.js", "../../node_modules/.bun/gcp-metadata@8.1.2+759ce506b1ed1a42/node_modules/gcp-metadata/build/src/index.js", "../../node_modules/.bun/base64-js@1.5.1/node_modules/base64-js/index.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/crypto/shared.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/crypto/browser/crypto.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/crypto/node/crypto.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/crypto/crypto.js", "../../node_modules/.bun/safe-buffer@5.2.1/node_modules/safe-buffer/index.js", "../../node_modules/.bun/ecdsa-sig-formatter@1.0.11/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js", "../../node_modules/.bun/ecdsa-sig-formatter@1.0.11/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/util.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/shared.cjs", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/authclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/loginticket.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/oauth2client.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/computeclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/idtokenclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/envDetect.js", "../../node_modules/.bun/jws@4.0.1/node_modules/jws/lib/data-stream.js", "../../node_modules/.bun/buffer-equal-constant-time@1.0.1/node_modules/buffer-equal-constant-time/index.js", "../../node_modules/.bun/jwa@2.0.1/node_modules/jwa/index.js", "../../node_modules/.bun/jws@4.0.1/node_modules/jws/lib/tostring.js", "../../node_modules/.bun/jws@4.0.1/node_modules/jws/lib/sign-stream.js", "../../node_modules/.bun/jws@4.0.1/node_modules/jws/lib/verify-stream.js", "../../node_modules/.bun/jws@4.0.1/node_modules/jws/index.js", "../../node_modules/.bun/gtoken@8.0.0+759ce506b1ed1a42/node_modules/gtoken/build/cjs/src/index.cjs", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/jwtaccess.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/jwtclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/refreshclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/impersonated.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/oauth2common.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/stscredentials.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/baseexternalclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/certificatesubjecttokensupplier.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/identitypoolclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/awsrequestsigner.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/awsclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/executable-response.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/externalclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/googleauth.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/iam.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/downscopedclient.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/auth/passthrough.js", "../../node_modules/.bun/google-auth-library@10.5.0+759ce506b1ed1a42/node_modules/google-auth-library/build/src/index.js"],
4
+ "sourcesContent": [
5
+ "'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n",
6
+ "\"use strict\";\n// Copyright 2023 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nconst pkg = require('../../../package.json');\nmodule.exports = { pkg };\n//# sourceMappingURL=util.cjs.map",
7
+ "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GaxiosError = exports.GAXIOS_ERROR_SYMBOL = void 0;\nexports.defaultErrorRedactor = defaultErrorRedactor;\nconst extend_1 = __importDefault(require(\"extend\"));\nconst util_cjs_1 = __importDefault(require(\"./util.cjs\"));\nconst pkg = util_cjs_1.default.pkg;\n/**\n * Support `instanceof` operator for `GaxiosError`s in different versions of this library.\n *\n * @see {@link GaxiosError[Symbol.hasInstance]}\n */\nexports.GAXIOS_ERROR_SYMBOL = Symbol.for(`${pkg.name}-gaxios-error`);\nclass GaxiosError extends Error {\n config;\n response;\n /**\n * An error code.\n * Can be a system error code, DOMException error name, or any error's 'code' property where it is a `string`.\n *\n * It is only a `number` when the cause is sourced from an API-level error (AIP-193).\n *\n * @see {@link https://nodejs.org/api/errors.html#errorcode error.code}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMException#error_names DOMException#error_names}\n * @see {@link https://google.aip.dev/193#http11json-representation AIP-193}\n *\n * @example\n * 'ECONNRESET'\n *\n * @example\n * 'TimeoutError'\n *\n * @example\n * 500\n */\n code;\n /**\n * An HTTP Status code.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/status Response#status}\n *\n * @example\n * 500\n */\n status;\n /**\n * @deprecated use {@link GaxiosError.cause} instead.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause Error#cause}\n *\n * @privateRemarks\n *\n * We will want to remove this property later as the modern `cause` property is better suited\n * for displaying and relaying nested errors. Keeping this here makes the resulting\n * error log larger than it needs to be.\n *\n */\n error;\n /**\n * Support `instanceof` operator for `GaxiosError` across builds/duplicated files.\n *\n * @see {@link GAXIOS_ERROR_SYMBOL}\n * @see {@link GaxiosError[Symbol.hasInstance]}\n * @see {@link https://github.com/microsoft/TypeScript/issues/13965#issuecomment-278570200}\n * @see {@link https://stackoverflow.com/questions/46618852/require-and-instanceof}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance#reverting_to_default_instanceof_behavior}\n */\n [exports.GAXIOS_ERROR_SYMBOL] = pkg.version;\n /**\n * Support `instanceof` operator for `GaxiosError` across builds/duplicated files.\n *\n * @see {@link GAXIOS_ERROR_SYMBOL}\n * @see {@link GaxiosError[GAXIOS_ERROR_SYMBOL]}\n */\n static [Symbol.hasInstance](instance) {\n if (instance &&\n typeof instance === 'object' &&\n exports.GAXIOS_ERROR_SYMBOL in instance &&\n instance[exports.GAXIOS_ERROR_SYMBOL] === pkg.version) {\n return true;\n }\n // fallback to native\n return Function.prototype[Symbol.hasInstance].call(GaxiosError, instance);\n }\n constructor(message, config, response, cause) {\n super(message, { cause });\n this.config = config;\n this.response = response;\n this.error = cause instanceof Error ? cause : undefined;\n // deep-copy config as we do not want to mutate\n // the existing config for future retries/use\n this.config = (0, extend_1.default)(true, {}, config);\n if (this.response) {\n this.response.config = (0, extend_1.default)(true, {}, this.response.config);\n }\n if (this.response) {\n try {\n this.response.data = translateData(this.config.responseType, \n // workaround for `node-fetch`'s `.data` deprecation...\n this.response?.bodyUsed ? this.response?.data : undefined);\n }\n catch {\n // best effort - don't throw an error within an error\n // we could set `this.response.config.responseType = 'unknown'`, but\n // that would mutate future calls with this config object.\n }\n this.status = this.response.status;\n }\n if (cause instanceof DOMException) {\n // The DOMException's equivalent to code is its name\n // E.g.: name = `TimeoutError`, code = number\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException/name\n this.code = cause.name;\n }\n else if (cause &&\n typeof cause === 'object' &&\n 'code' in cause &&\n (typeof cause.code === 'string' || typeof cause.code === 'number')) {\n this.code = cause.code;\n }\n }\n /**\n * An AIP-193 conforming error extractor.\n *\n * @see {@link https://google.aip.dev/193#http11json-representation AIP-193}\n *\n * @internal\n * @expiremental\n *\n * @param res the response object\n * @returns the extracted error information\n */\n static extractAPIErrorFromResponse(res, defaultErrorMessage = 'The request failed') {\n let message = defaultErrorMessage;\n // Use res.data as the error message\n if (typeof res.data === 'string') {\n message = res.data;\n }\n if (res.data &&\n typeof res.data === 'object' &&\n 'error' in res.data &&\n res.data.error &&\n !res.ok) {\n if (typeof res.data.error === 'string') {\n return {\n message: res.data.error,\n code: res.status,\n status: res.statusText,\n };\n }\n if (typeof res.data.error === 'object') {\n // extract status from data.message\n message =\n 'message' in res.data.error &&\n typeof res.data.error.message === 'string'\n ? res.data.error.message\n : message;\n // extract status from data.error\n const status = 'status' in res.data.error &&\n typeof res.data.error.status === 'string'\n ? res.data.error.status\n : res.statusText;\n // extract code from data.error\n const code = 'code' in res.data.error && typeof res.data.error.code === 'number'\n ? res.data.error.code\n : res.status;\n if ('errors' in res.data.error &&\n Array.isArray(res.data.error.errors)) {\n const errorMessages = [];\n for (const e of res.data.error.errors) {\n if (typeof e === 'object' &&\n 'message' in e &&\n typeof e.message === 'string') {\n errorMessages.push(e.message);\n }\n }\n return Object.assign({\n message: errorMessages.join('\\n') || message,\n code,\n status,\n }, res.data.error);\n }\n return Object.assign({\n message,\n code,\n status,\n }, res.data.error);\n }\n }\n return {\n message,\n code: res.status,\n status: res.statusText,\n };\n }\n}\nexports.GaxiosError = GaxiosError;\nfunction translateData(responseType, data) {\n switch (responseType) {\n case 'stream':\n return data;\n case 'json':\n return JSON.parse(JSON.stringify(data));\n case 'arraybuffer':\n return JSON.parse(Buffer.from(data).toString('utf8'));\n case 'blob':\n return JSON.parse(data.text());\n default:\n return data;\n }\n}\n/**\n * An experimental error redactor.\n *\n * @param config Config to potentially redact properties of\n * @param response Config to potentially redact properties of\n *\n * @experimental\n */\nfunction defaultErrorRedactor(data) {\n const REDACT = '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.';\n function redactHeaders(headers) {\n if (!headers)\n return;\n headers.forEach((_, key) => {\n // any casing of `Authentication`\n // any casing of `Authorization`\n // anything containing secret, such as 'client secret'\n if (/^authentication$/i.test(key) ||\n /^authorization$/i.test(key) ||\n /secret/i.test(key))\n headers.set(key, REDACT);\n });\n }\n function redactString(obj, key) {\n if (typeof obj === 'object' &&\n obj !== null &&\n typeof obj[key] === 'string') {\n const text = obj[key];\n if (/grant_type=/i.test(text) ||\n /assertion=/i.test(text) ||\n /secret/i.test(text)) {\n obj[key] = REDACT;\n }\n }\n }\n function redactObject(obj) {\n if (!obj || typeof obj !== 'object') {\n return;\n }\n else if (obj instanceof FormData ||\n obj instanceof URLSearchParams ||\n // support `node-fetch` FormData/URLSearchParams\n ('forEach' in obj && 'set' in obj)) {\n obj.forEach((_, key) => {\n if (['grant_type', 'assertion'].includes(key) || /secret/.test(key)) {\n obj.set(key, REDACT);\n }\n });\n }\n else {\n if ('grant_type' in obj) {\n obj['grant_type'] = REDACT;\n }\n if ('assertion' in obj) {\n obj['assertion'] = REDACT;\n }\n if ('client_secret' in obj) {\n obj['client_secret'] = REDACT;\n }\n }\n }\n if (data.config) {\n redactHeaders(data.config.headers);\n redactString(data.config, 'data');\n redactObject(data.config.data);\n redactString(data.config, 'body');\n redactObject(data.config.body);\n if (data.config.url.searchParams.has('token')) {\n data.config.url.searchParams.set('token', REDACT);\n }\n if (data.config.url.searchParams.has('client_secret')) {\n data.config.url.searchParams.set('client_secret', REDACT);\n }\n }\n if (data.response) {\n defaultErrorRedactor({ config: data.response.config });\n redactHeaders(data.response.headers);\n // workaround for `node-fetch`'s `.data` deprecation...\n if (data.response.bodyUsed) {\n redactString(data.response, 'data');\n redactObject(data.response.data);\n }\n }\n return data;\n}\n//# sourceMappingURL=common.js.map",
8
+ "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRetryConfig = getRetryConfig;\nasync function getRetryConfig(err) {\n let config = getConfig(err);\n if (!err || !err.config || (!config && !err.config.retry)) {\n return { shouldRetry: false };\n }\n config = config || {};\n config.currentRetryAttempt = config.currentRetryAttempt || 0;\n config.retry =\n config.retry === undefined || config.retry === null ? 3 : config.retry;\n config.httpMethodsToRetry = config.httpMethodsToRetry || [\n 'GET',\n 'HEAD',\n 'PUT',\n 'OPTIONS',\n 'DELETE',\n ];\n config.noResponseRetries =\n config.noResponseRetries === undefined || config.noResponseRetries === null\n ? 2\n : config.noResponseRetries;\n config.retryDelayMultiplier = config.retryDelayMultiplier\n ? config.retryDelayMultiplier\n : 2;\n config.timeOfFirstRequest = config.timeOfFirstRequest\n ? config.timeOfFirstRequest\n : Date.now();\n config.totalTimeout = config.totalTimeout\n ? config.totalTimeout\n : Number.MAX_SAFE_INTEGER;\n config.maxRetryDelay = config.maxRetryDelay\n ? config.maxRetryDelay\n : Number.MAX_SAFE_INTEGER;\n // If this wasn't in the list of status codes where we want\n // to automatically retry, return.\n const retryRanges = [\n // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n // 1xx - Retry (Informational, request still processing)\n // 2xx - Do not retry (Success)\n // 3xx - Do not retry (Redirect)\n // 4xx - Do not retry (Client errors)\n // 408 - Retry (\"Request Timeout\")\n // 429 - Retry (\"Too Many Requests\")\n // 5xx - Retry (Server errors)\n [100, 199],\n [408, 408],\n [429, 429],\n [500, 599],\n ];\n config.statusCodesToRetry = config.statusCodesToRetry || retryRanges;\n // Put the config back into the err\n err.config.retryConfig = config;\n // Determine if we should retry the request\n const shouldRetryFn = config.shouldRetry || shouldRetryRequest;\n if (!(await shouldRetryFn(err))) {\n return { shouldRetry: false, config: err.config };\n }\n const delay = getNextRetryDelay(config);\n // We're going to retry! Increment the counter.\n err.config.retryConfig.currentRetryAttempt += 1;\n // Create a promise that invokes the retry after the backOffDelay\n const backoff = config.retryBackoff\n ? config.retryBackoff(err, delay)\n : new Promise(resolve => {\n setTimeout(resolve, delay);\n });\n // Notify the user if they added an `onRetryAttempt` handler\n if (config.onRetryAttempt) {\n await config.onRetryAttempt(err);\n }\n // Return the promise in which recalls Gaxios to retry the request\n await backoff;\n return { shouldRetry: true, config: err.config };\n}\n/**\n * Determine based on config if we should retry the request.\n * @param err The GaxiosError passed to the interceptor.\n */\nfunction shouldRetryRequest(err) {\n const config = getConfig(err);\n if ((err.config.signal?.aborted && err.code !== 'TimeoutError') ||\n err.code === 'AbortError') {\n return false;\n }\n // If there's no config, or retries are disabled, return.\n if (!config || config.retry === 0) {\n return false;\n }\n // Check if this error has no response (ETIMEDOUT, ENOTFOUND, etc)\n if (!err.response &&\n (config.currentRetryAttempt || 0) >= config.noResponseRetries) {\n return false;\n }\n // Only retry with configured HttpMethods.\n if (!config.httpMethodsToRetry ||\n !config.httpMethodsToRetry.includes(err.config.method?.toUpperCase() || 'GET')) {\n return false;\n }\n // If this wasn't in the list of status codes where we want\n // to automatically retry, return.\n if (err.response && err.response.status) {\n let isInRange = false;\n for (const [min, max] of config.statusCodesToRetry) {\n const status = err.response.status;\n if (status >= min && status <= max) {\n isInRange = true;\n break;\n }\n }\n if (!isInRange) {\n return false;\n }\n }\n // If we are out of retry attempts, return\n config.currentRetryAttempt = config.currentRetryAttempt || 0;\n if (config.currentRetryAttempt >= config.retry) {\n return false;\n }\n return true;\n}\n/**\n * Acquire the raxConfig object from an GaxiosError if available.\n * @param err The Gaxios error with a config object.\n */\nfunction getConfig(err) {\n if (err && err.config && err.config.retryConfig) {\n return err.config.retryConfig;\n }\n return;\n}\n/**\n * Gets the delay to wait before the next retry.\n *\n * @param {RetryConfig} config The current set of retry options\n * @returns {number} the amount of ms to wait before the next retry attempt.\n */\nfunction getNextRetryDelay(config) {\n // Calculate time to wait with exponential backoff.\n // If this is the first retry, look for a configured retryDelay.\n const retryDelay = config.currentRetryAttempt\n ? 0\n : (config.retryDelay ?? 100);\n // Formula: retryDelay + ((retryDelayMultiplier^currentRetryAttempt - 1 / 2) * 1000)\n const calculatedDelay = retryDelay +\n ((Math.pow(config.retryDelayMultiplier, config.currentRetryAttempt) - 1) /\n 2) *\n 1000;\n const maxAllowableDelay = config.totalTimeout - (Date.now() - config.timeOfFirstRequest);\n return Math.min(calculatedDelay, maxAllowableDelay, config.maxRetryDelay);\n}\n//# sourceMappingURL=retry.js.map",
9
+ "\"use strict\";\n// Copyright 2024 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GaxiosInterceptorManager = void 0;\n/**\n * Class to manage collections of GaxiosInterceptors for both requests and responses.\n */\nclass GaxiosInterceptorManager extends Set {\n}\nexports.GaxiosInterceptorManager = GaxiosInterceptorManager;\n//# sourceMappingURL=interceptor.js.map",
10
+ "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Gaxios = void 0;\nconst extend_1 = __importDefault(require(\"extend\"));\nconst https_1 = require(\"https\");\nconst common_js_1 = require(\"./common.js\");\nconst retry_js_1 = require(\"./retry.js\");\nconst stream_1 = require(\"stream\");\nconst interceptor_js_1 = require(\"./interceptor.js\");\nconst randomUUID = async () => globalThis.crypto?.randomUUID() || (await import('crypto')).randomUUID();\nconst HTTP_STATUS_NO_CONTENT = 204;\nclass Gaxios {\n agentCache = new Map();\n /**\n * Default HTTP options that will be used for every HTTP request.\n */\n defaults;\n /**\n * Interceptors\n */\n interceptors;\n /**\n * The Gaxios class is responsible for making HTTP requests.\n * @param defaults The default set of options to be used for this instance.\n */\n constructor(defaults) {\n this.defaults = defaults || {};\n this.interceptors = {\n request: new interceptor_js_1.GaxiosInterceptorManager(),\n response: new interceptor_js_1.GaxiosInterceptorManager(),\n };\n }\n /**\n * A {@link fetch `fetch`} compliant API for {@link Gaxios}.\n *\n * @remarks\n *\n * This is useful as a drop-in replacement for `fetch` API usage.\n *\n * @example\n *\n * ```ts\n * const gaxios = new Gaxios();\n * const myFetch: typeof fetch = (...args) => gaxios.fetch(...args);\n * await myFetch('https://example.com');\n * ```\n *\n * @param args `fetch` API or `Gaxios#request` parameters\n * @returns the {@link Response} with Gaxios-added properties\n */\n fetch(...args) {\n // Up to 2 parameters in either overload\n const input = args[0];\n const init = args[1];\n let url = undefined;\n const headers = new Headers();\n // prepare URL\n if (typeof input === 'string') {\n url = new URL(input);\n }\n else if (input instanceof URL) {\n url = input;\n }\n else if (input && input.url) {\n url = new URL(input.url);\n }\n // prepare headers\n if (input && typeof input === 'object' && 'headers' in input) {\n _a.mergeHeaders(headers, input.headers);\n }\n if (init) {\n _a.mergeHeaders(headers, new Headers(init.headers));\n }\n // prepare request\n if (typeof input === 'object' && !(input instanceof URL)) {\n // input must have been a non-URL object\n return this.request({ ...init, ...input, headers, url });\n }\n else {\n // input must have been a string or URL\n return this.request({ ...init, headers, url });\n }\n }\n /**\n * Perform an HTTP request with the given options.\n * @param opts Set of HTTP options that will be used for this HTTP request.\n */\n async request(opts = {}) {\n let prepared = await this.#prepareRequest(opts);\n prepared = await this.#applyRequestInterceptors(prepared);\n return this.#applyResponseInterceptors(this._request(prepared));\n }\n async _defaultAdapter(config) {\n const fetchImpl = config.fetchImplementation ||\n this.defaults.fetchImplementation ||\n (await _a.#getFetch());\n // node-fetch v3 warns when `data` is present\n // https://github.com/node-fetch/node-fetch/issues/1000\n const preparedOpts = { ...config };\n delete preparedOpts.data;\n const res = (await fetchImpl(config.url, preparedOpts));\n const data = await this.getResponseData(config, res);\n if (!Object.getOwnPropertyDescriptor(res, 'data')?.configurable) {\n // Work-around for `node-fetch` v3 as accessing `data` would otherwise throw\n Object.defineProperties(res, {\n data: {\n configurable: true,\n writable: true,\n enumerable: true,\n value: data,\n },\n });\n }\n // Keep object as an instance of `Response`\n return Object.assign(res, { config, data });\n }\n /**\n * Internal, retryable version of the `request` method.\n * @param opts Set of HTTP options that will be used for this HTTP request.\n */\n async _request(opts) {\n try {\n let translatedResponse;\n if (opts.adapter) {\n translatedResponse = await opts.adapter(opts, this._defaultAdapter.bind(this));\n }\n else {\n translatedResponse = await this._defaultAdapter(opts);\n }\n if (!opts.validateStatus(translatedResponse.status)) {\n if (opts.responseType === 'stream') {\n const response = [];\n for await (const chunk of translatedResponse.data) {\n response.push(chunk);\n }\n translatedResponse.data = response.toString();\n }\n const errorInfo = common_js_1.GaxiosError.extractAPIErrorFromResponse(translatedResponse, `Request failed with status code ${translatedResponse.status}`);\n throw new common_js_1.GaxiosError(errorInfo?.message, opts, translatedResponse, errorInfo);\n }\n return translatedResponse;\n }\n catch (e) {\n let err;\n if (e instanceof common_js_1.GaxiosError) {\n err = e;\n }\n else if (e instanceof Error) {\n err = new common_js_1.GaxiosError(e.message, opts, undefined, e);\n }\n else {\n err = new common_js_1.GaxiosError('Unexpected Gaxios Error', opts, undefined, e);\n }\n const { shouldRetry, config } = await (0, retry_js_1.getRetryConfig)(err);\n if (shouldRetry && config) {\n err.config.retryConfig.currentRetryAttempt =\n config.retryConfig.currentRetryAttempt;\n // The error's config could be redacted - therefore we only want to\n // copy the retry state over to the existing config\n opts.retryConfig = err.config?.retryConfig;\n // re-prepare timeout for the next request\n this.#appendTimeoutToSignal(opts);\n return this._request(opts);\n }\n if (opts.errorRedactor) {\n opts.errorRedactor(err);\n }\n throw err;\n }\n }\n async getResponseData(opts, res) {\n if (res.status === HTTP_STATUS_NO_CONTENT) {\n return '';\n }\n if (opts.maxContentLength &&\n res.headers.has('content-length') &&\n opts.maxContentLength <\n Number.parseInt(res.headers?.get('content-length') || '')) {\n throw new common_js_1.GaxiosError(\"Response's `Content-Length` is over the limit.\", opts, Object.assign(res, { config: opts }));\n }\n switch (opts.responseType) {\n case 'stream':\n return res.body;\n case 'json': {\n const data = await res.text();\n try {\n return JSON.parse(data);\n }\n catch {\n return data;\n }\n }\n case 'arraybuffer':\n return res.arrayBuffer();\n case 'blob':\n return res.blob();\n case 'text':\n return res.text();\n default:\n return this.getResponseDataFromContentType(res);\n }\n }\n #urlMayUseProxy(url, noProxy = []) {\n const candidate = new URL(url);\n const noProxyList = [...noProxy];\n const noProxyEnvList = (process.env.NO_PROXY ?? process.env.no_proxy)?.split(',') || [];\n for (const rule of noProxyEnvList) {\n noProxyList.push(rule.trim());\n }\n for (const rule of noProxyList) {\n // Match regex\n if (rule instanceof RegExp) {\n if (rule.test(candidate.toString())) {\n return false;\n }\n }\n // Match URL\n else if (rule instanceof URL) {\n if (rule.origin === candidate.origin) {\n return false;\n }\n }\n // Match string regex\n else if (rule.startsWith('*.') || rule.startsWith('.')) {\n const cleanedRule = rule.replace(/^\\*\\./, '.');\n if (candidate.hostname.endsWith(cleanedRule)) {\n return false;\n }\n }\n // Basic string match\n else if (rule === candidate.origin ||\n rule === candidate.hostname ||\n rule === candidate.href) {\n return false;\n }\n }\n return true;\n }\n /**\n * Applies the request interceptors. The request interceptors are applied after the\n * call to prepareRequest is completed.\n *\n * @param {GaxiosOptionsPrepared} options The current set of options.\n *\n * @returns {Promise<GaxiosOptionsPrepared>} Promise that resolves to the set of options or response after interceptors are applied.\n */\n async #applyRequestInterceptors(options) {\n let promiseChain = Promise.resolve(options);\n for (const interceptor of this.interceptors.request.values()) {\n if (interceptor) {\n promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);\n }\n }\n return promiseChain;\n }\n /**\n * Applies the response interceptors. The response interceptors are applied after the\n * call to request is made.\n *\n * @param {GaxiosOptionsPrepared} options The current set of options.\n *\n * @returns {Promise<GaxiosOptionsPrepared>} Promise that resolves to the set of options or response after interceptors are applied.\n */\n async #applyResponseInterceptors(response) {\n let promiseChain = Promise.resolve(response);\n for (const interceptor of this.interceptors.response.values()) {\n if (interceptor) {\n promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);\n }\n }\n return promiseChain;\n }\n /**\n * Validates the options, merges them with defaults, and prepare request.\n *\n * @param options The original options passed from the client.\n * @returns Prepared options, ready to make a request\n */\n async #prepareRequest(options) {\n // Prepare Headers - copy in order to not mutate the original objects\n const preparedHeaders = new Headers(this.defaults.headers);\n _a.mergeHeaders(preparedHeaders, options.headers);\n // Merge options\n const opts = (0, extend_1.default)(true, {}, this.defaults, options);\n if (!opts.url) {\n throw new Error('URL is required.');\n }\n if (opts.baseURL) {\n opts.url = new URL(opts.url, opts.baseURL);\n }\n // don't modify the properties of a default or provided URL\n opts.url = new URL(opts.url);\n if (opts.params) {\n if (opts.paramsSerializer) {\n let additionalQueryParams = opts.paramsSerializer(opts.params);\n if (additionalQueryParams.startsWith('?')) {\n additionalQueryParams = additionalQueryParams.slice(1);\n }\n const prefix = opts.url.toString().includes('?') ? '&' : '?';\n opts.url = opts.url + prefix + additionalQueryParams;\n }\n else {\n const url = opts.url instanceof URL ? opts.url : new URL(opts.url);\n for (const [key, value] of new URLSearchParams(opts.params)) {\n url.searchParams.append(key, value);\n }\n opts.url = url;\n }\n }\n if (typeof options.maxContentLength === 'number') {\n opts.size = options.maxContentLength;\n }\n if (typeof options.maxRedirects === 'number') {\n opts.follow = options.maxRedirects;\n }\n const shouldDirectlyPassData = typeof opts.data === 'string' ||\n opts.data instanceof ArrayBuffer ||\n opts.data instanceof Blob ||\n // Node 18 does not have a global `File` object\n (globalThis.File && opts.data instanceof File) ||\n opts.data instanceof FormData ||\n opts.data instanceof stream_1.Readable ||\n opts.data instanceof ReadableStream ||\n opts.data instanceof String ||\n opts.data instanceof URLSearchParams ||\n ArrayBuffer.isView(opts.data) || // `Buffer` (Node.js), `DataView`, `TypedArray`\n /**\n * @deprecated `node-fetch` or another third-party's request types\n */\n ['Blob', 'File', 'FormData'].includes(opts.data?.constructor?.name || '');\n if (opts.multipart?.length) {\n const boundary = await randomUUID();\n preparedHeaders.set('content-type', `multipart/related; boundary=${boundary}`);\n opts.body = stream_1.Readable.from(this.getMultipartRequest(opts.multipart, boundary));\n }\n else if (shouldDirectlyPassData) {\n opts.body = opts.data;\n }\n else if (typeof opts.data === 'object') {\n if (preparedHeaders.get('Content-Type') ===\n 'application/x-www-form-urlencoded') {\n // If www-form-urlencoded content type has been set, but data is\n // provided as an object, serialize the content\n opts.body = opts.paramsSerializer\n ? opts.paramsSerializer(opts.data)\n : new URLSearchParams(opts.data);\n }\n else {\n if (!preparedHeaders.has('content-type')) {\n preparedHeaders.set('content-type', 'application/json');\n }\n opts.body = JSON.stringify(opts.data);\n }\n }\n else if (opts.data) {\n opts.body = opts.data;\n }\n opts.validateStatus = opts.validateStatus || this.validateStatus;\n opts.responseType = opts.responseType || 'unknown';\n if (!preparedHeaders.has('accept') && opts.responseType === 'json') {\n preparedHeaders.set('accept', 'application/json');\n }\n const proxy = opts.proxy ||\n process?.env?.HTTPS_PROXY ||\n process?.env?.https_proxy ||\n process?.env?.HTTP_PROXY ||\n process?.env?.http_proxy;\n if (opts.agent) {\n // don't do any of the following options - use the user-provided agent.\n }\n else if (proxy && this.#urlMayUseProxy(opts.url, opts.noProxy)) {\n const HttpsProxyAgent = await _a.#getProxyAgent();\n if (this.agentCache.has(proxy)) {\n opts.agent = this.agentCache.get(proxy);\n }\n else {\n opts.agent = new HttpsProxyAgent(proxy, {\n cert: opts.cert,\n key: opts.key,\n });\n this.agentCache.set(proxy, opts.agent);\n }\n }\n else if (opts.cert && opts.key) {\n // Configure client for mTLS\n if (this.agentCache.has(opts.key)) {\n opts.agent = this.agentCache.get(opts.key);\n }\n else {\n opts.agent = new https_1.Agent({\n cert: opts.cert,\n key: opts.key,\n });\n this.agentCache.set(opts.key, opts.agent);\n }\n }\n if (typeof opts.errorRedactor !== 'function' &&\n opts.errorRedactor !== false) {\n opts.errorRedactor = common_js_1.defaultErrorRedactor;\n }\n if (opts.body && !('duplex' in opts)) {\n /**\n * required for Node.js and the type isn't available today\n * @link https://github.com/nodejs/node/issues/46221\n * @link https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1483\n */\n opts.duplex = 'half';\n }\n this.#appendTimeoutToSignal(opts);\n return Object.assign(opts, {\n headers: preparedHeaders,\n url: opts.url instanceof URL ? opts.url : new URL(opts.url),\n });\n }\n #appendTimeoutToSignal(opts) {\n if (opts.timeout) {\n const timeoutSignal = AbortSignal.timeout(opts.timeout);\n if (opts.signal && !opts.signal.aborted) {\n opts.signal = AbortSignal.any([opts.signal, timeoutSignal]);\n }\n else {\n opts.signal = timeoutSignal;\n }\n }\n }\n /**\n * By default, throw for any non-2xx status code\n * @param status status code from the HTTP response\n */\n validateStatus(status) {\n return status >= 200 && status < 300;\n }\n /**\n * Attempts to parse a response by looking at the Content-Type header.\n * @param {Response} response the HTTP response.\n * @returns a promise that resolves to the response data.\n */\n async getResponseDataFromContentType(response) {\n let contentType = response.headers.get('Content-Type');\n if (contentType === null) {\n // Maintain existing functionality by calling text()\n return response.text();\n }\n contentType = contentType.toLowerCase();\n if (contentType.includes('application/json')) {\n let data = await response.text();\n try {\n data = JSON.parse(data);\n }\n catch {\n // continue\n }\n return data;\n }\n else if (contentType.match(/^text\\//)) {\n return response.text();\n }\n else {\n // If the content type is something not easily handled, just return the raw data (blob)\n return response.blob();\n }\n }\n /**\n * Creates an async generator that yields the pieces of a multipart/related request body.\n * This implementation follows the spec: https://www.ietf.org/rfc/rfc2387.txt. However, recursive\n * multipart/related requests are not currently supported.\n *\n * @param {GaxiosMultipartOptions[]} multipartOptions the pieces to turn into a multipart/related body.\n * @param {string} boundary the boundary string to be placed between each part.\n */\n async *getMultipartRequest(multipartOptions, boundary) {\n const finale = `--${boundary}--`;\n for (const currentPart of multipartOptions) {\n const partContentType = currentPart.headers.get('Content-Type') || 'application/octet-stream';\n const preamble = `--${boundary}\\r\\nContent-Type: ${partContentType}\\r\\n\\r\\n`;\n yield preamble;\n if (typeof currentPart.content === 'string') {\n yield currentPart.content;\n }\n else {\n yield* currentPart.content;\n }\n yield '\\r\\n';\n }\n yield finale;\n }\n /**\n * A cache for the lazily-loaded proxy agent.\n *\n * Should use {@link Gaxios[#getProxyAgent]} to retrieve.\n */\n // using `import` to dynamically import the types here\n static #proxyAgent;\n /**\n * A cache for the lazily-loaded fetch library.\n *\n * Should use {@link Gaxios[#getFetch]} to retrieve.\n */\n //\n static #fetch;\n /**\n * Imports, caches, and returns a proxy agent - if not already imported\n *\n * @returns A proxy agent\n */\n static async #getProxyAgent() {\n this.#proxyAgent ||= (await import('https-proxy-agent')).HttpsProxyAgent;\n return this.#proxyAgent;\n }\n static async #getFetch() {\n const hasWindow = typeof window !== 'undefined' && !!window;\n this.#fetch ||= hasWindow\n ? window.fetch\n : (await import('node-fetch')).default;\n return this.#fetch;\n }\n /**\n * Merges headers.\n * If the base headers do not exist a new `Headers` object will be returned.\n *\n * @remarks\n *\n * Using this utility can be helpful when the headers are not known to exist:\n * - if they exist as `Headers`, that instance will be used\n * - it improves performance and allows users to use their existing references to their `Headers`\n * - if they exist in another form (`HeadersInit`), they will be used to create a new `Headers` object\n * - if the base headers do not exist a new `Headers` object will be created\n *\n * @param base headers to append/overwrite to\n * @param append headers to append/overwrite with\n * @returns the base headers instance with merged `Headers`\n */\n static mergeHeaders(base, ...append) {\n base = base instanceof Headers ? base : new Headers(base);\n for (const headers of append) {\n const add = headers instanceof Headers ? headers : new Headers(headers);\n add.forEach((value, key) => {\n // set-cookie is the only header that would repeat.\n // A bit of background: https://developer.mozilla.org/en-US/docs/Web/API/Headers/getSetCookie\n key === 'set-cookie' ? base.append(key, value) : base.set(key, value);\n });\n }\n return base;\n }\n}\nexports.Gaxios = Gaxios;\n_a = Gaxios;\n//# sourceMappingURL=gaxios.js.map",
11
+ "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.instance = exports.Gaxios = exports.GaxiosError = void 0;\nexports.request = request;\nconst gaxios_js_1 = require(\"./gaxios.js\");\nObject.defineProperty(exports, \"Gaxios\", { enumerable: true, get: function () { return gaxios_js_1.Gaxios; } });\nvar common_js_1 = require(\"./common.js\");\nObject.defineProperty(exports, \"GaxiosError\", { enumerable: true, get: function () { return common_js_1.GaxiosError; } });\n__exportStar(require(\"./interceptor.js\"), exports);\n/**\n * The default instance used when the `request` method is directly\n * invoked.\n */\nexports.instance = new gaxios_js_1.Gaxios();\n/**\n * Make an HTTP request using the given options.\n * @param opts Options for the request\n */\nasync function request(opts) {\n return exports.instance.request(opts);\n}\n//# sourceMappingURL=index.js.map",
12
+ ";(function (globalObject) {\r\n 'use strict';\r\n\r\n/*\r\n * bignumber.js v9.3.1\r\n * A JavaScript library for arbitrary-precision arithmetic.\r\n * https://github.com/MikeMcl/bignumber.js\r\n * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>\r\n * MIT Licensed.\r\n *\r\n * BigNumber.prototype methods | BigNumber methods\r\n * |\r\n * absoluteValue abs | clone\r\n * comparedTo | config set\r\n * decimalPlaces dp | DECIMAL_PLACES\r\n * dividedBy div | ROUNDING_MODE\r\n * dividedToIntegerBy idiv | EXPONENTIAL_AT\r\n * exponentiatedBy pow | RANGE\r\n * integerValue | CRYPTO\r\n * isEqualTo eq | MODULO_MODE\r\n * isFinite | POW_PRECISION\r\n * isGreaterThan gt | FORMAT\r\n * isGreaterThanOrEqualTo gte | ALPHABET\r\n * isInteger | isBigNumber\r\n * isLessThan lt | maximum max\r\n * isLessThanOrEqualTo lte | minimum min\r\n * isNaN | random\r\n * isNegative | sum\r\n * isPositive |\r\n * isZero |\r\n * minus |\r\n * modulo mod |\r\n * multipliedBy times |\r\n * negated |\r\n * plus |\r\n * precision sd |\r\n * shiftedBy |\r\n * squareRoot sqrt |\r\n * toExponential |\r\n * toFixed |\r\n * toFormat |\r\n * toFraction |\r\n * toJSON |\r\n * toNumber |\r\n * toPrecision |\r\n * toString |\r\n * valueOf |\r\n *\r\n */\r\n\r\n\r\n var BigNumber,\r\n isNumeric = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,\r\n mathceil = Math.ceil,\r\n mathfloor = Math.floor,\r\n\r\n bignumberError = '[BigNumber Error] ',\r\n tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r\n\r\n BASE = 1e14,\r\n LOG_BASE = 14,\r\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\r\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\r\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r\n SQRT_BASE = 1e7,\r\n\r\n // EDITABLE\r\n // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r\n // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r\n MAX = 1E9; // 0 to MAX_INT32\r\n\r\n\r\n /*\r\n * Create and return a BigNumber constructor.\r\n */\r\n function clone(configObject) {\r\n var div, convertBase, parseNumeric,\r\n P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },\r\n ONE = new BigNumber(1),\r\n\r\n\r\n //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r\n\r\n\r\n // The default values below must be integers within the inclusive ranges stated.\r\n // The values can also be changed at run-time using BigNumber.set.\r\n\r\n // The maximum number of decimal places for operations involving division.\r\n DECIMAL_PLACES = 20, // 0 to MAX\r\n\r\n // The rounding mode used when rounding to the above decimal places, and when using\r\n // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r\n // UP 0 Away from zero.\r\n // DOWN 1 Towards zero.\r\n // CEIL 2 Towards +Infinity.\r\n // FLOOR 3 Towards -Infinity.\r\n // HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n ROUNDING_MODE = 4, // 0 to 8\r\n\r\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r\n\r\n // The exponent value at and beneath which toString returns exponential notation.\r\n // Number type: -7\r\n TO_EXP_NEG = -7, // 0 to -MAX\r\n\r\n // The exponent value at and above which toString returns exponential notation.\r\n // Number type: 21\r\n TO_EXP_POS = 21, // 0 to MAX\r\n\r\n // RANGE : [MIN_EXP, MAX_EXP]\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // Number type: -324 (5e-324)\r\n MIN_EXP = -1e7, // -1 to -MAX\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // Number type: 308 (1.7976931348623157e+308)\r\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r\n MAX_EXP = 1e7, // 1 to MAX\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n CRYPTO = false, // true or false\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend.\r\n // This modulo mode is commonly known as 'truncated division' and is\r\n // equivalent to (a % n) in JavaScript.\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r\n // The remainder is always positive.\r\n //\r\n // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r\n // modes are commonly used for the modulus operation.\r\n // Although the other rounding modes can also be used, they may not give useful results.\r\n MODULO_MODE = 1, // 0 to 9\r\n\r\n // The maximum number of significant digits of the result of the exponentiatedBy operation.\r\n // If POW_PRECISION is 0, there will be unlimited significant digits.\r\n POW_PRECISION = 0, // 0 to MAX\r\n\r\n // The format specification used by the BigNumber.prototype.toFormat method.\r\n FORMAT = {\r\n prefix: '',\r\n groupSize: 3,\r\n secondaryGroupSize: 0,\r\n groupSeparator: ',',\r\n decimalSeparator: '.',\r\n fractionGroupSize: 0,\r\n fractionGroupSeparator: '\\xA0', // non-breaking space\r\n suffix: ''\r\n },\r\n\r\n // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',\r\n // '-', '.', whitespace, or repeated character.\r\n // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz',\r\n alphabetHasNormalDecimalDigits = true;\r\n\r\n\r\n //------------------------------------------------------------------------------------------\r\n\r\n\r\n // CONSTRUCTOR\r\n\r\n\r\n /*\r\n * The BigNumber constructor and exported function.\r\n * Create and return a new instance of a BigNumber object.\r\n *\r\n * v {number|string|BigNumber} A numeric value.\r\n * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.\r\n */\r\n function BigNumber(v, b) {\r\n var alphabet, c, caseChanged, e, i, isNum, len, str,\r\n x = this;\r\n\r\n // Enable constructor call without `new`.\r\n if (!(x instanceof BigNumber)) return new BigNumber(v, b);\r\n\r\n if (b == null) {\r\n\r\n if (v && v._isBigNumber === true) {\r\n x.s = v.s;\r\n\r\n if (!v.c || v.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else if (v.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = v.e;\r\n x.c = v.c.slice();\r\n }\r\n\r\n return;\r\n }\r\n\r\n if ((isNum = typeof v == 'number') && v * 0 == 0) {\r\n\r\n // Use `1 / n` to handle minus zero also.\r\n x.s = 1 / v < 0 ? (v = -v, -1) : 1;\r\n\r\n // Fast path for integers, where n < 2147483648 (2**31).\r\n if (v === ~~v) {\r\n for (e = 0, i = v; i >= 10; i /= 10, e++);\r\n\r\n if (e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else {\r\n x.e = e;\r\n x.c = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n str = String(v);\r\n } else {\r\n\r\n if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);\r\n\r\n x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n\r\n // Allow exponential notation to be used with base 10 argument, while\r\n // also rounding to DECIMAL_PLACES as with other bases.\r\n if (b == 10 && alphabetHasNormalDecimalDigits) {\r\n x = new BigNumber(v);\r\n return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);\r\n }\r\n\r\n str = String(v);\r\n\r\n if (isNum = typeof v == 'number') {\r\n\r\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r\n if (v * 0 != 0) return parseNumeric(x, str, isNum, b);\r\n\r\n x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (BigNumber.DEBUG && str.replace(/^0\\.0*|\\./, '').length > 15) {\r\n throw Error\r\n (tooManyDigits + v);\r\n }\r\n } else {\r\n x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n alphabet = ALPHABET.slice(0, b);\r\n e = i = 0;\r\n\r\n // Check that str is a valid base b number.\r\n // Don't use RegExp, so alphabet can contain special characters.\r\n for (len = str.length; i < len; i++) {\r\n if (alphabet.indexOf(c = str.charAt(i)) < 0) {\r\n if (c == '.') {\r\n\r\n // If '.' is not the first character and it has not be found before.\r\n if (i > e) {\r\n e = len;\r\n continue;\r\n }\r\n } else if (!caseChanged) {\r\n\r\n // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r\n if (str == str.toUpperCase() && (str = str.toLowerCase()) ||\r\n str == str.toLowerCase() && (str = str.toUpperCase())) {\r\n caseChanged = true;\r\n i = -1;\r\n e = 0;\r\n continue;\r\n }\r\n }\r\n\r\n return parseNumeric(x, String(v), isNum, b);\r\n }\r\n }\r\n\r\n // Prevent later check for length on converted number.\r\n isNum = false;\r\n str = convertBase(str, b, 10, x.s);\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n else e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(--len) === 48;);\r\n\r\n if (str = str.slice(i, ++len)) {\r\n len -= i;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (isNum && BigNumber.DEBUG &&\r\n len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {\r\n throw Error\r\n (tooManyDigits + (x.s * v));\r\n }\r\n\r\n // Overflow?\r\n if ((e = e - i - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n x.c = x.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = e;\r\n x.c = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first element of the coefficient array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE; // i < 1\r\n\r\n if (i < len) {\r\n if (i) x.c.push(+str.slice(0, i));\r\n\r\n for (len -= LOG_BASE; i < len;) {\r\n x.c.push(+str.slice(i, i += LOG_BASE));\r\n }\r\n\r\n i = LOG_BASE - (str = str.slice(i)).length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--; str += '0');\r\n x.c.push(+str);\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n\r\n // CONSTRUCTOR PROPERTIES\r\n\r\n\r\n BigNumber.clone = clone;\r\n\r\n BigNumber.ROUND_UP = 0;\r\n BigNumber.ROUND_DOWN = 1;\r\n BigNumber.ROUND_CEIL = 2;\r\n BigNumber.ROUND_FLOOR = 3;\r\n BigNumber.ROUND_HALF_UP = 4;\r\n BigNumber.ROUND_HALF_DOWN = 5;\r\n BigNumber.ROUND_HALF_EVEN = 6;\r\n BigNumber.ROUND_HALF_CEIL = 7;\r\n BigNumber.ROUND_HALF_FLOOR = 8;\r\n BigNumber.EUCLID = 9;\r\n\r\n\r\n /*\r\n * Configure infrequently-changing library-wide settings.\r\n *\r\n * Accept an object with the following optional properties (if the value of a property is\r\n * a number, it must be an integer within the inclusive range stated):\r\n *\r\n * DECIMAL_PLACES {number} 0 to MAX\r\n * ROUNDING_MODE {number} 0 to 8\r\n * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]\r\n * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]\r\n * CRYPTO {boolean} true or false\r\n * MODULO_MODE {number} 0 to 9\r\n * POW_PRECISION {number} 0 to MAX\r\n * ALPHABET {string} A string of two or more unique characters which does\r\n * not contain '.'.\r\n * FORMAT {object} An object with some of the following properties:\r\n * prefix {string}\r\n * groupSize {number}\r\n * secondaryGroupSize {number}\r\n * groupSeparator {string}\r\n * decimalSeparator {string}\r\n * fractionGroupSize {number}\r\n * fractionGroupSeparator {string}\r\n * suffix {string}\r\n *\r\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\r\n *\r\n * E.g.\r\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r\n *\r\n * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r\n *\r\n * Return an object with the properties current values.\r\n */\r\n BigNumber.config = BigNumber.set = function (obj) {\r\n var p, v;\r\n\r\n if (obj != null) {\r\n\r\n if (typeof obj == 'object') {\r\n\r\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n DECIMAL_PLACES = v;\r\n }\r\n\r\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r\n // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 8, p);\r\n ROUNDING_MODE = v;\r\n }\r\n\r\n // EXPONENTIAL_AT {number|number[]}\r\n // Integer, -MAX to MAX inclusive or\r\n // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r\n // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, 0, p);\r\n intCheck(v[1], 0, MAX, p);\r\n TO_EXP_NEG = v[0];\r\n TO_EXP_POS = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);\r\n }\r\n }\r\n\r\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r\n // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r\n if (obj.hasOwnProperty(p = 'RANGE')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, -1, p);\r\n intCheck(v[1], 1, MAX, p);\r\n MIN_EXP = v[0];\r\n MAX_EXP = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n if (v) {\r\n MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' cannot be zero: ' + v);\r\n }\r\n }\r\n }\r\n\r\n // CRYPTO {boolean} true or false.\r\n // '[BigNumber Error] CRYPTO not true or false: {v}'\r\n // '[BigNumber Error] crypto unavailable'\r\n if (obj.hasOwnProperty(p = 'CRYPTO')) {\r\n v = obj[p];\r\n if (v === !!v) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n CRYPTO = v;\r\n } else {\r\n CRYPTO = !v;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n } else {\r\n CRYPTO = v;\r\n }\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' not true or false: ' + v);\r\n }\r\n }\r\n\r\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r\n // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'MODULO_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 9, p);\r\n MODULO_MODE = v;\r\n }\r\n\r\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'POW_PRECISION')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n POW_PRECISION = v;\r\n }\r\n\r\n // FORMAT {object}\r\n // '[BigNumber Error] FORMAT not an object: {v}'\r\n if (obj.hasOwnProperty(p = 'FORMAT')) {\r\n v = obj[p];\r\n if (typeof v == 'object') FORMAT = v;\r\n else throw Error\r\n (bignumberError + p + ' not an object: ' + v);\r\n }\r\n\r\n // ALPHABET {string}\r\n // '[BigNumber Error] ALPHABET invalid: {v}'\r\n if (obj.hasOwnProperty(p = 'ALPHABET')) {\r\n v = obj[p];\r\n\r\n // Disallow if less than two characters,\r\n // or if it contains '+', '-', '.', whitespace, or a repeated character.\r\n if (typeof v == 'string' && !/^.?$|[+\\-.\\s]|(.).*\\1/.test(v)) {\r\n alphabetHasNormalDecimalDigits = v.slice(0, 10) == '0123456789';\r\n ALPHABET = v;\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' invalid: ' + v);\r\n }\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Object expected: {v}'\r\n throw Error\r\n (bignumberError + 'Object expected: ' + obj);\r\n }\r\n }\r\n\r\n return {\r\n DECIMAL_PLACES: DECIMAL_PLACES,\r\n ROUNDING_MODE: ROUNDING_MODE,\r\n EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],\r\n RANGE: [MIN_EXP, MAX_EXP],\r\n CRYPTO: CRYPTO,\r\n MODULO_MODE: MODULO_MODE,\r\n POW_PRECISION: POW_PRECISION,\r\n FORMAT: FORMAT,\r\n ALPHABET: ALPHABET\r\n };\r\n };\r\n\r\n\r\n /*\r\n * Return true if v is a BigNumber instance, otherwise return false.\r\n *\r\n * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.\r\n *\r\n * v {any}\r\n *\r\n * '[BigNumber Error] Invalid BigNumber: {v}'\r\n */\r\n BigNumber.isBigNumber = function (v) {\r\n if (!v || v._isBigNumber !== true) return false;\r\n if (!BigNumber.DEBUG) return true;\r\n\r\n var i, n,\r\n c = v.c,\r\n e = v.e,\r\n s = v.s;\r\n\r\n out: if ({}.toString.call(c) == '[object Array]') {\r\n\r\n if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {\r\n\r\n // If the first element is zero, the BigNumber value must be zero.\r\n if (c[0] === 0) {\r\n if (e === 0 && c.length === 1) return true;\r\n break out;\r\n }\r\n\r\n // Calculate number of digits that c[0] should have, based on the exponent.\r\n i = (e + 1) % LOG_BASE;\r\n if (i < 1) i += LOG_BASE;\r\n\r\n // Calculate number of digits of c[0].\r\n //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {\r\n if (String(c[0]).length == i) {\r\n\r\n for (i = 0; i < c.length; i++) {\r\n n = c[i];\r\n if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;\r\n }\r\n\r\n // Last element cannot be zero, unless it is the only element.\r\n if (n !== 0) return true;\r\n }\r\n }\r\n\r\n // Infinity/NaN\r\n } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {\r\n return true;\r\n }\r\n\r\n throw Error\r\n (bignumberError + 'Invalid BigNumber: ' + v);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.maximum = BigNumber.max = function () {\r\n return maxOrMin(arguments, -1);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.minimum = BigNumber.min = function () {\r\n return maxOrMin(arguments, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r\n * zeros are produced).\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r\n * '[BigNumber Error] crypto unavailable'\r\n */\r\n BigNumber.random = (function () {\r\n var pow2_53 = 0x20000000000000;\r\n\r\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r\n // Check if Math.random() produces more than 32 bits of randomness.\r\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r\n ? function () { return mathfloor(Math.random() * pow2_53); }\r\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r\n (Math.random() * 0x800000 | 0); };\r\n\r\n return function (dp) {\r\n var a, b, e, k, v,\r\n i = 0,\r\n c = [],\r\n rand = new BigNumber(ONE);\r\n\r\n if (dp == null) dp = DECIMAL_PLACES;\r\n else intCheck(dp, 0, MAX);\r\n\r\n k = mathceil(dp / LOG_BASE);\r\n\r\n if (CRYPTO) {\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n if (crypto.getRandomValues) {\r\n\r\n a = crypto.getRandomValues(new Uint32Array(k *= 2));\r\n\r\n for (; i < k;) {\r\n\r\n // 53 bits:\r\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r\n // 11111 11111111 11111111\r\n // 0x20000 is 2^21.\r\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r\n\r\n // Rejection sampling:\r\n // 0 <= v < 9007199254740992\r\n // Probability that v >= 9e15, is\r\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r\n if (v >= 9e15) {\r\n b = crypto.getRandomValues(new Uint32Array(2));\r\n a[i] = b[0];\r\n a[i + 1] = b[1];\r\n } else {\r\n\r\n // 0 <= v <= 8999999999999999\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 2;\r\n }\r\n }\r\n i = k / 2;\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n a = crypto.randomBytes(k *= 7);\r\n\r\n for (; i < k;) {\r\n\r\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r\n // 0x100000000 is 2^32, 0x1000000 is 2^24\r\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r\n // 0 <= v < 9007199254740992\r\n v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +\r\n (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +\r\n (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];\r\n\r\n if (v >= 9e15) {\r\n crypto.randomBytes(7).copy(a, i);\r\n } else {\r\n\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 7;\r\n }\r\n }\r\n i = k / 7;\r\n } else {\r\n CRYPTO = false;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n }\r\n\r\n // Use Math.random.\r\n if (!CRYPTO) {\r\n\r\n for (; i < k;) {\r\n v = random53bitInt();\r\n if (v < 9e15) c[i++] = v % 1e14;\r\n }\r\n }\r\n\r\n k = c[--i];\r\n dp %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to dp.\r\n if (k && dp) {\r\n v = POWS_TEN[LOG_BASE - dp];\r\n c[i] = mathfloor(k / v) * v;\r\n }\r\n\r\n // Remove trailing elements which are zero.\r\n for (; c[i] === 0; c.pop(), i--);\r\n\r\n // Zero?\r\n if (i < 0) {\r\n c = [e = 0];\r\n } else {\r\n\r\n // Remove leading elements which are zero and adjust exponent accordingly.\r\n for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r\n\r\n // Count the digits of the first element of c to determine leading zeros, and...\r\n for (i = 1, v = c[0]; v >= 10; v /= 10, i++);\r\n\r\n // adjust the exponent accordingly.\r\n if (i < LOG_BASE) e -= LOG_BASE - i;\r\n }\r\n\r\n rand.e = e;\r\n rand.c = c;\r\n return rand;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the sum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.sum = function () {\r\n var i = 1,\r\n args = arguments,\r\n sum = new BigNumber(args[0]);\r\n for (; i < args.length;) sum = sum.plus(args[i++]);\r\n return sum;\r\n };\r\n\r\n\r\n // PRIVATE FUNCTIONS\r\n\r\n\r\n // Called by BigNumber and BigNumber.prototype.toString.\r\n convertBase = (function () {\r\n var decimal = '0123456789';\r\n\r\n /*\r\n * Convert string of baseIn to an array of numbers of baseOut.\r\n * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r\n * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r\n */\r\n function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }\r\n\r\n // Convert a numeric string of baseIn to a numeric string of baseOut.\r\n // If the caller is toString, we are converting from base 10 to baseOut.\r\n // If the caller is BigNumber, we are converting from baseIn to base 10.\r\n return function (str, baseIn, baseOut, sign, callerIsToString) {\r\n var alphabet, d, e, k, r, x, xc, y,\r\n i = str.indexOf('.'),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace('.', '');\r\n y = new BigNumber(baseIn);\r\n x = y.pow(str.length - i);\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n\r\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),\r\n 10, baseOut, decimal);\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n\r\n xc = toBaseOut(str, baseIn, baseOut, callerIsToString\r\n ? (alphabet = ALPHABET, decimal)\r\n : (alphabet = decimal, ALPHABET));\r\n\r\n // xc now represents str as an integer and converted to baseOut. e is the exponent.\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--k] == 0; xc.pop());\r\n\r\n // Zero?\r\n if (!xc[0]) return alphabet.charAt(0);\r\n\r\n // Does str represent an integer? If so, no need for the division.\r\n if (i < 0) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // The sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div(x, y, dp, rm, baseOut);\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n // xc now represents str converted to baseOut.\r\n\r\n // The index of the rounding digit.\r\n d = e + dp + 1;\r\n\r\n // The rounding digit: the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n\r\n // Look at the rounding digits and mode to determine whether to round up.\r\n\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n // If the index of the rounding digit is not greater than zero, or xc represents\r\n // zero, then the result of the base conversion is zero or, if rounding up, a value\r\n // such as 0.00001.\r\n if (d < 1 || !xc[0]) {\r\n\r\n // 1^-dp or 0\r\n str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);\r\n } else {\r\n\r\n // Truncate xc to the required number of decimal places.\r\n xc.length = d;\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (--baseOut; ++xc[--d] > baseOut;) {\r\n xc[d] = 0;\r\n\r\n if (!d) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (k = xc.length; !xc[--k];);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));\r\n\r\n // Add leading zeros, decimal point and trailing zeros as required.\r\n str = toFixedPoint(str, e, alphabet.charAt(0));\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n };\r\n })();\r\n\r\n\r\n // Perform division in the specified base. Called by div and convertBase.\r\n div = (function () {\r\n\r\n // Assume non-zero x and k.\r\n function multiply(x, k, base) {\r\n var m, temp, xlo, xhi,\r\n carry = 0,\r\n i = x.length,\r\n klo = k % SQRT_BASE,\r\n khi = k / SQRT_BASE | 0;\r\n\r\n for (x = x.slice(); i--;) {\r\n xlo = x[i] % SQRT_BASE;\r\n xhi = x[i] / SQRT_BASE | 0;\r\n m = khi * xlo + xhi * klo;\r\n temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;\r\n carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;\r\n x[i] = temp % base;\r\n }\r\n\r\n if (carry) x = [carry].concat(x);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, cmp;\r\n\r\n if (aL != bL) {\r\n cmp = aL > bL ? 1 : -1;\r\n } else {\r\n\r\n for (i = cmp = 0; i < aL; i++) {\r\n\r\n if (a[i] != b[i]) {\r\n cmp = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1; a.splice(0, 1));\r\n }\r\n\r\n // x: dividend, y: divisor.\r\n return function (x, y, dp, rm, base) {\r\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r\n yL, yz,\r\n s = x.s == y.s ? 1 : -1,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xc || !xc[0] || !yc || !yc[0]) {\r\n\r\n return new BigNumber(\r\n\r\n // Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :\r\n\r\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r\n );\r\n }\r\n\r\n q = new BigNumber(s);\r\n qc = q.c = [];\r\n e = x.e - y.e;\r\n s = dp + e + 1;\r\n\r\n if (!base) {\r\n base = BASE;\r\n e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);\r\n s = s / LOG_BASE | 0;\r\n }\r\n\r\n // Result exponent may be one less then the current value of e.\r\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r\n for (i = 0; yc[i] == (xc[i] || 0); i++);\r\n\r\n if (yc[i] > (xc[i] || 0)) e--;\r\n\r\n if (s < 0) {\r\n qc.push(1);\r\n more = true;\r\n } else {\r\n xL = xc.length;\r\n yL = yc.length;\r\n i = 0;\r\n s += 2;\r\n\r\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\r\n\r\n n = mathfloor(base / (yc[0] + 1));\r\n\r\n // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.\r\n // if (n > 1 || n++ == 1 && yc[0] < base / 2) {\r\n if (n > 1) {\r\n yc = multiply(yc, n, base);\r\n xc = multiply(xc, n, base);\r\n yL = yc.length;\r\n xL = xc.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xc.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL; rem[remL++] = 0);\r\n yz = yc.slice();\r\n yz = [0].concat(yz);\r\n yc0 = yc[0];\r\n if (yc[1] >= base / 2) yc0++;\r\n // Not necessary, but to prevent trial digit n > base, when using base 3.\r\n // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;\r\n\r\n do {\r\n n = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yc, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, n.\r\n\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // n is how many times the divisor goes into the current remainder.\r\n n = mathfloor(rem0 / yc0);\r\n\r\n // Algorithm:\r\n // product = divisor multiplied by trial digit (n).\r\n // Compare product and remainder.\r\n // If product is greater than remainder:\r\n // Subtract divisor from product, decrement trial digit.\r\n // Subtract product from remainder.\r\n // If product was less than remainder at the last compare:\r\n // Compare new remainder and divisor.\r\n // If remainder is greater than divisor:\r\n // Subtract divisor from remainder, increment trial digit.\r\n\r\n if (n > 1) {\r\n\r\n // n may be > base only when base is 3.\r\n if (n >= base) n = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiply(yc, n, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n // If product > remainder then trial digit n too high.\r\n // n is 1 too high about 5% of the time, and is not known to have\r\n // ever been more than 1 too high.\r\n while (compare(prod, rem, prodL, remL) == 1) {\r\n n--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yc, prodL, base);\r\n prodL = prod.length;\r\n cmp = 1;\r\n }\r\n } else {\r\n\r\n // n is 0 or 1, cmp is -1.\r\n // If n is 0, there is no need to compare yc and rem again below,\r\n // so change cmp to 1 to avoid it.\r\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\r\n if (n == 0) {\r\n\r\n // divisor < remainder, so n must be at least 1.\r\n cmp = n = 1;\r\n }\r\n\r\n // product = divisor\r\n prod = yc.slice();\r\n prodL = prod.length;\r\n }\r\n\r\n if (prodL < remL) prod = [0].concat(prod);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n remL = rem.length;\r\n\r\n // If product was < remainder.\r\n if (cmp == -1) {\r\n\r\n // Compare divisor and new remainder.\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n // Trial digit n too low.\r\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\r\n while (compare(yc, rem, yL, remL) < 1) {\r\n n++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yc, remL, base);\r\n remL = rem.length;\r\n }\r\n }\r\n } else if (cmp === 0) {\r\n n++;\r\n rem = [0];\r\n } // else cmp === 1 and n will be 0\r\n\r\n // Add the next digit, n, to the result array.\r\n qc[i++] = n;\r\n\r\n // Update the remainder.\r\n if (rem[0]) {\r\n rem[remL++] = xc[xi] || 0;\r\n } else {\r\n rem = [xc[xi]];\r\n remL = 1;\r\n }\r\n } while ((xi++ < xL || rem[0] != null) && s--);\r\n\r\n more = rem[0] != null;\r\n\r\n // Leading zero?\r\n if (!qc[0]) qc.splice(0, 1);\r\n }\r\n\r\n if (base == BASE) {\r\n\r\n // To calculate q.e, first get the number of digits of qc[0].\r\n for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);\r\n\r\n round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);\r\n\r\n // Caller is convertBase.\r\n } else {\r\n q.e = e;\r\n q.r = +more;\r\n }\r\n\r\n return q;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a string representing the value of BigNumber n in fixed-point or exponential\r\n * notation rounded to the specified decimal places or significant digits.\r\n *\r\n * n: a BigNumber.\r\n * i: the index of the last digit required (i.e. the digit that may be rounded up).\r\n * rm: the rounding mode.\r\n * id: 1 (toExponential) or 2 (toPrecision).\r\n */\r\n function format(n, i, rm, id) {\r\n var c0, e, ne, len, str;\r\n\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n if (!n.c) return n.toString();\r\n\r\n c0 = n.c[0];\r\n ne = n.e;\r\n\r\n if (i == null) {\r\n str = coeffToString(n.c);\r\n str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)\r\n ? toExponential(str, ne)\r\n : toFixedPoint(str, ne, '0');\r\n } else {\r\n n = round(new BigNumber(n), i, rm);\r\n\r\n // n.e may have changed if the value was rounded up.\r\n e = n.e;\r\n\r\n str = coeffToString(n.c);\r\n len = str.length;\r\n\r\n // toPrecision returns exponential notation if the number of significant digits\r\n // specified is less than the number of digits necessary to represent the integer\r\n // part of the value in fixed-point notation.\r\n\r\n // Exponential notation.\r\n if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {\r\n\r\n // Append zeros?\r\n for (; len < i; str += '0', len++);\r\n str = toExponential(str, e);\r\n\r\n // Fixed-point notation.\r\n } else {\r\n i -= ne + (id === 2 && e > ne);\r\n str = toFixedPoint(str, e, '0');\r\n\r\n // Append zeros?\r\n if (e + 1 > len) {\r\n if (--i > 0) for (str += '.'; i--; str += '0');\r\n } else {\r\n i += e - len;\r\n if (i > 0) {\r\n if (e + 1 == len) str += '.';\r\n for (; i--; str += '0');\r\n }\r\n }\r\n }\r\n }\r\n\r\n return n.s < 0 && c0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Handle BigNumber.max and BigNumber.min.\r\n // If any number is NaN, return NaN.\r\n function maxOrMin(args, n) {\r\n var k, y,\r\n i = 1,\r\n x = new BigNumber(args[0]);\r\n\r\n for (; i < args.length; i++) {\r\n y = new BigNumber(args[i]);\r\n if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r\n * Called by minus, plus and times.\r\n */\r\n function normalise(n, c, e) {\r\n var i = 1,\r\n j = c.length;\r\n\r\n // Remove trailing zeros.\r\n for (; !c[--j]; c.pop());\r\n\r\n // Calculate the base 10 exponent. First get the number of digits of c[0].\r\n for (j = c[0]; j >= 10; j /= 10, i++);\r\n\r\n // Overflow?\r\n if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n n.c = n.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n n.c = [n.e = 0];\r\n } else {\r\n n.e = e;\r\n n.c = c;\r\n }\r\n\r\n return n;\r\n }\r\n\r\n\r\n // Handle values that fail the validity test in BigNumber.\r\n parseNumeric = (function () {\r\n var basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\r\n dotAfter = /^([^.]+)\\.$/,\r\n dotBefore = /^\\.([^.]+)$/,\r\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r\n whitespaceOrPlus = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\r\n\r\n return function (x, str, isNum, b) {\r\n var base,\r\n s = isNum ? str : str.replace(whitespaceOrPlus, '');\r\n\r\n // No exception on ±Infinity or NaN.\r\n if (isInfinityOrNaN.test(s)) {\r\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r\n } else {\r\n if (!isNum) {\r\n\r\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\r\n s = s.replace(basePrefix, function (m, p1, p2) {\r\n base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r\n return !b || b == base ? p1 : m;\r\n });\r\n\r\n if (b) {\r\n base = b;\r\n\r\n // E.g. '1.' to '1', '.1' to '0.1'\r\n s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');\r\n }\r\n\r\n if (str != s) return new BigNumber(s, base);\r\n }\r\n\r\n // '[BigNumber Error] Not a number: {n}'\r\n // '[BigNumber Error] Not a base {b} number: {n}'\r\n if (BigNumber.DEBUG) {\r\n throw Error\r\n (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);\r\n }\r\n\r\n // NaN\r\n x.s = null;\r\n }\r\n\r\n x.c = x.e = null;\r\n }\r\n })();\r\n\r\n\r\n /*\r\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r\n * If r is truthy, it is known that there are more digits after the rounding digit.\r\n */\r\n function round(x, sd, rm, r) {\r\n var d, i, j, k, n, ni, rd,\r\n xc = x.c,\r\n pows10 = POWS_TEN;\r\n\r\n // if x is not Infinity or NaN...\r\n if (xc) {\r\n\r\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\r\n // ni is the index of n within x.c.\r\n // d is the number of digits of n.\r\n // i is the index of rd within n including leading zeros.\r\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\r\n out: {\r\n\r\n // Get the number of digits of the first element of xc.\r\n for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);\r\n i = sd - d;\r\n\r\n // If the rounding digit is in the first element of xc...\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n n = xc[ni = 0];\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = mathfloor(n / pows10[d - j - 1] % 10);\r\n } else {\r\n ni = mathceil((i + 1) / LOG_BASE);\r\n\r\n if (ni >= xc.length) {\r\n\r\n if (r) {\r\n\r\n // Needed by sqrt.\r\n for (; xc.length <= ni; xc.push(0));\r\n n = rd = 0;\r\n d = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n n = k = xc[ni];\r\n\r\n // Get the number of digits of n.\r\n for (d = 1; k >= 10; k /= 10, d++);\r\n\r\n // Get the index of rd within n.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within n, adjusted for leading zeros.\r\n // The number of leading zeros of n is given by LOG_BASE - d.\r\n j = i - LOG_BASE + d;\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);\r\n }\r\n }\r\n\r\n r = r || sd < 0 ||\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n // The expression n % pows10[d - j - 1] returns all digits of n to the right\r\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r\n xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);\r\n\r\n r = rm < 4\r\n ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xc[0]) {\r\n xc.length = 0;\r\n\r\n if (r) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xc.length = ni;\r\n k = 1;\r\n ni--;\r\n } else {\r\n xc.length = ni + 1;\r\n k = pows10[LOG_BASE - i];\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of n.\r\n xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;\r\n }\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n for (; ;) {\r\n\r\n // If the digit to be rounded up is in the first element of xc...\r\n if (ni == 0) {\r\n\r\n // i will be the length of xc[0] before k is added.\r\n for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);\r\n j = xc[0] += k;\r\n for (k = 1; j >= 10; j /= 10, k++);\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xc[0] == BASE) xc[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xc[ni] += k;\r\n if (xc[ni] != BASE) break;\r\n xc[ni--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xc.length; xc[--i] === 0; xc.pop());\r\n }\r\n\r\n // Overflow? Infinity.\r\n if (x.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n\r\n // Underflow? Zero.\r\n } else if (x.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function valueOf(n) {\r\n var str,\r\n e = n.e;\r\n\r\n if (e === null) return n.toString();\r\n\r\n str = coeffToString(n.c);\r\n\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(str, e)\r\n : toFixedPoint(str, e, '0');\r\n\r\n return n.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // PROTOTYPE/INSTANCE METHODS\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new BigNumber(this);\r\n if (x.s < 0) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * 0 if they have the same value,\r\n * or null if the value of either is NaN.\r\n */\r\n P.comparedTo = function (y, b) {\r\n return compare(this, new BigNumber(y, b));\r\n };\r\n\r\n\r\n /*\r\n * If dp is undefined or null or true or false, return the number of decimal places of the\r\n * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n *\r\n * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.decimalPlaces = P.dp = function (dp, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), dp + x.e + 1, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last number.\r\n if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);\r\n if (n < 0) n = 0;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.dividedBy = P.div = function (y, b) {\r\n return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the integer part of dividing the value of this\r\n * BigNumber by the value of BigNumber(y, b).\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y, b) {\r\n return div(this, new BigNumber(y, b), 0, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r\n *\r\n * If m is present, return the result modulo m.\r\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r\n * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r\n *\r\n * The modular power operation works efficiently when x, n, and m are integers, otherwise it\r\n * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r\n *\r\n * n {number|string|BigNumber} The exponent. An integer.\r\n * [m] {number|string|BigNumber} The modulus.\r\n *\r\n * '[BigNumber Error] Exponent not an integer: {n}'\r\n */\r\n P.exponentiatedBy = P.pow = function (n, m) {\r\n var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,\r\n x = this;\r\n\r\n n = new BigNumber(n);\r\n\r\n // Allow NaN and ±Infinity, but not other non-integers.\r\n if (n.c && !n.isInteger()) {\r\n throw Error\r\n (bignumberError + 'Exponent not an integer: ' + valueOf(n));\r\n }\r\n\r\n if (m != null) m = new BigNumber(m);\r\n\r\n // Exponent of MAX_SAFE_INTEGER is 15.\r\n nIsBig = n.e > 14;\r\n\r\n // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.\r\n if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {\r\n\r\n // The sign of the result of pow when x is negative depends on the evenness of n.\r\n // If +n overflows to ±Infinity, the evenness of n would be not be known.\r\n y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));\r\n return m ? y.mod(m) : y;\r\n }\r\n\r\n nIsNeg = n.s < 0;\r\n\r\n if (m) {\r\n\r\n // x % m returns NaN if abs(m) is zero, or m is NaN.\r\n if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);\r\n\r\n isModExp = !nIsNeg && x.isInteger() && m.isInteger();\r\n\r\n if (isModExp) x = x.mod(m);\r\n\r\n // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.\r\n // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.\r\n } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0\r\n // [1, 240000000]\r\n ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7\r\n // [80000000000000] [99999750000000]\r\n : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {\r\n\r\n // If x is negative and n is odd, k = -0, else k = 0.\r\n k = x.s < 0 && isOdd(n) ? -0 : 0;\r\n\r\n // If x >= 1, k = ±Infinity.\r\n if (x.e > -1) k = 1 / k;\r\n\r\n // If n is negative return ±0, else return ±Infinity.\r\n return new BigNumber(nIsNeg ? 1 / k : k);\r\n\r\n } else if (POW_PRECISION) {\r\n\r\n // Truncating each coefficient array to a length of k after each multiplication\r\n // equates to truncating significant digits to POW_PRECISION + [28, 41],\r\n // i.e. there will be a minimum of 28 guard digits retained.\r\n k = mathceil(POW_PRECISION / LOG_BASE + 2);\r\n }\r\n\r\n if (nIsBig) {\r\n half = new BigNumber(0.5);\r\n if (nIsNeg) n.s = 1;\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = Math.abs(+valueOf(n));\r\n nIsOdd = i % 2;\r\n }\r\n\r\n y = new BigNumber(ONE);\r\n\r\n // Performs 54 loop iterations for n of 9007199254740991.\r\n for (; ;) {\r\n\r\n if (nIsOdd) {\r\n y = y.times(x);\r\n if (!y.c) break;\r\n\r\n if (k) {\r\n if (y.c.length > k) y.c.length = k;\r\n } else if (isModExp) {\r\n y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (i) {\r\n i = mathfloor(i / 2);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n } else {\r\n n = n.times(half);\r\n round(n, n.e + 1, 1);\r\n\r\n if (n.e > 14) {\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = +valueOf(n);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n }\r\n }\r\n\r\n x = x.times(x);\r\n\r\n if (k) {\r\n if (x.c && x.c.length > k) x.c.length = k;\r\n } else if (isModExp) {\r\n x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (isModExp) return y;\r\n if (nIsNeg) y = ONE.div(y);\r\n\r\n return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r\n * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r\n */\r\n P.integerValue = function (rm) {\r\n var n = new BigNumber(this);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n return round(n, n.e + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isEqualTo = P.eq = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is a finite number, otherwise return false.\r\n */\r\n P.isFinite = function () {\r\n return !!this.c;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isGreaterThan = P.gt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isGreaterThanOrEqualTo = P.gte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;\r\n\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is an integer, otherwise return false.\r\n */\r\n P.isInteger = function () {\r\n return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isLessThan = P.lt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isLessThanOrEqualTo = P.lte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is NaN, otherwise return false.\r\n */\r\n P.isNaN = function () {\r\n return !this.s;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is negative, otherwise return false.\r\n */\r\n P.isNegative = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is positive, otherwise return false.\r\n */\r\n P.isPositive = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r\n */\r\n P.isZero = function () {\r\n return !!this.c && this.c[0] == 0;\r\n };\r\n\r\n\r\n /*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.minus = function (y, b) {\r\n var i, j, t, xLTy,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :\r\n\r\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r\n ROUNDING_MODE == 3 ? -0 : 0);\r\n }\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Determine which is the bigger number.\r\n if (a = xe - ye) {\r\n\r\n if (xLTy = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n\r\n // Prepend zeros to equalise exponents.\r\n for (b = a; b--; t.push(0));\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n\r\n if (xc[b] != yc[b]) {\r\n xLTy = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xLTy) {\r\n t = xc;\r\n xc = yc;\r\n yc = t;\r\n y.s = -y.s;\r\n }\r\n\r\n b = (j = yc.length) - (i = xc.length);\r\n\r\n // Append zeros to xc if shorter.\r\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r\n if (b > 0) for (; b--; xc[i++] = 0);\r\n b = BASE - 1;\r\n\r\n // Subtract yc from xc.\r\n for (; j > a;) {\r\n\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i]; xc[i] = b);\r\n --xc[i];\r\n xc[j] += BASE;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] == 0; xc.splice(0, 1), --ye);\r\n\r\n // Zero?\r\n if (!xc[0]) {\r\n\r\n // Following IEEE 754 (2008) 6.3,\r\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\r\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r\n // for finite x and y.\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r\n */\r\n P.modulo = P.mod = function (y, b) {\r\n var q, s,\r\n x = this;\r\n\r\n y = new BigNumber(y, b);\r\n\r\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r\n if (!x.c || !y.s || y.c && !y.c[0]) {\r\n return new BigNumber(NaN);\r\n\r\n // Return x if y is Infinity or x is zero.\r\n } else if (!y.c || x.c && !x.c[0]) {\r\n return new BigNumber(x);\r\n }\r\n\r\n if (MODULO_MODE == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // r = x - qy where 0 <= r < abs(y)\r\n s = y.s;\r\n y.s = 1;\r\n q = div(x, y, 0, 3);\r\n y.s = s;\r\n q.s *= s;\r\n } else {\r\n q = div(x, y, 0, MODULO_MODE);\r\n }\r\n\r\n y = x.minus(q.times(y));\r\n\r\n // To match JavaScript %, ensure sign of zero is sign of dividend.\r\n if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r\n * of BigNumber(y, b).\r\n */\r\n P.multipliedBy = P.times = function (y, b) {\r\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r\n base, sqrtBase,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new BigNumber(y, b)).c;\r\n\r\n // Either NaN, ±Infinity or ±0?\r\n if (!xc || !yc || !xc[0] || !yc[0]) {\r\n\r\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r\n if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {\r\n y.c = y.e = y.s = null;\r\n } else {\r\n y.s *= x.s;\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n if (!xc || !yc) {\r\n y.c = y.e = null;\r\n\r\n // Return ±0 if either is ±0.\r\n } else {\r\n y.c = [0];\r\n y.e = 0;\r\n }\r\n }\r\n\r\n return y;\r\n }\r\n\r\n e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);\r\n y.s *= x.s;\r\n xcL = xc.length;\r\n ycL = yc.length;\r\n\r\n // Ensure xc points to longer array and xcL to its length.\r\n if (xcL < ycL) {\r\n zc = xc;\r\n xc = yc;\r\n yc = zc;\r\n i = xcL;\r\n xcL = ycL;\r\n ycL = i;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n for (i = xcL + ycL, zc = []; i--; zc.push(0));\r\n\r\n base = BASE;\r\n sqrtBase = SQRT_BASE;\r\n\r\n for (i = ycL; --i >= 0;) {\r\n c = 0;\r\n ylo = yc[i] % sqrtBase;\r\n yhi = yc[i] / sqrtBase | 0;\r\n\r\n for (k = xcL, j = i + k; j > i;) {\r\n xlo = xc[--k] % sqrtBase;\r\n xhi = xc[k] / sqrtBase | 0;\r\n m = yhi * xlo + xhi * ylo;\r\n xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;\r\n c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;\r\n zc[j--] = xlo % base;\r\n }\r\n\r\n zc[j] = c;\r\n }\r\n\r\n if (c) {\r\n ++e;\r\n } else {\r\n zc.splice(0, 1);\r\n }\r\n\r\n return normalise(y, zc, e);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber negated,\r\n * i.e. multiplied by -1.\r\n */\r\n P.negated = function () {\r\n var x = new BigNumber(this);\r\n x.s = -x.s || null;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.plus = function (y, b) {\r\n var t,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Return ±Infinity if either ±Infinity.\r\n if (!xc || !yc) return new BigNumber(a / 0);\r\n\r\n // Either zero?\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r\n if (a = xe - ye) {\r\n if (a > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n a = -a;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; a--; t.push(0));\r\n t.reverse();\r\n }\r\n\r\n a = xc.length;\r\n b = yc.length;\r\n\r\n // Point xc to the longer array, and b to the shorter length.\r\n if (a - b < 0) {\r\n t = yc;\r\n yc = xc;\r\n xc = t;\r\n b = a;\r\n }\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r\n for (a = 0; b;) {\r\n a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;\r\n xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r\n }\r\n\r\n if (a) {\r\n xc = [a].concat(xc);\r\n ++ye;\r\n }\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n // ye = MAX_EXP + 1 possible\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * If sd is undefined or null or true or false, return the number of significant digits of\r\n * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n * If sd is true include integer-part trailing zeros in the count.\r\n *\r\n * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r\n * boolean: whether to count integer-part trailing zeros: true or false.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.precision = P.sd = function (sd, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (sd != null && sd !== !!sd) {\r\n intCheck(sd, 1, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), sd, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n v = c.length - 1;\r\n n = v * LOG_BASE + 1;\r\n\r\n if (v = c[v]) {\r\n\r\n // Subtract the number of trailing zeros of the last element.\r\n for (; v % 10 == 0; v /= 10, n--);\r\n\r\n // Add the number of digits of the first element.\r\n for (v = c[0]; v >= 10; v /= 10, n++);\r\n }\r\n\r\n if (sd && x.e + 1 > n) n = x.e + 1;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r\n *\r\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r\n */\r\n P.shiftedBy = function (k) {\r\n intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);\r\n return this.times('1e' + k);\r\n };\r\n\r\n\r\n /*\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var m, n, r, rep, t,\r\n x = this,\r\n c = x.c,\r\n s = x.s,\r\n e = x.e,\r\n dp = DECIMAL_PLACES + 4,\r\n half = new BigNumber('0.5');\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !c || !c[0]) {\r\n return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);\r\n }\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+valueOf(x));\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = coeffToString(c);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(+n);\r\n e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new BigNumber(n);\r\n } else {\r\n r = new BigNumber(s + '');\r\n }\r\n\r\n // Check for zero.\r\n // r could be zero if MIN_EXP is changed after the this value was created.\r\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r\n // coeffToString to throw.\r\n if (r.c[0]) {\r\n e = r.e;\r\n s = e + dp;\r\n if (s < 3) s = 0;\r\n\r\n // Newton-Raphson iteration.\r\n for (; ;) {\r\n t = r;\r\n r = half.times(t.plus(div(x, t, dp, 1)));\r\n\r\n if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {\r\n\r\n // The exponent of r may here be one less than the final result exponent,\r\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\r\n // are indexed correctly.\r\n if (r.e < e) --s;\r\n n = n.slice(s - 3, s + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r\n // iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the\r\n // exact result as the nines may infinitely repeat.\r\n if (!rep) {\r\n round(t, t.e + DECIMAL_PLACES + 2, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n dp += 4;\r\n s += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r\n // result. If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n round(r, r.e + DECIMAL_PLACES + 2, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in exponential notation and\r\n * rounded using ROUNDING_MODE to dp fixed decimal places.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toExponential = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp++;\r\n }\r\n return format(this, dp, rm, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\r\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r\n * but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toFixed = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp = dp + this.e + 1;\r\n }\r\n return format(this, dp, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\r\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r\n * of the format or FORMAT object (see BigNumber.set).\r\n *\r\n * The formatting object may contain some or all of the properties shown below.\r\n *\r\n * FORMAT = {\r\n * prefix: '',\r\n * groupSize: 3,\r\n * secondaryGroupSize: 0,\r\n * groupSeparator: ',',\r\n * decimalSeparator: '.',\r\n * fractionGroupSize: 0,\r\n * fractionGroupSeparator: '\\xA0', // non-breaking space\r\n * suffix: ''\r\n * };\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n * [format] {object} Formatting options. See FORMAT pbject above.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n * '[BigNumber Error] Argument not an object: {format}'\r\n */\r\n P.toFormat = function (dp, rm, format) {\r\n var str,\r\n x = this;\r\n\r\n if (format == null) {\r\n if (dp != null && rm && typeof rm == 'object') {\r\n format = rm;\r\n rm = null;\r\n } else if (dp && typeof dp == 'object') {\r\n format = dp;\r\n dp = rm = null;\r\n } else {\r\n format = FORMAT;\r\n }\r\n } else if (typeof format != 'object') {\r\n throw Error\r\n (bignumberError + 'Argument not an object: ' + format);\r\n }\r\n\r\n str = x.toFixed(dp, rm);\r\n\r\n if (x.c) {\r\n var i,\r\n arr = str.split('.'),\r\n g1 = +format.groupSize,\r\n g2 = +format.secondaryGroupSize,\r\n groupSeparator = format.groupSeparator || '',\r\n intPart = arr[0],\r\n fractionPart = arr[1],\r\n isNeg = x.s < 0,\r\n intDigits = isNeg ? intPart.slice(1) : intPart,\r\n len = intDigits.length;\r\n\r\n if (g2) {\r\n i = g1;\r\n g1 = g2;\r\n g2 = i;\r\n len -= i;\r\n }\r\n\r\n if (g1 > 0 && len > 0) {\r\n i = len % g1 || g1;\r\n intPart = intDigits.substr(0, i);\r\n for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);\r\n if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);\r\n if (isNeg) intPart = '-' + intPart;\r\n }\r\n\r\n str = fractionPart\r\n ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)\r\n ? fractionPart.replace(new RegExp('\\\\d{' + g2 + '}\\\\B', 'g'),\r\n '$&' + (format.fractionGroupSeparator || ''))\r\n : fractionPart)\r\n : intPart;\r\n }\r\n\r\n return (format.prefix || '') + str + (format.suffix || '');\r\n };\r\n\r\n\r\n /*\r\n * Return an array of two BigNumbers representing the value of this BigNumber as a simple\r\n * fraction with an integer numerator and an integer denominator.\r\n * The denominator will be a positive non-zero value less than or equal to the specified\r\n * maximum denominator. If a maximum denominator is not specified, the denominator will be\r\n * the lowest value necessary to represent the number exactly.\r\n *\r\n * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.\r\n *\r\n * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r\n */\r\n P.toFraction = function (md) {\r\n var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,\r\n x = this,\r\n xc = x.c;\r\n\r\n if (md != null) {\r\n n = new BigNumber(md);\r\n\r\n // Throw if md is less than one or is not an integer, unless it is Infinity.\r\n if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {\r\n throw Error\r\n (bignumberError + 'Argument ' +\r\n (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));\r\n }\r\n }\r\n\r\n if (!xc) return new BigNumber(x);\r\n\r\n d = new BigNumber(ONE);\r\n n1 = d0 = new BigNumber(ONE);\r\n d1 = n0 = new BigNumber(ONE);\r\n s = coeffToString(xc);\r\n\r\n // Determine initial denominator.\r\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r\n e = d.e = s.length - x.e - 1;\r\n d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];\r\n md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;\r\n\r\n exp = MAX_EXP;\r\n MAX_EXP = 1 / 0;\r\n n = new BigNumber(s);\r\n\r\n // n0 = d1 = 0\r\n n0.c[0] = 0;\r\n\r\n for (; ;) {\r\n q = div(n, d, 0, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.comparedTo(md) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n n1 = n0.plus(q.times(d2 = n1));\r\n n0 = d2;\r\n d = n.minus(q.times(d2 = d));\r\n n = d2;\r\n }\r\n\r\n d2 = div(md.minus(d0), d1, 0, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n e = e * 2;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1\r\n r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(\r\n div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\r\n\r\n MAX_EXP = exp;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this BigNumber converted to a number primitive.\r\n */\r\n P.toNumber = function () {\r\n return +valueOf(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber rounded to sd significant digits\r\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r\n * necessary to represent the integer part of the value in fixed-point notation, then use\r\n * exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n if (sd != null) intCheck(sd, 1, MAX);\r\n return format(this, sd, rm, 2);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r\n * TO_EXP_NEG, return exponential notation.\r\n *\r\n * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r\n *\r\n * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n */\r\n P.toString = function (b) {\r\n var str,\r\n n = this,\r\n s = n.s,\r\n e = n.e;\r\n\r\n // Infinity or NaN?\r\n if (e === null) {\r\n if (s) {\r\n str = 'Infinity';\r\n if (s < 0) str = '-' + str;\r\n } else {\r\n str = 'NaN';\r\n }\r\n } else {\r\n if (b == null) {\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(coeffToString(n.c), e)\r\n : toFixedPoint(coeffToString(n.c), e, '0');\r\n } else if (b === 10 && alphabetHasNormalDecimalDigits) {\r\n n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);\r\n str = toFixedPoint(coeffToString(n.c), n.e, '0');\r\n } else {\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);\r\n }\r\n\r\n if (s < 0 && n.c[0]) str = '-' + str;\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return as toString, but do not accept a base argument, and include the minus sign for\r\n * negative zero.\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n return valueOf(this);\r\n };\r\n\r\n\r\n P._isBigNumber = true;\r\n\r\n if (configObject != null) BigNumber.set(configObject);\r\n\r\n return BigNumber;\r\n }\r\n\r\n\r\n // PRIVATE HELPER FUNCTIONS\r\n\r\n // These functions don't need access to variables,\r\n // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.\r\n\r\n\r\n function bitFloor(n) {\r\n var i = n | 0;\r\n return n > 0 || n === i ? i : i - 1;\r\n }\r\n\r\n\r\n // Return a coefficient array as a string of base 10 digits.\r\n function coeffToString(a) {\r\n var s, z,\r\n i = 1,\r\n j = a.length,\r\n r = a[0] + '';\r\n\r\n for (; i < j;) {\r\n s = a[i++] + '';\r\n z = LOG_BASE - s.length;\r\n for (; z--; s = '0' + s);\r\n r += s;\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (j = r.length; r.charCodeAt(--j) === 48;);\r\n\r\n return r.slice(0, j + 1 || 1);\r\n }\r\n\r\n\r\n // Compare the value of BigNumbers x and y.\r\n function compare(x, y) {\r\n var a, b,\r\n xc = x.c,\r\n yc = y.c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either NaN?\r\n if (!i || !j) return null;\r\n\r\n a = xc && !xc[0];\r\n b = yc && !yc[0];\r\n\r\n // Either zero?\r\n if (a || b) return a ? b ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n a = i < 0;\r\n b = k == l;\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;\r\n\r\n // Compare exponents.\r\n if (!b) return k > l ^ a ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ a ? 1 : -1;\r\n }\r\n\r\n\r\n /*\r\n * Check that n is a primitive number, an integer, and in range, otherwise throw.\r\n */\r\n function intCheck(n, min, max, name) {\r\n if (n < min || n > max || n !== mathfloor(n)) {\r\n throw Error\r\n (bignumberError + (name || 'Argument') + (typeof n == 'number'\r\n ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r\n : ' not a primitive number: ') + String(n));\r\n }\r\n }\r\n\r\n\r\n // Assumes finite n.\r\n function isOdd(n) {\r\n var k = n.c.length - 1;\r\n return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;\r\n }\r\n\r\n\r\n function toExponential(str, e) {\r\n return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +\r\n (e < 0 ? 'e' : 'e+') + e;\r\n }\r\n\r\n\r\n function toFixedPoint(str, e, z) {\r\n var len, zs;\r\n\r\n // Negative exponent?\r\n if (e < 0) {\r\n\r\n // Prepend zeros.\r\n for (zs = z + '.'; ++e; zs += z);\r\n str = zs + str;\r\n\r\n // Positive exponent\r\n } else {\r\n len = str.length;\r\n\r\n // Append zeros.\r\n if (++e > len) {\r\n for (zs = z, e -= len; --e; zs += z);\r\n str += zs;\r\n } else if (e < len) {\r\n str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n return str;\r\n }\r\n\r\n\r\n // EXPORT\r\n\r\n\r\n BigNumber = clone();\r\n BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () { return BigNumber; });\r\n\r\n // Node.js and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = BigNumber;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalObject) {\r\n globalObject = typeof self != 'undefined' && self ? self : window;\r\n }\r\n\r\n globalObject.BigNumber = BigNumber;\r\n }\r\n})(this);\r\n",
13
+ "var BigNumber = require('bignumber.js');\n\n/*\n json2.js\n 2013-05-26\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n See http://www.JSON.org/js.html\n\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n\n\n This file creates a global JSON object containing two methods: stringify\n and parse.\n\n JSON.stringify(value, replacer, space)\n value any JavaScript value, usually an object or array.\n\n replacer an optional parameter that determines how object\n values are stringified for objects. It can be a\n function or an array of strings.\n\n space an optional parameter that specifies the indentation\n of nested structures. If it is omitted, the text will\n be packed without extra whitespace. If it is a number,\n it will specify the number of spaces to indent at each\n level. If it is a string (such as '\\t' or '&nbsp;'),\n it contains the characters used to indent at each level.\n\n This method produces a JSON text from a JavaScript value.\n\n When an object value is found, if the object contains a toJSON\n method, its toJSON method will be called and the result will be\n stringified. A toJSON method does not serialize: it returns the\n value represented by the name/value pair that should be serialized,\n or undefined if nothing should be serialized. The toJSON method\n will be passed the key associated with the value, and this will be\n bound to the value\n\n For example, this would serialize Dates as ISO strings.\n\n Date.prototype.toJSON = function (key) {\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n return this.getUTCFullYear() + '-' +\n f(this.getUTCMonth() + 1) + '-' +\n f(this.getUTCDate()) + 'T' +\n f(this.getUTCHours()) + ':' +\n f(this.getUTCMinutes()) + ':' +\n f(this.getUTCSeconds()) + 'Z';\n };\n\n You can provide an optional replacer method. It will be passed the\n key and value of each member, with this bound to the containing\n object. The value that is returned from your method will be\n serialized. If your method returns undefined, then the member will\n be excluded from the serialization.\n\n If the replacer parameter is an array of strings, then it will be\n used to select the members to be serialized. It filters the results\n such that only members with keys listed in the replacer array are\n stringified.\n\n Values that do not have JSON representations, such as undefined or\n functions, will not be serialized. Such values in objects will be\n dropped; in arrays they will be replaced with null. You can use\n a replacer function to replace those with JSON values.\n JSON.stringify(undefined) returns undefined.\n\n The optional space parameter produces a stringification of the\n value that is filled with line breaks and indentation to make it\n easier to read.\n\n If the space parameter is a non-empty string, then that string will\n be used for indentation. If the space parameter is a number, then\n the indentation will be that many spaces.\n\n Example:\n\n text = JSON.stringify(['e', {pluribus: 'unum'}]);\n // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n\n text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\\t');\n // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n text = JSON.stringify([new Date()], function (key, value) {\n return this[key] instanceof Date ?\n 'Date(' + this[key] + ')' : value;\n });\n // text is '[\"Date(---current time---)\"]'\n\n\n JSON.parse(text, reviver)\n This method parses a JSON text to produce an object or array.\n It can throw a SyntaxError exception.\n\n The optional reviver parameter is a function that can filter and\n transform the results. It receives each of the keys and values,\n and its return value is used instead of the original value.\n If it returns what it received, then the structure is not modified.\n If it returns undefined then the member is deleted.\n\n Example:\n\n // Parse the text. Values that look like ISO date strings will\n // be converted to Date objects.\n\n myData = JSON.parse(text, function (key, value) {\n var a;\n if (typeof value === 'string') {\n a =\n/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n if (a) {\n return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n +a[5], +a[6]));\n }\n }\n return value;\n });\n\n myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n var d;\n if (typeof value === 'string' &&\n value.slice(0, 5) === 'Date(' &&\n value.slice(-1) === ')') {\n d = new Date(value.slice(5, -1));\n if (d) {\n return d;\n }\n }\n return value;\n });\n\n\n This is a reference implementation. You are free to copy, modify, or\n redistribute.\n*/\n\n/*jslint evil: true, regexp: true */\n\n/*members \"\", \"\\b\", \"\\t\", \"\\n\", \"\\f\", \"\\r\", \"\\\"\", JSON, \"\\\\\", apply,\n call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n*/\n\n\n// Create a JSON object only if one does not already exist. We create the\n// methods in a closure to avoid creating global variables.\n\nvar JSON = module.exports;\n\n(function () {\n 'use strict';\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n gap,\n indent,\n meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n },\n rep;\n\n\n function quote(string) {\n\n// If the string contains no control characters, no quote characters, and no\n// backslash characters, then we can safely slap some quotes around it.\n// Otherwise we must also replace the offending characters with safe escape\n// sequences.\n\n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string'\n ? c\n : '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n }\n\n\n function str(key, holder) {\n\n// Produce a string from holder[key].\n\n var i, // The loop counter.\n k, // The member key.\n v, // The member value.\n length,\n mind = gap,\n partial,\n value = holder[key],\n isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));\n\n// If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n// If we were called with a replacer function, then call the replacer to\n// obtain a replacement value.\n\n if (typeof rep === 'function') {\n value = rep.call(holder, key, value);\n }\n\n// What happens next depends on the value's type.\n\n switch (typeof value) {\n case 'string':\n if (isBigNumber) {\n return value;\n } else {\n return quote(value);\n }\n\n case 'number':\n\n// JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n case 'bigint':\n\n// If the value is a boolean or null, convert it to a string. Note:\n// typeof null does not produce 'null'. The case is included here in\n// the remote chance that this gets fixed someday.\n\n return String(value);\n\n// If the type is 'object', we might be dealing with an object or an array or\n// null.\n\n case 'object':\n\n// Due to a specification blunder in ECMAScript, typeof null is 'object',\n// so watch out for that case.\n\n if (!value) {\n return 'null';\n }\n\n// Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n// Is the value an array?\n\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n\n// The value is an array. Stringify every element. Use null as a placeholder\n// for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n// Join all of the elements together, separated with commas, and wrap them in\n// brackets.\n\n v = partial.length === 0\n ? '[]'\n : gap\n ? '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + ']'\n : '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n// If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === 'object') {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === 'string') {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n } else {\n\n// Otherwise, iterate through all of the keys in the object.\n\n Object.keys(value).forEach(function(k) {\n var v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n });\n }\n\n// Join all of the member texts together, separated with commas,\n// and wrap them in braces.\n\n v = partial.length === 0\n ? '{}'\n : gap\n ? '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + '}'\n : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n }\n\n// If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== 'function') {\n JSON.stringify = function (value, replacer, space) {\n\n// The stringify method takes a value and an optional replacer, and an optional\n// space parameter, and returns a JSON text. The replacer can be a function\n// that can replace values, or an array of strings that will select the keys.\n// A default replacer method can be provided. Use of the space parameter can\n// produce text that is more easily readable.\n\n var i;\n gap = '';\n indent = '';\n\n// If the space parameter is a number, make an indent string containing that\n// many spaces.\n\n if (typeof space === 'number') {\n for (i = 0; i < space; i += 1) {\n indent += ' ';\n }\n\n// If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === 'string') {\n indent = space;\n }\n\n// If there is a replacer, it must be a function or an array.\n// Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== 'function' &&\n (typeof replacer !== 'object' ||\n typeof replacer.length !== 'number')) {\n throw new Error('JSON.stringify');\n }\n\n// Make a fake root object containing our value under the key of ''.\n// Return the result of stringifying the value.\n\n return str('', {'': value});\n };\n }\n}());\n",
14
+ "var BigNumber = null;\n\n// regexpxs extracted from\n// (c) BSD-3-Clause\n// https://github.com/fastify/secure-json-parse/graphs/contributors and https://github.com/hapijs/bourne/graphs/contributors\n\nconst suspectProtoRx = /(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])/;\nconst suspectConstructorRx = /(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)/;\n\n/*\n json_parse.js\n 2012-06-20\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n This file creates a json_parse function.\n During create you can (optionally) specify some behavioural switches\n\n require('json-bigint')(options)\n\n The optional options parameter holds switches that drive certain\n aspects of the parsing process:\n * options.strict = true will warn about duplicate-key usage in the json.\n The default (strict = false) will silently ignore those and overwrite\n values for keys that are in duplicate use.\n\n The resulting function follows this signature:\n json_parse(text, reviver)\n This method parses a JSON text to produce an object or array.\n It can throw a SyntaxError exception.\n\n The optional reviver parameter is a function that can filter and\n transform the results. It receives each of the keys and values,\n and its return value is used instead of the original value.\n If it returns what it received, then the structure is not modified.\n If it returns undefined then the member is deleted.\n\n Example:\n\n // Parse the text. Values that look like ISO date strings will\n // be converted to Date objects.\n\n myData = json_parse(text, function (key, value) {\n var a;\n if (typeof value === 'string') {\n a =\n/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n if (a) {\n return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n +a[5], +a[6]));\n }\n }\n return value;\n });\n\n This is a reference implementation. You are free to copy, modify, or\n redistribute.\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n*/\n\n/*members \"\", \"\\\"\", \"\\/\", \"\\\\\", at, b, call, charAt, f, fromCharCode,\n hasOwnProperty, message, n, name, prototype, push, r, t, text\n*/\n\nvar json_parse = function (options) {\n 'use strict';\n\n // This is a function that can parse a JSON text, producing a JavaScript\n // data structure. It is a simple, recursive descent parser. It does not use\n // eval or regular expressions, so it can be used as a model for implementing\n // a JSON parser in other languages.\n\n // We are defining the function inside of another function to avoid creating\n // global variables.\n\n // Default options one can override by passing options to the parse()\n var _options = {\n strict: false, // not being strict means do not generate syntax errors for \"duplicate key\"\n storeAsString: false, // toggles whether the values should be stored as BigNumber (default) or a string\n alwaysParseAsBig: false, // toggles whether all numbers should be Big\n useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js\n protoAction: 'error',\n constructorAction: 'error',\n };\n\n // If there are options, then use them to override the default _options\n if (options !== undefined && options !== null) {\n if (options.strict === true) {\n _options.strict = true;\n }\n if (options.storeAsString === true) {\n _options.storeAsString = true;\n }\n _options.alwaysParseAsBig =\n options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;\n _options.useNativeBigInt =\n options.useNativeBigInt === true ? options.useNativeBigInt : false;\n\n if (typeof options.constructorAction !== 'undefined') {\n if (\n options.constructorAction === 'error' ||\n options.constructorAction === 'ignore' ||\n options.constructorAction === 'preserve'\n ) {\n _options.constructorAction = options.constructorAction;\n } else {\n throw new Error(\n `Incorrect value for constructorAction option, must be \"error\", \"ignore\" or undefined but passed ${options.constructorAction}`\n );\n }\n }\n\n if (typeof options.protoAction !== 'undefined') {\n if (\n options.protoAction === 'error' ||\n options.protoAction === 'ignore' ||\n options.protoAction === 'preserve'\n ) {\n _options.protoAction = options.protoAction;\n } else {\n throw new Error(\n `Incorrect value for protoAction option, must be \"error\", \"ignore\" or undefined but passed ${options.protoAction}`\n );\n }\n }\n }\n\n var at, // The index of the current character\n ch, // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t',\n },\n text,\n error = function (m) {\n // Call error when something is wrong.\n\n throw {\n name: 'SyntaxError',\n message: m,\n at: at,\n text: text,\n };\n },\n next = function (c) {\n // If a c parameter is provided, verify that it matches the current character.\n\n if (c && c !== ch) {\n error(\"Expected '\" + c + \"' instead of '\" + ch + \"'\");\n }\n\n // Get the next character. When there are no more characters,\n // return the empty string.\n\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n number = function () {\n // Parse a number value.\n\n var number,\n string = '';\n\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error('Bad number');\n } else {\n if (BigNumber == null) BigNumber = require('bignumber.js');\n //if (number > 9007199254740992 || number < -9007199254740992)\n // Bignumber has stricter check: everything with length > 15 digits disallowed\n if (string.length > 15)\n return _options.storeAsString\n ? string\n : _options.useNativeBigInt\n ? BigInt(string)\n : new BigNumber(string);\n else\n return !_options.alwaysParseAsBig\n ? number\n : _options.useNativeBigInt\n ? BigInt(number)\n : new BigNumber(number);\n }\n },\n string = function () {\n // Parse a string value.\n\n var hex,\n i,\n string = '',\n uffff;\n\n // When parsing for string values, we must look for \" and \\ characters.\n\n if (ch === '\"') {\n var startAt = at;\n while (next()) {\n if (ch === '\"') {\n if (at - 1 > startAt) string += text.substring(startAt, at - 1);\n next();\n return string;\n }\n if (ch === '\\\\') {\n if (at - 1 > startAt) string += text.substring(startAt, at - 1);\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n startAt = at;\n }\n }\n }\n error('Bad string');\n },\n white = function () {\n // Skip whitespace.\n\n while (ch && ch <= ' ') {\n next();\n }\n },\n word = function () {\n // true, false, or null.\n\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error(\"Unexpected '\" + ch + \"'\");\n },\n value, // Place holder for the value function.\n array = function () {\n // Parse an array value.\n\n var array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function () {\n // Parse an object value.\n\n var key,\n object = Object.create(null);\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (\n _options.strict === true &&\n Object.hasOwnProperty.call(object, key)\n ) {\n error('Duplicate key \"' + key + '\"');\n }\n\n if (suspectProtoRx.test(key) === true) {\n if (_options.protoAction === 'error') {\n error('Object contains forbidden prototype property');\n } else if (_options.protoAction === 'ignore') {\n value();\n } else {\n object[key] = value();\n }\n } else if (suspectConstructorRx.test(key) === true) {\n if (_options.constructorAction === 'error') {\n error('Object contains forbidden constructor property');\n } else if (_options.constructorAction === 'ignore') {\n value();\n } else {\n object[key] = value();\n }\n } else {\n object[key] = value();\n }\n\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n\n value = function () {\n // Parse a JSON value. It could be an object, an array, a string, a number,\n // or a word.\n\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n // Return the json_parse function. It will have access to all of the above\n // functions and variables.\n\n return function (source, reviver) {\n var result;\n\n text = source + '';\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error('Syntax error');\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the result\n // in an empty key. If there is not a reviver function, we simply return the\n // result.\n\n return typeof reviver === 'function'\n ? (function walk(holder, key) {\n var k,\n v,\n value = holder[key];\n if (value && typeof value === 'object') {\n Object.keys(value).forEach(function (k) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n });\n }\n return reviver.call(holder, key, value);\n })({ '': result }, '')\n : result;\n };\n};\n\nmodule.exports = json_parse;\n",
15
+ "var json_stringify = require('./lib/stringify.js').stringify;\nvar json_parse = require('./lib/parse.js');\n\nmodule.exports = function(options) {\n return {\n parse: json_parse(options),\n stringify: json_stringify\n }\n};\n//create the default method members with no options applied for backwards compatibility\nmodule.exports.parse = json_parse();\nmodule.exports.stringify = json_stringify;\n",
16
+ "\"use strict\";\n/**\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCE_LINUX_BIOS_PATHS = void 0;\nexports.isGoogleCloudServerless = isGoogleCloudServerless;\nexports.isGoogleComputeEngineLinux = isGoogleComputeEngineLinux;\nexports.isGoogleComputeEngineMACAddress = isGoogleComputeEngineMACAddress;\nexports.isGoogleComputeEngine = isGoogleComputeEngine;\nexports.detectGCPResidency = detectGCPResidency;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\n/**\n * Known paths unique to Google Compute Engine Linux instances\n */\nexports.GCE_LINUX_BIOS_PATHS = {\n BIOS_DATE: '/sys/class/dmi/id/bios_date',\n BIOS_VENDOR: '/sys/class/dmi/id/bios_vendor',\n};\nconst GCE_MAC_ADDRESS_REGEX = /^42:01/;\n/**\n * Determines if the process is running on a Google Cloud Serverless environment (Cloud Run or Cloud Functions instance).\n *\n * Uses the:\n * - {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n * - {@link https://cloud.google.com/functions/docs/env-var Cloud Functions environment variables}.\n *\n * @returns {boolean} `true` if the process is running on GCP serverless, `false` otherwise.\n */\nfunction isGoogleCloudServerless() {\n /**\n * `CLOUD_RUN_JOB` is used for Cloud Run Jobs\n * - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n *\n * `FUNCTION_NAME` is used in older Cloud Functions environments:\n * - See {@link https://cloud.google.com/functions/docs/env-var Python 3.7 and Go 1.11}.\n *\n * `K_SERVICE` is used in Cloud Run and newer Cloud Functions environments:\n * - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n * - See {@link https://cloud.google.com/functions/docs/env-var Cloud Functions newer runtimes}.\n */\n const isGFEnvironment = process.env.CLOUD_RUN_JOB ||\n process.env.FUNCTION_NAME ||\n process.env.K_SERVICE;\n return !!isGFEnvironment;\n}\n/**\n * Determines if the process is running on a Linux Google Compute Engine instance.\n *\n * @returns {boolean} `true` if the process is running on Linux GCE, `false` otherwise.\n */\nfunction isGoogleComputeEngineLinux() {\n if ((0, os_1.platform)() !== 'linux')\n return false;\n try {\n // ensure this file exist\n (0, fs_1.statSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_DATE);\n // ensure this file exist and matches\n const biosVendor = (0, fs_1.readFileSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR, 'utf8');\n return /Google/.test(biosVendor);\n }\n catch {\n return false;\n }\n}\n/**\n * Determines if the process is running on a Google Compute Engine instance with a known\n * MAC address.\n *\n * @returns {boolean} `true` if the process is running on GCE (as determined by MAC address), `false` otherwise.\n */\nfunction isGoogleComputeEngineMACAddress() {\n const interfaces = (0, os_1.networkInterfaces)();\n for (const item of Object.values(interfaces)) {\n if (!item)\n continue;\n for (const { mac } of item) {\n if (GCE_MAC_ADDRESS_REGEX.test(mac)) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Determines if the process is running on a Google Compute Engine instance.\n *\n * @returns {boolean} `true` if the process is running on GCE, `false` otherwise.\n */\nfunction isGoogleComputeEngine() {\n return isGoogleComputeEngineLinux() || isGoogleComputeEngineMACAddress();\n}\n/**\n * Determines if the process is running on Google Cloud Platform.\n *\n * @returns {boolean} `true` if the process is running on GCP, `false` otherwise.\n */\nfunction detectGCPResidency() {\n return isGoogleCloudServerless() || isGoogleComputeEngine();\n}\n//# sourceMappingURL=gcp-residency.js.map",
17
+ "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Colours = void 0;\n/**\n * Handles figuring out if we can use ANSI colours and handing out the escape codes.\n *\n * This is for package-internal use only, and may change at any time.\n *\n * @private\n * @internal\n */\nclass Colours {\n /**\n * @param stream The stream (e.g. process.stderr)\n * @returns true if the stream should have colourization enabled\n */\n static isEnabled(stream) {\n return (stream && // May happen in browsers.\n stream.isTTY &&\n (typeof stream.getColorDepth === 'function'\n ? stream.getColorDepth() > 2\n : true));\n }\n static refresh() {\n Colours.enabled = Colours.isEnabled(process === null || process === void 0 ? void 0 : process.stderr);\n if (!this.enabled) {\n Colours.reset = '';\n Colours.bright = '';\n Colours.dim = '';\n Colours.red = '';\n Colours.green = '';\n Colours.yellow = '';\n Colours.blue = '';\n Colours.magenta = '';\n Colours.cyan = '';\n Colours.white = '';\n Colours.grey = '';\n }\n else {\n Colours.reset = '\\u001b[0m';\n Colours.bright = '\\u001b[1m';\n Colours.dim = '\\u001b[2m';\n Colours.red = '\\u001b[31m';\n Colours.green = '\\u001b[32m';\n Colours.yellow = '\\u001b[33m';\n Colours.blue = '\\u001b[34m';\n Colours.magenta = '\\u001b[35m';\n Colours.cyan = '\\u001b[36m';\n Colours.white = '\\u001b[37m';\n Colours.grey = '\\u001b[90m';\n }\n }\n}\nexports.Colours = Colours;\nColours.enabled = false;\nColours.reset = '';\nColours.bright = '';\nColours.dim = '';\nColours.red = '';\nColours.green = '';\nColours.yellow = '';\nColours.blue = '';\nColours.magenta = '';\nColours.cyan = '';\nColours.white = '';\nColours.grey = '';\nColours.refresh();\n//# sourceMappingURL=colours.js.map",
18
+ "\"use strict\";\n// Copyright 2021-2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.env = exports.DebugLogBackendBase = exports.placeholder = exports.AdhocDebugLogger = exports.LogSeverity = void 0;\nexports.getNodeBackend = getNodeBackend;\nexports.getDebugBackend = getDebugBackend;\nexports.getStructuredBackend = getStructuredBackend;\nexports.setBackend = setBackend;\nexports.log = log;\nconst events_1 = require(\"events\");\nconst process = __importStar(require(\"process\"));\nconst util = __importStar(require(\"util\"));\nconst colours_1 = require(\"./colours\");\n// Some functions (as noted) are based on the Node standard library, from\n// the following file:\n//\n// https://github.com/nodejs/node/blob/main/lib/internal/util/debuglog.js\n/**\n * This module defines an ad-hoc debug logger for Google Cloud Platform\n * client libraries in Node. An ad-hoc debug logger is a tool which lets\n * users use an external, unified interface (in this case, environment\n * variables) to determine what logging they want to see at runtime. This\n * isn't necessarily fed into the console, but is meant to be under the\n * control of the user. The kind of logging that will be produced by this\n * is more like \"call retry happened\", not \"events you'd want to record\n * in Cloud Logger\".\n *\n * More for Googlers implementing libraries with it:\n * go/cloud-client-logging-design\n */\n/**\n * Possible log levels. These are a subset of Cloud Observability levels.\n * https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity\n */\nvar LogSeverity;\n(function (LogSeverity) {\n LogSeverity[\"DEFAULT\"] = \"DEFAULT\";\n LogSeverity[\"DEBUG\"] = \"DEBUG\";\n LogSeverity[\"INFO\"] = \"INFO\";\n LogSeverity[\"WARNING\"] = \"WARNING\";\n LogSeverity[\"ERROR\"] = \"ERROR\";\n})(LogSeverity || (exports.LogSeverity = LogSeverity = {}));\n/**\n * Our logger instance. This actually contains the meat of dealing\n * with log lines, including EventEmitter. This contains the function\n * that will be passed back to users of the package.\n */\nclass AdhocDebugLogger extends events_1.EventEmitter {\n /**\n * @param upstream The backend will pass a function that will be\n * called whenever our logger function is invoked.\n */\n constructor(namespace, upstream) {\n super();\n this.namespace = namespace;\n this.upstream = upstream;\n this.func = Object.assign(this.invoke.bind(this), {\n // Also add an instance pointer back to us.\n instance: this,\n // And pull over the EventEmitter functionality.\n on: (event, listener) => this.on(event, listener),\n });\n // Convenience methods for log levels.\n this.func.debug = (...args) => this.invokeSeverity(LogSeverity.DEBUG, ...args);\n this.func.info = (...args) => this.invokeSeverity(LogSeverity.INFO, ...args);\n this.func.warn = (...args) => this.invokeSeverity(LogSeverity.WARNING, ...args);\n this.func.error = (...args) => this.invokeSeverity(LogSeverity.ERROR, ...args);\n this.func.sublog = (namespace) => log(namespace, this.func);\n }\n invoke(fields, ...args) {\n // Push out any upstream logger first.\n if (this.upstream) {\n try {\n this.upstream(fields, ...args);\n }\n catch (e) {\n // Swallow exceptions to avoid interfering with other logging.\n }\n }\n // Emit sink events.\n try {\n this.emit('log', fields, args);\n }\n catch (e) {\n // Swallow exceptions to avoid interfering with other logging.\n }\n }\n invokeSeverity(severity, ...args) {\n this.invoke({ severity }, ...args);\n }\n}\nexports.AdhocDebugLogger = AdhocDebugLogger;\n/**\n * This can be used in place of a real logger while waiting for Promises or disabling logging.\n */\nexports.placeholder = new AdhocDebugLogger('', () => { }).func;\n/**\n * The base class for debug logging backends. It's possible to use this, but the\n * same non-guarantees above still apply (unstable interface, etc).\n *\n * @private\n * @internal\n */\nclass DebugLogBackendBase {\n constructor() {\n var _a;\n this.cached = new Map();\n this.filters = [];\n this.filtersSet = false;\n // Look for the Node config variable for what systems to enable. We'll store\n // these for the log method below, which will call setFilters() once.\n let nodeFlag = (_a = process.env[exports.env.nodeEnables]) !== null && _a !== void 0 ? _a : '*';\n if (nodeFlag === 'all') {\n nodeFlag = '*';\n }\n this.filters = nodeFlag.split(',');\n }\n log(namespace, fields, ...args) {\n try {\n if (!this.filtersSet) {\n this.setFilters();\n this.filtersSet = true;\n }\n let logger = this.cached.get(namespace);\n if (!logger) {\n logger = this.makeLogger(namespace);\n this.cached.set(namespace, logger);\n }\n logger(fields, ...args);\n }\n catch (e) {\n // Silently ignore all errors; we don't want them to interfere with\n // the user's running app.\n // e;\n console.error(e);\n }\n }\n}\nexports.DebugLogBackendBase = DebugLogBackendBase;\n// The basic backend. This one definitely works, but it's less feature-filled.\n//\n// Rather than using util.debuglog, this implements the same basic logic directly.\n// The reason for this decision is that debuglog checks the value of the\n// NODE_DEBUG environment variable before any user code runs; we therefore\n// can't pipe our own enables into it (and util.debuglog will never print unless\n// the user duplicates it into NODE_DEBUG, which isn't reasonable).\n//\nclass NodeBackend extends DebugLogBackendBase {\n constructor() {\n super(...arguments);\n // Default to allowing all systems, since we gate earlier based on whether the\n // variable is empty.\n this.enabledRegexp = /.*/g;\n }\n isEnabled(namespace) {\n return this.enabledRegexp.test(namespace);\n }\n makeLogger(namespace) {\n if (!this.enabledRegexp.test(namespace)) {\n return () => { };\n }\n return (fields, ...args) => {\n var _a;\n // TODO: `fields` needs to be turned into a string here, one way or another.\n const nscolour = `${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`;\n const pid = `${colours_1.Colours.yellow}${process.pid}${colours_1.Colours.reset}`;\n let level;\n switch (fields.severity) {\n case LogSeverity.ERROR:\n level = `${colours_1.Colours.red}${fields.severity}${colours_1.Colours.reset}`;\n break;\n case LogSeverity.INFO:\n level = `${colours_1.Colours.magenta}${fields.severity}${colours_1.Colours.reset}`;\n break;\n case LogSeverity.WARNING:\n level = `${colours_1.Colours.yellow}${fields.severity}${colours_1.Colours.reset}`;\n break;\n default:\n level = (_a = fields.severity) !== null && _a !== void 0 ? _a : LogSeverity.DEFAULT;\n break;\n }\n const msg = util.formatWithOptions({ colors: colours_1.Colours.enabled }, ...args);\n const filteredFields = Object.assign({}, fields);\n delete filteredFields.severity;\n const fieldsJson = Object.getOwnPropertyNames(filteredFields).length\n ? JSON.stringify(filteredFields)\n : '';\n const fieldsColour = fieldsJson\n ? `${colours_1.Colours.grey}${fieldsJson}${colours_1.Colours.reset}`\n : '';\n console.error('%s [%s|%s] %s%s', pid, nscolour, level, msg, fieldsJson ? ` ${fieldsColour}` : '');\n };\n }\n // Regexp patterns below are from here:\n // https://github.com/nodejs/node/blob/c0aebed4b3395bd65d54b18d1fd00f071002ac20/lib/internal/util/debuglog.js#L36\n setFilters() {\n const totalFilters = this.filters.join(',');\n const regexp = totalFilters\n .replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^');\n this.enabledRegexp = new RegExp(`^${regexp}$`, 'i');\n }\n}\n/**\n * @returns A backend based on Node util.debuglog; this is the default.\n */\nfunction getNodeBackend() {\n return new NodeBackend();\n}\nclass DebugBackend extends DebugLogBackendBase {\n constructor(pkg) {\n super();\n this.debugPkg = pkg;\n }\n makeLogger(namespace) {\n const debugLogger = this.debugPkg(namespace);\n return (fields, ...args) => {\n // TODO: `fields` needs to be turned into a string here.\n debugLogger(args[0], ...args.slice(1));\n };\n }\n setFilters() {\n var _a;\n const existingFilters = (_a = process.env['NODE_DEBUG']) !== null && _a !== void 0 ? _a : '';\n process.env['NODE_DEBUG'] = `${existingFilters}${existingFilters ? ',' : ''}${this.filters.join(',')}`;\n }\n}\n/**\n * Creates a \"debug\" package backend. The user must call require('debug') and pass\n * the resulting object to this function.\n *\n * ```\n * setBackend(getDebugBackend(require('debug')))\n * ```\n *\n * https://www.npmjs.com/package/debug\n *\n * Note: Google does not explicitly endorse or recommend this package; it's just\n * being provided as an option.\n *\n * @returns A backend based on the npm \"debug\" package.\n */\nfunction getDebugBackend(debugPkg) {\n return new DebugBackend(debugPkg);\n}\n/**\n * This pretty much works like the Node logger, but it outputs structured\n * logging JSON matching Google Cloud's ingestion specs. Rather than handling\n * its own output, it wraps another backend. The passed backend must be a subclass\n * of `DebugLogBackendBase` (any of the backends exposed by this package will work).\n */\nclass StructuredBackend extends DebugLogBackendBase {\n constructor(upstream) {\n var _a;\n super();\n this.upstream = (_a = upstream) !== null && _a !== void 0 ? _a : undefined;\n }\n makeLogger(namespace) {\n var _a;\n const debugLogger = (_a = this.upstream) === null || _a === void 0 ? void 0 : _a.makeLogger(namespace);\n return (fields, ...args) => {\n var _a;\n const severity = (_a = fields.severity) !== null && _a !== void 0 ? _a : LogSeverity.INFO;\n const json = Object.assign({\n severity,\n message: util.format(...args),\n }, fields);\n const jsonString = JSON.stringify(json);\n if (debugLogger) {\n debugLogger(fields, jsonString);\n }\n else {\n console.log('%s', jsonString);\n }\n };\n }\n setFilters() {\n var _a;\n (_a = this.upstream) === null || _a === void 0 ? void 0 : _a.setFilters();\n }\n}\n/**\n * Creates a \"structured logging\" backend. This pretty much works like the\n * Node logger, but it outputs structured logging JSON matching Google\n * Cloud's ingestion specs instead of plain text.\n *\n * ```\n * setBackend(getStructuredBackend())\n * ```\n *\n * @param upstream If you want to use something besides the Node backend to\n * write the actual log lines into, pass that here.\n * @returns A backend based on Google Cloud structured logging.\n */\nfunction getStructuredBackend(upstream) {\n return new StructuredBackend(upstream);\n}\n/**\n * The environment variables that we standardized on, for all ad-hoc logging.\n */\nexports.env = {\n /**\n * Filter wildcards specific to the Node syntax, and similar to the built-in\n * utils.debuglog() environment variable. If missing, disables logging.\n */\n nodeEnables: 'GOOGLE_SDK_NODE_LOGGING',\n};\n// Keep a copy of all namespaced loggers so users can reliably .on() them.\n// Note that these cached functions will need to deal with changes in the backend.\nconst loggerCache = new Map();\n// Our current global backend. This might be:\nlet cachedBackend = undefined;\n/**\n * Set the backend to use for our log output.\n * - A backend object\n * - null to disable logging\n * - undefined for \"nothing yet\", defaults to the Node backend\n *\n * @param backend Results from one of the get*Backend() functions.\n */\nfunction setBackend(backend) {\n cachedBackend = backend;\n loggerCache.clear();\n}\n/**\n * Creates a logging function. Multiple calls to this with the same namespace\n * will produce the same logger, with the same event emitter hooks.\n *\n * Namespaces can be a simple string (\"system\" name), or a qualified string\n * (system:subsystem), which can be used for filtering, or for \"system:*\".\n *\n * @param namespace The namespace, a descriptive text string.\n * @returns A function you can call that works similar to console.log().\n */\nfunction log(namespace, parent) {\n // If the enable environment variable isn't set, do nothing. The user\n // can still choose to set a backend of their choice using the manual\n // `setBackend()`.\n if (!cachedBackend) {\n const enablesFlag = process.env[exports.env.nodeEnables];\n if (!enablesFlag) {\n return exports.placeholder;\n }\n }\n // This might happen mostly if the typings are dropped in a user's code,\n // or if they're calling from JavaScript.\n if (!namespace) {\n return exports.placeholder;\n }\n // Handle sub-loggers.\n if (parent) {\n namespace = `${parent.instance.namespace}:${namespace}`;\n }\n // Reuse loggers so things like event sinks are persistent.\n const existing = loggerCache.get(namespace);\n if (existing) {\n return existing.func;\n }\n // Do we have a backend yet?\n if (cachedBackend === null) {\n // Explicitly disabled.\n return exports.placeholder;\n }\n else if (cachedBackend === undefined) {\n // One hasn't been made yet, so default to Node.\n cachedBackend = getNodeBackend();\n }\n // The logger is further wrapped so we can handle the backend changing out.\n const logger = (() => {\n let previousBackend = undefined;\n const newLogger = new AdhocDebugLogger(namespace, (fields, ...args) => {\n if (previousBackend !== cachedBackend) {\n // Did the user pass a custom backend?\n if (cachedBackend === null) {\n // Explicitly disabled.\n return;\n }\n else if (cachedBackend === undefined) {\n // One hasn't been made yet, so default to Node.\n cachedBackend = getNodeBackend();\n }\n previousBackend = cachedBackend;\n }\n cachedBackend === null || cachedBackend === void 0 ? void 0 : cachedBackend.log(namespace, fields, ...args);\n });\n return newLogger;\n })();\n loggerCache.set(namespace, logger);\n return logger.func;\n}\n//# sourceMappingURL=logging-utils.js.map",
19
+ "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./logging-utils\"), exports);\n//# sourceMappingURL=index.js.map",
20
+ "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.gcpResidencyCache = exports.METADATA_SERVER_DETECTION = exports.HEADERS = exports.HEADER_VALUE = exports.HEADER_NAME = exports.SECONDARY_HOST_ADDRESS = exports.HOST_ADDRESS = exports.BASE_PATH = void 0;\nexports.instance = instance;\nexports.project = project;\nexports.universe = universe;\nexports.bulk = bulk;\nexports.isAvailable = isAvailable;\nexports.resetIsAvailableCache = resetIsAvailableCache;\nexports.getGCPResidency = getGCPResidency;\nexports.setGCPResidency = setGCPResidency;\nexports.requestTimeout = requestTimeout;\n/**\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst gaxios_1 = require(\"gaxios\");\nconst jsonBigint = require(\"json-bigint\");\nconst gcp_residency_1 = require(\"./gcp-residency\");\nconst logger = __importStar(require(\"google-logging-utils\"));\nexports.BASE_PATH = '/computeMetadata/v1';\nexports.HOST_ADDRESS = 'http://169.254.169.254';\nexports.SECONDARY_HOST_ADDRESS = 'http://metadata.google.internal.';\nexports.HEADER_NAME = 'Metadata-Flavor';\nexports.HEADER_VALUE = 'Google';\nexports.HEADERS = Object.freeze({ [exports.HEADER_NAME]: exports.HEADER_VALUE });\nconst log = logger.log('gcp-metadata');\n/**\n * Metadata server detection override options.\n *\n * Available via `process.env.METADATA_SERVER_DETECTION`.\n */\nexports.METADATA_SERVER_DETECTION = Object.freeze({\n 'assume-present': \"don't try to ping the metadata server, but assume it's present\",\n none: \"don't try to ping the metadata server, but don't try to use it either\",\n 'bios-only': \"treat the result of a BIOS probe as canonical (don't fall back to pinging)\",\n 'ping-only': 'skip the BIOS probe, and go straight to pinging',\n});\n/**\n * Returns the base URL while taking into account the GCE_METADATA_HOST\n * environment variable if it exists.\n *\n * @returns The base URL, e.g., http://169.254.169.254/computeMetadata/v1.\n */\nfunction getBaseUrl(baseUrl) {\n if (!baseUrl) {\n baseUrl =\n process.env.GCE_METADATA_IP ||\n process.env.GCE_METADATA_HOST ||\n exports.HOST_ADDRESS;\n }\n // If no scheme is provided default to HTTP:\n if (!/^https?:\\/\\//.test(baseUrl)) {\n baseUrl = `http://${baseUrl}`;\n }\n return new URL(exports.BASE_PATH, baseUrl).href;\n}\n// Accepts an options object passed from the user to the API. In previous\n// versions of the API, it referred to a `Request` or an `Axios` request\n// options object. Now it refers to an object with very limited property\n// names. This is here to help ensure users don't pass invalid options when\n// they upgrade from 0.4 to 0.5 to 0.8.\nfunction validate(options) {\n Object.keys(options).forEach(key => {\n switch (key) {\n case 'params':\n case 'property':\n case 'headers':\n break;\n case 'qs':\n throw new Error(\"'qs' is not a valid configuration option. Please use 'params' instead.\");\n default:\n throw new Error(`'${key}' is not a valid configuration option.`);\n }\n });\n}\nasync function metadataAccessor(type, options = {}, noResponseRetries = 3, fastFail = false) {\n const headers = new Headers(exports.HEADERS);\n let metadataKey = '';\n let params = {};\n if (typeof type === 'object') {\n const metadataAccessor = type;\n new Headers(metadataAccessor.headers).forEach((value, key) => headers.set(key, value));\n metadataKey = metadataAccessor.metadataKey;\n params = metadataAccessor.params || params;\n noResponseRetries = metadataAccessor.noResponseRetries || noResponseRetries;\n fastFail = metadataAccessor.fastFail || fastFail;\n }\n else {\n metadataKey = type;\n }\n if (typeof options === 'string') {\n metadataKey += `/${options}`;\n }\n else {\n validate(options);\n if (options.property) {\n metadataKey += `/${options.property}`;\n }\n new Headers(options.headers).forEach((value, key) => headers.set(key, value));\n params = options.params || params;\n }\n const requestMethod = fastFail ? fastFailMetadataRequest : gaxios_1.request;\n const req = {\n url: `${getBaseUrl()}/${metadataKey}`,\n headers,\n retryConfig: { noResponseRetries },\n params,\n responseType: 'text',\n timeout: requestTimeout(),\n };\n log.info('instance request %j', req);\n const res = await requestMethod(req);\n log.info('instance metadata is %s', res.data);\n const metadataFlavor = res.headers.get(exports.HEADER_NAME);\n if (metadataFlavor !== exports.HEADER_VALUE) {\n throw new RangeError(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header. Expected '${exports.HEADER_VALUE}', got ${metadataFlavor ? `'${metadataFlavor}'` : 'no header'}`);\n }\n if (typeof res.data === 'string') {\n try {\n return jsonBigint.parse(res.data);\n }\n catch {\n /* ignore */\n }\n }\n return res.data;\n}\nasync function fastFailMetadataRequest(options) {\n const secondaryOptions = {\n ...options,\n url: options.url\n ?.toString()\n .replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)),\n };\n // We race a connection between DNS/IP to metadata server. There are a couple\n // reasons for this:\n //\n // 1. the DNS is slow in some GCP environments; by checking both, we might\n // detect the runtime environment significantly faster.\n // 2. we can't just check the IP, which is tarpitted and slow to respond\n // on a user's local machine.\n //\n // Returns first resolved promise or if all promises get rejected we return an AggregateError.\n //\n // Note, however, if a failure happens prior to a success, a rejection should\n // occur, this is for folks running locally.\n //\n const r1 = (0, gaxios_1.request)(options);\n const r2 = (0, gaxios_1.request)(secondaryOptions);\n return Promise.any([r1, r2]);\n}\n/**\n * Obtain metadata for the current GCE instance.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const serviceAccount: {} = await instance('service-accounts/');\n * const serviceAccountEmail: string = await instance('service-accounts/default/email');\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction instance(options) {\n return metadataAccessor('instance', options);\n}\n/**\n * Obtain metadata for the current GCP project.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const projectId: string = await project('project-id');\n * const numericProjectId: number = await project('numeric-project-id');\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction project(options) {\n return metadataAccessor('project', options);\n}\n/**\n * Obtain metadata for the current universe.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const universeDomain: string = await universe('universe-domain');\n * ```\n */\nfunction universe(options) {\n return metadataAccessor('universe', options);\n}\n/**\n * Retrieve metadata items in parallel.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const data = await bulk([\n * {\n * metadataKey: 'instance',\n * },\n * {\n * metadataKey: 'project/project-id',\n * },\n * ] as const);\n *\n * // data.instance;\n * // data['project/project-id'];\n * ```\n *\n * @param properties The metadata properties to retrieve\n * @returns The metadata in `metadatakey:value` format\n */\nasync function bulk(properties) {\n const r = {};\n await Promise.all(properties.map(item => {\n return (async () => {\n const res = await metadataAccessor(item);\n const key = item.metadataKey;\n r[key] = res;\n })();\n }));\n return r;\n}\n/*\n * How many times should we retry detecting GCP environment.\n */\nfunction detectGCPAvailableRetries() {\n return process.env.DETECT_GCP_RETRIES\n ? Number(process.env.DETECT_GCP_RETRIES)\n : 0;\n}\nlet cachedIsAvailableResponse;\n/**\n * Determine if the metadata server is currently available.\n */\nasync function isAvailable() {\n if (process.env.METADATA_SERVER_DETECTION) {\n const value = process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();\n if (!(value in exports.METADATA_SERVER_DETECTION)) {\n throw new RangeError(`Unknown \\`METADATA_SERVER_DETECTION\\` env variable. Got \\`${value}\\`, but it should be \\`${Object.keys(exports.METADATA_SERVER_DETECTION).join('`, `')}\\`, or unset`);\n }\n switch (value) {\n case 'assume-present':\n return true;\n case 'none':\n return false;\n case 'bios-only':\n return getGCPResidency();\n case 'ping-only':\n // continue, we want to ping the server\n }\n }\n try {\n // If a user is instantiating several GCP libraries at the same time,\n // this may result in multiple calls to isAvailable(), to detect the\n // runtime environment. We use the same promise for each of these calls\n // to reduce the network load.\n if (cachedIsAvailableResponse === undefined) {\n cachedIsAvailableResponse = metadataAccessor('instance', undefined, detectGCPAvailableRetries(), \n // If the default HOST_ADDRESS has been overridden, we should not\n // make an effort to try SECONDARY_HOST_ADDRESS (as we are likely in\n // a non-GCP environment):\n !(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST));\n }\n await cachedIsAvailableResponse;\n return true;\n }\n catch (e) {\n const err = e;\n if (process.env.DEBUG_AUTH) {\n console.info(err);\n }\n // Promise.any() rejects with AggregateError when neither metadata host\n // is available. This is expected outside GCP, not a warning condition.\n if (err instanceof AggregateError)\n return false;\n if (err.type === 'request-timeout') {\n // If running in a GCP environment, metadata endpoint should return\n // within ms.\n return false;\n }\n if (err.response && err.response.status === 404) {\n return false;\n }\n else {\n if (!(err.response && err.response.status === 404) &&\n // A warning is emitted if we see an unexpected err.code, or err.code\n // is not populated:\n (!err.code ||\n ![\n 'EHOSTDOWN',\n 'EHOSTUNREACH',\n 'ENETUNREACH',\n 'ENOENT',\n 'ENOTFOUND',\n 'ECONNREFUSED',\n ].includes(err.code.toString()))) {\n let code = 'UNKNOWN';\n if (err.code)\n code = err.code.toString();\n process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, 'MetadataLookupWarning');\n }\n // Failure to resolve the metadata service means that it is not available.\n return false;\n }\n }\n}\n/**\n * reset the memoized isAvailable() lookup.\n */\nfunction resetIsAvailableCache() {\n cachedIsAvailableResponse = undefined;\n}\n/**\n * A cache for the detected GCP Residency.\n */\nexports.gcpResidencyCache = null;\n/**\n * Detects GCP Residency.\n * Caches results to reduce costs for subsequent calls.\n *\n * @see setGCPResidency for setting\n */\nfunction getGCPResidency() {\n if (exports.gcpResidencyCache === null) {\n setGCPResidency();\n }\n return exports.gcpResidencyCache;\n}\n/**\n * Sets the detected GCP Residency.\n * Useful for forcing metadata server detection behavior.\n *\n * Set `null` to autodetect the environment (default behavior).\n * @see getGCPResidency for getting\n */\nfunction setGCPResidency(value = null) {\n exports.gcpResidencyCache = value !== null ? value : (0, gcp_residency_1.detectGCPResidency)();\n}\n/**\n * Obtain the timeout for requests to the metadata server.\n *\n * In certain environments and conditions requests can take longer than\n * the default timeout to complete. This function will determine the\n * appropriate timeout based on the environment.\n *\n * @returns {number} a request timeout duration in milliseconds.\n */\nfunction requestTimeout() {\n return getGCPResidency() ? 0 : 3000;\n}\n__exportStar(require(\"./gcp-residency\"), exports);\n//# sourceMappingURL=index.js.map",
21
+ "'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n",
22
+ "\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromArrayBufferToHex = fromArrayBufferToHex;\n/**\n * Converts an ArrayBuffer to a hexadecimal string.\n * @param arrayBuffer The ArrayBuffer to convert to hexadecimal string.\n * @return The hexadecimal encoding of the ArrayBuffer.\n */\nfunction fromArrayBufferToHex(arrayBuffer) {\n // Convert buffer to byte array.\n const byteArray = Array.from(new Uint8Array(arrayBuffer));\n // Convert bytes to hex string.\n return byteArray\n .map(byte => {\n return byte.toString(16).padStart(2, '0');\n })\n .join('');\n}\n//# sourceMappingURL=shared.js.map",
23
+ "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/* global window */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserCrypto = void 0;\n// This file implements crypto functions we need using in-browser\n// SubtleCrypto interface `window.crypto.subtle`.\nconst base64js = require(\"base64-js\");\nconst shared_1 = require(\"../shared\");\nclass BrowserCrypto {\n constructor() {\n if (typeof window === 'undefined' ||\n window.crypto === undefined ||\n window.crypto.subtle === undefined) {\n throw new Error(\"SubtleCrypto not found. Make sure it's an https:// website.\");\n }\n }\n async sha256DigestBase64(str) {\n // SubtleCrypto digest() method is async, so we must make\n // this method async as well.\n // To calculate SHA256 digest using SubtleCrypto, we first\n // need to convert an input string to an ArrayBuffer:\n const inputBuffer = new TextEncoder().encode(str);\n // Result is ArrayBuffer as well.\n const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer);\n return base64js.fromByteArray(new Uint8Array(outputBuffer));\n }\n randomBytesBase64(count) {\n const array = new Uint8Array(count);\n window.crypto.getRandomValues(array);\n return base64js.fromByteArray(array);\n }\n static padBase64(base64) {\n // base64js requires padding, so let's add some '='\n while (base64.length % 4 !== 0) {\n base64 += '=';\n }\n return base64;\n }\n async verify(pubkey, data, signature) {\n const algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' },\n };\n const dataArray = new TextEncoder().encode(data);\n const signatureArray = base64js.toByteArray(BrowserCrypto.padBase64(signature));\n const cryptoKey = await window.crypto.subtle.importKey('jwk', pubkey, algo, true, ['verify']);\n // SubtleCrypto's verify method is async so we must make\n // this method async as well.\n const result = await window.crypto.subtle.verify(algo, cryptoKey, signatureArray, dataArray);\n return result;\n }\n async sign(privateKey, data) {\n const algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' },\n };\n const dataArray = new TextEncoder().encode(data);\n const cryptoKey = await window.crypto.subtle.importKey('jwk', privateKey, algo, true, ['sign']);\n // SubtleCrypto's sign method is async so we must make\n // this method async as well.\n const result = await window.crypto.subtle.sign(algo, cryptoKey, dataArray);\n return base64js.fromByteArray(new Uint8Array(result));\n }\n decodeBase64StringUtf8(base64) {\n const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base64));\n const result = new TextDecoder().decode(uint8array);\n return result;\n }\n encodeBase64StringUtf8(text) {\n const uint8array = new TextEncoder().encode(text);\n const result = base64js.fromByteArray(uint8array);\n return result;\n }\n /**\n * Computes the SHA-256 hash of the provided string.\n * @param str The plain text string to hash.\n * @return A promise that resolves with the SHA-256 hash of the provided\n * string in hexadecimal encoding.\n */\n async sha256DigestHex(str) {\n // SubtleCrypto digest() method is async, so we must make\n // this method async as well.\n // To calculate SHA256 digest using SubtleCrypto, we first\n // need to convert an input string to an ArrayBuffer:\n const inputBuffer = new TextEncoder().encode(str);\n // Result is ArrayBuffer as well.\n const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer);\n return (0, shared_1.fromArrayBufferToHex)(outputBuffer);\n }\n /**\n * Computes the HMAC hash of a message using the provided crypto key and the\n * SHA-256 algorithm.\n * @param key The secret crypto key in utf-8 or ArrayBuffer format.\n * @param msg The plain text message.\n * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer\n * format.\n */\n async signWithHmacSha256(key, msg) {\n // Convert key, if provided in ArrayBuffer format, to string.\n const rawKey = typeof key === 'string'\n ? key\n : String.fromCharCode(...new Uint16Array(key));\n const enc = new TextEncoder();\n const cryptoKey = await window.crypto.subtle.importKey('raw', enc.encode(rawKey), {\n name: 'HMAC',\n hash: {\n name: 'SHA-256',\n },\n }, false, ['sign']);\n return window.crypto.subtle.sign('HMAC', cryptoKey, enc.encode(msg));\n }\n}\nexports.BrowserCrypto = BrowserCrypto;\n//# sourceMappingURL=crypto.js.map",
24
+ "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeCrypto = void 0;\nconst crypto = require(\"crypto\");\nclass NodeCrypto {\n async sha256DigestBase64(str) {\n return crypto.createHash('sha256').update(str).digest('base64');\n }\n randomBytesBase64(count) {\n return crypto.randomBytes(count).toString('base64');\n }\n async verify(pubkey, data, signature) {\n const verifier = crypto.createVerify('RSA-SHA256');\n verifier.update(data);\n verifier.end();\n return verifier.verify(pubkey, signature, 'base64');\n }\n async sign(privateKey, data) {\n const signer = crypto.createSign('RSA-SHA256');\n signer.update(data);\n signer.end();\n return signer.sign(privateKey, 'base64');\n }\n decodeBase64StringUtf8(base64) {\n return Buffer.from(base64, 'base64').toString('utf-8');\n }\n encodeBase64StringUtf8(text) {\n return Buffer.from(text, 'utf-8').toString('base64');\n }\n /**\n * Computes the SHA-256 hash of the provided string.\n * @param str The plain text string to hash.\n * @return A promise that resolves with the SHA-256 hash of the provided\n * string in hexadecimal encoding.\n */\n async sha256DigestHex(str) {\n return crypto.createHash('sha256').update(str).digest('hex');\n }\n /**\n * Computes the HMAC hash of a message using the provided crypto key and the\n * SHA-256 algorithm.\n * @param key The secret crypto key in utf-8 or ArrayBuffer format.\n * @param msg The plain text message.\n * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer\n * format.\n */\n async signWithHmacSha256(key, msg) {\n const cryptoKey = typeof key === 'string' ? key : toBuffer(key);\n return toArrayBuffer(crypto.createHmac('sha256', cryptoKey).update(msg).digest());\n }\n}\nexports.NodeCrypto = NodeCrypto;\n/**\n * Converts a Node.js Buffer to an ArrayBuffer.\n * https://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer\n * @param buffer The Buffer input to covert.\n * @return The ArrayBuffer representation of the input.\n */\nfunction toArrayBuffer(buffer) {\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);\n}\n/**\n * Converts an ArrayBuffer to a Node.js Buffer.\n * @param arrayBuffer The ArrayBuffer input to covert.\n * @return The Buffer representation of the input.\n */\nfunction toBuffer(arrayBuffer) {\n return Buffer.from(arrayBuffer);\n}\n//# sourceMappingURL=crypto.js.map",
25
+ "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/* global window */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createCrypto = createCrypto;\nexports.hasBrowserCrypto = hasBrowserCrypto;\nconst crypto_1 = require(\"./browser/crypto\");\nconst crypto_2 = require(\"./node/crypto\");\n__exportStar(require(\"./shared\"), exports);\n// Crypto interface will provide required crypto functions.\n// Use `createCrypto()` factory function to create an instance\n// of Crypto. It will either use Node.js `crypto` module, or\n// use browser's SubtleCrypto interface. Since most of the\n// SubtleCrypto methods return promises, we must make those\n// methods return promises here as well, even though in Node.js\n// they are synchronous.\nfunction createCrypto() {\n if (hasBrowserCrypto()) {\n return new crypto_1.BrowserCrypto();\n }\n return new crypto_2.NodeCrypto();\n}\nfunction hasBrowserCrypto() {\n return (typeof window !== 'undefined' &&\n typeof window.crypto !== 'undefined' &&\n typeof window.crypto.subtle !== 'undefined');\n}\n//# sourceMappingURL=crypto.js.map",
26
+ "/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n",
27
+ "'use strict';\n\nfunction getParamSize(keySize) {\n\tvar result = ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1);\n\treturn result;\n}\n\nvar paramBytesForAlg = {\n\tES256: getParamSize(256),\n\tES384: getParamSize(384),\n\tES512: getParamSize(521)\n};\n\nfunction getParamBytesForAlg(alg) {\n\tvar paramBytes = paramBytesForAlg[alg];\n\tif (paramBytes) {\n\t\treturn paramBytes;\n\t}\n\n\tthrow new Error('Unknown algorithm \"' + alg + '\"');\n}\n\nmodule.exports = getParamBytesForAlg;\n",
28
+ "'use strict';\n\nvar Buffer = require('safe-buffer').Buffer;\n\nvar getParamBytesForAlg = require('./param-bytes-for-alg');\n\nvar MAX_OCTET = 0x80,\n\tCLASS_UNIVERSAL = 0,\n\tPRIMITIVE_BIT = 0x20,\n\tTAG_SEQ = 0x10,\n\tTAG_INT = 0x02,\n\tENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6),\n\tENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6);\n\nfunction base64Url(base64) {\n\treturn base64\n\t\t.replace(/=/g, '')\n\t\t.replace(/\\+/g, '-')\n\t\t.replace(/\\//g, '_');\n}\n\nfunction signatureAsBuffer(signature) {\n\tif (Buffer.isBuffer(signature)) {\n\t\treturn signature;\n\t} else if ('string' === typeof signature) {\n\t\treturn Buffer.from(signature, 'base64');\n\t}\n\n\tthrow new TypeError('ECDSA signature must be a Base64 string or a Buffer');\n}\n\nfunction derToJose(signature, alg) {\n\tsignature = signatureAsBuffer(signature);\n\tvar paramBytes = getParamBytesForAlg(alg);\n\n\t// the DER encoded param should at most be the param size, plus a padding\n\t// zero, since due to being a signed integer\n\tvar maxEncodedParamLength = paramBytes + 1;\n\n\tvar inputLength = signature.length;\n\n\tvar offset = 0;\n\tif (signature[offset++] !== ENCODED_TAG_SEQ) {\n\t\tthrow new Error('Could not find expected \"seq\"');\n\t}\n\n\tvar seqLength = signature[offset++];\n\tif (seqLength === (MAX_OCTET | 1)) {\n\t\tseqLength = signature[offset++];\n\t}\n\n\tif (inputLength - offset < seqLength) {\n\t\tthrow new Error('\"seq\" specified length of \"' + seqLength + '\", only \"' + (inputLength - offset) + '\" remaining');\n\t}\n\n\tif (signature[offset++] !== ENCODED_TAG_INT) {\n\t\tthrow new Error('Could not find expected \"int\" for \"r\"');\n\t}\n\n\tvar rLength = signature[offset++];\n\n\tif (inputLength - offset - 2 < rLength) {\n\t\tthrow new Error('\"r\" specified length of \"' + rLength + '\", only \"' + (inputLength - offset - 2) + '\" available');\n\t}\n\n\tif (maxEncodedParamLength < rLength) {\n\t\tthrow new Error('\"r\" specified length of \"' + rLength + '\", max of \"' + maxEncodedParamLength + '\" is acceptable');\n\t}\n\n\tvar rOffset = offset;\n\toffset += rLength;\n\n\tif (signature[offset++] !== ENCODED_TAG_INT) {\n\t\tthrow new Error('Could not find expected \"int\" for \"s\"');\n\t}\n\n\tvar sLength = signature[offset++];\n\n\tif (inputLength - offset !== sLength) {\n\t\tthrow new Error('\"s\" specified length of \"' + sLength + '\", expected \"' + (inputLength - offset) + '\"');\n\t}\n\n\tif (maxEncodedParamLength < sLength) {\n\t\tthrow new Error('\"s\" specified length of \"' + sLength + '\", max of \"' + maxEncodedParamLength + '\" is acceptable');\n\t}\n\n\tvar sOffset = offset;\n\toffset += sLength;\n\n\tif (offset !== inputLength) {\n\t\tthrow new Error('Expected to consume entire buffer, but \"' + (inputLength - offset) + '\" bytes remain');\n\t}\n\n\tvar rPadding = paramBytes - rLength,\n\t\tsPadding = paramBytes - sLength;\n\n\tvar dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength);\n\n\tfor (offset = 0; offset < rPadding; ++offset) {\n\t\tdst[offset] = 0;\n\t}\n\tsignature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength);\n\n\toffset = paramBytes;\n\n\tfor (var o = offset; offset < o + sPadding; ++offset) {\n\t\tdst[offset] = 0;\n\t}\n\tsignature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength);\n\n\tdst = dst.toString('base64');\n\tdst = base64Url(dst);\n\n\treturn dst;\n}\n\nfunction countPadding(buf, start, stop) {\n\tvar padding = 0;\n\twhile (start + padding < stop && buf[start + padding] === 0) {\n\t\t++padding;\n\t}\n\n\tvar needsSign = buf[start + padding] >= MAX_OCTET;\n\tif (needsSign) {\n\t\t--padding;\n\t}\n\n\treturn padding;\n}\n\nfunction joseToDer(signature, alg) {\n\tsignature = signatureAsBuffer(signature);\n\tvar paramBytes = getParamBytesForAlg(alg);\n\n\tvar signatureBytes = signature.length;\n\tif (signatureBytes !== paramBytes * 2) {\n\t\tthrow new TypeError('\"' + alg + '\" signatures must be \"' + paramBytes * 2 + '\" bytes, saw \"' + signatureBytes + '\"');\n\t}\n\n\tvar rPadding = countPadding(signature, 0, paramBytes);\n\tvar sPadding = countPadding(signature, paramBytes, signature.length);\n\tvar rLength = paramBytes - rPadding;\n\tvar sLength = paramBytes - sPadding;\n\n\tvar rsBytes = 1 + 1 + rLength + 1 + 1 + sLength;\n\n\tvar shortLength = rsBytes < MAX_OCTET;\n\n\tvar dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes);\n\n\tvar offset = 0;\n\tdst[offset++] = ENCODED_TAG_SEQ;\n\tif (shortLength) {\n\t\t// Bit 8 has value \"0\"\n\t\t// bits 7-1 give the length.\n\t\tdst[offset++] = rsBytes;\n\t} else {\n\t\t// Bit 8 of first octet has value \"1\"\n\t\t// bits 7-1 give the number of additional length octets.\n\t\tdst[offset++] = MAX_OCTET\t| 1;\n\t\t// length, base 256\n\t\tdst[offset++] = rsBytes & 0xff;\n\t}\n\tdst[offset++] = ENCODED_TAG_INT;\n\tdst[offset++] = rLength;\n\tif (rPadding < 0) {\n\t\tdst[offset++] = 0;\n\t\toffset += signature.copy(dst, offset, 0, paramBytes);\n\t} else {\n\t\toffset += signature.copy(dst, offset, rPadding, paramBytes);\n\t}\n\tdst[offset++] = ENCODED_TAG_INT;\n\tdst[offset++] = sLength;\n\tif (sPadding < 0) {\n\t\tdst[offset++] = 0;\n\t\tsignature.copy(dst, offset, paramBytes);\n\t} else {\n\t\tsignature.copy(dst, offset, paramBytes + sPadding);\n\t}\n\n\treturn dst;\n}\n\nmodule.exports = {\n\tderToJose: derToJose,\n\tjoseToDer: joseToDer\n};\n",
29
+ "\"use strict\";\n// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUCache = void 0;\nexports.snakeToCamel = snakeToCamel;\nexports.originalOrCamelOptions = originalOrCamelOptions;\nexports.removeUndefinedValuesInObject = removeUndefinedValuesInObject;\nexports.isValidFile = isValidFile;\nexports.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;\nconst fs = require(\"fs\");\nconst os = require(\"os\");\nconst path = require(\"path\");\nconst WELL_KNOWN_CERTIFICATE_CONFIG_FILE = 'certificate_config.json';\nconst CLOUDSDK_CONFIG_DIRECTORY = 'gcloud';\n/**\n * Returns the camel case of a provided string.\n *\n * @remarks\n *\n * Match any `_` and not `_` pair, then return the uppercase of the not `_`\n * character.\n *\n * @param str the string to convert\n * @returns the camelCase'd string\n */\nfunction snakeToCamel(str) {\n return str.replace(/([_][^_])/g, match => match.slice(1).toUpperCase());\n}\n/**\n * Get the value of `obj[key]` or `obj[camelCaseKey]`, with a preference\n * for original, non-camelCase key.\n *\n * @param obj object to lookup a value in\n * @returns a `get` function for getting `obj[key || snakeKey]`, if available\n */\nfunction originalOrCamelOptions(obj) {\n /**\n *\n * @param key an index of object, preferably snake_case\n * @returns the value `obj[key || snakeKey]`, if available\n */\n function get(key) {\n const o = (obj || {});\n return o[key] ?? o[snakeToCamel(key)];\n }\n return { get };\n}\n/**\n * A simple LRU cache utility.\n * Not meant for external usage.\n *\n * @experimental\n */\nclass LRUCache {\n capacity;\n /**\n * Maps are in order. Thus, the older item is the first item.\n *\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map}\n */\n #cache = new Map();\n maxAge;\n constructor(options) {\n this.capacity = options.capacity;\n this.maxAge = options.maxAge;\n }\n /**\n * Moves the key to the end of the cache.\n *\n * @param key the key to move\n * @param value the value of the key\n */\n #moveToEnd(key, value) {\n this.#cache.delete(key);\n this.#cache.set(key, {\n value,\n lastAccessed: Date.now(),\n });\n }\n /**\n * Add an item to the cache.\n *\n * @param key the key to upsert\n * @param value the value of the key\n */\n set(key, value) {\n this.#moveToEnd(key, value);\n this.#evict();\n }\n /**\n * Get an item from the cache.\n *\n * @param key the key to retrieve\n */\n get(key) {\n const item = this.#cache.get(key);\n if (!item)\n return;\n this.#moveToEnd(key, item.value);\n this.#evict();\n return item.value;\n }\n /**\n * Maintain the cache based on capacity and TTL.\n */\n #evict() {\n const cutoffDate = this.maxAge ? Date.now() - this.maxAge : 0;\n /**\n * Because we know Maps are in order, this item is both the\n * last item in the list (capacity) and oldest (maxAge).\n */\n let oldestItem = this.#cache.entries().next();\n while (!oldestItem.done &&\n (this.#cache.size > this.capacity || // too many\n oldestItem.value[1].lastAccessed < cutoffDate) // too old\n ) {\n this.#cache.delete(oldestItem.value[0]);\n oldestItem = this.#cache.entries().next();\n }\n }\n}\nexports.LRUCache = LRUCache;\n// Given and object remove fields where value is undefined.\nfunction removeUndefinedValuesInObject(object) {\n Object.entries(object).forEach(([key, value]) => {\n if (value === undefined || value === 'undefined') {\n delete object[key];\n }\n });\n return object;\n}\n/**\n * Helper to check if a path points to a valid file.\n */\nasync function isValidFile(filePath) {\n try {\n const stats = await fs.promises.lstat(filePath);\n return stats.isFile();\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Determines the well-known gcloud location for the certificate config file.\n * @returns The platform-specific path to the configuration file.\n * @internal\n */\nfunction getWellKnownCertificateConfigFileLocation() {\n const configDir = process.env.CLOUDSDK_CONFIG ||\n (_isWindows()\n ? path.join(process.env.APPDATA || '', CLOUDSDK_CONFIG_DIRECTORY)\n : path.join(process.env.HOME || '', '.config', CLOUDSDK_CONFIG_DIRECTORY));\n return path.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);\n}\n/**\n * Checks if the current operating system is Windows.\n * @returns True if the OS is Windows, false otherwise.\n * @internal\n */\nfunction _isWindows() {\n return os.platform().startsWith('win');\n}\n//# sourceMappingURL=util.js.map",
30
+ "\"use strict\";\n// Copyright 2023 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.USER_AGENT = exports.PRODUCT_NAME = exports.pkg = void 0;\nconst pkg = require('../../package.json');\nexports.pkg = pkg;\nconst PRODUCT_NAME = 'google-api-nodejs-client';\nexports.PRODUCT_NAME = PRODUCT_NAME;\nconst USER_AGENT = `${PRODUCT_NAME}/${pkg.version}`;\nexports.USER_AGENT = USER_AGENT;\n//# sourceMappingURL=shared.cjs.map",
31
+ "\"use strict\";\n// Copyright 2012 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthClient = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = exports.DEFAULT_UNIVERSE = void 0;\nconst events_1 = require(\"events\");\nconst gaxios_1 = require(\"gaxios\");\nconst util_1 = require(\"../util\");\nconst google_logging_utils_1 = require(\"google-logging-utils\");\nconst shared_cjs_1 = require(\"../shared.cjs\");\n/**\n * The default cloud universe\n *\n * @see {@link AuthJSONOptions.universe_domain}\n */\nexports.DEFAULT_UNIVERSE = 'googleapis.com';\n/**\n * The default {@link AuthClientOptions.eagerRefreshThresholdMillis}\n */\nexports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = 5 * 60 * 1000;\n/**\n * The base of all Auth Clients.\n */\nclass AuthClient extends events_1.EventEmitter {\n apiKey;\n projectId;\n /**\n * The quota project ID. The quota project can be used by client libraries for the billing purpose.\n * See {@link https://cloud.google.com/docs/quota Working with quotas}\n */\n quotaProjectId;\n /**\n * The {@link Gaxios `Gaxios`} instance used for making requests.\n */\n transporter;\n credentials = {};\n eagerRefreshThresholdMillis = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;\n forceRefreshOnFailure = false;\n universeDomain = exports.DEFAULT_UNIVERSE;\n /**\n * Symbols that can be added to GaxiosOptions to specify the method name that is\n * making an RPC call, for logging purposes, as well as a string ID that can be\n * used to correlate calls and responses.\n */\n static RequestMethodNameSymbol = Symbol('request method name');\n static RequestLogIdSymbol = Symbol('request log id');\n constructor(opts = {}) {\n super();\n const options = (0, util_1.originalOrCamelOptions)(opts);\n // Shared auth options\n this.apiKey = opts.apiKey;\n this.projectId = options.get('project_id') ?? null;\n this.quotaProjectId = options.get('quota_project_id');\n this.credentials = options.get('credentials') ?? {};\n this.universeDomain = options.get('universe_domain') ?? exports.DEFAULT_UNIVERSE;\n // Shared client options\n this.transporter = opts.transporter ?? new gaxios_1.Gaxios(opts.transporterOptions);\n if (options.get('useAuthRequestParameters') !== false) {\n this.transporter.interceptors.request.add(AuthClient.DEFAULT_REQUEST_INTERCEPTOR);\n this.transporter.interceptors.response.add(AuthClient.DEFAULT_RESPONSE_INTERCEPTOR);\n }\n if (opts.eagerRefreshThresholdMillis) {\n this.eagerRefreshThresholdMillis = opts.eagerRefreshThresholdMillis;\n }\n this.forceRefreshOnFailure = opts.forceRefreshOnFailure ?? false;\n }\n /**\n * A {@link fetch `fetch`} compliant API for {@link AuthClient}.\n *\n * @see {@link AuthClient.request} for the classic method.\n *\n * @remarks\n *\n * This is useful as a drop-in replacement for `fetch` API usage.\n *\n * @example\n *\n * ```ts\n * const authClient = new AuthClient();\n * const fetchWithAuthClient: typeof fetch = (...args) => authClient.fetch(...args);\n * await fetchWithAuthClient('https://example.com');\n * ```\n *\n * @param args `fetch` API or {@link Gaxios.fetch `Gaxios#fetch`} parameters\n * @returns the {@link GaxiosResponse} with Gaxios-added properties\n */\n fetch(...args) {\n // Up to 2 parameters in either overload\n const input = args[0];\n const init = args[1];\n let url = undefined;\n const headers = new Headers();\n // prepare URL\n if (typeof input === 'string') {\n url = new URL(input);\n }\n else if (input instanceof URL) {\n url = input;\n }\n else if (input && input.url) {\n url = new URL(input.url);\n }\n // prepare headers\n if (input && typeof input === 'object' && 'headers' in input) {\n gaxios_1.Gaxios.mergeHeaders(headers, input.headers);\n }\n if (init) {\n gaxios_1.Gaxios.mergeHeaders(headers, new Headers(init.headers));\n }\n // prepare request\n if (typeof input === 'object' && !(input instanceof URL)) {\n // input must have been a non-URL object\n return this.request({ ...init, ...input, headers, url });\n }\n else {\n // input must have been a string or URL\n return this.request({ ...init, headers, url });\n }\n }\n /**\n * Sets the auth credentials.\n */\n setCredentials(credentials) {\n this.credentials = credentials;\n }\n /**\n * Append additional headers, e.g., x-goog-user-project, shared across the\n * classes inheriting AuthClient. This method should be used by any method\n * that overrides getRequestMetadataAsync(), which is a shared helper for\n * setting request information in both gRPC and HTTP API calls.\n *\n * @param headers object to append additional headers to.\n */\n addSharedMetadataHeaders(headers) {\n // quota_project_id, stored in application_default_credentials.json, is set in\n // the x-goog-user-project header, to indicate an alternate account for\n // billing and quota:\n if (!headers.has('x-goog-user-project') && // don't override a value the user sets.\n this.quotaProjectId) {\n headers.set('x-goog-user-project', this.quotaProjectId);\n }\n return headers;\n }\n /**\n * Adds the `x-goog-user-project` and `authorization` headers to the target Headers\n * object, if they exist on the source.\n *\n * @param target the headers to target\n * @param source the headers to source from\n * @returns the target headers\n */\n addUserProjectAndAuthHeaders(target, source) {\n const xGoogUserProject = source.get('x-goog-user-project');\n const authorizationHeader = source.get('authorization');\n if (xGoogUserProject) {\n target.set('x-goog-user-project', xGoogUserProject);\n }\n if (authorizationHeader) {\n target.set('authorization', authorizationHeader);\n }\n return target;\n }\n static log = (0, google_logging_utils_1.log)('auth');\n static DEFAULT_REQUEST_INTERCEPTOR = {\n resolved: async (config) => {\n // Set `x-goog-api-client`, if not already set\n if (!config.headers.has('x-goog-api-client')) {\n const nodeVersion = process.version.replace(/^v/, '');\n config.headers.set('x-goog-api-client', `gl-node/${nodeVersion}`);\n }\n // Set `User-Agent`\n const userAgent = config.headers.get('User-Agent');\n if (!userAgent) {\n config.headers.set('User-Agent', shared_cjs_1.USER_AGENT);\n }\n else if (!userAgent.includes(`${shared_cjs_1.PRODUCT_NAME}/`)) {\n config.headers.set('User-Agent', `${userAgent} ${shared_cjs_1.USER_AGENT}`);\n }\n try {\n const symbols = config;\n const methodName = symbols[AuthClient.RequestMethodNameSymbol];\n // This doesn't need to be very unique or interesting, it's just an aid for\n // matching requests to responses.\n const logId = `${Math.floor(Math.random() * 1000)}`;\n symbols[AuthClient.RequestLogIdSymbol] = logId;\n // Boil down the object we're printing out.\n const logObject = {\n url: config.url,\n headers: config.headers,\n };\n if (methodName) {\n AuthClient.log.info('%s [%s] request %j', methodName, logId, logObject);\n }\n else {\n AuthClient.log.info('[%s] request %j', logId, logObject);\n }\n }\n catch (e) {\n // Logging must not create new errors; swallow them all.\n }\n return config;\n },\n };\n static DEFAULT_RESPONSE_INTERCEPTOR = {\n resolved: async (response) => {\n try {\n const symbols = response.config;\n const methodName = symbols[AuthClient.RequestMethodNameSymbol];\n const logId = symbols[AuthClient.RequestLogIdSymbol];\n if (methodName) {\n AuthClient.log.info('%s [%s] response %j', methodName, logId, response.data);\n }\n else {\n AuthClient.log.info('[%s] response %j', logId, response.data);\n }\n }\n catch (e) {\n // Logging must not create new errors; swallow them all.\n }\n return response;\n },\n rejected: async (error) => {\n try {\n const symbols = error.config;\n const methodName = symbols[AuthClient.RequestMethodNameSymbol];\n const logId = symbols[AuthClient.RequestLogIdSymbol];\n if (methodName) {\n AuthClient.log.info('%s [%s] error %j', methodName, logId, error.response?.data);\n }\n else {\n AuthClient.log.error('[%s] error %j', logId, error.response?.data);\n }\n }\n catch (e) {\n // Logging must not create new errors; swallow them all.\n }\n // Re-throw the error.\n throw error;\n },\n };\n /**\n * Sets the method name that is making a Gaxios request, so that logging may tag\n * log lines with the operation.\n * @param config A Gaxios request config\n * @param methodName The method name making the call\n */\n static setMethodName(config, methodName) {\n try {\n const symbols = config;\n symbols[AuthClient.RequestMethodNameSymbol] = methodName;\n }\n catch (e) {\n // Logging must not create new errors; swallow them all.\n }\n }\n /**\n * Retry config for Auth-related requests.\n *\n * @remarks\n *\n * This is not a part of the default {@link AuthClient.transporter transporter/gaxios}\n * config as some downstream APIs would prefer if customers explicitly enable retries,\n * such as GCS.\n */\n static get RETRY_CONFIG() {\n return {\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['GET', 'PUT', 'POST', 'HEAD', 'OPTIONS', 'DELETE'],\n },\n };\n }\n}\nexports.AuthClient = AuthClient;\n//# sourceMappingURL=authclient.js.map",
32
+ "\"use strict\";\n// Copyright 2014 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LoginTicket = void 0;\nclass LoginTicket {\n envelope;\n payload;\n /**\n * Create a simple class to extract user ID from an ID Token\n *\n * @param {string} env Envelope of the jwt\n * @param {TokenPayload} pay Payload of the jwt\n * @constructor\n */\n constructor(env, pay) {\n this.envelope = env;\n this.payload = pay;\n }\n getEnvelope() {\n return this.envelope;\n }\n getPayload() {\n return this.payload;\n }\n /**\n * Create a simple class to extract user ID from an ID Token\n *\n * @return The user ID\n */\n getUserId() {\n const payload = this.getPayload();\n if (payload && payload.sub) {\n return payload.sub;\n }\n return null;\n }\n /**\n * Returns attributes from the login ticket. This can contain\n * various information about the user session.\n *\n * @return The envelope and payload\n */\n getAttributes() {\n return { envelope: this.getEnvelope(), payload: this.getPayload() };\n }\n}\nexports.LoginTicket = LoginTicket;\n//# sourceMappingURL=loginticket.js.map",
33
+ "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuth2Client = exports.ClientAuthentication = exports.CertificateFormat = exports.CodeChallengeMethod = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst querystring = require(\"querystring\");\nconst stream = require(\"stream\");\nconst formatEcdsa = require(\"ecdsa-sig-formatter\");\nconst util_1 = require(\"../util\");\nconst crypto_1 = require(\"../crypto/crypto\");\nconst authclient_1 = require(\"./authclient\");\nconst loginticket_1 = require(\"./loginticket\");\nvar CodeChallengeMethod;\n(function (CodeChallengeMethod) {\n CodeChallengeMethod[\"Plain\"] = \"plain\";\n CodeChallengeMethod[\"S256\"] = \"S256\";\n})(CodeChallengeMethod || (exports.CodeChallengeMethod = CodeChallengeMethod = {}));\nvar CertificateFormat;\n(function (CertificateFormat) {\n CertificateFormat[\"PEM\"] = \"PEM\";\n CertificateFormat[\"JWK\"] = \"JWK\";\n})(CertificateFormat || (exports.CertificateFormat = CertificateFormat = {}));\n/**\n * The client authentication type. Supported values are basic, post, and none.\n * https://datatracker.ietf.org/doc/html/rfc7591#section-2\n */\nvar ClientAuthentication;\n(function (ClientAuthentication) {\n ClientAuthentication[\"ClientSecretPost\"] = \"ClientSecretPost\";\n ClientAuthentication[\"ClientSecretBasic\"] = \"ClientSecretBasic\";\n ClientAuthentication[\"None\"] = \"None\";\n})(ClientAuthentication || (exports.ClientAuthentication = ClientAuthentication = {}));\nclass OAuth2Client extends authclient_1.AuthClient {\n redirectUri;\n certificateCache = {};\n certificateExpiry = null;\n certificateCacheFormat = CertificateFormat.PEM;\n refreshTokenPromises = new Map();\n endpoints;\n issuers;\n clientAuthentication;\n // TODO: refactor tests to make this private\n _clientId;\n // TODO: refactor tests to make this private\n _clientSecret;\n refreshHandler;\n /**\n * An OAuth2 Client for Google APIs.\n *\n * @param options The OAuth2 Client Options. Passing an `clientId` directly is **@DEPRECATED**.\n * @param clientSecret **@DEPRECATED**. Provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead.\n * @param redirectUri **@DEPRECATED**. Provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead.\n */\n constructor(options = {}, \n /**\n * @deprecated - provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead\n */\n clientSecret, \n /**\n * @deprecated - provide a {@link OAuth2ClientOptions `OAuth2ClientOptions`} object in the first parameter instead\n */\n redirectUri) {\n super(typeof options === 'object' ? options : {});\n if (typeof options !== 'object') {\n options = {\n clientId: options,\n clientSecret,\n redirectUri,\n };\n }\n this._clientId = options.clientId || options.client_id;\n this._clientSecret = options.clientSecret || options.client_secret;\n this.redirectUri = options.redirectUri || options.redirect_uris?.[0];\n this.endpoints = {\n tokenInfoUrl: 'https://oauth2.googleapis.com/tokeninfo',\n oauth2AuthBaseUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n oauth2TokenUrl: 'https://oauth2.googleapis.com/token',\n oauth2RevokeUrl: 'https://oauth2.googleapis.com/revoke',\n oauth2FederatedSignonPemCertsUrl: 'https://www.googleapis.com/oauth2/v1/certs',\n oauth2FederatedSignonJwkCertsUrl: 'https://www.googleapis.com/oauth2/v3/certs',\n oauth2IapPublicKeyUrl: 'https://www.gstatic.com/iap/verify/public_key',\n ...options.endpoints,\n };\n this.clientAuthentication =\n options.clientAuthentication || ClientAuthentication.ClientSecretPost;\n this.issuers = options.issuers || [\n 'accounts.google.com',\n 'https://accounts.google.com',\n this.universeDomain,\n ];\n }\n /**\n * @deprecated use instance's {@link OAuth2Client.endpoints}\n */\n static GOOGLE_TOKEN_INFO_URL = 'https://oauth2.googleapis.com/tokeninfo';\n /**\n * Clock skew - five minutes in seconds\n */\n static CLOCK_SKEW_SECS_ = 300;\n /**\n * The default max Token Lifetime is one day in seconds\n */\n static DEFAULT_MAX_TOKEN_LIFETIME_SECS_ = 86400;\n /**\n * Generates URL for consent page landing.\n * @param opts Options.\n * @return URL to consent page.\n */\n generateAuthUrl(opts = {}) {\n if (opts.code_challenge_method && !opts.code_challenge) {\n throw new Error('If a code_challenge_method is provided, code_challenge must be included.');\n }\n opts.response_type = opts.response_type || 'code';\n opts.client_id = opts.client_id || this._clientId;\n opts.redirect_uri = opts.redirect_uri || this.redirectUri;\n // Allow scopes to be passed either as array or a string\n if (Array.isArray(opts.scope)) {\n opts.scope = opts.scope.join(' ');\n }\n const rootUrl = this.endpoints.oauth2AuthBaseUrl.toString();\n return (rootUrl +\n '?' +\n querystring.stringify(opts));\n }\n generateCodeVerifier() {\n // To make the code compatible with browser SubtleCrypto we need to make\n // this method async.\n throw new Error('generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.');\n }\n /**\n * Convenience method to automatically generate a code_verifier, and its\n * resulting SHA256. If used, this must be paired with a S256\n * code_challenge_method.\n *\n * For a full example see:\n * https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js\n */\n async generateCodeVerifierAsync() {\n // base64 encoding uses 6 bits per character, and we want to generate128\n // characters. 6*128/8 = 96.\n const crypto = (0, crypto_1.createCrypto)();\n const randomString = crypto.randomBytesBase64(96);\n // The valid characters in the code_verifier are [A-Z]/[a-z]/[0-9]/\n // \"-\"/\".\"/\"_\"/\"~\". Base64 encoded strings are pretty close, so we're just\n // swapping out a few chars.\n const codeVerifier = randomString\n .replace(/\\+/g, '~')\n .replace(/=/g, '_')\n .replace(/\\//g, '-');\n // Generate the base64 encoded SHA256\n const unencodedCodeChallenge = await crypto.sha256DigestBase64(codeVerifier);\n // We need to use base64UrlEncoding instead of standard base64\n const codeChallenge = unencodedCodeChallenge\n .split('=')[0]\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n return { codeVerifier, codeChallenge };\n }\n getToken(codeOrOptions, callback) {\n const options = typeof codeOrOptions === 'string' ? { code: codeOrOptions } : codeOrOptions;\n if (callback) {\n this.getTokenAsync(options).then(r => callback(null, r.tokens, r.res), e => callback(e, null, e.response));\n }\n else {\n return this.getTokenAsync(options);\n }\n }\n async getTokenAsync(options) {\n const url = this.endpoints.oauth2TokenUrl.toString();\n const headers = new Headers();\n const values = {\n client_id: options.client_id || this._clientId,\n code_verifier: options.codeVerifier,\n code: options.code,\n grant_type: 'authorization_code',\n redirect_uri: options.redirect_uri || this.redirectUri,\n };\n if (this.clientAuthentication === ClientAuthentication.ClientSecretBasic) {\n const basic = Buffer.from(`${this._clientId}:${this._clientSecret}`);\n headers.set('authorization', `Basic ${basic.toString('base64')}`);\n }\n if (this.clientAuthentication === ClientAuthentication.ClientSecretPost) {\n values.client_secret = this._clientSecret;\n }\n const opts = {\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n url,\n data: new URLSearchParams((0, util_1.removeUndefinedValuesInObject)(values)),\n headers,\n };\n authclient_1.AuthClient.setMethodName(opts, 'getTokenAsync');\n const res = await this.transporter.request(opts);\n const tokens = res.data;\n if (res.data && res.data.expires_in) {\n tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res };\n }\n /**\n * Refreshes the access token.\n * @param refresh_token Existing refresh token.\n * @private\n */\n async refreshToken(refreshToken) {\n if (!refreshToken) {\n return this.refreshTokenNoCache(refreshToken);\n }\n // If a request to refresh using the same token has started,\n // return the same promise.\n if (this.refreshTokenPromises.has(refreshToken)) {\n return this.refreshTokenPromises.get(refreshToken);\n }\n const p = this.refreshTokenNoCache(refreshToken).then(r => {\n this.refreshTokenPromises.delete(refreshToken);\n return r;\n }, e => {\n this.refreshTokenPromises.delete(refreshToken);\n throw e;\n });\n this.refreshTokenPromises.set(refreshToken, p);\n return p;\n }\n async refreshTokenNoCache(refreshToken) {\n if (!refreshToken) {\n throw new Error('No refresh token is set.');\n }\n const url = this.endpoints.oauth2TokenUrl.toString();\n const data = {\n refresh_token: refreshToken,\n client_id: this._clientId,\n client_secret: this._clientSecret,\n grant_type: 'refresh_token',\n };\n let res;\n try {\n const opts = {\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n url,\n data: new URLSearchParams((0, util_1.removeUndefinedValuesInObject)(data)),\n };\n authclient_1.AuthClient.setMethodName(opts, 'refreshTokenNoCache');\n // request for new token\n res = await this.transporter.request(opts);\n }\n catch (e) {\n if (e instanceof gaxios_1.GaxiosError &&\n e.message === 'invalid_grant' &&\n e.response?.data &&\n /ReAuth/i.test(e.response.data.error_description)) {\n e.message = JSON.stringify(e.response.data);\n }\n throw e;\n }\n const tokens = res.data;\n // TODO: de-duplicate this code from a few spots\n if (res.data && res.data.expires_in) {\n tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res };\n }\n refreshAccessToken(callback) {\n if (callback) {\n this.refreshAccessTokenAsync().then(r => callback(null, r.credentials, r.res), callback);\n }\n else {\n return this.refreshAccessTokenAsync();\n }\n }\n async refreshAccessTokenAsync() {\n const r = await this.refreshToken(this.credentials.refresh_token);\n const tokens = r.tokens;\n tokens.refresh_token = this.credentials.refresh_token;\n this.credentials = tokens;\n return { credentials: this.credentials, res: r.res };\n }\n getAccessToken(callback) {\n if (callback) {\n this.getAccessTokenAsync().then(r => callback(null, r.token, r.res), callback);\n }\n else {\n return this.getAccessTokenAsync();\n }\n }\n async getAccessTokenAsync() {\n const shouldRefresh = !this.credentials.access_token || this.isTokenExpiring();\n if (shouldRefresh) {\n if (!this.credentials.refresh_token) {\n if (this.refreshHandler) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken?.access_token) {\n this.setCredentials(refreshedAccessToken);\n return { token: this.credentials.access_token };\n }\n }\n else {\n throw new Error('No refresh token or refresh handler callback is set.');\n }\n }\n const r = await this.refreshAccessTokenAsync();\n if (!r.credentials || (r.credentials && !r.credentials.access_token)) {\n throw new Error('Could not refresh access token.');\n }\n return { token: r.credentials.access_token, res: r.res };\n }\n else {\n return { token: this.credentials.access_token };\n }\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * In OAuth2Client, the result has the form:\n * { authorization: 'Bearer <access_token_value>' }\n */\n async getRequestHeaders(url) {\n const headers = (await this.getRequestMetadataAsync(url)).headers;\n return headers;\n }\n async getRequestMetadataAsync(url) {\n url;\n const thisCreds = this.credentials;\n if (!thisCreds.access_token &&\n !thisCreds.refresh_token &&\n !this.apiKey &&\n !this.refreshHandler) {\n throw new Error('No access, refresh token, API key or refresh handler callback is set.');\n }\n if (thisCreds.access_token && !this.isTokenExpiring()) {\n thisCreds.token_type = thisCreds.token_type || 'Bearer';\n const headers = new Headers({\n authorization: thisCreds.token_type + ' ' + thisCreds.access_token,\n });\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n // If refreshHandler exists, call processAndValidateRefreshHandler().\n if (this.refreshHandler) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken?.access_token) {\n this.setCredentials(refreshedAccessToken);\n const headers = new Headers({\n authorization: 'Bearer ' + this.credentials.access_token,\n });\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n }\n if (this.apiKey) {\n return { headers: new Headers({ 'X-Goog-Api-Key': this.apiKey }) };\n }\n let r = null;\n let tokens = null;\n try {\n r = await this.refreshToken(thisCreds.refresh_token);\n tokens = r.tokens;\n }\n catch (err) {\n const e = err;\n if (e.response &&\n (e.response.status === 403 || e.response.status === 404)) {\n e.message = `Could not refresh access token: ${e.message}`;\n }\n throw e;\n }\n const credentials = this.credentials;\n credentials.token_type = credentials.token_type || 'Bearer';\n tokens.refresh_token = credentials.refresh_token;\n this.credentials = tokens;\n const headers = new Headers({\n authorization: credentials.token_type + ' ' + tokens.access_token,\n });\n return { headers: this.addSharedMetadataHeaders(headers), res: r.res };\n }\n /**\n * Generates an URL to revoke the given token.\n * @param token The existing token to be revoked.\n *\n * @deprecated use instance method {@link OAuth2Client.getRevokeTokenURL}\n */\n static getRevokeTokenUrl(token) {\n return new OAuth2Client().getRevokeTokenURL(token).toString();\n }\n /**\n * Generates a URL to revoke the given token.\n *\n * @param token The existing token to be revoked.\n */\n getRevokeTokenURL(token) {\n const url = new URL(this.endpoints.oauth2RevokeUrl);\n url.searchParams.append('token', token);\n return url;\n }\n revokeToken(token, callback) {\n const opts = {\n ...OAuth2Client.RETRY_CONFIG,\n url: this.getRevokeTokenURL(token).toString(),\n method: 'POST',\n };\n authclient_1.AuthClient.setMethodName(opts, 'revokeToken');\n if (callback) {\n this.transporter\n .request(opts)\n .then(r => callback(null, r), callback);\n }\n else {\n return this.transporter.request(opts);\n }\n }\n revokeCredentials(callback) {\n if (callback) {\n this.revokeCredentialsAsync().then(res => callback(null, res), callback);\n }\n else {\n return this.revokeCredentialsAsync();\n }\n }\n async revokeCredentialsAsync() {\n const token = this.credentials.access_token;\n this.credentials = {};\n if (token) {\n return this.revokeToken(token);\n }\n else {\n throw new Error('No access token to revoke.');\n }\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n async requestAsync(opts, reAuthRetried = false) {\n try {\n const r = await this.getRequestMetadataAsync();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, r.headers);\n if (this.apiKey) {\n opts.headers.set('X-Goog-Api-Key', this.apiKey);\n }\n return await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - An access_token and refresh_token were available, but either no\n // expiry_date was available or the forceRefreshOnFailure flag is set.\n // The absent expiry_date case can happen when developers stash the\n // access_token and refresh_token for later use, but the access_token\n // fails on the first try because it's expired. Some developers may\n // choose to enable forceRefreshOnFailure to mitigate time-related\n // errors.\n // Or the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - No refresh_token was available\n // - An access_token and a refreshHandler callback were available, but\n // either no expiry_date was available or the forceRefreshOnFailure\n // flag is set. The access_token fails on the first try because it's\n // expired. Some developers may choose to enable forceRefreshOnFailure\n // to mitigate time-related errors.\n const mayRequireRefresh = this.credentials &&\n this.credentials.access_token &&\n this.credentials.refresh_token &&\n (!this.credentials.expiry_date || this.forceRefreshOnFailure);\n const mayRequireRefreshWithNoRefreshToken = this.credentials &&\n this.credentials.access_token &&\n !this.credentials.refresh_token &&\n (!this.credentials.expiry_date || this.forceRefreshOnFailure) &&\n this.refreshHandler;\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n mayRequireRefresh) {\n await this.refreshAccessTokenAsync();\n return this.requestAsync(opts, true);\n }\n else if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n mayRequireRefreshWithNoRefreshToken) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken?.access_token) {\n this.setCredentials(refreshedAccessToken);\n }\n return this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n }\n verifyIdToken(options, callback) {\n // This function used to accept two arguments instead of an options object.\n // Check the types to help users upgrade with less pain.\n // This check can be removed after a 2.0 release.\n if (callback && typeof callback !== 'function') {\n throw new Error('This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.');\n }\n if (callback) {\n this.verifyIdTokenAsync(options).then(r => callback(null, r), callback);\n }\n else {\n return this.verifyIdTokenAsync(options);\n }\n }\n async verifyIdTokenAsync(options) {\n if (!options.idToken) {\n throw new Error('The verifyIdToken method requires an ID Token');\n }\n const response = await this.getFederatedSignonCertsAsync();\n const login = await this.verifySignedJwtWithCertsAsync(options.idToken, response.certs, options.audience, this.issuers, options.maxExpiry);\n return login;\n }\n /**\n * Obtains information about the provisioned access token. Especially useful\n * if you want to check the scopes that were provisioned to a given token.\n *\n * @param accessToken Required. The Access Token for which you want to get\n * user info.\n */\n async getTokenInfo(accessToken) {\n const { data } = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n headers: {\n 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',\n authorization: `Bearer ${accessToken}`,\n },\n url: this.endpoints.tokenInfoUrl.toString(),\n });\n const info = Object.assign({\n expiry_date: new Date().getTime() + data.expires_in * 1000,\n scopes: data.scope.split(' '),\n }, data);\n delete info.expires_in;\n delete info.scope;\n return info;\n }\n getFederatedSignonCerts(callback) {\n if (callback) {\n this.getFederatedSignonCertsAsync().then(r => callback(null, r.certs, r.res), callback);\n }\n else {\n return this.getFederatedSignonCertsAsync();\n }\n }\n async getFederatedSignonCertsAsync() {\n const nowTime = new Date().getTime();\n const format = (0, crypto_1.hasBrowserCrypto)()\n ? CertificateFormat.JWK\n : CertificateFormat.PEM;\n if (this.certificateExpiry &&\n nowTime < this.certificateExpiry.getTime() &&\n this.certificateCacheFormat === format) {\n return { certs: this.certificateCache, format };\n }\n let res;\n let url;\n switch (format) {\n case CertificateFormat.PEM:\n url = this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();\n break;\n case CertificateFormat.JWK:\n url = this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();\n break;\n default:\n throw new Error(`Unsupported certificate format ${format}`);\n }\n try {\n const opts = {\n ...OAuth2Client.RETRY_CONFIG,\n url,\n };\n authclient_1.AuthClient.setMethodName(opts, 'getFederatedSignonCertsAsync');\n res = await this.transporter.request(opts);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Failed to retrieve verification certificates: ${e.message}`;\n }\n throw e;\n }\n const cacheControl = res?.headers.get('cache-control');\n let cacheAge = -1;\n if (cacheControl) {\n const maxAge = /max-age=(?<maxAge>[0-9]+)/.exec(cacheControl)?.groups\n ?.maxAge;\n if (maxAge) {\n // Cache results with max-age (in seconds)\n cacheAge = Number(maxAge) * 1000; // milliseconds\n }\n }\n let certificates = {};\n switch (format) {\n case CertificateFormat.PEM:\n certificates = res.data;\n break;\n case CertificateFormat.JWK:\n for (const key of res.data.keys) {\n certificates[key.kid] = key;\n }\n break;\n default:\n throw new Error(`Unsupported certificate format ${format}`);\n }\n const now = new Date();\n this.certificateExpiry =\n cacheAge === -1 ? null : new Date(now.getTime() + cacheAge);\n this.certificateCache = certificates;\n this.certificateCacheFormat = format;\n return { certs: certificates, format, res };\n }\n getIapPublicKeys(callback) {\n if (callback) {\n this.getIapPublicKeysAsync().then(r => callback(null, r.pubkeys, r.res), callback);\n }\n else {\n return this.getIapPublicKeysAsync();\n }\n }\n async getIapPublicKeysAsync() {\n let res;\n const url = this.endpoints.oauth2IapPublicKeyUrl.toString();\n try {\n const opts = {\n ...OAuth2Client.RETRY_CONFIG,\n url,\n };\n authclient_1.AuthClient.setMethodName(opts, 'getIapPublicKeysAsync');\n res = await this.transporter.request(opts);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Failed to retrieve verification certificates: ${e.message}`;\n }\n throw e;\n }\n return { pubkeys: res.data, res };\n }\n verifySignedJwtWithCerts() {\n // To make the code compatible with browser SubtleCrypto we need to make\n // this method async.\n throw new Error('verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.');\n }\n /**\n * Verify the id token is signed with the correct certificate\n * and is from the correct audience.\n * @param jwt The jwt to verify (The ID Token in this case).\n * @param certs The array of certs to test the jwt against.\n * @param requiredAudience The audience to test the jwt against.\n * @param issuers The allowed issuers of the jwt (Optional).\n * @param maxExpiry The max expiry the certificate can be (Optional).\n * @return Returns a promise resolving to LoginTicket on verification.\n */\n async verifySignedJwtWithCertsAsync(jwt, certs, requiredAudience, issuers, maxExpiry) {\n const crypto = (0, crypto_1.createCrypto)();\n if (!maxExpiry) {\n maxExpiry = OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;\n }\n const segments = jwt.split('.');\n if (segments.length !== 3) {\n throw new Error('Wrong number of segments in token: ' + jwt);\n }\n const signed = segments[0] + '.' + segments[1];\n let signature = segments[2];\n let envelope;\n let payload;\n try {\n envelope = JSON.parse(crypto.decodeBase64StringUtf8(segments[0]));\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `Can't parse token envelope: ${segments[0]}': ${err.message}`;\n }\n throw err;\n }\n if (!envelope) {\n throw new Error(\"Can't parse token envelope: \" + segments[0]);\n }\n try {\n payload = JSON.parse(crypto.decodeBase64StringUtf8(segments[1]));\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `Can't parse token payload '${segments[0]}`;\n }\n throw err;\n }\n if (!payload) {\n throw new Error(\"Can't parse token payload: \" + segments[1]);\n }\n if (!Object.prototype.hasOwnProperty.call(certs, envelope.kid)) {\n // If this is not present, then there's no reason to attempt verification\n throw new Error('No pem found for envelope: ' + JSON.stringify(envelope));\n }\n const cert = certs[envelope.kid];\n if (envelope.alg === 'ES256') {\n signature = formatEcdsa.joseToDer(signature, 'ES256').toString('base64');\n }\n const verified = await crypto.verify(cert, signed, signature);\n if (!verified) {\n throw new Error('Invalid token signature: ' + jwt);\n }\n if (!payload.iat) {\n throw new Error('No issue time in token: ' + JSON.stringify(payload));\n }\n if (!payload.exp) {\n throw new Error('No expiration time in token: ' + JSON.stringify(payload));\n }\n const iat = Number(payload.iat);\n if (isNaN(iat))\n throw new Error('iat field using invalid format');\n const exp = Number(payload.exp);\n if (isNaN(exp))\n throw new Error('exp field using invalid format');\n const now = new Date().getTime() / 1000;\n if (exp >= now + maxExpiry) {\n throw new Error('Expiration time too far in future: ' + JSON.stringify(payload));\n }\n const earliest = iat - OAuth2Client.CLOCK_SKEW_SECS_;\n const latest = exp + OAuth2Client.CLOCK_SKEW_SECS_;\n if (now < earliest) {\n throw new Error('Token used too early, ' +\n now +\n ' < ' +\n earliest +\n ': ' +\n JSON.stringify(payload));\n }\n if (now > latest) {\n throw new Error('Token used too late, ' +\n now +\n ' > ' +\n latest +\n ': ' +\n JSON.stringify(payload));\n }\n if (issuers && issuers.indexOf(payload.iss) < 0) {\n throw new Error('Invalid issuer, expected one of [' +\n issuers +\n '], but got ' +\n payload.iss);\n }\n // Check the audience matches if we have one\n if (typeof requiredAudience !== 'undefined' && requiredAudience !== null) {\n const aud = payload.aud;\n let audVerified = false;\n // If the requiredAudience is an array, check if it contains token\n // audience\n if (requiredAudience.constructor === Array) {\n audVerified = requiredAudience.indexOf(aud) > -1;\n }\n else {\n audVerified = aud === requiredAudience;\n }\n if (!audVerified) {\n throw new Error('Wrong recipient, payload audience != requiredAudience');\n }\n }\n return new loginticket_1.LoginTicket(envelope, payload);\n }\n /**\n * Returns a promise that resolves with AccessTokenResponse type if\n * refreshHandler is defined.\n * If not, nothing is returned.\n */\n async processAndValidateRefreshHandler() {\n if (this.refreshHandler) {\n const accessTokenResponse = await this.refreshHandler();\n if (!accessTokenResponse.access_token) {\n throw new Error('No access token is returned by the refreshHandler callback.');\n }\n return accessTokenResponse;\n }\n return;\n }\n /**\n * Returns true if a token is expired or will expire within\n * eagerRefreshThresholdMillismilliseconds.\n * If there is no expiry time, assumes the token is not expired or expiring.\n */\n isTokenExpiring() {\n const expiryDate = this.credentials.expiry_date;\n return expiryDate\n ? expiryDate <= new Date().getTime() + this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.OAuth2Client = OAuth2Client;\n//# sourceMappingURL=oauth2client.js.map",
34
+ "\"use strict\";\n// Copyright 2013 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Compute = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst gcpMetadata = require(\"gcp-metadata\");\nconst oauth2client_1 = require(\"./oauth2client\");\nclass Compute extends oauth2client_1.OAuth2Client {\n serviceAccountEmail;\n scopes;\n /**\n * Google Compute Engine service account credentials.\n *\n * Retrieve access token from the metadata server.\n * See: https://cloud.google.com/compute/docs/access/authenticate-workloads#applications\n */\n constructor(options = {}) {\n super(options);\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = { expiry_date: 1, refresh_token: 'compute-placeholder' };\n this.serviceAccountEmail = options.serviceAccountEmail || 'default';\n this.scopes = Array.isArray(options.scopes)\n ? options.scopes\n : options.scopes\n ? [options.scopes]\n : [];\n }\n /**\n * Refreshes the access token.\n * @param refreshToken Unused parameter\n */\n async refreshTokenNoCache() {\n const tokenPath = `service-accounts/${this.serviceAccountEmail}/token`;\n let data;\n try {\n const instanceOptions = {\n property: tokenPath,\n };\n if (this.scopes.length > 0) {\n instanceOptions.params = {\n scopes: this.scopes.join(','),\n };\n }\n data = await gcpMetadata.instance(instanceOptions);\n }\n catch (e) {\n if (e instanceof gaxios_1.GaxiosError) {\n e.message = `Could not refresh access token: ${e.message}`;\n this.wrapError(e);\n }\n throw e;\n }\n const tokens = data;\n if (data && data.expires_in) {\n tokens.expiry_date = new Date().getTime() + data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res: null };\n }\n /**\n * Fetches an ID token.\n * @param targetAudience the audience for the fetched ID token.\n */\n async fetchIdToken(targetAudience) {\n const idTokenPath = `service-accounts/${this.serviceAccountEmail}/identity` +\n `?format=full&audience=${targetAudience}`;\n let idToken;\n try {\n const instanceOptions = {\n property: idTokenPath,\n };\n idToken = await gcpMetadata.instance(instanceOptions);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Could not fetch ID token: ${e.message}`;\n }\n throw e;\n }\n return idToken;\n }\n wrapError(e) {\n const res = e.response;\n if (res && res.status) {\n e.status = res.status;\n if (res.status === 403) {\n e.message =\n 'A Forbidden error was returned while attempting to retrieve an access ' +\n 'token for the Compute Engine built-in service account. This may be because the Compute ' +\n 'Engine instance does not have the correct permission scopes specified: ' +\n e.message;\n }\n else if (res.status === 404) {\n e.message =\n 'A Not Found error was returned while attempting to retrieve an access' +\n 'token for the Compute Engine built-in service account. This may be because the Compute ' +\n 'Engine instance does not have any permission scopes specified: ' +\n e.message;\n }\n }\n }\n}\nexports.Compute = Compute;\n//# sourceMappingURL=computeclient.js.map",
35
+ "\"use strict\";\n// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IdTokenClient = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nclass IdTokenClient extends oauth2client_1.OAuth2Client {\n targetAudience;\n idTokenProvider;\n /**\n * Google ID Token client\n *\n * Retrieve ID token from the metadata server.\n * See: https://cloud.google.com/docs/authentication/get-id-token#metadata-server\n */\n constructor(options) {\n super(options);\n this.targetAudience = options.targetAudience;\n this.idTokenProvider = options.idTokenProvider;\n }\n async getRequestMetadataAsync() {\n if (!this.credentials.id_token ||\n !this.credentials.expiry_date ||\n this.isTokenExpiring()) {\n const idToken = await this.idTokenProvider.fetchIdToken(this.targetAudience);\n this.credentials = {\n id_token: idToken,\n expiry_date: this.getIdTokenExpiryDate(idToken),\n };\n }\n const headers = new Headers({\n authorization: 'Bearer ' + this.credentials.id_token,\n });\n return { headers };\n }\n getIdTokenExpiryDate(idToken) {\n const payloadB64 = idToken.split('.')[1];\n if (payloadB64) {\n const payload = JSON.parse(Buffer.from(payloadB64, 'base64').toString('ascii'));\n return payload.exp * 1000;\n }\n }\n}\nexports.IdTokenClient = IdTokenClient;\n//# sourceMappingURL=idtokenclient.js.map",
36
+ "\"use strict\";\n// Copyright 2018 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCPEnv = void 0;\nexports.clear = clear;\nexports.getEnv = getEnv;\nconst gcpMetadata = require(\"gcp-metadata\");\nvar GCPEnv;\n(function (GCPEnv) {\n GCPEnv[\"APP_ENGINE\"] = \"APP_ENGINE\";\n GCPEnv[\"KUBERNETES_ENGINE\"] = \"KUBERNETES_ENGINE\";\n GCPEnv[\"CLOUD_FUNCTIONS\"] = \"CLOUD_FUNCTIONS\";\n GCPEnv[\"COMPUTE_ENGINE\"] = \"COMPUTE_ENGINE\";\n GCPEnv[\"CLOUD_RUN\"] = \"CLOUD_RUN\";\n GCPEnv[\"CLOUD_RUN_JOBS\"] = \"CLOUD_RUN_JOBS\";\n GCPEnv[\"NONE\"] = \"NONE\";\n})(GCPEnv || (exports.GCPEnv = GCPEnv = {}));\nlet envPromise;\nfunction clear() {\n envPromise = undefined;\n}\nasync function getEnv() {\n if (envPromise) {\n return envPromise;\n }\n envPromise = getEnvMemoized();\n return envPromise;\n}\nasync function getEnvMemoized() {\n let env = GCPEnv.NONE;\n if (isAppEngine()) {\n env = GCPEnv.APP_ENGINE;\n }\n else if (isCloudFunction()) {\n env = GCPEnv.CLOUD_FUNCTIONS;\n }\n else if (await isComputeEngine()) {\n if (await isKubernetesEngine()) {\n env = GCPEnv.KUBERNETES_ENGINE;\n }\n else if (isCloudRun()) {\n env = GCPEnv.CLOUD_RUN;\n }\n else if (isCloudRunJob()) {\n env = GCPEnv.CLOUD_RUN_JOBS;\n }\n else {\n env = GCPEnv.COMPUTE_ENGINE;\n }\n }\n else {\n env = GCPEnv.NONE;\n }\n return env;\n}\nfunction isAppEngine() {\n return !!(process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME);\n}\nfunction isCloudFunction() {\n return !!(process.env.FUNCTION_NAME || process.env.FUNCTION_TARGET);\n}\n/**\n * This check only verifies that the environment is running knative.\n * This must be run *after* checking for Kubernetes, otherwise it will\n * return a false positive.\n */\nfunction isCloudRun() {\n return !!process.env.K_CONFIGURATION;\n}\nfunction isCloudRunJob() {\n return !!process.env.CLOUD_RUN_JOB;\n}\nasync function isKubernetesEngine() {\n try {\n await gcpMetadata.instance('attributes/cluster-name');\n return true;\n }\n catch (e) {\n return false;\n }\n}\nasync function isComputeEngine() {\n return gcpMetadata.isAvailable();\n}\n//# sourceMappingURL=envDetect.js.map",
37
+ "/*global module, process*/\nvar Buffer = require('safe-buffer').Buffer;\nvar Stream = require('stream');\nvar util = require('util');\n\nfunction DataStream(data) {\n this.buffer = null;\n this.writable = true;\n this.readable = true;\n\n // No input\n if (!data) {\n this.buffer = Buffer.alloc(0);\n return this;\n }\n\n // Stream\n if (typeof data.pipe === 'function') {\n this.buffer = Buffer.alloc(0);\n data.pipe(this);\n return this;\n }\n\n // Buffer or String\n // or Object (assumedly a passworded key)\n if (data.length || typeof data === 'object') {\n this.buffer = data;\n this.writable = false;\n process.nextTick(function () {\n this.emit('end', data);\n this.readable = false;\n this.emit('close');\n }.bind(this));\n return this;\n }\n\n throw new TypeError('Unexpected data type ('+ typeof data + ')');\n}\nutil.inherits(DataStream, Stream);\n\nDataStream.prototype.write = function write(data) {\n this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]);\n this.emit('data', data);\n};\n\nDataStream.prototype.end = function end(data) {\n if (data)\n this.write(data);\n this.emit('end', data);\n this.emit('close');\n this.writable = false;\n this.readable = false;\n};\n\nmodule.exports = DataStream;\n",
38
+ "/*jshint node:true */\n'use strict';\nvar Buffer = require('buffer').Buffer; // browserify\nvar SlowBuffer = require('buffer').SlowBuffer;\n\nmodule.exports = bufferEq;\n\nfunction bufferEq(a, b) {\n\n // shortcutting on type is necessary for correctness\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n return false;\n }\n\n // buffer sizes should be well-known information, so despite this\n // shortcutting, it doesn't leak any information about the *contents* of the\n // buffers.\n if (a.length !== b.length) {\n return false;\n }\n\n var c = 0;\n for (var i = 0; i < a.length; i++) {\n /*jshint bitwise:false */\n c |= a[i] ^ b[i]; // XOR\n }\n return c === 0;\n}\n\nbufferEq.install = function() {\n Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) {\n return bufferEq(this, that);\n };\n};\n\nvar origBufEqual = Buffer.prototype.equal;\nvar origSlowBufEqual = SlowBuffer.prototype.equal;\nbufferEq.restore = function() {\n Buffer.prototype.equal = origBufEqual;\n SlowBuffer.prototype.equal = origSlowBufEqual;\n};\n",
39
+ "var Buffer = require('safe-buffer').Buffer;\nvar crypto = require('crypto');\nvar formatEcdsa = require('ecdsa-sig-formatter');\nvar util = require('util');\n\nvar MSG_INVALID_ALGORITHM = '\"%s\" is not a valid algorithm.\\n Supported algorithms are:\\n \"HS256\", \"HS384\", \"HS512\", \"RS256\", \"RS384\", \"RS512\", \"PS256\", \"PS384\", \"PS512\", \"ES256\", \"ES384\", \"ES512\" and \"none\".'\nvar MSG_INVALID_SECRET = 'secret must be a string or buffer';\nvar MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer';\nvar MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object';\n\nvar supportsKeyObjects = typeof crypto.createPublicKey === 'function';\nif (supportsKeyObjects) {\n MSG_INVALID_VERIFIER_KEY += ' or a KeyObject';\n MSG_INVALID_SECRET += 'or a KeyObject';\n}\n\nfunction checkIsPublicKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return;\n }\n\n if (!supportsKeyObjects) {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key !== 'object') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.type !== 'string') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.asymmetricKeyType !== 'string') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.export !== 'function') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n};\n\nfunction checkIsPrivateKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return;\n }\n\n if (typeof key === 'object') {\n return;\n }\n\n throw typeError(MSG_INVALID_SIGNER_KEY);\n};\n\nfunction checkIsSecretKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return key;\n }\n\n if (!supportsKeyObjects) {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (typeof key !== 'object') {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (key.type !== 'secret') {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (typeof key.export !== 'function') {\n throw typeError(MSG_INVALID_SECRET);\n }\n}\n\nfunction fromBase64(base64) {\n return base64\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}\n\nfunction toBase64(base64url) {\n base64url = base64url.toString();\n\n var padding = 4 - base64url.length % 4;\n if (padding !== 4) {\n for (var i = 0; i < padding; ++i) {\n base64url += '=';\n }\n }\n\n return base64url\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n}\n\nfunction typeError(template) {\n var args = [].slice.call(arguments, 1);\n var errMsg = util.format.bind(util, template).apply(null, args);\n return new TypeError(errMsg);\n}\n\nfunction bufferOrString(obj) {\n return Buffer.isBuffer(obj) || typeof obj === 'string';\n}\n\nfunction normalizeInput(thing) {\n if (!bufferOrString(thing))\n thing = JSON.stringify(thing);\n return thing;\n}\n\nfunction createHmacSigner(bits) {\n return function sign(thing, secret) {\n checkIsSecretKey(secret);\n thing = normalizeInput(thing);\n var hmac = crypto.createHmac('sha' + bits, secret);\n var sig = (hmac.update(thing), hmac.digest('base64'))\n return fromBase64(sig);\n }\n}\n\nvar bufferEqual;\nvar timingSafeEqual = 'timingSafeEqual' in crypto ? function timingSafeEqual(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n return crypto.timingSafeEqual(a, b)\n} : function timingSafeEqual(a, b) {\n if (!bufferEqual) {\n bufferEqual = require('buffer-equal-constant-time');\n }\n\n return bufferEqual(a, b)\n}\n\nfunction createHmacVerifier(bits) {\n return function verify(thing, signature, secret) {\n var computedSig = createHmacSigner(bits)(thing, secret);\n return timingSafeEqual(Buffer.from(signature), Buffer.from(computedSig));\n }\n}\n\nfunction createKeySigner(bits) {\n return function sign(thing, privateKey) {\n checkIsPrivateKey(privateKey);\n thing = normalizeInput(thing);\n // Even though we are specifying \"RSA\" here, this works with ECDSA\n // keys as well.\n var signer = crypto.createSign('RSA-SHA' + bits);\n var sig = (signer.update(thing), signer.sign(privateKey, 'base64'));\n return fromBase64(sig);\n }\n}\n\nfunction createKeyVerifier(bits) {\n return function verify(thing, signature, publicKey) {\n checkIsPublicKey(publicKey);\n thing = normalizeInput(thing);\n signature = toBase64(signature);\n var verifier = crypto.createVerify('RSA-SHA' + bits);\n verifier.update(thing);\n return verifier.verify(publicKey, signature, 'base64');\n }\n}\n\nfunction createPSSKeySigner(bits) {\n return function sign(thing, privateKey) {\n checkIsPrivateKey(privateKey);\n thing = normalizeInput(thing);\n var signer = crypto.createSign('RSA-SHA' + bits);\n var sig = (signer.update(thing), signer.sign({\n key: privateKey,\n padding: crypto.constants.RSA_PKCS1_PSS_PADDING,\n saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST\n }, 'base64'));\n return fromBase64(sig);\n }\n}\n\nfunction createPSSKeyVerifier(bits) {\n return function verify(thing, signature, publicKey) {\n checkIsPublicKey(publicKey);\n thing = normalizeInput(thing);\n signature = toBase64(signature);\n var verifier = crypto.createVerify('RSA-SHA' + bits);\n verifier.update(thing);\n return verifier.verify({\n key: publicKey,\n padding: crypto.constants.RSA_PKCS1_PSS_PADDING,\n saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST\n }, signature, 'base64');\n }\n}\n\nfunction createECDSASigner(bits) {\n var inner = createKeySigner(bits);\n return function sign() {\n var signature = inner.apply(null, arguments);\n signature = formatEcdsa.derToJose(signature, 'ES' + bits);\n return signature;\n };\n}\n\nfunction createECDSAVerifer(bits) {\n var inner = createKeyVerifier(bits);\n return function verify(thing, signature, publicKey) {\n signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64');\n var result = inner(thing, signature, publicKey);\n return result;\n };\n}\n\nfunction createNoneSigner() {\n return function sign() {\n return '';\n }\n}\n\nfunction createNoneVerifier() {\n return function verify(thing, signature) {\n return signature === '';\n }\n}\n\nmodule.exports = function jwa(algorithm) {\n var signerFactories = {\n hs: createHmacSigner,\n rs: createKeySigner,\n ps: createPSSKeySigner,\n es: createECDSASigner,\n none: createNoneSigner,\n }\n var verifierFactories = {\n hs: createHmacVerifier,\n rs: createKeyVerifier,\n ps: createPSSKeyVerifier,\n es: createECDSAVerifer,\n none: createNoneVerifier,\n }\n var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);\n if (!match)\n throw typeError(MSG_INVALID_ALGORITHM, algorithm);\n var algo = (match[1] || match[3]).toLowerCase();\n var bits = match[2];\n\n return {\n sign: signerFactories[algo](bits),\n verify: verifierFactories[algo](bits),\n }\n};\n",
40
+ "/*global module*/\nvar Buffer = require('buffer').Buffer;\n\nmodule.exports = function toString(obj) {\n if (typeof obj === 'string')\n return obj;\n if (typeof obj === 'number' || Buffer.isBuffer(obj))\n return obj.toString();\n return JSON.stringify(obj);\n};\n",
41
+ "/*global module*/\nvar Buffer = require('safe-buffer').Buffer;\nvar DataStream = require('./data-stream');\nvar jwa = require('jwa');\nvar Stream = require('stream');\nvar toString = require('./tostring');\nvar util = require('util');\n\nfunction base64url(string, encoding) {\n return Buffer\n .from(string, encoding)\n .toString('base64')\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}\n\nfunction jwsSecuredInput(header, payload, encoding) {\n encoding = encoding || 'utf8';\n var encodedHeader = base64url(toString(header), 'binary');\n var encodedPayload = base64url(toString(payload), encoding);\n return util.format('%s.%s', encodedHeader, encodedPayload);\n}\n\nfunction jwsSign(opts) {\n var header = opts.header;\n var payload = opts.payload;\n var secretOrKey = opts.secret || opts.privateKey;\n var encoding = opts.encoding;\n var algo = jwa(header.alg);\n var securedInput = jwsSecuredInput(header, payload, encoding);\n var signature = algo.sign(securedInput, secretOrKey);\n return util.format('%s.%s', securedInput, signature);\n}\n\nfunction SignStream(opts) {\n var secret = opts.secret;\n secret = secret == null ? opts.privateKey : secret;\n secret = secret == null ? opts.key : secret;\n if (/^hs/i.test(opts.header.alg) === true && secret == null) {\n throw new TypeError('secret must be a string or buffer or a KeyObject')\n }\n var secretStream = new DataStream(secret);\n this.readable = true;\n this.header = opts.header;\n this.encoding = opts.encoding;\n this.secret = this.privateKey = this.key = secretStream;\n this.payload = new DataStream(opts.payload);\n this.secret.once('close', function () {\n if (!this.payload.writable && this.readable)\n this.sign();\n }.bind(this));\n\n this.payload.once('close', function () {\n if (!this.secret.writable && this.readable)\n this.sign();\n }.bind(this));\n}\nutil.inherits(SignStream, Stream);\n\nSignStream.prototype.sign = function sign() {\n try {\n var signature = jwsSign({\n header: this.header,\n payload: this.payload.buffer,\n secret: this.secret.buffer,\n encoding: this.encoding\n });\n this.emit('done', signature);\n this.emit('data', signature);\n this.emit('end');\n this.readable = false;\n return signature;\n } catch (e) {\n this.readable = false;\n this.emit('error', e);\n this.emit('close');\n }\n};\n\nSignStream.sign = jwsSign;\n\nmodule.exports = SignStream;\n",
42
+ "/*global module*/\nvar Buffer = require('safe-buffer').Buffer;\nvar DataStream = require('./data-stream');\nvar jwa = require('jwa');\nvar Stream = require('stream');\nvar toString = require('./tostring');\nvar util = require('util');\nvar JWS_REGEX = /^[a-zA-Z0-9\\-_]+?\\.[a-zA-Z0-9\\-_]+?\\.([a-zA-Z0-9\\-_]+)?$/;\n\nfunction isObject(thing) {\n return Object.prototype.toString.call(thing) === '[object Object]';\n}\n\nfunction safeJsonParse(thing) {\n if (isObject(thing))\n return thing;\n try { return JSON.parse(thing); }\n catch (e) { return undefined; }\n}\n\nfunction headerFromJWS(jwsSig) {\n var encodedHeader = jwsSig.split('.', 1)[0];\n return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary'));\n}\n\nfunction securedInputFromJWS(jwsSig) {\n return jwsSig.split('.', 2).join('.');\n}\n\nfunction signatureFromJWS(jwsSig) {\n return jwsSig.split('.')[2];\n}\n\nfunction payloadFromJWS(jwsSig, encoding) {\n encoding = encoding || 'utf8';\n var payload = jwsSig.split('.')[1];\n return Buffer.from(payload, 'base64').toString(encoding);\n}\n\nfunction isValidJws(string) {\n return JWS_REGEX.test(string) && !!headerFromJWS(string);\n}\n\nfunction jwsVerify(jwsSig, algorithm, secretOrKey) {\n if (!algorithm) {\n var err = new Error(\"Missing algorithm parameter for jws.verify\");\n err.code = \"MISSING_ALGORITHM\";\n throw err;\n }\n jwsSig = toString(jwsSig);\n var signature = signatureFromJWS(jwsSig);\n var securedInput = securedInputFromJWS(jwsSig);\n var algo = jwa(algorithm);\n return algo.verify(securedInput, signature, secretOrKey);\n}\n\nfunction jwsDecode(jwsSig, opts) {\n opts = opts || {};\n jwsSig = toString(jwsSig);\n\n if (!isValidJws(jwsSig))\n return null;\n\n var header = headerFromJWS(jwsSig);\n\n if (!header)\n return null;\n\n var payload = payloadFromJWS(jwsSig);\n if (header.typ === 'JWT' || opts.json)\n payload = JSON.parse(payload, opts.encoding);\n\n return {\n header: header,\n payload: payload,\n signature: signatureFromJWS(jwsSig)\n };\n}\n\nfunction VerifyStream(opts) {\n opts = opts || {};\n var secretOrKey = opts.secret;\n secretOrKey = secretOrKey == null ? opts.publicKey : secretOrKey;\n secretOrKey = secretOrKey == null ? opts.key : secretOrKey;\n if (/^hs/i.test(opts.algorithm) === true && secretOrKey == null) {\n throw new TypeError('secret must be a string or buffer or a KeyObject')\n }\n var secretStream = new DataStream(secretOrKey);\n this.readable = true;\n this.algorithm = opts.algorithm;\n this.encoding = opts.encoding;\n this.secret = this.publicKey = this.key = secretStream;\n this.signature = new DataStream(opts.signature);\n this.secret.once('close', function () {\n if (!this.signature.writable && this.readable)\n this.verify();\n }.bind(this));\n\n this.signature.once('close', function () {\n if (!this.secret.writable && this.readable)\n this.verify();\n }.bind(this));\n}\nutil.inherits(VerifyStream, Stream);\nVerifyStream.prototype.verify = function verify() {\n try {\n var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer);\n var obj = jwsDecode(this.signature.buffer, this.encoding);\n this.emit('done', valid, obj);\n this.emit('data', valid);\n this.emit('end');\n this.readable = false;\n return valid;\n } catch (e) {\n this.readable = false;\n this.emit('error', e);\n this.emit('close');\n }\n};\n\nVerifyStream.decode = jwsDecode;\nVerifyStream.isValid = isValidJws;\nVerifyStream.verify = jwsVerify;\n\nmodule.exports = VerifyStream;\n",
43
+ "/*global exports*/\nvar SignStream = require('./lib/sign-stream');\nvar VerifyStream = require('./lib/verify-stream');\n\nvar ALGORITHMS = [\n 'HS256', 'HS384', 'HS512',\n 'RS256', 'RS384', 'RS512',\n 'PS256', 'PS384', 'PS512',\n 'ES256', 'ES384', 'ES512'\n];\n\nexports.ALGORITHMS = ALGORITHMS;\nexports.sign = SignStream.sign;\nexports.verify = VerifyStream.verify;\nexports.decode = VerifyStream.decode;\nexports.isValid = VerifyStream.isValid;\nexports.createSign = function createSign(opts) {\n return new SignStream(opts);\n};\nexports.createVerify = function createVerify(opts) {\n return new VerifyStream(opts);\n};\n",
44
+ "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GoogleToken = void 0;\nvar fs = _interopRequireWildcard(require(\"fs\"));\nvar _gaxios = require(\"gaxios\");\nvar jws = _interopRequireWildcard(require(\"jws\"));\nvar path = _interopRequireWildcard(require(\"path\"));\nvar _util = require(\"util\");\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, \"default\": e }; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) \"default\" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }\nfunction _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }\nfunction _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); }\nfunction _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }\nfunction _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }\nfunction _assertClassBrand(e, t, n) { if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError(\"Private element is not present on this object\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _wrapNativeSuper(t) { var r = \"function\" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }\nfunction _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf(\"[native code]\"); } catch (n) { return \"function\" == typeof t; } }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2); } }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; } /**\n * Copyright 2018 Google LLC\n *\n * Distributed under MIT license.\n * See file LICENSE for detail or copy at https://opensource.org/licenses/MIT\n */\nvar readFile = fs.readFile ? (0, _util.promisify)(fs.readFile) : /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n throw new ErrorWithCode('use key rather than keyFile.', 'MISSING_CREDENTIALS');\n case 1:\n return _context.a(2);\n }\n }, _callee);\n}));\nvar GOOGLE_TOKEN_URL = 'https://oauth2.googleapis.com/token';\nvar GOOGLE_REVOKE_TOKEN_URL = 'https://oauth2.googleapis.com/revoke?token=';\nvar ErrorWithCode = /*#__PURE__*/function (_Error) {\n function ErrorWithCode(message, code) {\n var _this;\n _classCallCheck(this, ErrorWithCode);\n _this = _callSuper(this, ErrorWithCode, [message]);\n _defineProperty(_this, \"code\", void 0);\n _this.code = code;\n return _this;\n }\n _inherits(ErrorWithCode, _Error);\n return _createClass(ErrorWithCode);\n}(/*#__PURE__*/_wrapNativeSuper(Error));\nvar _inFlightRequest = /*#__PURE__*/new WeakMap();\nvar _GoogleToken_brand = /*#__PURE__*/new WeakSet();\nvar GoogleToken = exports.GoogleToken = /*#__PURE__*/function () {\n /**\n * Create a GoogleToken.\n *\n * @param options Configuration object.\n */\n function GoogleToken(_options) {\n _classCallCheck(this, GoogleToken);\n _classPrivateMethodInitSpec(this, _GoogleToken_brand);\n _defineProperty(this, \"expiresAt\", void 0);\n _defineProperty(this, \"key\", void 0);\n _defineProperty(this, \"keyFile\", void 0);\n _defineProperty(this, \"iss\", void 0);\n _defineProperty(this, \"sub\", void 0);\n _defineProperty(this, \"scope\", void 0);\n _defineProperty(this, \"rawToken\", void 0);\n _defineProperty(this, \"tokenExpires\", void 0);\n _defineProperty(this, \"email\", void 0);\n _defineProperty(this, \"additionalClaims\", void 0);\n _defineProperty(this, \"eagerRefreshThresholdMillis\", void 0);\n _defineProperty(this, \"transporter\", {\n request: function request(opts) {\n return (0, _gaxios.request)(opts);\n }\n });\n _classPrivateFieldInitSpec(this, _inFlightRequest, void 0);\n _assertClassBrand(_GoogleToken_brand, this, _configure).call(this, _options);\n }\n\n /**\n * Returns whether the token has expired.\n *\n * @return true if the token has expired, false otherwise.\n */\n return _createClass(GoogleToken, [{\n key: \"accessToken\",\n get: function get() {\n return this.rawToken ? this.rawToken.access_token : undefined;\n }\n }, {\n key: \"idToken\",\n get: function get() {\n return this.rawToken ? this.rawToken.id_token : undefined;\n }\n }, {\n key: \"tokenType\",\n get: function get() {\n return this.rawToken ? this.rawToken.token_type : undefined;\n }\n }, {\n key: \"refreshToken\",\n get: function get() {\n return this.rawToken ? this.rawToken.refresh_token : undefined;\n }\n }, {\n key: \"hasExpired\",\n value: function hasExpired() {\n var now = new Date().getTime();\n if (this.rawToken && this.expiresAt) {\n return now >= this.expiresAt;\n } else {\n return true;\n }\n }\n\n /**\n * Returns whether the token will expire within eagerRefreshThresholdMillis\n *\n * @return true if the token will be expired within eagerRefreshThresholdMillis, false otherwise.\n */\n }, {\n key: \"isTokenExpiring\",\n value: function isTokenExpiring() {\n var _this$eagerRefreshThr;\n var now = new Date().getTime();\n var eagerRefreshThresholdMillis = (_this$eagerRefreshThr = this.eagerRefreshThresholdMillis) !== null && _this$eagerRefreshThr !== void 0 ? _this$eagerRefreshThr : 0;\n if (this.rawToken && this.expiresAt) {\n return this.expiresAt <= now + eagerRefreshThresholdMillis;\n } else {\n return true;\n }\n }\n\n /**\n * Returns a cached token or retrieves a new one from Google.\n *\n * @param callback The callback function.\n */\n }, {\n key: \"getToken\",\n value: function getToken(callback) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (_typeof(callback) === 'object') {\n opts = callback;\n callback = undefined;\n }\n opts = Object.assign({\n forceRefresh: false\n }, opts);\n if (callback) {\n var cb = callback;\n _assertClassBrand(_GoogleToken_brand, this, _getTokenAsync).call(this, opts).then(function (t) {\n return cb(null, t);\n }, callback);\n return;\n }\n return _assertClassBrand(_GoogleToken_brand, this, _getTokenAsync).call(this, opts);\n }\n\n /**\n * Given a keyFile, extract the key and client email if available\n * @param keyFile Path to a json, pem, or p12 file that contains the key.\n * @returns an object with privateKey and clientEmail properties\n */\n }, {\n key: \"getCredentials\",\n value: (function () {\n var _getCredentials = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(keyFile) {\n var ext, key, body, privateKey, clientEmail, _privateKey, _t;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.n) {\n case 0:\n ext = path.extname(keyFile);\n _t = ext;\n _context2.n = _t === '.json' ? 1 : _t === '.der' ? 4 : _t === '.crt' ? 4 : _t === '.pem' ? 4 : _t === '.p12' ? 6 : _t === '.pfx' ? 6 : 7;\n break;\n case 1:\n _context2.n = 2;\n return readFile(keyFile, 'utf8');\n case 2:\n key = _context2.v;\n body = JSON.parse(key);\n privateKey = body.private_key;\n clientEmail = body.client_email;\n if (!(!privateKey || !clientEmail)) {\n _context2.n = 3;\n break;\n }\n throw new ErrorWithCode('private_key and client_email are required.', 'MISSING_CREDENTIALS');\n case 3:\n return _context2.a(2, {\n privateKey: privateKey,\n clientEmail: clientEmail\n });\n case 4:\n _context2.n = 5;\n return readFile(keyFile, 'utf8');\n case 5:\n _privateKey = _context2.v;\n return _context2.a(2, {\n privateKey: _privateKey\n });\n case 6:\n throw new ErrorWithCode('*.p12 certificates are not supported after v6.1.2. ' + 'Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.', 'UNKNOWN_CERTIFICATE_TYPE');\n case 7:\n throw new ErrorWithCode('Unknown certificate type. Type is determined based on file extension. ' + 'Current supported extensions are *.json, and *.pem.', 'UNKNOWN_CERTIFICATE_TYPE');\n case 8:\n return _context2.a(2);\n }\n }, _callee2);\n }));\n function getCredentials(_x) {\n return _getCredentials.apply(this, arguments);\n }\n return getCredentials;\n }())\n }, {\n key: \"revokeToken\",\n value: function revokeToken(callback) {\n if (callback) {\n _assertClassBrand(_GoogleToken_brand, this, _revokeTokenAsync).call(this).then(function () {\n return callback();\n }, callback);\n return;\n }\n return _assertClassBrand(_GoogleToken_brand, this, _revokeTokenAsync).call(this);\n }\n }]);\n}();\nfunction _getTokenAsync(_x2) {\n return _getTokenAsync2.apply(this, arguments);\n}\nfunction _getTokenAsync2() {\n _getTokenAsync2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(opts) {\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n if (!(_classPrivateFieldGet(_inFlightRequest, this) && !opts.forceRefresh)) {\n _context3.n = 1;\n break;\n }\n return _context3.a(2, _classPrivateFieldGet(_inFlightRequest, this));\n case 1:\n _context3.p = 1;\n _context3.n = 2;\n return _classPrivateFieldSet(_inFlightRequest, this, _assertClassBrand(_GoogleToken_brand, this, _getTokenAsyncInner).call(this, opts));\n case 2:\n return _context3.a(2, _context3.v);\n case 3:\n _context3.p = 3;\n _classPrivateFieldSet(_inFlightRequest, this, undefined);\n return _context3.f(3);\n case 4:\n return _context3.a(2);\n }\n }, _callee3, this, [[1,, 3, 4]]);\n }));\n return _getTokenAsync2.apply(this, arguments);\n}\nfunction _getTokenAsyncInner(_x3) {\n return _getTokenAsyncInner2.apply(this, arguments);\n}\nfunction _getTokenAsyncInner2() {\n _getTokenAsyncInner2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(opts) {\n var creds;\n return _regenerator().w(function (_context4) {\n while (1) switch (_context4.n) {\n case 0:\n if (!(this.isTokenExpiring() === false && opts.forceRefresh === false)) {\n _context4.n = 1;\n break;\n }\n return _context4.a(2, Promise.resolve(this.rawToken));\n case 1:\n if (!(!this.key && !this.keyFile)) {\n _context4.n = 2;\n break;\n }\n throw new Error('No key or keyFile set.');\n case 2:\n if (!(!this.key && this.keyFile)) {\n _context4.n = 4;\n break;\n }\n _context4.n = 3;\n return this.getCredentials(this.keyFile);\n case 3:\n creds = _context4.v;\n this.key = creds.privateKey;\n this.iss = creds.clientEmail || this.iss;\n if (!creds.clientEmail) {\n _assertClassBrand(_GoogleToken_brand, this, _ensureEmail).call(this);\n }\n case 4:\n return _context4.a(2, _assertClassBrand(_GoogleToken_brand, this, _requestToken).call(this));\n }\n }, _callee4, this);\n }));\n return _getTokenAsyncInner2.apply(this, arguments);\n}\nfunction _ensureEmail() {\n if (!this.iss) {\n throw new ErrorWithCode('email is required.', 'MISSING_CREDENTIALS');\n }\n}\nfunction _revokeTokenAsync() {\n return _revokeTokenAsync2.apply(this, arguments);\n}\nfunction _revokeTokenAsync2() {\n _revokeTokenAsync2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {\n var url;\n return _regenerator().w(function (_context5) {\n while (1) switch (_context5.n) {\n case 0:\n if (this.accessToken) {\n _context5.n = 1;\n break;\n }\n throw new Error('No token to revoke.');\n case 1:\n url = GOOGLE_REVOKE_TOKEN_URL + this.accessToken;\n _context5.n = 2;\n return this.transporter.request({\n url: url,\n retry: true\n });\n case 2:\n _assertClassBrand(_GoogleToken_brand, this, _configure).call(this, {\n email: this.iss,\n sub: this.sub,\n key: this.key,\n keyFile: this.keyFile,\n scope: this.scope,\n additionalClaims: this.additionalClaims\n });\n case 3:\n return _context5.a(2);\n }\n }, _callee5, this);\n }));\n return _revokeTokenAsync2.apply(this, arguments);\n}\n/**\n * Configure the GoogleToken for re-use.\n * @param {object} options Configuration object.\n */\nfunction _configure() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.keyFile = options.keyFile;\n this.key = options.key;\n this.rawToken = undefined;\n this.iss = options.email || options.iss;\n this.sub = options.sub;\n this.additionalClaims = options.additionalClaims;\n if (_typeof(options.scope) === 'object') {\n this.scope = options.scope.join(' ');\n } else {\n this.scope = options.scope;\n }\n this.eagerRefreshThresholdMillis = options.eagerRefreshThresholdMillis;\n if (options.transporter) {\n this.transporter = options.transporter;\n }\n}\n/**\n * Request the token from Google.\n */\nfunction _requestToken() {\n return _requestToken2.apply(this, arguments);\n}\nfunction _requestToken2() {\n _requestToken2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {\n var iat, additionalClaims, payload, signedJWT, r, _response, _response2, body, desc, _t2;\n return _regenerator().w(function (_context6) {\n while (1) switch (_context6.n) {\n case 0:\n iat = Math.floor(new Date().getTime() / 1000);\n additionalClaims = this.additionalClaims || {};\n payload = Object.assign({\n iss: this.iss,\n scope: this.scope,\n aud: GOOGLE_TOKEN_URL,\n exp: iat + 3600,\n iat: iat,\n sub: this.sub\n }, additionalClaims);\n signedJWT = jws.sign({\n header: {\n alg: 'RS256'\n },\n payload: payload,\n secret: this.key\n });\n _context6.p = 1;\n _context6.n = 2;\n return this.transporter.request({\n method: 'POST',\n url: GOOGLE_TOKEN_URL,\n data: new URLSearchParams({\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: signedJWT\n }),\n responseType: 'json',\n retryConfig: {\n httpMethodsToRetry: ['POST']\n }\n });\n case 2:\n r = _context6.v;\n this.rawToken = r.data;\n this.expiresAt = r.data.expires_in === null || r.data.expires_in === undefined ? undefined : (iat + r.data.expires_in) * 1000;\n return _context6.a(2, this.rawToken);\n case 3:\n _context6.p = 3;\n _t2 = _context6.v;\n this.rawToken = undefined;\n this.tokenExpires = undefined;\n body = _t2.response && (_response = _t2.response) !== null && _response !== void 0 && _response.data ? (_response2 = _t2.response) === null || _response2 === void 0 ? void 0 : _response2.data : {};\n if (body.error) {\n desc = body.error_description ? \": \".concat(body.error_description) : '';\n _t2.message = \"\".concat(body.error).concat(desc);\n }\n throw _t2;\n case 4:\n return _context6.a(2);\n }\n }, _callee6, this, [[1, 3]]);\n }));\n return _requestToken2.apply(this, arguments);\n}",
45
+ "\"use strict\";\n// Copyright 2015 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JWTAccess = void 0;\nconst jws = require(\"jws\");\nconst util_1 = require(\"../util\");\nconst DEFAULT_HEADER = {\n alg: 'RS256',\n typ: 'JWT',\n};\nclass JWTAccess {\n email;\n key;\n keyId;\n projectId;\n eagerRefreshThresholdMillis;\n cache = new util_1.LRUCache({\n capacity: 500,\n maxAge: 60 * 60 * 1000,\n });\n /**\n * JWTAccess service account credentials.\n *\n * Create a new access token by using the credential to create a new JWT token\n * that's recognized as the access token.\n *\n * @param email the service account email address.\n * @param key the private key that will be used to sign the token.\n * @param keyId the ID of the private key used to sign the token.\n */\n constructor(email, key, keyId, eagerRefreshThresholdMillis) {\n this.email = email;\n this.key = key;\n this.keyId = keyId;\n this.eagerRefreshThresholdMillis =\n eagerRefreshThresholdMillis ?? 5 * 60 * 1000;\n }\n /**\n * Ensures that we're caching a key appropriately, giving precedence to scopes vs. url\n *\n * @param url The URI being authorized.\n * @param scopes The scope or scopes being authorized\n * @returns A string that returns the cached key.\n */\n getCachedKey(url, scopes) {\n let cacheKey = url;\n if (scopes && Array.isArray(scopes) && scopes.length) {\n cacheKey = url ? `${url}_${scopes.join('_')}` : `${scopes.join('_')}`;\n }\n else if (typeof scopes === 'string') {\n cacheKey = url ? `${url}_${scopes}` : scopes;\n }\n if (!cacheKey) {\n throw Error('Scopes or url must be provided');\n }\n return cacheKey;\n }\n /**\n * Get a non-expired access token, after refreshing if necessary.\n *\n * @param url The URI being authorized.\n * @param additionalClaims An object with a set of additional claims to\n * include in the payload.\n * @returns An object that includes the authorization header.\n */\n getRequestHeaders(url, additionalClaims, scopes) {\n // Return cached authorization headers, unless we are within\n // eagerRefreshThresholdMillis ms of them expiring:\n const key = this.getCachedKey(url, scopes);\n const cachedToken = this.cache.get(key);\n const now = Date.now();\n if (cachedToken &&\n cachedToken.expiration - now > this.eagerRefreshThresholdMillis) {\n // Copying headers into a new `Headers` object to avoid potential leakage -\n // as this is a cache it is possible for multiple requests to reference this\n // same value.\n return new Headers(cachedToken.headers);\n }\n const iat = Math.floor(Date.now() / 1000);\n const exp = JWTAccess.getExpirationTime(iat);\n let defaultClaims;\n // Turn scopes into space-separated string\n if (Array.isArray(scopes)) {\n scopes = scopes.join(' ');\n }\n // If scopes are specified, sign with scopes\n if (scopes) {\n defaultClaims = {\n iss: this.email,\n sub: this.email,\n scope: scopes,\n exp,\n iat,\n };\n }\n else {\n defaultClaims = {\n iss: this.email,\n sub: this.email,\n aud: url,\n exp,\n iat,\n };\n }\n // if additionalClaims are provided, ensure they do not collide with\n // other required claims.\n if (additionalClaims) {\n for (const claim in defaultClaims) {\n if (additionalClaims[claim]) {\n throw new Error(`The '${claim}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`);\n }\n }\n }\n const header = this.keyId\n ? { ...DEFAULT_HEADER, kid: this.keyId }\n : DEFAULT_HEADER;\n const payload = Object.assign(defaultClaims, additionalClaims);\n // Sign the jwt and add it to the cache\n const signedJWT = jws.sign({ header, payload, secret: this.key });\n const headers = new Headers({ authorization: `Bearer ${signedJWT}` });\n this.cache.set(key, {\n expiration: exp * 1000,\n headers,\n });\n return headers;\n }\n /**\n * Returns an expiration time for the JWT token.\n *\n * @param iat The issued at time for the JWT.\n * @returns An expiration time for the JWT.\n */\n static getExpirationTime(iat) {\n const exp = iat + 3600; // 3600 seconds = 1 hour\n return exp;\n }\n /**\n * Create a JWTAccess credentials instance using the given input options.\n * @param json The input object.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the service account auth settings.');\n }\n if (!json.client_email) {\n throw new Error('The incoming JSON object does not contain a client_email field');\n }\n if (!json.private_key) {\n throw new Error('The incoming JSON object does not contain a private_key field');\n }\n // Extract the relevant information from the json key file.\n this.email = json.client_email;\n this.key = json.private_key;\n this.keyId = json.private_key_id;\n this.projectId = json.project_id;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n reject(new Error('Must pass in a stream containing the service account auth settings.'));\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('data', chunk => (s += chunk))\n .on('error', reject)\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n resolve();\n }\n catch (err) {\n reject(err);\n }\n });\n });\n }\n}\nexports.JWTAccess = JWTAccess;\n//# sourceMappingURL=jwtaccess.js.map",
46
+ "\"use strict\";\n// Copyright 2013 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JWT = void 0;\nconst gtoken_1 = require(\"gtoken\");\nconst jwtaccess_1 = require(\"./jwtaccess\");\nconst oauth2client_1 = require(\"./oauth2client\");\nconst authclient_1 = require(\"./authclient\");\nclass JWT extends oauth2client_1.OAuth2Client {\n email;\n keyFile;\n key;\n keyId;\n defaultScopes;\n scopes;\n scope;\n subject;\n gtoken;\n additionalClaims;\n useJWTAccessWithScope;\n defaultServicePath;\n access;\n /**\n * JWT service account credentials.\n *\n * Retrieve access token using gtoken.\n *\n * @param options the\n */\n constructor(options = {}) {\n super(options);\n this.email = options.email;\n this.keyFile = options.keyFile;\n this.key = options.key;\n this.keyId = options.keyId;\n this.scopes = options.scopes;\n this.subject = options.subject;\n this.additionalClaims = options.additionalClaims;\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = { refresh_token: 'jwt-placeholder', expiry_date: 1 };\n }\n /**\n * Creates a copy of the credential with the specified scopes.\n * @param scopes List of requested scopes or a single scope.\n * @return The cloned instance.\n */\n createScoped(scopes) {\n const jwt = new JWT(this);\n jwt.scopes = scopes;\n return jwt;\n }\n /**\n * Obtains the metadata to be sent with the request.\n *\n * @param url the URI being authorized.\n */\n async getRequestMetadataAsync(url) {\n url = this.defaultServicePath ? `https://${this.defaultServicePath}/` : url;\n const useSelfSignedJWT = (!this.hasUserScopes() && url) ||\n (this.useJWTAccessWithScope && this.hasAnyScopes()) ||\n this.universeDomain !== authclient_1.DEFAULT_UNIVERSE;\n if (this.subject && this.universeDomain !== authclient_1.DEFAULT_UNIVERSE) {\n throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${authclient_1.DEFAULT_UNIVERSE}`);\n }\n if (!this.apiKey && useSelfSignedJWT) {\n if (this.additionalClaims &&\n this.additionalClaims.target_audience) {\n const { tokens } = await this.refreshToken();\n return {\n headers: this.addSharedMetadataHeaders(new Headers({\n authorization: `Bearer ${tokens.id_token}`,\n })),\n };\n }\n else {\n // no scopes have been set, but a uri has been provided. Use JWTAccess\n // credentials.\n if (!this.access) {\n this.access = new jwtaccess_1.JWTAccess(this.email, this.key, this.keyId, this.eagerRefreshThresholdMillis);\n }\n let scopes;\n if (this.hasUserScopes()) {\n scopes = this.scopes;\n }\n else if (!url) {\n scopes = this.defaultScopes;\n }\n const useScopes = this.useJWTAccessWithScope ||\n this.universeDomain !== authclient_1.DEFAULT_UNIVERSE;\n const headers = await this.access.getRequestHeaders(url ?? undefined, this.additionalClaims, \n // Scopes take precedent over audience for signing,\n // so we only provide them if `useJWTAccessWithScope` is on or\n // if we are in a non-default universe\n useScopes ? scopes : undefined);\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n }\n else if (this.hasAnyScopes() || this.apiKey) {\n return super.getRequestMetadataAsync(url);\n }\n else {\n // If no audience, apiKey, or scopes are provided, we should not attempt\n // to populate any headers:\n return { headers: new Headers() };\n }\n }\n /**\n * Fetches an ID token.\n * @param targetAudience the audience for the fetched ID token.\n */\n async fetchIdToken(targetAudience) {\n // Create a new gToken for fetching an ID token\n const gtoken = new gtoken_1.GoogleToken({\n iss: this.email,\n sub: this.subject,\n scope: this.scopes || this.defaultScopes,\n keyFile: this.keyFile,\n key: this.key,\n additionalClaims: { target_audience: targetAudience },\n transporter: this.transporter,\n });\n await gtoken.getToken({\n forceRefresh: true,\n });\n if (!gtoken.idToken) {\n throw new Error('Unknown error: Failed to fetch ID token');\n }\n return gtoken.idToken;\n }\n /**\n * Determine if there are currently scopes available.\n */\n hasUserScopes() {\n if (!this.scopes) {\n return false;\n }\n return this.scopes.length > 0;\n }\n /**\n * Are there any default or user scopes defined.\n */\n hasAnyScopes() {\n if (this.scopes && this.scopes.length > 0)\n return true;\n if (this.defaultScopes && this.defaultScopes.length > 0)\n return true;\n return false;\n }\n authorize(callback) {\n if (callback) {\n this.authorizeAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.authorizeAsync();\n }\n }\n async authorizeAsync() {\n const result = await this.refreshToken();\n if (!result) {\n throw new Error('No result returned');\n }\n this.credentials = result.tokens;\n this.credentials.refresh_token = 'jwt-placeholder';\n this.key = this.gtoken.key;\n this.email = this.gtoken.iss;\n return result.tokens;\n }\n /**\n * Refreshes the access token.\n * @param refreshToken ignored\n * @private\n */\n async refreshTokenNoCache() {\n const gtoken = this.createGToken();\n const token = await gtoken.getToken({\n forceRefresh: this.isTokenExpiring(),\n });\n const tokens = {\n access_token: token.access_token,\n token_type: 'Bearer',\n expiry_date: gtoken.expiresAt,\n id_token: gtoken.idToken,\n };\n this.emit('tokens', tokens);\n return { res: null, tokens };\n }\n /**\n * Create a gToken if it doesn't already exist.\n */\n createGToken() {\n if (!this.gtoken) {\n this.gtoken = new gtoken_1.GoogleToken({\n iss: this.email,\n sub: this.subject,\n scope: this.scopes || this.defaultScopes,\n keyFile: this.keyFile,\n key: this.key,\n additionalClaims: this.additionalClaims,\n transporter: this.transporter,\n });\n }\n return this.gtoken;\n }\n /**\n * Create a JWT credentials instance using the given input options.\n * @param json The input object.\n *\n * @remarks\n *\n * **Important**: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to {@link https://cloud.google.com/docs/authentication/external/externally-sourced-credentials Validate credential configurations from external sources}.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the service account auth settings.');\n }\n if (!json.client_email) {\n throw new Error('The incoming JSON object does not contain a client_email field');\n }\n if (!json.private_key) {\n throw new Error('The incoming JSON object does not contain a private_key field');\n }\n // Extract the relevant information from the json key file.\n this.email = json.client_email;\n this.key = json.private_key;\n this.keyId = json.private_key_id;\n this.projectId = json.project_id;\n this.quotaProjectId = json.quota_project_id;\n this.universeDomain = json.universe_domain || this.universeDomain;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n throw new Error('Must pass in a stream containing the service account auth settings.');\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => (s += chunk))\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n });\n }\n /**\n * Creates a JWT credentials instance using an API Key for authentication.\n * @param apiKey The API Key in string form.\n */\n fromAPIKey(apiKey) {\n if (typeof apiKey !== 'string') {\n throw new Error('Must provide an API Key string.');\n }\n this.apiKey = apiKey;\n }\n /**\n * Using the key or keyFile on the JWT client, obtain an object that contains\n * the key and the client email.\n */\n async getCredentials() {\n if (this.key) {\n return { private_key: this.key, client_email: this.email };\n }\n else if (this.keyFile) {\n const gtoken = this.createGToken();\n const creds = await gtoken.getCredentials(this.keyFile);\n return { private_key: creds.privateKey, client_email: creds.clientEmail };\n }\n throw new Error('A key or a keyFile must be provided to getCredentials.');\n }\n}\nexports.JWT = JWT;\n//# sourceMappingURL=jwtclient.js.map",
47
+ "\"use strict\";\n// Copyright 2015 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserRefreshClient = exports.USER_REFRESH_ACCOUNT_TYPE = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nconst authclient_1 = require(\"./authclient\");\nexports.USER_REFRESH_ACCOUNT_TYPE = 'authorized_user';\nclass UserRefreshClient extends oauth2client_1.OAuth2Client {\n // TODO: refactor tests to make this private\n // In a future gts release, the _propertyName rule will be lifted.\n // This is also a hard one because `this.refreshToken` is a function.\n _refreshToken;\n /**\n * The User Refresh Token client.\n *\n * @param optionsOrClientId The User Refresh Token client options. Passing an `clientId` directly is **@DEPRECATED**.\n * @param clientSecret **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n * @param refreshToken **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n * @param eagerRefreshThresholdMillis **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n * @param forceRefreshOnFailure **@DEPRECATED**. Provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead.\n */\n constructor(optionsOrClientId, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n clientSecret, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n refreshToken, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n eagerRefreshThresholdMillis, \n /**\n * @deprecated - provide a {@link UserRefreshClientOptions `UserRefreshClientOptions`} object in the first parameter instead\n */\n forceRefreshOnFailure) {\n const opts = optionsOrClientId && typeof optionsOrClientId === 'object'\n ? optionsOrClientId\n : {\n clientId: optionsOrClientId,\n clientSecret,\n refreshToken,\n eagerRefreshThresholdMillis,\n forceRefreshOnFailure,\n };\n super(opts);\n this._refreshToken = opts.refreshToken;\n this.credentials.refresh_token = opts.refreshToken;\n }\n /**\n * Refreshes the access token.\n * @param refreshToken An ignored refreshToken..\n * @param callback Optional callback.\n */\n async refreshTokenNoCache() {\n return super.refreshTokenNoCache(this._refreshToken);\n }\n async fetchIdToken(targetAudience) {\n const opts = {\n ...UserRefreshClient.RETRY_CONFIG,\n url: this.endpoints.oauth2TokenUrl,\n method: 'POST',\n data: new URLSearchParams({\n client_id: this._clientId,\n client_secret: this._clientSecret,\n grant_type: 'refresh_token',\n refresh_token: this._refreshToken,\n target_audience: targetAudience,\n }),\n };\n authclient_1.AuthClient.setMethodName(opts, 'fetchIdToken');\n const res = await this.transporter.request(opts);\n return res.data.id_token;\n }\n /**\n * Create a UserRefreshClient credentials instance using the given input\n * options.\n * @param json The input object.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the user refresh token');\n }\n if (json.type !== 'authorized_user') {\n throw new Error('The incoming JSON object does not have the \"authorized_user\" type');\n }\n if (!json.client_id) {\n throw new Error('The incoming JSON object does not contain a client_id field');\n }\n if (!json.client_secret) {\n throw new Error('The incoming JSON object does not contain a client_secret field');\n }\n if (!json.refresh_token) {\n throw new Error('The incoming JSON object does not contain a refresh_token field');\n }\n this._clientId = json.client_id;\n this._clientSecret = json.client_secret;\n this._refreshToken = json.refresh_token;\n this.credentials.refresh_token = json.refresh_token;\n this.quotaProjectId = json.quota_project_id;\n this.universeDomain = json.universe_domain || this.universeDomain;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n async fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n return reject(new Error('Must pass in a stream containing the user refresh token.'));\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => (s += chunk))\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n return resolve();\n }\n catch (err) {\n return reject(err);\n }\n });\n });\n }\n /**\n * Create a UserRefreshClient credentials instance using the given input\n * options.\n * @param json The input object.\n */\n static fromJSON(json) {\n const client = new UserRefreshClient();\n client.fromJSON(json);\n return client;\n }\n}\nexports.UserRefreshClient = UserRefreshClient;\n//# sourceMappingURL=refreshclient.js.map",
48
+ "\"use strict\";\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Impersonated = exports.IMPERSONATED_ACCOUNT_TYPE = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nconst gaxios_1 = require(\"gaxios\");\nconst util_1 = require(\"../util\");\nexports.IMPERSONATED_ACCOUNT_TYPE = 'impersonated_service_account';\nclass Impersonated extends oauth2client_1.OAuth2Client {\n sourceClient;\n targetPrincipal;\n targetScopes;\n delegates;\n lifetime;\n endpoint;\n /**\n * Impersonated service account credentials.\n *\n * Create a new access token by impersonating another service account.\n *\n * Impersonated Credentials allowing credentials issued to a user or\n * service account to impersonate another. The source project using\n * Impersonated Credentials must enable the \"IAMCredentials\" API.\n * Also, the target service account must grant the orginating principal\n * the \"Service Account Token Creator\" IAM role.\n *\n * **IMPORTANT**: This method does not validate the credential configuration.\n * A security risk occurs when a credential configuration configured with\n * malicious URLs is used. When the credential configuration is accepted from\n * an untrusted source, you should validate it before using it with this\n * method. For more details, see\n * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.\n *\n * @param {object} options - The configuration object.\n * @param {object} [options.sourceClient] the source credential used as to\n * acquire the impersonated credentials.\n * @param {string} [options.targetPrincipal] the service account to\n * impersonate.\n * @param {string[]} [options.delegates] the chained list of delegates\n * required to grant the final access_token. If set, the sequence of\n * identities must have \"Service Account Token Creator\" capability granted to\n * the preceding identity. For example, if set to [serviceAccountB,\n * serviceAccountC], the sourceCredential must have the Token Creator role on\n * serviceAccountB. serviceAccountB must have the Token Creator on\n * serviceAccountC. Finally, C must have Token Creator on target_principal.\n * If left unset, sourceCredential must have that role on targetPrincipal.\n * @param {string[]} [options.targetScopes] scopes to request during the\n * authorization grant.\n * @param {number} [options.lifetime] number of seconds the delegated\n * credential should be valid for up to 3600 seconds by default, or 43,200\n * seconds by extending the token's lifetime, see:\n * https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials#sa-credentials-oauth\n * @param {string} [options.endpoint] api endpoint override.\n */\n constructor(options = {}) {\n super(options);\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = {\n expiry_date: 1,\n refresh_token: 'impersonated-placeholder',\n };\n this.sourceClient = options.sourceClient ?? new oauth2client_1.OAuth2Client();\n this.targetPrincipal = options.targetPrincipal ?? '';\n this.delegates = options.delegates ?? [];\n this.targetScopes = options.targetScopes ?? [];\n this.lifetime = options.lifetime ?? 3600;\n const usingExplicitUniverseDomain = !!(0, util_1.originalOrCamelOptions)(options).get('universe_domain');\n if (!usingExplicitUniverseDomain) {\n // override the default universe with the source's universe\n this.universeDomain = this.sourceClient.universeDomain;\n }\n else if (this.sourceClient.universeDomain !== this.universeDomain) {\n // non-default universe and is not matching the source - this could be a credential leak\n throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);\n }\n this.endpoint =\n options.endpoint ?? `https://iamcredentials.${this.universeDomain}`;\n }\n /**\n * Signs some bytes.\n *\n * {@link https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signBlob Reference Documentation}\n * @param blobToSign String to sign.\n *\n * @returns A {@link SignBlobResponse} denoting the keyID and signedBlob in base64 string\n */\n async sign(blobToSign) {\n await this.sourceClient.getAccessToken();\n const name = `projects/-/serviceAccounts/${this.targetPrincipal}`;\n const u = `${this.endpoint}/v1/${name}:signBlob`;\n const body = {\n delegates: this.delegates,\n payload: Buffer.from(blobToSign).toString('base64'),\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n return res.data;\n }\n /** The service account email to be impersonated. */\n getTargetPrincipal() {\n return this.targetPrincipal;\n }\n /**\n * Refreshes the access token.\n */\n async refreshToken() {\n try {\n await this.sourceClient.getAccessToken();\n const name = 'projects/-/serviceAccounts/' + this.targetPrincipal;\n const u = `${this.endpoint}/v1/${name}:generateAccessToken`;\n const body = {\n delegates: this.delegates,\n scope: this.targetScopes,\n lifetime: this.lifetime + 's',\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n const tokenResponse = res.data;\n this.credentials.access_token = tokenResponse.accessToken;\n this.credentials.expiry_date = Date.parse(tokenResponse.expireTime);\n return {\n tokens: this.credentials,\n res,\n };\n }\n catch (error) {\n if (!(error instanceof Error))\n throw error;\n let status = 0;\n let message = '';\n if (error instanceof gaxios_1.GaxiosError) {\n status = error?.response?.data?.error?.status;\n message = error?.response?.data?.error?.message;\n }\n if (status && message) {\n error.message = `${status}: unable to impersonate: ${message}`;\n throw error;\n }\n else {\n error.message = `unable to impersonate: ${error}`;\n throw error;\n }\n }\n }\n /**\n * Generates an OpenID Connect ID token for a service account.\n *\n * {@link https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/generateIdToken Reference Documentation}\n *\n * @param targetAudience the audience for the fetched ID token.\n * @param options the for the request\n * @return an OpenID Connect ID token\n */\n async fetchIdToken(targetAudience, options) {\n await this.sourceClient.getAccessToken();\n const name = `projects/-/serviceAccounts/${this.targetPrincipal}`;\n const u = `${this.endpoint}/v1/${name}:generateIdToken`;\n const body = {\n delegates: this.delegates,\n audience: targetAudience,\n includeEmail: options?.includeEmail ?? true,\n useEmailAzp: options?.includeEmail ?? true,\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n return res.data.token;\n }\n}\nexports.Impersonated = Impersonated;\n//# sourceMappingURL=impersonated.js.map",
49
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuthClientAuthHandler = void 0;\nexports.getErrorFromOAuthErrorResponse = getErrorFromOAuthErrorResponse;\nconst gaxios_1 = require(\"gaxios\");\nconst crypto_1 = require(\"../crypto/crypto\");\n/** List of HTTP methods that accept request bodies. */\nconst METHODS_SUPPORTING_REQUEST_BODY = ['PUT', 'POST', 'PATCH'];\n/**\n * Abstract class for handling client authentication in OAuth-based\n * operations.\n * When request-body client authentication is used, only application/json and\n * application/x-www-form-urlencoded content types for HTTP methods that support\n * request bodies are supported.\n */\nclass OAuthClientAuthHandler {\n #crypto = (0, crypto_1.createCrypto)();\n #clientAuthentication;\n transporter;\n /**\n * Instantiates an OAuth client authentication handler.\n * @param options The OAuth Client Auth Handler instance options. Passing an `ClientAuthentication` directly is **@DEPRECATED**.\n */\n constructor(options) {\n if (options && 'clientId' in options) {\n this.#clientAuthentication = options;\n this.transporter = new gaxios_1.Gaxios();\n }\n else {\n this.#clientAuthentication = options?.clientAuthentication;\n this.transporter = options?.transporter || new gaxios_1.Gaxios();\n }\n }\n /**\n * Applies client authentication on the OAuth request's headers or POST\n * body but does not process the request.\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n * @param bearerToken The optional bearer token to use for authentication.\n * When this is used, no client authentication credentials are needed.\n */\n applyClientAuthenticationOptions(opts, bearerToken) {\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n // Inject authenticated header.\n this.injectAuthenticatedHeaders(opts, bearerToken);\n // Inject authenticated request body.\n if (!bearerToken) {\n this.injectAuthenticatedRequestBody(opts);\n }\n }\n /**\n * Applies client authentication on the request's header if either\n * basic authentication or bearer token authentication is selected.\n *\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n * @param bearerToken The optional bearer token to use for authentication.\n * When this is used, no client authentication credentials are needed.\n */\n injectAuthenticatedHeaders(opts, bearerToken) {\n // Bearer token prioritized higher than basic Auth.\n if (bearerToken) {\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers, {\n authorization: `Bearer ${bearerToken}`,\n });\n }\n else if (this.#clientAuthentication?.confidentialClientType === 'basic') {\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n const clientId = this.#clientAuthentication.clientId;\n const clientSecret = this.#clientAuthentication.clientSecret || '';\n const base64EncodedCreds = this.#crypto.encodeBase64StringUtf8(`${clientId}:${clientSecret}`);\n gaxios_1.Gaxios.mergeHeaders(opts.headers, {\n authorization: `Basic ${base64EncodedCreds}`,\n });\n }\n }\n /**\n * Applies client authentication on the request's body if request-body\n * client authentication is selected.\n *\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n */\n injectAuthenticatedRequestBody(opts) {\n if (this.#clientAuthentication?.confidentialClientType === 'request-body') {\n const method = (opts.method || 'GET').toUpperCase();\n if (!METHODS_SUPPORTING_REQUEST_BODY.includes(method)) {\n throw new Error(`${method} HTTP method does not support ` +\n `${this.#clientAuthentication.confidentialClientType} ` +\n 'client authentication');\n }\n // Get content-type\n const headers = new Headers(opts.headers);\n const contentType = headers.get('content-type');\n // Inject authenticated request body\n if (contentType?.startsWith('application/x-www-form-urlencoded') ||\n opts.data instanceof URLSearchParams) {\n const data = new URLSearchParams(opts.data ?? '');\n data.append('client_id', this.#clientAuthentication.clientId);\n data.append('client_secret', this.#clientAuthentication.clientSecret || '');\n opts.data = data;\n }\n else if (contentType?.startsWith('application/json')) {\n opts.data = opts.data || {};\n Object.assign(opts.data, {\n client_id: this.#clientAuthentication.clientId,\n client_secret: this.#clientAuthentication.clientSecret || '',\n });\n }\n else {\n throw new Error(`${contentType} content-types are not supported with ` +\n `${this.#clientAuthentication.confidentialClientType} ` +\n 'client authentication');\n }\n }\n }\n /**\n * Retry config for Auth-related requests.\n *\n * @remarks\n *\n * This is not a part of the default {@link AuthClient.transporter transporter/gaxios}\n * config as some downstream APIs would prefer if customers explicitly enable retries,\n * such as GCS.\n */\n static get RETRY_CONFIG() {\n return {\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['GET', 'PUT', 'POST', 'HEAD', 'OPTIONS', 'DELETE'],\n },\n };\n }\n}\nexports.OAuthClientAuthHandler = OAuthClientAuthHandler;\n/**\n * Converts an OAuth error response to a native JavaScript Error.\n * @param resp The OAuth error response to convert to a native Error object.\n * @param err The optional original error. If provided, the error properties\n * will be copied to the new error.\n * @return The converted native Error object.\n */\nfunction getErrorFromOAuthErrorResponse(resp, err) {\n // Error response.\n const errorCode = resp.error;\n const errorDescription = resp.error_description;\n const errorUri = resp.error_uri;\n let message = `Error code ${errorCode}`;\n if (typeof errorDescription !== 'undefined') {\n message += `: ${errorDescription}`;\n }\n if (typeof errorUri !== 'undefined') {\n message += ` - ${errorUri}`;\n }\n const newError = new Error(message);\n // Copy properties from original error to newly generated error.\n if (err) {\n const keys = Object.keys(err);\n if (err.stack) {\n // Copy error.stack if available.\n keys.push('stack');\n }\n keys.forEach(key => {\n // Do not overwrite the message field.\n if (key !== 'message') {\n Object.defineProperty(newError, key, {\n value: err[key],\n writable: false,\n enumerable: true,\n });\n }\n });\n }\n return newError;\n}\n//# sourceMappingURL=oauth2common.js.map",
50
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StsCredentials = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst authclient_1 = require(\"./authclient\");\nconst oauth2common_1 = require(\"./oauth2common\");\nconst util_1 = require(\"../util\");\n/**\n * Implements the OAuth 2.0 token exchange based on\n * https://tools.ietf.org/html/rfc8693\n */\nclass StsCredentials extends oauth2common_1.OAuthClientAuthHandler {\n #tokenExchangeEndpoint;\n /**\n * Initializes an STS credentials instance.\n *\n * @param options The STS credentials instance options. Passing an `tokenExchangeEndpoint` directly is **@DEPRECATED**.\n * @param clientAuthentication **@DEPRECATED**. Provide a {@link StsCredentialsConstructionOptions `StsCredentialsConstructionOptions`} object in the first parameter instead.\n */\n constructor(options = {\n tokenExchangeEndpoint: '',\n }, \n /**\n * @deprecated - provide a {@link StsCredentialsConstructionOptions `StsCredentialsConstructionOptions`} object in the first parameter instead\n */\n clientAuthentication) {\n if (typeof options !== 'object' || options instanceof URL) {\n options = {\n tokenExchangeEndpoint: options,\n clientAuthentication,\n };\n }\n super(options);\n this.#tokenExchangeEndpoint = options.tokenExchangeEndpoint;\n }\n /**\n * Exchanges the provided token for another type of token based on the\n * rfc8693 spec.\n * @param stsCredentialsOptions The token exchange options used to populate\n * the token exchange request.\n * @param additionalHeaders Optional additional headers to pass along the\n * request.\n * @param options Optional additional GCP-specific non-spec defined options\n * to send with the request.\n * Example: `&options=${encodeUriComponent(JSON.stringified(options))}`\n * @return A promise that resolves with the token exchange response containing\n * the requested token and its expiration time.\n */\n async exchangeToken(stsCredentialsOptions, headers, options) {\n const values = {\n grant_type: stsCredentialsOptions.grantType,\n resource: stsCredentialsOptions.resource,\n audience: stsCredentialsOptions.audience,\n scope: stsCredentialsOptions.scope?.join(' '),\n requested_token_type: stsCredentialsOptions.requestedTokenType,\n subject_token: stsCredentialsOptions.subjectToken,\n subject_token_type: stsCredentialsOptions.subjectTokenType,\n actor_token: stsCredentialsOptions.actingParty?.actorToken,\n actor_token_type: stsCredentialsOptions.actingParty?.actorTokenType,\n // Non-standard GCP-specific options.\n options: options && JSON.stringify(options),\n };\n const opts = {\n ...StsCredentials.RETRY_CONFIG,\n url: this.#tokenExchangeEndpoint.toString(),\n method: 'POST',\n headers,\n data: new URLSearchParams((0, util_1.removeUndefinedValuesInObject)(values)),\n };\n authclient_1.AuthClient.setMethodName(opts, 'exchangeToken');\n // Apply OAuth client authentication.\n this.applyClientAuthenticationOptions(opts);\n try {\n const response = await this.transporter.request(opts);\n // Successful response.\n const stsSuccessfulResponse = response.data;\n stsSuccessfulResponse.res = response;\n return stsSuccessfulResponse;\n }\n catch (error) {\n // Translate error to OAuthError.\n if (error instanceof gaxios_1.GaxiosError && error.response) {\n throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data, \n // Preserve other fields from the original error.\n error);\n }\n // Request could fail before the server responds.\n throw error;\n }\n }\n}\nexports.StsCredentials = StsCredentials;\n//# sourceMappingURL=stscredentials.js.map",
51
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseExternalAccountClient = exports.CLOUD_RESOURCE_MANAGER = exports.EXTERNAL_ACCOUNT_TYPE = exports.EXPIRATION_TIME_OFFSET = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst stream = require(\"stream\");\nconst authclient_1 = require(\"./authclient\");\nconst sts = require(\"./stscredentials\");\nconst util_1 = require(\"../util\");\nconst shared_cjs_1 = require(\"../shared.cjs\");\n/**\n * The required token exchange grant_type: rfc8693#section-2.1\n */\nconst STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange';\n/**\n * The requested token exchange requested_token_type: rfc8693#section-2.1\n */\nconst STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/** The default OAuth scope to request when none is provided. */\nconst DEFAULT_OAUTH_SCOPE = 'https://www.googleapis.com/auth/cloud-platform';\n/** Default impersonated token lifespan in seconds.*/\nconst DEFAULT_TOKEN_LIFESPAN = 3600;\n/**\n * Offset to take into account network delays and server clock skews.\n */\nexports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000;\n/**\n * The credentials JSON file type for external account clients.\n * There are 3 types of JSON configs:\n * 1. authorized_user => Google end user credential\n * 2. service_account => Google service account credential\n * 3. external_Account => non-GCP service (eg. AWS, Azure, K8s)\n */\nexports.EXTERNAL_ACCOUNT_TYPE = 'external_account';\n/**\n * Cloud resource manager URL used to retrieve project information.\n *\n * @deprecated use {@link BaseExternalAccountClient.cloudResourceManagerURL} instead\n **/\nexports.CLOUD_RESOURCE_MANAGER = 'https://cloudresourcemanager.googleapis.com/v1/projects/';\n/** The workforce audience pattern. */\nconst WORKFORCE_AUDIENCE_PATTERN = '//iam\\\\.googleapis\\\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+';\nconst DEFAULT_TOKEN_URL = 'https://sts.{universeDomain}/v1/token';\n/**\n * Base external account client. This is used to instantiate AuthClients for\n * exchanging external account credentials for GCP access token and authorizing\n * requests to GCP APIs.\n * The base class implements common logic for exchanging various type of\n * external credentials for GCP access token. The logic of determining and\n * retrieving the external credential based on the environment and\n * credential_source will be left for the subclasses.\n */\nclass BaseExternalAccountClient extends authclient_1.AuthClient {\n /**\n * OAuth scopes for the GCP access token to use. When not provided,\n * the default https://www.googleapis.com/auth/cloud-platform is\n * used.\n */\n scopes;\n projectNumber;\n audience;\n subjectTokenType;\n stsCredential;\n clientAuth;\n credentialSourceType;\n cachedAccessToken;\n serviceAccountImpersonationUrl;\n serviceAccountImpersonationLifetime;\n workforcePoolUserProject;\n configLifetimeRequested;\n tokenUrl;\n /**\n * @example\n * ```ts\n * new URL('https://cloudresourcemanager.googleapis.com/v1/projects/');\n * ```\n */\n cloudResourceManagerURL;\n supplierContext;\n /**\n * A pending access token request. Used for concurrent calls.\n */\n #pendingAccessToken = null;\n /**\n * Instantiate a BaseExternalAccountClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file. The camelCased options\n * are aliases for the snake_cased options.\n */\n constructor(options) {\n super(options);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const type = opts.get('type');\n if (type && type !== exports.EXTERNAL_ACCOUNT_TYPE) {\n throw new Error(`Expected \"${exports.EXTERNAL_ACCOUNT_TYPE}\" type but ` +\n `received \"${options.type}\"`);\n }\n const clientId = opts.get('client_id');\n const clientSecret = opts.get('client_secret');\n this.tokenUrl =\n opts.get('token_url') ??\n DEFAULT_TOKEN_URL.replace('{universeDomain}', this.universeDomain);\n const subjectTokenType = opts.get('subject_token_type');\n const workforcePoolUserProject = opts.get('workforce_pool_user_project');\n const serviceAccountImpersonationUrl = opts.get('service_account_impersonation_url');\n const serviceAccountImpersonation = opts.get('service_account_impersonation');\n const serviceAccountImpersonationLifetime = (0, util_1.originalOrCamelOptions)(serviceAccountImpersonation).get('token_lifetime_seconds');\n this.cloudResourceManagerURL = new URL(opts.get('cloud_resource_manager_url') ||\n `https://cloudresourcemanager.${this.universeDomain}/v1/projects/`);\n if (clientId) {\n this.clientAuth = {\n confidentialClientType: 'basic',\n clientId,\n clientSecret,\n };\n }\n this.stsCredential = new sts.StsCredentials({\n tokenExchangeEndpoint: this.tokenUrl,\n clientAuthentication: this.clientAuth,\n });\n this.scopes = opts.get('scopes') || [DEFAULT_OAUTH_SCOPE];\n this.cachedAccessToken = null;\n this.audience = opts.get('audience');\n this.subjectTokenType = subjectTokenType;\n this.workforcePoolUserProject = workforcePoolUserProject;\n const workforceAudiencePattern = new RegExp(WORKFORCE_AUDIENCE_PATTERN);\n if (this.workforcePoolUserProject &&\n !this.audience.match(workforceAudiencePattern)) {\n throw new Error('workforcePoolUserProject should not be set for non-workforce pool ' +\n 'credentials.');\n }\n this.serviceAccountImpersonationUrl = serviceAccountImpersonationUrl;\n this.serviceAccountImpersonationLifetime =\n serviceAccountImpersonationLifetime;\n if (this.serviceAccountImpersonationLifetime) {\n this.configLifetimeRequested = true;\n }\n else {\n this.configLifetimeRequested = false;\n this.serviceAccountImpersonationLifetime = DEFAULT_TOKEN_LIFESPAN;\n }\n this.projectNumber = this.getProjectNumber(this.audience);\n this.supplierContext = {\n audience: this.audience,\n subjectTokenType: this.subjectTokenType,\n transporter: this.transporter,\n };\n }\n /** The service account email to be impersonated, if available. */\n getServiceAccountEmail() {\n if (this.serviceAccountImpersonationUrl) {\n if (this.serviceAccountImpersonationUrl.length > 256) {\n /**\n * Prevents DOS attacks.\n * @see {@link https://github.com/googleapis/google-auth-library-nodejs/security/code-scanning/84}\n **/\n throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);\n }\n // Parse email from URL. The formal looks as follows:\n // https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/name@project-id.iam.gserviceaccount.com:generateAccessToken\n const re = /serviceAccounts\\/(?<email>[^:]+):generateAccessToken$/;\n const result = re.exec(this.serviceAccountImpersonationUrl);\n return result?.groups?.email || null;\n }\n return null;\n }\n /**\n * Provides a mechanism to inject GCP access tokens directly.\n * When the provided credential expires, a new credential, using the\n * external account options, is retrieved.\n * @param credentials The Credentials object to set on the current client.\n */\n setCredentials(credentials) {\n super.setCredentials(credentials);\n this.cachedAccessToken = credentials;\n }\n /**\n * @return A promise that resolves with the current GCP access token\n * response. If the current credential is expired, a new one is retrieved.\n */\n async getAccessToken() {\n // If cached access token is unavailable or expired, force refresh.\n if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return GCP access token in GetAccessTokenResponse format.\n return {\n token: this.cachedAccessToken.access_token,\n res: this.cachedAccessToken.res,\n };\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * The result has the form:\n * { authorization: 'Bearer <access_token_value>' }\n */\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = new Headers({\n authorization: `Bearer ${accessTokenResponse.token}`,\n });\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * @return A promise that resolves with the project ID corresponding to the\n * current workload identity pool or current workforce pool if\n * determinable. For workforce pool credential, it returns the project ID\n * corresponding to the workforcePoolUserProject.\n * This is introduced to match the current pattern of using the Auth\n * library:\n * const projectId = await auth.getProjectId();\n * const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;\n * const res = await client.request({ url });\n * The resource may not have permission\n * (resourcemanager.projects.get) to call this API or the required\n * scopes may not be selected:\n * https://cloud.google.com/resource-manager/reference/rest/v1/projects/get#authorization-scopes\n */\n async getProjectId() {\n const projectNumber = this.projectNumber || this.workforcePoolUserProject;\n if (this.projectId) {\n // Return previously determined project ID.\n return this.projectId;\n }\n else if (projectNumber) {\n // Preferable not to use request() to avoid retrial policies.\n const headers = await this.getRequestHeaders();\n const opts = {\n ...BaseExternalAccountClient.RETRY_CONFIG,\n headers,\n url: `${this.cloudResourceManagerURL.toString()}${projectNumber}`,\n };\n authclient_1.AuthClient.setMethodName(opts, 'getProjectId');\n const response = await this.transporter.request(opts);\n this.projectId = response.data.projectId;\n return this.projectId;\n }\n return null;\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure.\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, requestHeaders);\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * External credentials are exchanged for GCP access tokens via the token\n * exchange endpoint and other settings provided in the client options\n * object.\n * If the service_account_impersonation_url is provided, an additional\n * step to exchange the external account GCP access token for a service\n * account impersonated token is performed.\n * @return A promise that resolves with the fresh GCP access tokens.\n */\n async refreshAccessTokenAsync() {\n // Use an existing access token request, or cache a new one\n this.#pendingAccessToken =\n this.#pendingAccessToken || this.#internalRefreshAccessTokenAsync();\n try {\n return await this.#pendingAccessToken;\n }\n finally {\n // clear pending access token for future requests\n this.#pendingAccessToken = null;\n }\n }\n async #internalRefreshAccessTokenAsync() {\n // Retrieve the external credential.\n const subjectToken = await this.retrieveSubjectToken();\n // Construct the STS credentials options.\n const stsCredentialsOptions = {\n grantType: STS_GRANT_TYPE,\n audience: this.audience,\n requestedTokenType: STS_REQUEST_TOKEN_TYPE,\n subjectToken,\n subjectTokenType: this.subjectTokenType,\n // generateAccessToken requires the provided access token to have\n // scopes:\n // https://www.googleapis.com/auth/iam or\n // https://www.googleapis.com/auth/cloud-platform\n // The new service account access token scopes will match the user\n // provided ones.\n scope: this.serviceAccountImpersonationUrl\n ? [DEFAULT_OAUTH_SCOPE]\n : this.getScopesArray(),\n };\n // Exchange the external credentials for a GCP access token.\n // Client auth is prioritized over passing the workforcePoolUserProject\n // parameter for STS token exchange.\n const additionalOptions = !this.clientAuth && this.workforcePoolUserProject\n ? { userProject: this.workforcePoolUserProject }\n : undefined;\n const additionalHeaders = new Headers({\n 'x-goog-api-client': this.getMetricsHeaderValue(),\n });\n const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, additionalHeaders, additionalOptions);\n if (this.serviceAccountImpersonationUrl) {\n this.cachedAccessToken = await this.getImpersonatedAccessToken(stsResponse.access_token);\n }\n else if (stsResponse.expires_in) {\n // Save response in cached access token.\n this.cachedAccessToken = {\n access_token: stsResponse.access_token,\n expiry_date: new Date().getTime() + stsResponse.expires_in * 1000,\n res: stsResponse.res,\n };\n }\n else {\n // Save response in cached access token.\n this.cachedAccessToken = {\n access_token: stsResponse.access_token,\n res: stsResponse.res,\n };\n }\n // Save credentials.\n this.credentials = {};\n Object.assign(this.credentials, this.cachedAccessToken);\n delete this.credentials.res;\n // Trigger tokens event to notify external listeners.\n this.emit('tokens', {\n refresh_token: null,\n expiry_date: this.cachedAccessToken.expiry_date,\n access_token: this.cachedAccessToken.access_token,\n token_type: 'Bearer',\n id_token: null,\n });\n // Return the cached access token.\n return this.cachedAccessToken;\n }\n /**\n * Returns the workload identity pool project number if it is determinable\n * from the audience resource name.\n * @param audience The STS audience used to determine the project number.\n * @return The project number associated with the workload identity pool, if\n * this can be determined from the STS audience field. Otherwise, null is\n * returned.\n */\n getProjectNumber(audience) {\n // STS audience pattern:\n // //iam.googleapis.com/projects/$PROJECT_NUMBER/locations/...\n const match = audience.match(/\\/projects\\/([^/]+)/);\n if (!match) {\n return null;\n }\n return match[1];\n }\n /**\n * Exchanges an external account GCP access token for a service\n * account impersonated access token using iamcredentials\n * GenerateAccessToken API.\n * @param token The access token to exchange for a service account access\n * token.\n * @return A promise that resolves with the service account impersonated\n * credentials response.\n */\n async getImpersonatedAccessToken(token) {\n const opts = {\n ...BaseExternalAccountClient.RETRY_CONFIG,\n url: this.serviceAccountImpersonationUrl,\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n authorization: `Bearer ${token}`,\n },\n data: {\n scope: this.getScopesArray(),\n lifetime: this.serviceAccountImpersonationLifetime + 's',\n },\n };\n authclient_1.AuthClient.setMethodName(opts, 'getImpersonatedAccessToken');\n const response = await this.transporter.request(opts);\n const successResponse = response.data;\n return {\n access_token: successResponse.accessToken,\n // Convert from ISO format to timestamp.\n expiry_date: new Date(successResponse.expireTime).getTime(),\n res: response,\n };\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param accessToken The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(accessToken) {\n const now = new Date().getTime();\n return accessToken.expiry_date\n ? now >= accessToken.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n /**\n * @return The list of scopes for the requested GCP access token.\n */\n getScopesArray() {\n // Since scopes can be provided as string or array, the type should\n // be normalized.\n if (typeof this.scopes === 'string') {\n return [this.scopes];\n }\n return this.scopes || [DEFAULT_OAUTH_SCOPE];\n }\n getMetricsHeaderValue() {\n const nodeVersion = process.version.replace(/^v/, '');\n const saImpersonation = this.serviceAccountImpersonationUrl !== undefined;\n const credentialSourceType = this.credentialSourceType\n ? this.credentialSourceType\n : 'unknown';\n return `gl-node/${nodeVersion} auth/${shared_cjs_1.pkg.version} google-byoid-sdk source/${credentialSourceType} sa-impersonation/${saImpersonation} config-lifetime/${this.configLifetimeRequested}`;\n }\n getTokenUrl() {\n return this.tokenUrl;\n }\n}\nexports.BaseExternalAccountClient = BaseExternalAccountClient;\n//# sourceMappingURL=baseexternalclient.js.map",
52
+ "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileSubjectTokenSupplier = void 0;\nconst util_1 = require(\"util\");\nconst fs = require(\"fs\");\n// fs.readfile is undefined in browser karma tests causing\n// `npm run browser-test` to fail as test.oauth2.ts imports this file via\n// src/index.ts.\n// Fallback to void function to avoid promisify throwing a TypeError.\nconst readFile = (0, util_1.promisify)(fs.readFile ?? (() => { }));\nconst realpath = (0, util_1.promisify)(fs.realpath ?? (() => { }));\nconst lstat = (0, util_1.promisify)(fs.lstat ?? (() => { }));\n/**\n * Internal subject token supplier implementation used when a file location\n * is configured in the credential configuration used to build an {@link IdentityPoolClient}\n */\nclass FileSubjectTokenSupplier {\n filePath;\n formatType;\n subjectTokenFieldName;\n /**\n * Instantiates a new file based subject token supplier.\n * @param opts The file subject token supplier options to build the supplier\n * with.\n */\n constructor(opts) {\n this.filePath = opts.filePath;\n this.formatType = opts.formatType;\n this.subjectTokenFieldName = opts.subjectTokenFieldName;\n }\n /**\n * Returns the subject token stored at the file specified in the constructor.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link IdentityPoolClient}, contains the requested audience and subject\n * token type for the external account identity. Not used.\n */\n async getSubjectToken() {\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n let parsedFilePath = this.filePath;\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n parsedFilePath = await realpath(parsedFilePath);\n if (!(await lstat(parsedFilePath)).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `The file at ${parsedFilePath} does not exist, or it is not a file. ${err.message}`;\n }\n throw err;\n }\n let subjectToken;\n const rawText = await readFile(parsedFilePath, { encoding: 'utf8' });\n if (this.formatType === 'text') {\n subjectToken = rawText;\n }\n else if (this.formatType === 'json' && this.subjectTokenFieldName) {\n const json = JSON.parse(rawText);\n subjectToken = json[this.subjectTokenFieldName];\n }\n if (!subjectToken) {\n throw new Error('Unable to parse the subject_token from the credential_source file');\n }\n return subjectToken;\n }\n}\nexports.FileSubjectTokenSupplier = FileSubjectTokenSupplier;\n//# sourceMappingURL=filesubjecttokensupplier.js.map",
53
+ "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UrlSubjectTokenSupplier = void 0;\nconst authclient_1 = require(\"./authclient\");\n/**\n * Internal subject token supplier implementation used when a URL\n * is configured in the credential configuration used to build an {@link IdentityPoolClient}\n */\nclass UrlSubjectTokenSupplier {\n url;\n headers;\n formatType;\n subjectTokenFieldName;\n additionalGaxiosOptions;\n /**\n * Instantiates a URL subject token supplier.\n * @param opts The URL subject token supplier options to build the supplier with.\n */\n constructor(opts) {\n this.url = opts.url;\n this.formatType = opts.formatType;\n this.subjectTokenFieldName = opts.subjectTokenFieldName;\n this.headers = opts.headers;\n this.additionalGaxiosOptions = opts.additionalGaxiosOptions;\n }\n /**\n * Sends a GET request to the URL provided in the constructor and resolves\n * with the returned external subject token.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link IdentityPoolClient}, contains the requested audience and subject\n * token type for the external account identity. Not used.\n */\n async getSubjectToken(context) {\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.url,\n method: 'GET',\n headers: this.headers,\n };\n authclient_1.AuthClient.setMethodName(opts, 'getSubjectToken');\n let subjectToken;\n if (this.formatType === 'text') {\n const response = await context.transporter.request(opts);\n subjectToken = response.data;\n }\n else if (this.formatType === 'json' && this.subjectTokenFieldName) {\n const response = await context.transporter.request(opts);\n subjectToken = response.data[this.subjectTokenFieldName];\n }\n if (!subjectToken) {\n throw new Error('Unable to parse the subject_token from the credential_source URL');\n }\n return subjectToken;\n }\n}\nexports.UrlSubjectTokenSupplier = UrlSubjectTokenSupplier;\n//# sourceMappingURL=urlsubjecttokensupplier.js.map",
54
+ "\"use strict\";\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CertificateSubjectTokenSupplier = exports.InvalidConfigurationError = exports.CertificateSourceUnavailableError = exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = void 0;\nconst util_1 = require(\"../util\");\nconst fs = require(\"fs\");\nconst crypto_1 = require(\"crypto\");\nconst https = require(\"https\");\nexports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = 'GOOGLE_API_CERTIFICATE_CONFIG';\n/**\n * Thrown when the certificate source cannot be located or accessed.\n */\nclass CertificateSourceUnavailableError extends Error {\n constructor(message) {\n super(message);\n this.name = 'CertificateSourceUnavailableError';\n }\n}\nexports.CertificateSourceUnavailableError = CertificateSourceUnavailableError;\n/**\n * Thrown for invalid configuration that is not related to file availability.\n */\nclass InvalidConfigurationError extends Error {\n constructor(message) {\n super(message);\n this.name = 'InvalidConfigurationError';\n }\n}\nexports.InvalidConfigurationError = InvalidConfigurationError;\n/**\n * A subject token supplier that uses a client certificate for authentication.\n * It provides the certificate chain as the subject token for identity federation.\n */\nclass CertificateSubjectTokenSupplier {\n certificateConfigPath;\n trustChainPath;\n cert;\n key;\n /**\n * Initializes a new instance of the CertificateSubjectTokenSupplier.\n * @param opts The configuration options for the supplier.\n */\n constructor(opts) {\n if (!opts.useDefaultCertificateConfig && !opts.certificateConfigLocation) {\n throw new InvalidConfigurationError('Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.');\n }\n if (opts.useDefaultCertificateConfig && opts.certificateConfigLocation) {\n throw new InvalidConfigurationError('Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.');\n }\n this.trustChainPath = opts.trustChainPath;\n this.certificateConfigPath = opts.certificateConfigLocation ?? '';\n }\n /**\n * Creates an HTTPS agent configured with the client certificate and private key for mTLS.\n * @returns An mTLS-configured https.Agent.\n */\n async createMtlsHttpsAgent() {\n if (!this.key || !this.cert) {\n throw new InvalidConfigurationError('Cannot create mTLS Agent with missing certificate or key');\n }\n return new https.Agent({ key: this.key, cert: this.cert });\n }\n /**\n * Constructs the subject token, which is the base64-encoded certificate chain.\n * @returns A promise that resolves with the subject token.\n */\n async getSubjectToken() {\n // The \"subject token\" in this context is the processed certificate chain.\n this.certificateConfigPath = await this.#resolveCertificateConfigFilePath();\n const { certPath, keyPath } = await this.#getCertAndKeyPaths();\n ({ cert: this.cert, key: this.key } = await this.#getKeyAndCert(certPath, keyPath));\n return await this.#processChainFromPaths(this.cert);\n }\n /**\n * Resolves the absolute path to the certificate configuration file\n * by checking the \"certificate_config_location\" provided in the ADC file,\n * or the \"GOOGLE_API_CERTIFICATE_CONFIG\" environment variable\n * or in the default gcloud path.\n * @param overridePath An optional path to check first.\n * @returns The resolved file path.\n */\n async #resolveCertificateConfigFilePath() {\n // 1. Check for the override path from constructor options.\n const overridePath = this.certificateConfigPath;\n if (overridePath) {\n if (await (0, util_1.isValidFile)(overridePath)) {\n return overridePath;\n }\n throw new CertificateSourceUnavailableError(`Provided certificate config path is invalid: ${overridePath}`);\n }\n // 2. Check the standard environment variable.\n const envPath = process.env[exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];\n if (envPath) {\n if (await (0, util_1.isValidFile)(envPath)) {\n return envPath;\n }\n throw new CertificateSourceUnavailableError(`Path from environment variable \"${exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}\" is invalid: ${envPath}`);\n }\n // 3. Check the well-known gcloud config location.\n const wellKnownPath = (0, util_1.getWellKnownCertificateConfigFileLocation)();\n if (await (0, util_1.isValidFile)(wellKnownPath)) {\n return wellKnownPath;\n }\n // 4. If none are found, throw an error.\n throw new CertificateSourceUnavailableError('Could not find certificate configuration file. Searched override path, ' +\n `the \"${exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}\" env var, and the gcloud path (${wellKnownPath}).`);\n }\n /**\n * Reads and parses the certificate config JSON file to extract the certificate and key paths.\n * @returns An object containing the certificate and key paths.\n */\n async #getCertAndKeyPaths() {\n const configPath = this.certificateConfigPath;\n let fileContents;\n try {\n fileContents = await fs.promises.readFile(configPath, 'utf8');\n }\n catch (err) {\n throw new CertificateSourceUnavailableError(`Failed to read certificate config file at: ${configPath}`);\n }\n try {\n const config = JSON.parse(fileContents);\n const certPath = config?.cert_configs?.workload?.cert_path;\n const keyPath = config?.cert_configs?.workload?.key_path;\n if (!certPath || !keyPath) {\n throw new InvalidConfigurationError(`Certificate config file (${configPath}) is missing required \"cert_path\" or \"key_path\" in the workload config.`);\n }\n return { certPath, keyPath };\n }\n catch (e) {\n if (e instanceof InvalidConfigurationError)\n throw e;\n throw new InvalidConfigurationError(`Failed to parse certificate config from ${configPath}: ${e.message}`);\n }\n }\n /**\n * Reads and parses the cert and key files get their content and check valid format.\n * @returns An object containing the cert content and key content in buffer format.\n */\n async #getKeyAndCert(certPath, keyPath) {\n let cert, key;\n try {\n cert = await fs.promises.readFile(certPath);\n new crypto_1.X509Certificate(cert);\n }\n catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n throw new CertificateSourceUnavailableError(`Failed to read certificate file at ${certPath}: ${message}`);\n }\n try {\n key = await fs.promises.readFile(keyPath);\n (0, crypto_1.createPrivateKey)(key);\n }\n catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n throw new CertificateSourceUnavailableError(`Failed to read private key file at ${keyPath}: ${message}`);\n }\n return { cert, key };\n }\n /**\n * Reads the leaf certificate and trust chain, combines them,\n * and returns a JSON array of base64-encoded certificates.\n * @returns A stringified JSON array of the certificate chain.\n */\n async #processChainFromPaths(leafCertBuffer) {\n const leafCert = new crypto_1.X509Certificate(leafCertBuffer);\n // If no trust chain is provided, just use the successfully parsed leaf certificate.\n if (!this.trustChainPath) {\n return JSON.stringify([leafCert.raw.toString('base64')]);\n }\n // Handle the trust chain logic.\n try {\n const chainPems = await fs.promises.readFile(this.trustChainPath, 'utf8');\n const pemBlocks = chainPems.match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g) ?? [];\n const chainCerts = pemBlocks.map((pem, index) => {\n try {\n return new crypto_1.X509Certificate(pem);\n }\n catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n // Throw a more precise error if a single certificate in the chain is invalid.\n throw new InvalidConfigurationError(`Failed to parse certificate at index ${index} in trust chain file ${this.trustChainPath}: ${message}`);\n }\n });\n const leafIndex = chainCerts.findIndex(chainCert => leafCert.raw.equals(chainCert.raw));\n let finalChain;\n if (leafIndex === -1) {\n // Leaf not found, so prepend it to the chain.\n finalChain = [leafCert, ...chainCerts];\n }\n else if (leafIndex === 0) {\n // Leaf is already the first element, so the chain is correctly ordered.\n finalChain = chainCerts;\n }\n else {\n // Leaf is in the chain but not at the top, which is invalid.\n throw new InvalidConfigurationError(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${leafIndex}).`);\n }\n return JSON.stringify(finalChain.map(cert => cert.raw.toString('base64')));\n }\n catch (err) {\n // Re-throw our specific configuration errors.\n if (err instanceof InvalidConfigurationError)\n throw err;\n const message = err instanceof Error ? err.message : String(err);\n throw new CertificateSourceUnavailableError(`Failed to process certificate chain from ${this.trustChainPath}: ${message}`);\n }\n }\n}\nexports.CertificateSubjectTokenSupplier = CertificateSubjectTokenSupplier;\n//# sourceMappingURL=certificatesubjecttokensupplier.js.map",
55
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IdentityPoolClient = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst util_1 = require(\"../util\");\nconst filesubjecttokensupplier_1 = require(\"./filesubjecttokensupplier\");\nconst urlsubjecttokensupplier_1 = require(\"./urlsubjecttokensupplier\");\nconst certificatesubjecttokensupplier_1 = require(\"./certificatesubjecttokensupplier\");\nconst stscredentials_1 = require(\"./stscredentials\");\nconst gaxios_1 = require(\"gaxios\");\n/**\n * Defines the Url-sourced and file-sourced external account clients mainly\n * used for K8s and Azure workloads.\n */\nclass IdentityPoolClient extends baseexternalclient_1.BaseExternalAccountClient {\n subjectTokenSupplier;\n /**\n * Instantiate an IdentityPoolClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid file-sourced or\n * url-sourced credential or a workforce pool user project is provided\n * with a non workforce audience.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file. The camelCased options\n * are aliases for the snake_cased options.\n */\n constructor(options) {\n super(options);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const credentialSource = opts.get('credential_source');\n const subjectTokenSupplier = opts.get('subject_token_supplier');\n // Validate credential sourcing configuration.\n if (!credentialSource && !subjectTokenSupplier) {\n throw new Error('A credential source or subject token supplier must be specified.');\n }\n if (credentialSource && subjectTokenSupplier) {\n throw new Error('Only one of credential source or subject token supplier can be specified.');\n }\n if (subjectTokenSupplier) {\n this.subjectTokenSupplier = subjectTokenSupplier;\n this.credentialSourceType = 'programmatic';\n }\n else {\n const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource);\n const formatOpts = (0, util_1.originalOrCamelOptions)(credentialSourceOpts.get('format'));\n // Text is the default format type.\n const formatType = formatOpts.get('type') || 'text';\n const formatSubjectTokenFieldName = formatOpts.get('subject_token_field_name');\n if (formatType !== 'json' && formatType !== 'text') {\n throw new Error(`Invalid credential_source format \"${formatType}\"`);\n }\n if (formatType === 'json' && !formatSubjectTokenFieldName) {\n throw new Error('Missing subject_token_field_name for JSON credential_source format');\n }\n const file = credentialSourceOpts.get('file');\n const url = credentialSourceOpts.get('url');\n const certificate = credentialSourceOpts.get('certificate');\n const headers = credentialSourceOpts.get('headers');\n if ((file && url) || (url && certificate) || (file && certificate)) {\n throw new Error('No valid Identity Pool \"credential_source\" provided, must be either file, url, or certificate.');\n }\n else if (file) {\n this.credentialSourceType = 'file';\n this.subjectTokenSupplier = new filesubjecttokensupplier_1.FileSubjectTokenSupplier({\n filePath: file,\n formatType: formatType,\n subjectTokenFieldName: formatSubjectTokenFieldName,\n });\n }\n else if (url) {\n this.credentialSourceType = 'url';\n this.subjectTokenSupplier = new urlsubjecttokensupplier_1.UrlSubjectTokenSupplier({\n url: url,\n formatType: formatType,\n subjectTokenFieldName: formatSubjectTokenFieldName,\n headers: headers,\n additionalGaxiosOptions: IdentityPoolClient.RETRY_CONFIG,\n });\n }\n else if (certificate) {\n this.credentialSourceType = 'certificate';\n const certificateSubjecttokensupplier = new certificatesubjecttokensupplier_1.CertificateSubjectTokenSupplier({\n useDefaultCertificateConfig: certificate.use_default_certificate_config,\n certificateConfigLocation: certificate.certificate_config_location,\n trustChainPath: certificate.trust_chain_path,\n });\n this.subjectTokenSupplier = certificateSubjecttokensupplier;\n }\n else {\n throw new Error('No valid Identity Pool \"credential_source\" provided, must be either file, url, or certificate.');\n }\n }\n }\n /**\n * Triggered when a external subject token is needed to be exchanged for a GCP\n * access token via GCP STS endpoint. Gets a subject token by calling\n * the configured {@link SubjectTokenSupplier}\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n const subjectToken = await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);\n if (this.subjectTokenSupplier instanceof certificatesubjecttokensupplier_1.CertificateSubjectTokenSupplier) {\n const mtlsAgent = await this.subjectTokenSupplier.createMtlsHttpsAgent();\n this.stsCredential = new stscredentials_1.StsCredentials({\n tokenExchangeEndpoint: this.getTokenUrl(),\n clientAuthentication: this.clientAuth,\n transporter: new gaxios_1.Gaxios({ agent: mtlsAgent }),\n });\n this.transporter = new gaxios_1.Gaxios({\n ...(this.transporter.defaults || {}),\n agent: mtlsAgent,\n });\n }\n return subjectToken;\n }\n}\nexports.IdentityPoolClient = IdentityPoolClient;\n//# sourceMappingURL=identitypoolclient.js.map",
56
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsRequestSigner = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst crypto_1 = require(\"../crypto/crypto\");\n/** AWS Signature Version 4 signing algorithm identifier. */\nconst AWS_ALGORITHM = 'AWS4-HMAC-SHA256';\n/**\n * The termination string for the AWS credential scope value as defined in\n * https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n */\nconst AWS_REQUEST_TYPE = 'aws4_request';\n/**\n * Implements an AWS API request signer based on the AWS Signature Version 4\n * signing process.\n * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nclass AwsRequestSigner {\n getCredentials;\n region;\n crypto;\n /**\n * Instantiates an AWS API request signer used to send authenticated signed\n * requests to AWS APIs based on the AWS Signature Version 4 signing process.\n * This also provides a mechanism to generate the signed request without\n * sending it.\n * @param getCredentials A mechanism to retrieve AWS security credentials\n * when needed.\n * @param region The AWS region to use.\n */\n constructor(getCredentials, region) {\n this.getCredentials = getCredentials;\n this.region = region;\n this.crypto = (0, crypto_1.createCrypto)();\n }\n /**\n * Generates the signed request for the provided HTTP request for calling\n * an AWS API. This follows the steps described at:\n * https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html\n * @param amzOptions The AWS request options that need to be signed.\n * @return A promise that resolves with the GaxiosOptions containing the\n * signed HTTP request parameters.\n */\n async getRequestOptions(amzOptions) {\n if (!amzOptions.url) {\n throw new RangeError('\"url\" is required in \"amzOptions\"');\n }\n // Stringify JSON requests. This will be set in the request body of the\n // generated signed request.\n const requestPayloadData = typeof amzOptions.data === 'object'\n ? JSON.stringify(amzOptions.data)\n : amzOptions.data;\n const url = amzOptions.url;\n const method = amzOptions.method || 'GET';\n const requestPayload = amzOptions.body || requestPayloadData;\n const additionalAmzHeaders = amzOptions.headers;\n const awsSecurityCredentials = await this.getCredentials();\n const uri = new URL(url);\n if (typeof requestPayload !== 'string' && requestPayload !== undefined) {\n throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${requestPayload}`);\n }\n const headerMap = await generateAuthenticationHeaderMap({\n crypto: this.crypto,\n host: uri.host,\n canonicalUri: uri.pathname,\n canonicalQuerystring: uri.search.slice(1),\n method,\n region: this.region,\n securityCredentials: awsSecurityCredentials,\n requestPayload,\n additionalAmzHeaders,\n });\n // Append additional optional headers, eg. X-Amz-Target, Content-Type, etc.\n const headers = gaxios_1.Gaxios.mergeHeaders(\n // Add x-amz-date if available.\n headerMap.amzDate ? { 'x-amz-date': headerMap.amzDate } : {}, {\n authorization: headerMap.authorizationHeader,\n host: uri.host,\n }, additionalAmzHeaders || {});\n if (awsSecurityCredentials.token) {\n gaxios_1.Gaxios.mergeHeaders(headers, {\n 'x-amz-security-token': awsSecurityCredentials.token,\n });\n }\n const awsSignedReq = {\n url,\n method: method,\n headers,\n };\n if (requestPayload !== undefined) {\n awsSignedReq.body = requestPayload;\n }\n return awsSignedReq;\n }\n}\nexports.AwsRequestSigner = AwsRequestSigner;\n/**\n * Creates the HMAC-SHA256 hash of the provided message using the\n * provided key.\n *\n * @param crypto The crypto instance used to facilitate cryptographic\n * operations.\n * @param key The HMAC-SHA256 key to use.\n * @param msg The message to hash.\n * @return The computed hash bytes.\n */\nasync function sign(crypto, key, msg) {\n return await crypto.signWithHmacSha256(key, msg);\n}\n/**\n * Calculates the signing key used to calculate the signature for\n * AWS Signature Version 4 based on:\n * https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param crypto The crypto instance used to facilitate cryptographic\n * operations.\n * @param key The AWS secret access key.\n * @param dateStamp The '%Y%m%d' date format.\n * @param region The AWS region.\n * @param serviceName The AWS service name, eg. sts.\n * @return The signing key bytes.\n */\nasync function getSigningKey(crypto, key, dateStamp, region, serviceName) {\n const kDate = await sign(crypto, `AWS4${key}`, dateStamp);\n const kRegion = await sign(crypto, kDate, region);\n const kService = await sign(crypto, kRegion, serviceName);\n const kSigning = await sign(crypto, kService, 'aws4_request');\n return kSigning;\n}\n/**\n * Generates the authentication header map needed for generating the AWS\n * Signature Version 4 signed request.\n *\n * @param option The options needed to compute the authentication header map.\n * @return The AWS authentication header map which constitutes of the following\n * components: amz-date, authorization header and canonical query string.\n */\nasync function generateAuthenticationHeaderMap(options) {\n const additionalAmzHeaders = gaxios_1.Gaxios.mergeHeaders(options.additionalAmzHeaders);\n const requestPayload = options.requestPayload || '';\n // iam.amazonaws.com host => iam service.\n // sts.us-east-2.amazonaws.com => sts service.\n const serviceName = options.host.split('.')[0];\n const now = new Date();\n // Format: '%Y%m%dT%H%M%SZ'.\n const amzDate = now\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.[0-9]+/, '');\n // Format: '%Y%m%d'.\n const dateStamp = now.toISOString().replace(/[-]/g, '').replace(/T.*/, '');\n // Add AWS token if available.\n if (options.securityCredentials.token) {\n additionalAmzHeaders.set('x-amz-security-token', options.securityCredentials.token);\n }\n // Header keys need to be sorted alphabetically.\n const amzHeaders = gaxios_1.Gaxios.mergeHeaders({\n host: options.host,\n }, \n // Previously the date was not fixed with x-amz- and could be provided manually.\n // https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-header-value-trim.req\n additionalAmzHeaders.has('date') ? {} : { 'x-amz-date': amzDate }, additionalAmzHeaders);\n let canonicalHeaders = '';\n // TypeScript is missing `Headers#keys` at the time of writing\n const signedHeadersList = [\n ...amzHeaders.keys(),\n ].sort();\n signedHeadersList.forEach(key => {\n canonicalHeaders += `${key}:${amzHeaders.get(key)}\\n`;\n });\n const signedHeaders = signedHeadersList.join(';');\n const payloadHash = await options.crypto.sha256DigestHex(requestPayload);\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n const canonicalRequest = `${options.method.toUpperCase()}\\n` +\n `${options.canonicalUri}\\n` +\n `${options.canonicalQuerystring}\\n` +\n `${canonicalHeaders}\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`;\n const credentialScope = `${dateStamp}/${options.region}/${serviceName}/${AWS_REQUEST_TYPE}`;\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n const stringToSign = `${AWS_ALGORITHM}\\n` +\n `${amzDate}\\n` +\n `${credentialScope}\\n` +\n (await options.crypto.sha256DigestHex(canonicalRequest));\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n const signingKey = await getSigningKey(options.crypto, options.securityCredentials.secretAccessKey, dateStamp, options.region, serviceName);\n const signature = await sign(options.crypto, signingKey, stringToSign);\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n const authorizationHeader = `${AWS_ALGORITHM} Credential=${options.securityCredentials.accessKeyId}/` +\n `${credentialScope}, SignedHeaders=${signedHeaders}, ` +\n `Signature=${(0, crypto_1.fromArrayBufferToHex)(signature)}`;\n return {\n // Do not return x-amz-date if date is available.\n amzDate: additionalAmzHeaders.has('date') ? undefined : amzDate,\n authorizationHeader,\n canonicalQuerystring: options.canonicalQuerystring,\n };\n}\n//# sourceMappingURL=awsrequestsigner.js.map",
57
+ "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultAwsSecurityCredentialsSupplier = void 0;\nconst authclient_1 = require(\"./authclient\");\n/**\n * Internal AWS security credentials supplier implementation used by {@link AwsClient}\n * when a credential source is provided instead of a user defined supplier.\n * The logic is summarized as:\n * 1. If imdsv2_session_token_url is provided in the credential source, then\n * fetch the aws session token and include it in the headers of the\n * metadata requests. This is a requirement for IDMSv2 but optional\n * for IDMSv1.\n * 2. Retrieve AWS region from availability-zone.\n * 3a. Check AWS credentials in environment variables. If not found, get\n * from security-credentials endpoint.\n * 3b. Get AWS credentials from security-credentials endpoint. In order\n * to retrieve this, the AWS role needs to be determined by calling\n * security-credentials endpoint without any argument. Then the\n * credentials can be retrieved via: security-credentials/role_name\n * 4. Generate the signed request to AWS STS GetCallerIdentity action.\n * 5. Inject x-goog-cloud-target-resource into header and serialize the\n * signed request. This will be the subject-token to pass to GCP STS.\n */\nclass DefaultAwsSecurityCredentialsSupplier {\n regionUrl;\n securityCredentialsUrl;\n imdsV2SessionTokenUrl;\n additionalGaxiosOptions;\n /**\n * Instantiates a new DefaultAwsSecurityCredentialsSupplier using information\n * from the credential_source stored in the ADC file.\n * @param opts The default aws security credentials supplier options object to\n * build the supplier with.\n */\n constructor(opts) {\n this.regionUrl = opts.regionUrl;\n this.securityCredentialsUrl = opts.securityCredentialsUrl;\n this.imdsV2SessionTokenUrl = opts.imdsV2SessionTokenUrl;\n this.additionalGaxiosOptions = opts.additionalGaxiosOptions;\n }\n /**\n * Returns the active AWS region. This first checks to see if the region\n * is available as an environment variable. If it is not, then the supplier\n * will call the region URL.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link AwsClient}, contains the requested audience and subject token type\n * for the external account identity.\n * @return A promise that resolves with the AWS region string.\n */\n async getAwsRegion(context) {\n // Priority order for region determination:\n // AWS_REGION > AWS_DEFAULT_REGION > metadata server.\n if (this.#regionFromEnv) {\n return this.#regionFromEnv;\n }\n const metadataHeaders = new Headers();\n if (!this.#regionFromEnv && this.imdsV2SessionTokenUrl) {\n metadataHeaders.set('x-aws-ec2-metadata-token', await this.#getImdsV2SessionToken(context.transporter));\n }\n if (!this.regionUrl) {\n throw new RangeError('Unable to determine AWS region due to missing ' +\n '\"options.credential_source.region_url\"');\n }\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.regionUrl,\n method: 'GET',\n headers: metadataHeaders,\n };\n authclient_1.AuthClient.setMethodName(opts, 'getAwsRegion');\n const response = await context.transporter.request(opts);\n // Remove last character. For example, if us-east-2b is returned,\n // the region would be us-east-2.\n return response.data.substr(0, response.data.length - 1);\n }\n /**\n * Returns AWS security credentials. This first checks to see if the credentials\n * is available as environment variables. If it is not, then the supplier\n * will call the security credentials URL.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link AwsClient}, contains the requested audience and subject token type\n * for the external account identity.\n * @return A promise that resolves with the AWS security credentials.\n */\n async getAwsSecurityCredentials(context) {\n // Check environment variables for permanent credentials first.\n // https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html\n if (this.#securityCredentialsFromEnv) {\n return this.#securityCredentialsFromEnv;\n }\n const metadataHeaders = new Headers();\n if (this.imdsV2SessionTokenUrl) {\n metadataHeaders.set('x-aws-ec2-metadata-token', await this.#getImdsV2SessionToken(context.transporter));\n }\n // Since the role on a VM can change, we don't need to cache it.\n const roleName = await this.#getAwsRoleName(metadataHeaders, context.transporter);\n // Temporary credentials typically last for several hours.\n // Expiration is returned in response.\n // Consider future optimization of this logic to cache AWS tokens\n // until their natural expiration.\n const awsCreds = await this.#retrieveAwsSecurityCredentials(roleName, metadataHeaders, context.transporter);\n return {\n accessKeyId: awsCreds.AccessKeyId,\n secretAccessKey: awsCreds.SecretAccessKey,\n token: awsCreds.Token,\n };\n }\n /**\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the IMDSv2 Session Token.\n */\n async #getImdsV2SessionToken(transporter) {\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.imdsV2SessionTokenUrl,\n method: 'PUT',\n headers: { 'x-aws-ec2-metadata-token-ttl-seconds': '300' },\n };\n authclient_1.AuthClient.setMethodName(opts, '#getImdsV2SessionToken');\n const response = await transporter.request(opts);\n return response.data;\n }\n /**\n * @param headers The headers to be used in the metadata request.\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the assigned role to the current\n * AWS VM. This is needed for calling the security-credentials endpoint.\n */\n async #getAwsRoleName(headers, transporter) {\n if (!this.securityCredentialsUrl) {\n throw new Error('Unable to determine AWS role name due to missing ' +\n '\"options.credential_source.url\"');\n }\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.securityCredentialsUrl,\n method: 'GET',\n headers: headers,\n };\n authclient_1.AuthClient.setMethodName(opts, '#getAwsRoleName');\n const response = await transporter.request(opts);\n return response.data;\n }\n /**\n * Retrieves the temporary AWS credentials by calling the security-credentials\n * endpoint as specified in the `credential_source` object.\n * @param roleName The role attached to the current VM.\n * @param headers The headers to be used in the metadata request.\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the temporary AWS credentials\n * needed for creating the GetCallerIdentity signed request.\n */\n async #retrieveAwsSecurityCredentials(roleName, headers, transporter) {\n const opts = {\n ...this.additionalGaxiosOptions,\n url: `${this.securityCredentialsUrl}/${roleName}`,\n headers: headers,\n };\n authclient_1.AuthClient.setMethodName(opts, '#retrieveAwsSecurityCredentials');\n const response = await transporter.request(opts);\n return response.data;\n }\n get #regionFromEnv() {\n // The AWS region can be provided through AWS_REGION or AWS_DEFAULT_REGION.\n // Only one is required.\n return (process.env['AWS_REGION'] || process.env['AWS_DEFAULT_REGION'] || null);\n }\n get #securityCredentialsFromEnv() {\n // Both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are required.\n if (process.env['AWS_ACCESS_KEY_ID'] &&\n process.env['AWS_SECRET_ACCESS_KEY']) {\n return {\n accessKeyId: process.env['AWS_ACCESS_KEY_ID'],\n secretAccessKey: process.env['AWS_SECRET_ACCESS_KEY'],\n token: process.env['AWS_SESSION_TOKEN'],\n };\n }\n return null;\n }\n}\nexports.DefaultAwsSecurityCredentialsSupplier = DefaultAwsSecurityCredentialsSupplier;\n//# sourceMappingURL=defaultawssecuritycredentialssupplier.js.map",
58
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsClient = void 0;\nconst awsrequestsigner_1 = require(\"./awsrequestsigner\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst defaultawssecuritycredentialssupplier_1 = require(\"./defaultawssecuritycredentialssupplier\");\nconst util_1 = require(\"../util\");\nconst gaxios_1 = require(\"gaxios\");\n/**\n * AWS external account client. This is used for AWS workloads, where\n * AWS STS GetCallerIdentity serialized signed requests are exchanged for\n * GCP access token.\n */\nclass AwsClient extends baseexternalclient_1.BaseExternalAccountClient {\n environmentId;\n awsSecurityCredentialsSupplier;\n regionalCredVerificationUrl;\n awsRequestSigner;\n region;\n static #DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL = 'https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15';\n /**\n * @deprecated AWS client no validates the EC2 metadata address.\n **/\n static AWS_EC2_METADATA_IPV4_ADDRESS = '169.254.169.254';\n /**\n * @deprecated AWS client no validates the EC2 metadata address.\n **/\n static AWS_EC2_METADATA_IPV6_ADDRESS = 'fd00:ec2::254';\n /**\n * Instantiates an AwsClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid AWS credential.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file.\n */\n constructor(options) {\n super(options);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const credentialSource = opts.get('credential_source');\n const awsSecurityCredentialsSupplier = opts.get('aws_security_credentials_supplier');\n // Validate credential sourcing configuration.\n if (!credentialSource && !awsSecurityCredentialsSupplier) {\n throw new Error('A credential source or AWS security credentials supplier must be specified.');\n }\n if (credentialSource && awsSecurityCredentialsSupplier) {\n throw new Error('Only one of credential source or AWS security credentials supplier can be specified.');\n }\n if (awsSecurityCredentialsSupplier) {\n this.awsSecurityCredentialsSupplier = awsSecurityCredentialsSupplier;\n this.regionalCredVerificationUrl =\n AwsClient.#DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL;\n this.credentialSourceType = 'programmatic';\n }\n else {\n const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource);\n this.environmentId = credentialSourceOpts.get('environment_id');\n // This is only required if the AWS region is not available in the\n // AWS_REGION or AWS_DEFAULT_REGION environment variables.\n const regionUrl = credentialSourceOpts.get('region_url');\n // This is only required if AWS security credentials are not available in\n // environment variables.\n const securityCredentialsUrl = credentialSourceOpts.get('url');\n const imdsV2SessionTokenUrl = credentialSourceOpts.get('imdsv2_session_token_url');\n this.awsSecurityCredentialsSupplier =\n new defaultawssecuritycredentialssupplier_1.DefaultAwsSecurityCredentialsSupplier({\n regionUrl: regionUrl,\n securityCredentialsUrl: securityCredentialsUrl,\n imdsV2SessionTokenUrl: imdsV2SessionTokenUrl,\n });\n this.regionalCredVerificationUrl = credentialSourceOpts.get('regional_cred_verification_url');\n this.credentialSourceType = 'aws';\n // Data validators.\n this.validateEnvironmentId();\n }\n this.awsRequestSigner = null;\n this.region = '';\n }\n validateEnvironmentId() {\n const match = this.environmentId?.match(/^(aws)(\\d+)$/);\n if (!match || !this.regionalCredVerificationUrl) {\n throw new Error('No valid AWS \"credential_source\" provided');\n }\n else if (parseInt(match[2], 10) !== 1) {\n throw new Error(`aws version \"${match[2]}\" is not supported in the current build.`);\n }\n }\n /**\n * Triggered when an external subject token is needed to be exchanged for a\n * GCP access token via GCP STS endpoint. This will call the\n * {@link AwsSecurityCredentialsSupplier} to retrieve an AWS region and AWS\n * Security Credentials, then use them to create a signed AWS STS request that\n * can be exchanged for a GCP access token.\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n // Initialize AWS request signer if not already initialized.\n if (!this.awsRequestSigner) {\n this.region = await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext);\n this.awsRequestSigner = new awsrequestsigner_1.AwsRequestSigner(async () => {\n return this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext);\n }, this.region);\n }\n // Generate signed request to AWS STS GetCallerIdentity API.\n // Use the required regional endpoint. Otherwise, the request will fail.\n const options = await this.awsRequestSigner.getRequestOptions({\n ...AwsClient.RETRY_CONFIG,\n url: this.regionalCredVerificationUrl.replace('{region}', this.region),\n method: 'POST',\n });\n // The GCP STS endpoint expects the headers to be formatted as:\n // [\n // {key: 'x-amz-date', value: '...'},\n // {key: 'authorization', value: '...'},\n // ...\n // ]\n // And then serialized as:\n // encodeURIComponent(JSON.stringify({\n // url: '...',\n // method: 'POST',\n // headers: [{key: 'x-amz-date', value: '...'}, ...]\n // }))\n const reformattedHeader = [];\n const extendedHeaders = gaxios_1.Gaxios.mergeHeaders({\n // The full, canonical resource name of the workload identity pool\n // provider, with or without the HTTPS prefix.\n // Including this header as part of the signature is recommended to\n // ensure data integrity.\n 'x-goog-cloud-target-resource': this.audience,\n }, options.headers);\n // Reformat header to GCP STS expected format.\n extendedHeaders.forEach((value, key) => reformattedHeader.push({ key, value }));\n // Serialize the reformatted signed request.\n return encodeURIComponent(JSON.stringify({\n url: options.url,\n method: options.method,\n headers: reformattedHeader,\n }));\n }\n}\nexports.AwsClient = AwsClient;\n//# sourceMappingURL=awsclient.js.map",
59
+ "\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InvalidSubjectTokenError = exports.InvalidMessageFieldError = exports.InvalidCodeFieldError = exports.InvalidTokenTypeFieldError = exports.InvalidExpirationTimeFieldError = exports.InvalidSuccessFieldError = exports.InvalidVersionFieldError = exports.ExecutableResponseError = exports.ExecutableResponse = void 0;\nconst SAML_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:saml2';\nconst OIDC_SUBJECT_TOKEN_TYPE1 = 'urn:ietf:params:oauth:token-type:id_token';\nconst OIDC_SUBJECT_TOKEN_TYPE2 = 'urn:ietf:params:oauth:token-type:jwt';\n/**\n * Defines the response of a 3rd party executable run by the pluggable auth client.\n */\nclass ExecutableResponse {\n /**\n * The version of the Executable response. Only version 1 is currently supported.\n */\n version;\n /**\n * Whether the executable ran successfully.\n */\n success;\n /**\n * The epoch time for expiration of the token in seconds.\n */\n expirationTime;\n /**\n * The type of subject token in the response, currently supported values are:\n * urn:ietf:params:oauth:token-type:saml2\n * urn:ietf:params:oauth:token-type:id_token\n * urn:ietf:params:oauth:token-type:jwt\n */\n tokenType;\n /**\n * The error code from the executable.\n */\n errorCode;\n /**\n * The error message from the executable.\n */\n errorMessage;\n /**\n * The subject token from the executable, format depends on tokenType.\n */\n subjectToken;\n /**\n * Instantiates an ExecutableResponse instance using the provided JSON object\n * from the output of the executable.\n * @param responseJson Response from a 3rd party executable, loaded from a\n * run of the executable or a cached output file.\n */\n constructor(responseJson) {\n // Check that the required fields exist in the json response.\n if (!responseJson.version) {\n throw new InvalidVersionFieldError(\"Executable response must contain a 'version' field.\");\n }\n if (responseJson.success === undefined) {\n throw new InvalidSuccessFieldError(\"Executable response must contain a 'success' field.\");\n }\n this.version = responseJson.version;\n this.success = responseJson.success;\n // Validate required fields for a successful response.\n if (this.success) {\n this.expirationTime = responseJson.expiration_time;\n this.tokenType = responseJson.token_type;\n // Validate token type field.\n if (this.tokenType !== SAML_SUBJECT_TOKEN_TYPE &&\n this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE1 &&\n this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE2) {\n throw new InvalidTokenTypeFieldError(\"Executable response must contain a 'token_type' field when successful \" +\n `and it must be one of ${OIDC_SUBJECT_TOKEN_TYPE1}, ${OIDC_SUBJECT_TOKEN_TYPE2}, or ${SAML_SUBJECT_TOKEN_TYPE}.`);\n }\n // Validate subject token.\n if (this.tokenType === SAML_SUBJECT_TOKEN_TYPE) {\n if (!responseJson.saml_response) {\n throw new InvalidSubjectTokenError(`Executable response must contain a 'saml_response' field when token_type=${SAML_SUBJECT_TOKEN_TYPE}.`);\n }\n this.subjectToken = responseJson.saml_response;\n }\n else {\n if (!responseJson.id_token) {\n throw new InvalidSubjectTokenError(\"Executable response must contain a 'id_token' field when \" +\n `token_type=${OIDC_SUBJECT_TOKEN_TYPE1} or ${OIDC_SUBJECT_TOKEN_TYPE2}.`);\n }\n this.subjectToken = responseJson.id_token;\n }\n }\n else {\n // Both code and message must be provided for unsuccessful responses.\n if (!responseJson.code) {\n throw new InvalidCodeFieldError(\"Executable response must contain a 'code' field when unsuccessful.\");\n }\n if (!responseJson.message) {\n throw new InvalidMessageFieldError(\"Executable response must contain a 'message' field when unsuccessful.\");\n }\n this.errorCode = responseJson.code;\n this.errorMessage = responseJson.message;\n }\n }\n /**\n * @return A boolean representing if the response has a valid token. Returns\n * true when the response was successful and the token is not expired.\n */\n isValid() {\n return !this.isExpired() && this.success;\n }\n /**\n * @return A boolean representing if the response is expired. Returns true if the\n * provided timeout has passed.\n */\n isExpired() {\n return (this.expirationTime !== undefined &&\n this.expirationTime < Math.round(Date.now() / 1000));\n }\n}\nexports.ExecutableResponse = ExecutableResponse;\n/**\n * An error thrown by the ExecutableResponse class.\n */\nclass ExecutableResponseError extends Error {\n constructor(message) {\n super(message);\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\nexports.ExecutableResponseError = ExecutableResponseError;\n/**\n * An error thrown when the 'version' field in an executable response is missing or invalid.\n */\nclass InvalidVersionFieldError extends ExecutableResponseError {\n}\nexports.InvalidVersionFieldError = InvalidVersionFieldError;\n/**\n * An error thrown when the 'success' field in an executable response is missing or invalid.\n */\nclass InvalidSuccessFieldError extends ExecutableResponseError {\n}\nexports.InvalidSuccessFieldError = InvalidSuccessFieldError;\n/**\n * An error thrown when the 'expiration_time' field in an executable response is missing or invalid.\n */\nclass InvalidExpirationTimeFieldError extends ExecutableResponseError {\n}\nexports.InvalidExpirationTimeFieldError = InvalidExpirationTimeFieldError;\n/**\n * An error thrown when the 'token_type' field in an executable response is missing or invalid.\n */\nclass InvalidTokenTypeFieldError extends ExecutableResponseError {\n}\nexports.InvalidTokenTypeFieldError = InvalidTokenTypeFieldError;\n/**\n * An error thrown when the 'code' field in an executable response is missing or invalid.\n */\nclass InvalidCodeFieldError extends ExecutableResponseError {\n}\nexports.InvalidCodeFieldError = InvalidCodeFieldError;\n/**\n * An error thrown when the 'message' field in an executable response is missing or invalid.\n */\nclass InvalidMessageFieldError extends ExecutableResponseError {\n}\nexports.InvalidMessageFieldError = InvalidMessageFieldError;\n/**\n * An error thrown when the subject token in an executable response is missing or invalid.\n */\nclass InvalidSubjectTokenError extends ExecutableResponseError {\n}\nexports.InvalidSubjectTokenError = InvalidSubjectTokenError;\n//# sourceMappingURL=executable-response.js.map",
60
+ "\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PluggableAuthHandler = exports.ExecutableError = void 0;\nconst executable_response_1 = require(\"./executable-response\");\nconst childProcess = require(\"child_process\");\nconst fs = require(\"fs\");\n/**\n * Error thrown from the executable run by PluggableAuthClient.\n */\nclass ExecutableError extends Error {\n /**\n * The exit code returned by the executable.\n */\n code;\n constructor(message, code) {\n super(`The executable failed with exit code: ${code} and error message: ${message}.`);\n this.code = code;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\nexports.ExecutableError = ExecutableError;\n/**\n * A handler used to retrieve 3rd party token responses from user defined\n * executables and cached file output for the PluggableAuthClient class.\n */\nclass PluggableAuthHandler {\n commandComponents;\n timeoutMillis;\n outputFile;\n /**\n * Instantiates a PluggableAuthHandler instance using the provided\n * PluggableAuthHandlerOptions object.\n */\n constructor(options) {\n if (!options.command) {\n throw new Error('No command provided.');\n }\n this.commandComponents = PluggableAuthHandler.parseCommand(options.command);\n this.timeoutMillis = options.timeoutMillis;\n if (!this.timeoutMillis) {\n throw new Error('No timeoutMillis provided.');\n }\n this.outputFile = options.outputFile;\n }\n /**\n * Calls user provided executable to get a 3rd party subject token and\n * returns the response.\n * @param envMap a Map of additional Environment Variables required for\n * the executable.\n * @return A promise that resolves with the executable response.\n */\n retrieveResponseFromExecutable(envMap) {\n return new Promise((resolve, reject) => {\n // Spawn process to run executable using added environment variables.\n const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {\n env: { ...process.env, ...Object.fromEntries(envMap) },\n });\n let output = '';\n // Append stdout to output as executable runs.\n child.stdout.on('data', (data) => {\n output += data;\n });\n // Append stderr as executable runs.\n child.stderr.on('data', (err) => {\n output += err;\n });\n // Set up a timeout to end the child process and throw an error.\n const timeout = setTimeout(() => {\n // Kill child process and remove listeners so 'close' event doesn't get\n // read after child process is killed.\n child.removeAllListeners();\n child.kill();\n return reject(new Error('The executable failed to finish within the timeout specified.'));\n }, this.timeoutMillis);\n child.on('close', (code) => {\n // Cancel timeout if executable closes before timeout is reached.\n clearTimeout(timeout);\n if (code === 0) {\n // If the executable completed successfully, try to return the parsed response.\n try {\n const responseJson = JSON.parse(output);\n const response = new executable_response_1.ExecutableResponse(responseJson);\n return resolve(response);\n }\n catch (error) {\n if (error instanceof executable_response_1.ExecutableResponseError) {\n return reject(error);\n }\n return reject(new executable_response_1.ExecutableResponseError(`The executable returned an invalid response: ${output}`));\n }\n }\n else {\n return reject(new ExecutableError(output, code.toString()));\n }\n });\n });\n }\n /**\n * Checks user provided output file for response from previous run of\n * executable and return the response if it exists, is formatted correctly, and is not expired.\n */\n async retrieveCachedResponse() {\n if (!this.outputFile || this.outputFile.length === 0) {\n return undefined;\n }\n let filePath;\n try {\n filePath = await fs.promises.realpath(this.outputFile);\n }\n catch {\n // If file path cannot be resolved, return undefined.\n return undefined;\n }\n if (!(await fs.promises.lstat(filePath)).isFile()) {\n // If path does not lead to file, return undefined.\n return undefined;\n }\n const responseString = await fs.promises.readFile(filePath, {\n encoding: 'utf8',\n });\n if (responseString === '') {\n return undefined;\n }\n try {\n const responseJson = JSON.parse(responseString);\n const response = new executable_response_1.ExecutableResponse(responseJson);\n // Check if response is successful and unexpired.\n if (response.isValid()) {\n return new executable_response_1.ExecutableResponse(responseJson);\n }\n return undefined;\n }\n catch (error) {\n if (error instanceof executable_response_1.ExecutableResponseError) {\n throw error;\n }\n throw new executable_response_1.ExecutableResponseError(`The output file contained an invalid response: ${responseString}`);\n }\n }\n /**\n * Parses given command string into component array, splitting on spaces unless\n * spaces are between quotation marks.\n */\n static parseCommand(command) {\n // Split the command into components by splitting on spaces,\n // unless spaces are contained in quotation marks.\n const components = command.match(/(?:[^\\s\"]+|\"[^\"]*\")+/g);\n if (!components) {\n throw new Error(`Provided command: \"${command}\" could not be parsed.`);\n }\n // Remove quotation marks from the beginning and end of each component if they are present.\n for (let i = 0; i < components.length; i++) {\n if (components[i][0] === '\"' && components[i].slice(-1) === '\"') {\n components[i] = components[i].slice(1, -1);\n }\n }\n return components;\n }\n}\nexports.PluggableAuthHandler = PluggableAuthHandler;\n//# sourceMappingURL=pluggable-auth-handler.js.map",
61
+ "\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PluggableAuthClient = exports.ExecutableError = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst executable_response_1 = require(\"./executable-response\");\nconst pluggable_auth_handler_1 = require(\"./pluggable-auth-handler\");\nvar pluggable_auth_handler_2 = require(\"./pluggable-auth-handler\");\nObject.defineProperty(exports, \"ExecutableError\", { enumerable: true, get: function () { return pluggable_auth_handler_2.ExecutableError; } });\n/**\n * The default executable timeout when none is provided, in milliseconds.\n */\nconst DEFAULT_EXECUTABLE_TIMEOUT_MILLIS = 30 * 1000;\n/**\n * The minimum allowed executable timeout in milliseconds.\n */\nconst MINIMUM_EXECUTABLE_TIMEOUT_MILLIS = 5 * 1000;\n/**\n * The maximum allowed executable timeout in milliseconds.\n */\nconst MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS = 120 * 1000;\n/**\n * The environment variable to check to see if executable can be run.\n * Value must be set to '1' for the executable to run.\n */\nconst GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES = 'GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES';\n/**\n * The maximum currently supported executable version.\n */\nconst MAXIMUM_EXECUTABLE_VERSION = 1;\n/**\n * PluggableAuthClient enables the exchange of workload identity pool external credentials for\n * Google access tokens by retrieving 3rd party tokens through a user supplied executable. These\n * scripts/executables are completely independent of the Google Cloud Auth libraries. These\n * credentials plug into ADC and will call the specified executable to retrieve the 3rd party token\n * to be exchanged for a Google access token.\n *\n * <p>To use these credentials, the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment variable\n * must be set to '1'. This is for security reasons.\n *\n * <p>Both OIDC and SAML are supported. The executable must adhere to a specific response format\n * defined below.\n *\n * <p>The executable must print out the 3rd party token to STDOUT in JSON format. When an\n * output_file is specified in the credential configuration, the executable must also handle writing the\n * JSON response to this file.\n *\n * <pre>\n * OIDC response sample:\n * {\n * \"version\": 1,\n * \"success\": true,\n * \"token_type\": \"urn:ietf:params:oauth:token-type:id_token\",\n * \"id_token\": \"HEADER.PAYLOAD.SIGNATURE\",\n * \"expiration_time\": 1620433341\n * }\n *\n * SAML2 response sample:\n * {\n * \"version\": 1,\n * \"success\": true,\n * \"token_type\": \"urn:ietf:params:oauth:token-type:saml2\",\n * \"saml_response\": \"...\",\n * \"expiration_time\": 1620433341\n * }\n *\n * Error response sample:\n * {\n * \"version\": 1,\n * \"success\": false,\n * \"code\": \"401\",\n * \"message\": \"Error message.\"\n * }\n * </pre>\n *\n * <p>The \"expiration_time\" field in the JSON response is only required for successful\n * responses when an output file was specified in the credential configuration\n *\n * <p>The auth libraries will populate certain environment variables that will be accessible by the\n * executable, such as: GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE, GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE,\n * GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE, GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL, and\n * GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE.\n *\n * <p>Please see this repositories README for a complete executable request/response specification.\n */\nclass PluggableAuthClient extends baseexternalclient_1.BaseExternalAccountClient {\n /**\n * The command used to retrieve the third party token.\n */\n command;\n /**\n * The timeout in milliseconds for running executable,\n * set to default if none provided.\n */\n timeoutMillis;\n /**\n * The path to file to check for cached executable response.\n */\n outputFile;\n /**\n * Executable and output file handler.\n */\n handler;\n /**\n * Instantiates a PluggableAuthClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid pluggable auth credential.\n * @param options The external account options object typically loaded from\n * the external account JSON credential file.\n */\n constructor(options) {\n super(options);\n if (!options.credential_source.executable) {\n throw new Error('No valid Pluggable Auth \"credential_source\" provided.');\n }\n this.command = options.credential_source.executable.command;\n if (!this.command) {\n throw new Error('No valid Pluggable Auth \"credential_source\" provided.');\n }\n // Check if the provided timeout exists and if it is valid.\n if (options.credential_source.executable.timeout_millis === undefined) {\n this.timeoutMillis = DEFAULT_EXECUTABLE_TIMEOUT_MILLIS;\n }\n else {\n this.timeoutMillis = options.credential_source.executable.timeout_millis;\n if (this.timeoutMillis < MINIMUM_EXECUTABLE_TIMEOUT_MILLIS ||\n this.timeoutMillis > MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS) {\n throw new Error(`Timeout must be between ${MINIMUM_EXECUTABLE_TIMEOUT_MILLIS} and ` +\n `${MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS} milliseconds.`);\n }\n }\n this.outputFile = options.credential_source.executable.output_file;\n this.handler = new pluggable_auth_handler_1.PluggableAuthHandler({\n command: this.command,\n timeoutMillis: this.timeoutMillis,\n outputFile: this.outputFile,\n });\n this.credentialSourceType = 'executable';\n }\n /**\n * Triggered when an external subject token is needed to be exchanged for a\n * GCP access token via GCP STS endpoint.\n * This uses the `options.credential_source` object to figure out how\n * to retrieve the token using the current environment. In this case,\n * this calls a user provided executable which returns the subject token.\n * The logic is summarized as:\n * 1. Validated that the executable is allowed to run. The\n * GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment must be set to\n * 1 for security reasons.\n * 2. If an output file is specified by the user, check the file location\n * for a response. If the file exists and contains a valid response,\n * return the subject token from the file.\n * 3. Call the provided executable and return response.\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n // Check if the executable is allowed to run.\n if (process.env[GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES] !== '1') {\n throw new Error('Pluggable Auth executables need to be explicitly allowed to run by ' +\n 'setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment ' +\n 'Variable to 1.');\n }\n let executableResponse = undefined;\n // Try to get cached executable response from output file.\n if (this.outputFile) {\n executableResponse = await this.handler.retrieveCachedResponse();\n }\n // If no response from output file, call the executable.\n if (!executableResponse) {\n // Set up environment map with required values for the executable.\n const envMap = new Map();\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE', this.audience);\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE', this.subjectTokenType);\n // Always set to 0 because interactive mode is not supported.\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE', '0');\n if (this.outputFile) {\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE', this.outputFile);\n }\n const serviceAccountEmail = this.getServiceAccountEmail();\n if (serviceAccountEmail) {\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL', serviceAccountEmail);\n }\n executableResponse =\n await this.handler.retrieveResponseFromExecutable(envMap);\n }\n if (executableResponse.version > MAXIMUM_EXECUTABLE_VERSION) {\n throw new Error(`Version of executable is not currently supported, maximum supported version is ${MAXIMUM_EXECUTABLE_VERSION}.`);\n }\n // Check that response was successful.\n if (!executableResponse.success) {\n throw new pluggable_auth_handler_1.ExecutableError(executableResponse.errorMessage, executableResponse.errorCode);\n }\n // Check that response contains expiration time if output file was specified.\n if (this.outputFile) {\n if (!executableResponse.expirationTime) {\n throw new executable_response_1.InvalidExpirationTimeFieldError('The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.');\n }\n }\n // Check that response is not expired.\n if (executableResponse.isExpired()) {\n throw new Error('Executable response is expired.');\n }\n // Return subject token from response.\n return executableResponse.subjectToken;\n }\n}\nexports.PluggableAuthClient = PluggableAuthClient;\n//# sourceMappingURL=pluggable-auth-client.js.map",
62
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExternalAccountClient = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst identitypoolclient_1 = require(\"./identitypoolclient\");\nconst awsclient_1 = require(\"./awsclient\");\nconst pluggable_auth_client_1 = require(\"./pluggable-auth-client\");\n/**\n * Dummy class with no constructor. Developers are expected to use fromJSON.\n */\nclass ExternalAccountClient {\n constructor() {\n throw new Error('ExternalAccountClients should be initialized via: ' +\n 'ExternalAccountClient.fromJSON(), ' +\n 'directly via explicit constructors, eg. ' +\n 'new AwsClient(options), new IdentityPoolClient(options), new' +\n 'PluggableAuthClientOptions, or via ' +\n 'new GoogleAuth(options).getClient()');\n }\n /**\n * This static method will instantiate the\n * corresponding type of external account credential depending on the\n * underlying credential source.\n *\n * **IMPORTANT**: This method does not validate the credential configuration.\n * A security risk occurs when a credential configuration configured with\n * malicious URLs is used. When the credential configuration is accepted from\n * an untrusted source, you should validate it before using it with this\n * method. For more details, see\n * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.\n *\n * @param options The external account options object typically loaded\n * from the external account JSON credential file.\n * @return A BaseExternalAccountClient instance or null if the options\n * provided do not correspond to an external account credential.\n */\n static fromJSON(options) {\n if (options && options.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n if (options.credential_source?.environment_id) {\n return new awsclient_1.AwsClient(options);\n }\n else if (options.credential_source?.executable) {\n return new pluggable_auth_client_1.PluggableAuthClient(options);\n }\n else {\n return new identitypoolclient_1.IdentityPoolClient(options);\n }\n }\n else {\n return null;\n }\n }\n}\nexports.ExternalAccountClient = ExternalAccountClient;\n//# sourceMappingURL=externalclient.js.map",
63
+ "\"use strict\";\n// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = void 0;\nconst authclient_1 = require(\"./authclient\");\nconst oauth2common_1 = require(\"./oauth2common\");\nconst gaxios_1 = require(\"gaxios\");\nconst stream = require(\"stream\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\n/**\n * The credentials JSON file type for external account authorized user clients.\n */\nexports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = 'external_account_authorized_user';\nconst DEFAULT_TOKEN_URL = 'https://sts.{universeDomain}/v1/oauthtoken';\n/**\n * Handler for token refresh requests sent to the token_url endpoint for external\n * authorized user credentials.\n */\nclass ExternalAccountAuthorizedUserHandler extends oauth2common_1.OAuthClientAuthHandler {\n #tokenRefreshEndpoint;\n /**\n * Initializes an ExternalAccountAuthorizedUserHandler instance.\n * @param url The URL of the token refresh endpoint.\n * @param transporter The transporter to use for the refresh request.\n * @param clientAuthentication The client authentication credentials to use\n * for the refresh request.\n */\n constructor(options) {\n super(options);\n this.#tokenRefreshEndpoint = options.tokenRefreshEndpoint;\n }\n /**\n * Requests a new access token from the token_url endpoint using the provided\n * refresh token.\n * @param refreshToken The refresh token to use to generate a new access token.\n * @param additionalHeaders Optional additional headers to pass along the\n * request.\n * @return A promise that resolves with the token refresh response containing\n * the requested access token and its expiration time.\n */\n async refreshToken(refreshToken, headers) {\n const opts = {\n ...ExternalAccountAuthorizedUserHandler.RETRY_CONFIG,\n url: this.#tokenRefreshEndpoint,\n method: 'POST',\n headers,\n data: new URLSearchParams({\n grant_type: 'refresh_token',\n refresh_token: refreshToken,\n }),\n };\n authclient_1.AuthClient.setMethodName(opts, 'refreshToken');\n // Apply OAuth client authentication.\n this.applyClientAuthenticationOptions(opts);\n try {\n const response = await this.transporter.request(opts);\n // Successful response.\n const tokenRefreshResponse = response.data;\n tokenRefreshResponse.res = response;\n return tokenRefreshResponse;\n }\n catch (error) {\n // Translate error to OAuthError.\n if (error instanceof gaxios_1.GaxiosError && error.response) {\n throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data, \n // Preserve other fields from the original error.\n error);\n }\n // Request could fail before the server responds.\n throw error;\n }\n }\n}\n/**\n * External Account Authorized User Client. This is used for OAuth2 credentials\n * sourced using external identities through Workforce Identity Federation.\n * Obtaining the initial access and refresh token can be done through the\n * Google Cloud CLI.\n */\nclass ExternalAccountAuthorizedUserClient extends authclient_1.AuthClient {\n cachedAccessToken;\n externalAccountAuthorizedUserHandler;\n refreshToken;\n /**\n * Instantiates an ExternalAccountAuthorizedUserClient instances using the\n * provided JSON object loaded from a credentials files.\n * An error is throws if the credential is not valid.\n * @param options The external account authorized user option object typically\n * from the external accoutn authorized user JSON credential file.\n */\n constructor(options) {\n super(options);\n if (options.universe_domain) {\n this.universeDomain = options.universe_domain;\n }\n this.refreshToken = options.refresh_token;\n const clientAuthentication = {\n confidentialClientType: 'basic',\n clientId: options.client_id,\n clientSecret: options.client_secret,\n };\n this.externalAccountAuthorizedUserHandler =\n new ExternalAccountAuthorizedUserHandler({\n tokenRefreshEndpoint: options.token_url ??\n DEFAULT_TOKEN_URL.replace('{universeDomain}', this.universeDomain),\n transporter: this.transporter,\n clientAuthentication,\n });\n this.cachedAccessToken = null;\n this.quotaProjectId = options.quota_project_id;\n // As threshold could be zero,\n // eagerRefreshThresholdMillis || EXPIRATION_TIME_OFFSET will override the\n // zero value.\n if (typeof options?.eagerRefreshThresholdMillis !== 'number') {\n this.eagerRefreshThresholdMillis = baseexternalclient_1.EXPIRATION_TIME_OFFSET;\n }\n else {\n this.eagerRefreshThresholdMillis = options\n .eagerRefreshThresholdMillis;\n }\n this.forceRefreshOnFailure = !!options?.forceRefreshOnFailure;\n }\n async getAccessToken() {\n // If cached access token is unavailable or expired, force refresh.\n if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return GCP access token in GetAccessTokenResponse format.\n return {\n token: this.cachedAccessToken.access_token,\n res: this.cachedAccessToken.res,\n };\n }\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = new Headers({\n authorization: `Bearer ${accessTokenResponse.token}`,\n });\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure.\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, requestHeaders);\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * @return A promise that resolves with the refreshed credential.\n */\n async refreshAccessTokenAsync() {\n // Refresh the access token using the refresh token.\n const refreshResponse = await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);\n this.cachedAccessToken = {\n access_token: refreshResponse.access_token,\n expiry_date: new Date().getTime() + refreshResponse.expires_in * 1000,\n res: refreshResponse.res,\n };\n if (refreshResponse.refresh_token !== undefined) {\n this.refreshToken = refreshResponse.refresh_token;\n }\n return this.cachedAccessToken;\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param credentials The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(credentials) {\n const now = new Date().getTime();\n return credentials.expiry_date\n ? now >= credentials.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.ExternalAccountAuthorizedUserClient = ExternalAccountAuthorizedUserClient;\n//# sourceMappingURL=externalAccountAuthorizedUserClient.js.map",
64
+ "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleAuth = exports.GoogleAuthExceptionMessages = void 0;\nconst child_process_1 = require(\"child_process\");\nconst fs = require(\"fs\");\nconst gaxios_1 = require(\"gaxios\");\nconst gcpMetadata = require(\"gcp-metadata\");\nconst os = require(\"os\");\nconst path = require(\"path\");\nconst crypto_1 = require(\"../crypto/crypto\");\nconst computeclient_1 = require(\"./computeclient\");\nconst idtokenclient_1 = require(\"./idtokenclient\");\nconst envDetect_1 = require(\"./envDetect\");\nconst jwtclient_1 = require(\"./jwtclient\");\nconst refreshclient_1 = require(\"./refreshclient\");\nconst impersonated_1 = require(\"./impersonated\");\nconst externalclient_1 = require(\"./externalclient\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst authclient_1 = require(\"./authclient\");\nconst externalAccountAuthorizedUserClient_1 = require(\"./externalAccountAuthorizedUserClient\");\nconst util_1 = require(\"../util\");\nexports.GoogleAuthExceptionMessages = {\n API_KEY_WITH_CREDENTIALS: 'API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.',\n NO_PROJECT_ID_FOUND: 'Unable to detect a Project Id in the current environment. \\n' +\n 'To learn more about authentication and Google APIs, visit: \\n' +\n 'https://cloud.google.com/docs/authentication/getting-started',\n NO_CREDENTIALS_FOUND: 'Unable to find credentials in current environment. \\n' +\n 'To learn more about authentication and Google APIs, visit: \\n' +\n 'https://cloud.google.com/docs/authentication/getting-started',\n NO_ADC_FOUND: 'Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.',\n NO_UNIVERSE_DOMAIN_FOUND: 'Unable to detect a Universe Domain in the current environment.\\n' +\n 'To learn more about Universe Domain retrieval, visit: \\n' +\n 'https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys',\n};\nclass GoogleAuth {\n /**\n * Caches a value indicating whether the auth layer is running on Google\n * Compute Engine.\n * @private\n */\n checkIsGCE = undefined;\n useJWTAccessWithScope;\n defaultServicePath;\n // Note: this properly is only public to satisfy unit tests.\n // https://github.com/Microsoft/TypeScript/issues/5228\n get isGCE() {\n return this.checkIsGCE;\n }\n _findProjectIdPromise;\n _cachedProjectId;\n // To save the contents of the JSON credential file\n jsonContent = null;\n apiKey;\n cachedCredential = null;\n /**\n * A pending {@link AuthClient}. Used for concurrent {@link GoogleAuth.getClient} calls.\n */\n #pendingAuthClient = null;\n /**\n * Scopes populated by the client library by default. We differentiate between\n * these and user defined scopes when deciding whether to use a self-signed JWT.\n */\n defaultScopes;\n keyFilename;\n scopes;\n clientOptions = {};\n /**\n * Configuration is resolved in the following order of precedence:\n * - {@link GoogleAuthOptions.credentials `credentials`}\n * - {@link GoogleAuthOptions.keyFilename `keyFilename`}\n * - {@link GoogleAuthOptions.keyFile `keyFile`}\n *\n * {@link GoogleAuthOptions.clientOptions `clientOptions`} are passed to the\n * {@link AuthClient `AuthClient`s}.\n *\n * @param opts\n */\n constructor(opts = {}) {\n this._cachedProjectId = opts.projectId || null;\n this.cachedCredential = opts.authClient || null;\n this.keyFilename = opts.keyFilename || opts.keyFile;\n this.scopes = opts.scopes;\n this.clientOptions = opts.clientOptions || {};\n this.jsonContent = opts.credentials || null;\n this.apiKey = opts.apiKey || this.clientOptions.apiKey || null;\n // Cannot use both API Key + Credentials\n if (this.apiKey && (this.jsonContent || this.clientOptions.credentials)) {\n throw new RangeError(exports.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);\n }\n if (opts.universeDomain) {\n this.clientOptions.universeDomain = opts.universeDomain;\n }\n }\n // GAPIC client libraries should always use self-signed JWTs. The following\n // variables are set on the JWT client in order to indicate the type of library,\n // and sign the JWT with the correct audience and scopes (if not supplied).\n setGapicJWTValues(client) {\n client.defaultServicePath = this.defaultServicePath;\n client.useJWTAccessWithScope = this.useJWTAccessWithScope;\n client.defaultScopes = this.defaultScopes;\n }\n getProjectId(callback) {\n if (callback) {\n this.getProjectIdAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.getProjectIdAsync();\n }\n }\n /**\n * A temporary method for internal `getProjectId` usages where `null` is\n * acceptable. In a future major release, `getProjectId` should return `null`\n * (as the `Promise<string | null>` base signature describes) and this private\n * method should be removed.\n *\n * @returns Promise that resolves with project id (or `null`)\n */\n async getProjectIdOptional() {\n try {\n return await this.getProjectId();\n }\n catch (e) {\n if (e instanceof Error &&\n e.message === exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND) {\n return null;\n }\n else {\n throw e;\n }\n }\n }\n /**\n * A private method for finding and caching a projectId.\n *\n * Supports environments in order of precedence:\n * - GCLOUD_PROJECT or GOOGLE_CLOUD_PROJECT environment variable\n * - GOOGLE_APPLICATION_CREDENTIALS JSON file\n * - Cloud SDK: `gcloud config config-helper --format json`\n * - GCE project ID from metadata server\n *\n * @returns projectId\n */\n async findAndCacheProjectId() {\n let projectId = null;\n projectId ||= await this.getProductionProjectId();\n projectId ||= await this.getFileProjectId();\n projectId ||= await this.getDefaultServiceProjectId();\n projectId ||= await this.getGCEProjectId();\n projectId ||= await this.getExternalAccountClientProjectId();\n if (projectId) {\n this._cachedProjectId = projectId;\n return projectId;\n }\n else {\n throw new Error(exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND);\n }\n }\n async getProjectIdAsync() {\n if (this._cachedProjectId) {\n return this._cachedProjectId;\n }\n if (!this._findProjectIdPromise) {\n this._findProjectIdPromise = this.findAndCacheProjectId();\n }\n return this._findProjectIdPromise;\n }\n /**\n * Retrieves a universe domain from the metadata server via\n * {@link gcpMetadata.universe}.\n *\n * @returns a universe domain\n */\n async getUniverseDomainFromMetadataServer() {\n let universeDomain;\n try {\n universeDomain = await gcpMetadata.universe('universe-domain');\n universeDomain ||= authclient_1.DEFAULT_UNIVERSE;\n }\n catch (e) {\n if (e && e?.response?.status === 404) {\n universeDomain = authclient_1.DEFAULT_UNIVERSE;\n }\n else {\n throw e;\n }\n }\n return universeDomain;\n }\n /**\n * Retrieves, caches, and returns the universe domain in the following order\n * of precedence:\n * - The universe domain in {@link GoogleAuth.clientOptions}\n * - An existing or ADC {@link AuthClient}'s universe domain\n * - {@link gcpMetadata.universe}, if {@link Compute} client\n *\n * @returns The universe domain\n */\n async getUniverseDomain() {\n let universeDomain = (0, util_1.originalOrCamelOptions)(this.clientOptions).get('universe_domain');\n try {\n universeDomain ??= (await this.getClient()).universeDomain;\n }\n catch {\n // client or ADC is not available\n universeDomain ??= authclient_1.DEFAULT_UNIVERSE;\n }\n return universeDomain;\n }\n /**\n * @returns Any scopes (user-specified or default scopes specified by the\n * client library) that need to be set on the current Auth client.\n */\n getAnyScopes() {\n return this.scopes || this.defaultScopes;\n }\n getApplicationDefault(optionsOrCallback = {}, callback) {\n let options;\n if (typeof optionsOrCallback === 'function') {\n callback = optionsOrCallback;\n }\n else {\n options = optionsOrCallback;\n }\n if (callback) {\n this.getApplicationDefaultAsync(options).then(r => callback(null, r.credential, r.projectId), callback);\n }\n else {\n return this.getApplicationDefaultAsync(options);\n }\n }\n async getApplicationDefaultAsync(options = {}) {\n // If we've already got a cached credential, return it.\n // This will also preserve one's configured quota project, in case they\n // set one directly on the credential previously.\n if (this.cachedCredential) {\n // cache, while preserving existing quota project preferences\n return await this.#prepareAndCacheClient(this.cachedCredential, null);\n }\n let credential;\n // Check for the existence of a local environment variable pointing to the\n // location of the credential file. This is typically used in local\n // developer scenarios.\n credential =\n await this._tryGetApplicationCredentialsFromEnvironmentVariable(options);\n if (credential) {\n if (credential instanceof jwtclient_1.JWT) {\n credential.scopes = this.scopes;\n }\n else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) {\n credential.scopes = this.getAnyScopes();\n }\n return await this.#prepareAndCacheClient(credential);\n }\n // Look in the well-known credential file location.\n credential =\n await this._tryGetApplicationCredentialsFromWellKnownFile(options);\n if (credential) {\n if (credential instanceof jwtclient_1.JWT) {\n credential.scopes = this.scopes;\n }\n else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) {\n credential.scopes = this.getAnyScopes();\n }\n return await this.#prepareAndCacheClient(credential);\n }\n // Determine if we're running on GCE.\n if (await this._checkIsGCE()) {\n options.scopes = this.getAnyScopes();\n return await this.#prepareAndCacheClient(new computeclient_1.Compute(options));\n }\n throw new Error(exports.GoogleAuthExceptionMessages.NO_ADC_FOUND);\n }\n async #prepareAndCacheClient(credential, quotaProjectIdOverride = process.env['GOOGLE_CLOUD_QUOTA_PROJECT'] || null) {\n const projectId = await this.getProjectIdOptional();\n if (quotaProjectIdOverride) {\n credential.quotaProjectId = quotaProjectIdOverride;\n }\n this.cachedCredential = credential;\n return { credential, projectId };\n }\n /**\n * Determines whether the auth layer is running on Google Compute Engine.\n * Checks for GCP Residency, then fallback to checking if metadata server\n * is available.\n *\n * @returns A promise that resolves with the boolean.\n * @api private\n */\n async _checkIsGCE() {\n if (this.checkIsGCE === undefined) {\n this.checkIsGCE =\n gcpMetadata.getGCPResidency() || (await gcpMetadata.isAvailable());\n }\n return this.checkIsGCE;\n }\n /**\n * Attempts to load default credentials from the environment variable path..\n * @returns Promise that resolves with the OAuth2Client or null.\n * @api private\n */\n async _tryGetApplicationCredentialsFromEnvironmentVariable(options) {\n const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] ||\n process.env['google_application_credentials'];\n if (!credentialsPath || credentialsPath.length === 0) {\n return null;\n }\n try {\n return this._getApplicationCredentialsFromFilePath(credentialsPath, options);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`;\n }\n throw e;\n }\n }\n /**\n * Attempts to load default credentials from a well-known file location\n * @return Promise that resolves with the OAuth2Client or null.\n * @api private\n */\n async _tryGetApplicationCredentialsFromWellKnownFile(options) {\n // First, figure out the location of the file, depending upon the OS type.\n let location = null;\n if (this._isWindows()) {\n // Windows\n location = process.env['APPDATA'];\n }\n else {\n // Linux or Mac\n const home = process.env['HOME'];\n if (home) {\n location = path.join(home, '.config');\n }\n }\n // If we found the root path, expand it.\n if (location) {\n location = path.join(location, 'gcloud', 'application_default_credentials.json');\n if (!fs.existsSync(location)) {\n location = null;\n }\n }\n // The file does not exist.\n if (!location) {\n return null;\n }\n // The file seems to exist. Try to use it.\n const client = await this._getApplicationCredentialsFromFilePath(location, options);\n return client;\n }\n /**\n * Attempts to load default credentials from a file at the given path..\n * @param filePath The path to the file to read.\n * @returns Promise that resolves with the OAuth2Client\n * @api private\n */\n async _getApplicationCredentialsFromFilePath(filePath, options = {}) {\n // Make sure the path looks like a string.\n if (!filePath || filePath.length === 0) {\n throw new Error('The file path is invalid.');\n }\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n filePath = fs.realpathSync(filePath);\n if (!fs.lstatSync(filePath).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;\n }\n throw err;\n }\n // Now open a read stream on the file, and parse it.\n const readStream = fs.createReadStream(filePath);\n return this.fromStream(readStream, options);\n }\n /**\n * Create a credentials instance using a given impersonated input options.\n * @param json The impersonated input object.\n * @returns JWT or UserRefresh Client with data\n */\n fromImpersonatedJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing an impersonated refresh token');\n }\n if (json.type !== impersonated_1.IMPERSONATED_ACCOUNT_TYPE) {\n throw new Error(`The incoming JSON object does not have the \"${impersonated_1.IMPERSONATED_ACCOUNT_TYPE}\" type`);\n }\n if (!json.source_credentials) {\n throw new Error('The incoming JSON object does not contain a source_credentials field');\n }\n if (!json.service_account_impersonation_url) {\n throw new Error('The incoming JSON object does not contain a service_account_impersonation_url field');\n }\n const sourceClient = this.fromJSON(json.source_credentials);\n if (json.service_account_impersonation_url?.length > 256) {\n /**\n * Prevents DOS attacks.\n * @see {@link https://github.com/googleapis/google-auth-library-nodejs/security/code-scanning/85}\n **/\n throw new RangeError(`Target principal is too long: ${json.service_account_impersonation_url}`);\n }\n // Extract service account from service_account_impersonation_url\n const targetPrincipal = /(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(json.service_account_impersonation_url)?.groups?.target;\n if (!targetPrincipal) {\n throw new RangeError(`Cannot extract target principal from ${json.service_account_impersonation_url}`);\n }\n const targetScopes = (this.scopes || json.scopes || this.defaultScopes) ?? [];\n return new impersonated_1.Impersonated({\n ...json,\n sourceClient,\n targetPrincipal,\n targetScopes: Array.isArray(targetScopes) ? targetScopes : [targetScopes],\n });\n }\n /**\n * Create a credentials instance using the given input options.\n * This client is not cached.\n *\n * **Important**: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to {@link https://cloud.google.com/docs/authentication/external/externally-sourced-credentials Validate credential configurations from external sources}.\n *\n * @deprecated This method is being deprecated because of a potential security risk.\n *\n * This method does not validate the credential configuration. The security\n * risk occurs when a credential configuration is accepted from a source that\n * is not under your control and used without validation on your side.\n *\n * If you know that you will be loading credential configurations of a\n * specific type, it is recommended to use a credential-type-specific\n * constructor. This will ensure that an unexpected credential type with\n * potential for malicious intent is not loaded unintentionally. You might\n * still have to do validation for certain credential types. Please follow\n * the recommendation for that method. For example, if you want to load only\n * service accounts, you can use the `JWT` constructor:\n * ```\n * const {JWT} = require('google-auth-library');\n * const keys = require('/path/to/key.json');\n * const client = new JWT({\n * email: keys.client_email,\n * key: keys.private_key,\n * scopes: ['https://www.googleapis.com/auth/cloud-platform'],\n * });\n * ```\n *\n * If you are loading your credential configuration from an untrusted source and have\n * not mitigated the risks (e.g. by validating the configuration yourself), make\n * these changes as soon as possible to prevent security risks to your environment.\n *\n * Regardless of the method used, it is always your responsibility to validate\n * configurations received from external sources.\n *\n * For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.\n *\n * @param json The input object.\n * @param options The JWT or UserRefresh options for the client\n * @returns JWT or UserRefresh Client with data\n */\n fromJSON(json, options = {}) {\n let client;\n // user's preferred universe domain\n const preferredUniverseDomain = (0, util_1.originalOrCamelOptions)(options).get('universe_domain');\n if (json.type === refreshclient_1.USER_REFRESH_ACCOUNT_TYPE) {\n client = new refreshclient_1.UserRefreshClient(options);\n client.fromJSON(json);\n }\n else if (json.type === impersonated_1.IMPERSONATED_ACCOUNT_TYPE) {\n client = this.fromImpersonatedJSON(json);\n }\n else if (json.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n client = externalclient_1.ExternalAccountClient.fromJSON({\n ...json,\n ...options,\n });\n client.scopes = this.getAnyScopes();\n }\n else if (json.type === externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE) {\n client = new externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient({\n ...json,\n ...options,\n });\n }\n else {\n options.scopes = this.scopes;\n client = new jwtclient_1.JWT(options);\n this.setGapicJWTValues(client);\n client.fromJSON(json);\n }\n if (preferredUniverseDomain) {\n client.universeDomain = preferredUniverseDomain;\n }\n return client;\n }\n /**\n * Return a JWT or UserRefreshClient from JavaScript object, caching both the\n * object used to instantiate and the client.\n * @param json The input object.\n * @param options The JWT or UserRefresh options for the client\n * @returns JWT or UserRefresh Client with data\n */\n _cacheClientFromJSON(json, options) {\n const client = this.fromJSON(json, options);\n // cache both raw data used to instantiate client and client itself.\n this.jsonContent = json;\n this.cachedCredential = client;\n return client;\n }\n fromStream(inputStream, optionsOrCallback = {}, callback) {\n let options = {};\n if (typeof optionsOrCallback === 'function') {\n callback = optionsOrCallback;\n }\n else {\n options = optionsOrCallback;\n }\n if (callback) {\n this.fromStreamAsync(inputStream, options).then(r => callback(null, r), callback);\n }\n else {\n return this.fromStreamAsync(inputStream, options);\n }\n }\n fromStreamAsync(inputStream, options) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n throw new Error('Must pass in a stream containing the Google auth settings.');\n }\n const chunks = [];\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => chunks.push(chunk))\n .on('end', () => {\n try {\n try {\n const data = JSON.parse(chunks.join(''));\n const r = this._cacheClientFromJSON(data, options);\n return resolve(r);\n }\n catch (err) {\n // If we failed parsing this.keyFileName, assume that it\n // is a PEM or p12 certificate:\n if (!this.keyFilename)\n throw err;\n const client = new jwtclient_1.JWT({\n ...this.clientOptions,\n keyFile: this.keyFilename,\n });\n this.cachedCredential = client;\n this.setGapicJWTValues(client);\n return resolve(client);\n }\n }\n catch (err) {\n return reject(err);\n }\n });\n });\n }\n /**\n * Create a credentials instance using the given API key string.\n * The created client is not cached. In order to create and cache it use the {@link GoogleAuth.getClient `getClient`} method after first providing an {@link GoogleAuth.apiKey `apiKey`}.\n *\n * @param apiKey The API key string\n * @param options An optional options object.\n * @returns A JWT loaded from the key\n */\n fromAPIKey(apiKey, options = {}) {\n return new jwtclient_1.JWT({ ...options, apiKey });\n }\n /**\n * Determines whether the current operating system is Windows.\n * @api private\n */\n _isWindows() {\n const sys = os.platform();\n if (sys && sys.length >= 3) {\n if (sys.substring(0, 3).toLowerCase() === 'win') {\n return true;\n }\n }\n return false;\n }\n /**\n * Run the Google Cloud SDK command that prints the default project ID\n */\n async getDefaultServiceProjectId() {\n return new Promise(resolve => {\n (0, child_process_1.exec)('gcloud config config-helper --format json', (err, stdout) => {\n if (!err && stdout) {\n try {\n const projectId = JSON.parse(stdout).configuration.properties.core.project;\n resolve(projectId);\n return;\n }\n catch (e) {\n // ignore errors\n }\n }\n resolve(null);\n });\n });\n }\n /**\n * Loads the project id from environment variables.\n * @api private\n */\n getProductionProjectId() {\n return (process.env['GCLOUD_PROJECT'] ||\n process.env['GOOGLE_CLOUD_PROJECT'] ||\n process.env['gcloud_project'] ||\n process.env['google_cloud_project']);\n }\n /**\n * Loads the project id from the GOOGLE_APPLICATION_CREDENTIALS json file.\n * @api private\n */\n async getFileProjectId() {\n if (this.cachedCredential) {\n // Try to read the project ID from the cached credentials file\n return this.cachedCredential.projectId;\n }\n // Ensure the projectId is loaded from the keyFile if available.\n if (this.keyFilename) {\n const creds = await this.getClient();\n if (creds && creds.projectId) {\n return creds.projectId;\n }\n }\n // Try to load a credentials file and read its project ID\n const r = await this._tryGetApplicationCredentialsFromEnvironmentVariable();\n if (r) {\n return r.projectId;\n }\n else {\n return null;\n }\n }\n /**\n * Gets the project ID from external account client if available.\n */\n async getExternalAccountClientProjectId() {\n if (!this.jsonContent || this.jsonContent.type !== baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n return null;\n }\n const creds = await this.getClient();\n // Do not suppress the underlying error, as the error could contain helpful\n // information for debugging and fixing. This is especially true for\n // external account creds as in order to get the project ID, the following\n // operations have to succeed:\n // 1. Valid credentials file should be supplied.\n // 2. Ability to retrieve access tokens from STS token exchange API.\n // 3. Ability to exchange for service account impersonated credentials (if\n // enabled).\n // 4. Ability to get project info using the access token from step 2 or 3.\n // Without surfacing the error, it is harder for developers to determine\n // which step went wrong.\n return await creds.getProjectId();\n }\n /**\n * Gets the Compute Engine project ID if it can be inferred.\n */\n async getGCEProjectId() {\n try {\n const r = await gcpMetadata.project('project-id');\n return r;\n }\n catch (e) {\n // Ignore any errors\n return null;\n }\n }\n getCredentials(callback) {\n if (callback) {\n this.getCredentialsAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.getCredentialsAsync();\n }\n }\n async getCredentialsAsync() {\n const client = await this.getClient();\n if (client instanceof impersonated_1.Impersonated) {\n return { client_email: client.getTargetPrincipal() };\n }\n if (client instanceof baseexternalclient_1.BaseExternalAccountClient) {\n const serviceAccountEmail = client.getServiceAccountEmail();\n if (serviceAccountEmail) {\n return {\n client_email: serviceAccountEmail,\n universe_domain: client.universeDomain,\n };\n }\n }\n if (this.jsonContent) {\n return {\n client_email: this.jsonContent.client_email,\n private_key: this.jsonContent.private_key,\n universe_domain: this.jsonContent.universe_domain,\n };\n }\n if (await this._checkIsGCE()) {\n const [client_email, universe_domain] = await Promise.all([\n gcpMetadata.instance('service-accounts/default/email'),\n this.getUniverseDomain(),\n ]);\n return { client_email, universe_domain };\n }\n throw new Error(exports.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND);\n }\n /**\n * Automatically obtain an {@link AuthClient `AuthClient`} based on the\n * provided configuration. If no options were passed, use Application\n * Default Credentials.\n */\n async getClient() {\n if (this.cachedCredential) {\n return this.cachedCredential;\n }\n // Use an existing auth client request, or cache a new one\n this.#pendingAuthClient =\n this.#pendingAuthClient || this.#determineClient();\n try {\n return await this.#pendingAuthClient;\n }\n finally {\n // reset the pending auth client in case it is changed later\n this.#pendingAuthClient = null;\n }\n }\n async #determineClient() {\n if (this.jsonContent) {\n return this._cacheClientFromJSON(this.jsonContent, this.clientOptions);\n }\n else if (this.keyFilename) {\n const filePath = path.resolve(this.keyFilename);\n const stream = fs.createReadStream(filePath);\n return await this.fromStreamAsync(stream, this.clientOptions);\n }\n else if (this.apiKey) {\n const client = await this.fromAPIKey(this.apiKey, this.clientOptions);\n client.scopes = this.scopes;\n const { credential } = await this.#prepareAndCacheClient(client);\n return credential;\n }\n else {\n const { credential } = await this.getApplicationDefaultAsync(this.clientOptions);\n return credential;\n }\n }\n /**\n * Creates a client which will fetch an ID token for authorization.\n * @param targetAudience the audience for the fetched ID token.\n * @returns IdTokenClient for making HTTP calls authenticated with ID tokens.\n */\n async getIdTokenClient(targetAudience) {\n const client = await this.getClient();\n if (!('fetchIdToken' in client)) {\n throw new Error('Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.');\n }\n return new idtokenclient_1.IdTokenClient({ targetAudience, idTokenProvider: client });\n }\n /**\n * Automatically obtain application default credentials, and return\n * an access token for making requests.\n */\n async getAccessToken() {\n const client = await this.getClient();\n return (await client.getAccessToken()).token;\n }\n /**\n * Obtain the HTTP headers that will provide authorization for a given\n * request.\n */\n async getRequestHeaders(url) {\n const client = await this.getClient();\n return client.getRequestHeaders(url);\n }\n /**\n * Obtain credentials for a request, then attach the appropriate headers to\n * the request options.\n * @param opts Axios or Request options on which to attach the headers\n */\n async authorizeRequest(opts = {}) {\n const url = opts.url;\n const client = await this.getClient();\n const headers = await client.getRequestHeaders(url);\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers, headers);\n return opts;\n }\n /**\n * A {@link fetch `fetch`} compliant API for {@link GoogleAuth}.\n *\n * @see {@link GoogleAuth.request} for the classic method.\n *\n * @remarks\n *\n * This is useful as a drop-in replacement for `fetch` API usage.\n *\n * @example\n *\n * ```ts\n * const auth = new GoogleAuth();\n * const fetchWithAuth: typeof fetch = (...args) => auth.fetch(...args);\n * await fetchWithAuth('https://example.com');\n * ```\n *\n * @param args `fetch` API or {@link Gaxios.fetch `Gaxios#fetch`} parameters\n * @returns the {@link GaxiosResponse} with Gaxios-added properties\n */\n async fetch(...args) {\n const client = await this.getClient();\n return client.fetch(...args);\n }\n /**\n * Automatically obtain application default credentials, and make an\n * HTTP request using the given options.\n *\n * @see {@link GoogleAuth.fetch} for the modern method.\n *\n * @param opts Axios request options for the HTTP request.\n */\n async request(opts) {\n const client = await this.getClient();\n return client.request(opts);\n }\n /**\n * Determine the compute environment in which the code is running.\n */\n getEnv() {\n return (0, envDetect_1.getEnv)();\n }\n /**\n * Sign the given data with the current private key, or go out\n * to the IAM API to sign it.\n * @param data The data to be signed.\n * @param endpoint A custom endpoint to use.\n *\n * @example\n * ```\n * sign('data', 'https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/');\n * ```\n */\n async sign(data, endpoint) {\n const client = await this.getClient();\n const universe = await this.getUniverseDomain();\n endpoint =\n endpoint ||\n `https://iamcredentials.${universe}/v1/projects/-/serviceAccounts/`;\n if (client instanceof impersonated_1.Impersonated) {\n const signed = await client.sign(data);\n return signed.signedBlob;\n }\n const crypto = (0, crypto_1.createCrypto)();\n if (client instanceof jwtclient_1.JWT && client.key) {\n const sign = await crypto.sign(client.key, data);\n return sign;\n }\n const creds = await this.getCredentials();\n if (!creds.client_email) {\n throw new Error('Cannot sign data without `client_email`.');\n }\n return this.signBlob(crypto, creds.client_email, data, endpoint);\n }\n async signBlob(crypto, emailOrUniqueId, data, endpoint) {\n const url = new URL(endpoint + `${emailOrUniqueId}:signBlob`);\n const res = await this.request({\n method: 'POST',\n url: url.href,\n data: {\n payload: crypto.encodeBase64StringUtf8(data),\n },\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['POST'],\n },\n });\n return res.data.signedBlob;\n }\n}\nexports.GoogleAuth = GoogleAuth;\n//# sourceMappingURL=googleauth.js.map",
65
+ "\"use strict\";\n// Copyright 2014 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IAMAuth = void 0;\nclass IAMAuth {\n selector;\n token;\n /**\n * IAM credentials.\n *\n * @param selector the iam authority selector\n * @param token the token\n * @constructor\n */\n constructor(selector, token) {\n this.selector = selector;\n this.token = token;\n this.selector = selector;\n this.token = token;\n }\n /**\n * Acquire the HTTP headers required to make an authenticated request.\n */\n getRequestHeaders() {\n return {\n 'x-goog-iam-authority-selector': this.selector,\n 'x-goog-iam-authorization-token': this.token,\n };\n }\n}\nexports.IAMAuth = IAMAuth;\n//# sourceMappingURL=iam.js.map",
66
+ "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DownscopedClient = exports.EXPIRATION_TIME_OFFSET = exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst stream = require(\"stream\");\nconst authclient_1 = require(\"./authclient\");\nconst sts = require(\"./stscredentials\");\n/**\n * The required token exchange grant_type: rfc8693#section-2.1\n */\nconst STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange';\n/**\n * The requested token exchange requested_token_type: rfc8693#section-2.1\n */\nconst STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/**\n * The requested token exchange subject_token_type: rfc8693#section-2.1\n */\nconst STS_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/**\n * The maximum number of access boundary rules a Credential Access Boundary\n * can contain.\n */\nexports.MAX_ACCESS_BOUNDARY_RULES_COUNT = 10;\n/**\n * Offset to take into account network delays and server clock skews.\n */\nexports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000;\n/**\n * Defines a set of Google credentials that are downscoped from an existing set\n * of Google OAuth2 credentials. This is useful to restrict the Identity and\n * Access Management (IAM) permissions that a short-lived credential can use.\n * The common pattern of usage is to have a token broker with elevated access\n * generate these downscoped credentials from higher access source credentials\n * and pass the downscoped short-lived access tokens to a token consumer via\n * some secure authenticated channel for limited access to Google Cloud Storage\n * resources.\n */\nclass DownscopedClient extends authclient_1.AuthClient {\n authClient;\n credentialAccessBoundary;\n cachedDownscopedAccessToken;\n stsCredential;\n /**\n * Instantiates a downscoped client object using the provided source\n * AuthClient and credential access boundary rules.\n * To downscope permissions of a source AuthClient, a Credential Access\n * Boundary that specifies which resources the new credential can access, as\n * well as an upper bound on the permissions that are available on each\n * resource, has to be defined. A downscoped client can then be instantiated\n * using the source AuthClient and the Credential Access Boundary.\n * @param options the {@link DownscopedClientOptions `DownscopedClientOptions`} to use. Passing an `AuthClient` directly is **@DEPRECATED**.\n * @param credentialAccessBoundary **@DEPRECATED**. Provide a {@link DownscopedClientOptions `DownscopedClientOptions`} object in the first parameter instead.\n */\n constructor(\n /**\n * AuthClient is for backwards-compatibility.\n */\n options, \n /**\n * @deprecated - provide a {@link DownscopedClientOptions `DownscopedClientOptions`} object in the first parameter instead\n */\n credentialAccessBoundary = {\n accessBoundary: {\n accessBoundaryRules: [],\n },\n }) {\n super(options instanceof authclient_1.AuthClient ? {} : options);\n if (options instanceof authclient_1.AuthClient) {\n this.authClient = options;\n this.credentialAccessBoundary = credentialAccessBoundary;\n }\n else {\n this.authClient = options.authClient;\n this.credentialAccessBoundary = options.credentialAccessBoundary;\n }\n // Check 1-10 Access Boundary Rules are defined within Credential Access\n // Boundary.\n if (this.credentialAccessBoundary.accessBoundary.accessBoundaryRules\n .length === 0) {\n throw new Error('At least one access boundary rule needs to be defined.');\n }\n else if (this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length >\n exports.MAX_ACCESS_BOUNDARY_RULES_COUNT) {\n throw new Error('The provided access boundary has more than ' +\n `${exports.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);\n }\n // Check at least one permission should be defined in each Access Boundary\n // Rule.\n for (const rule of this.credentialAccessBoundary.accessBoundary\n .accessBoundaryRules) {\n if (rule.availablePermissions.length === 0) {\n throw new Error('At least one permission should be defined in access boundary rules.');\n }\n }\n this.stsCredential = new sts.StsCredentials({\n tokenExchangeEndpoint: `https://sts.${this.universeDomain}/v1/token`,\n });\n this.cachedDownscopedAccessToken = null;\n }\n /**\n * Provides a mechanism to inject Downscoped access tokens directly.\n * The expiry_date field is required to facilitate determination of the token\n * expiration which would make it easier for the token consumer to handle.\n * @param credentials The Credentials object to set on the current client.\n */\n setCredentials(credentials) {\n if (!credentials.expiry_date) {\n throw new Error('The access token expiry_date field is missing in the provided ' +\n 'credentials.');\n }\n super.setCredentials(credentials);\n this.cachedDownscopedAccessToken = credentials;\n }\n async getAccessToken() {\n // If the cached access token is unavailable or expired, force refresh.\n // The Downscoped access token will be returned in\n // DownscopedAccessTokenResponse format.\n if (!this.cachedDownscopedAccessToken ||\n this.isExpired(this.cachedDownscopedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return Downscoped access token in DownscopedAccessTokenResponse format.\n return {\n token: this.cachedDownscopedAccessToken.access_token,\n expirationTime: this.cachedDownscopedAccessToken.expiry_date,\n res: this.cachedDownscopedAccessToken.res,\n };\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * The result has the form:\n * { authorization: 'Bearer <access_token_value>' }\n */\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = new Headers({\n authorization: `Bearer ${accessTokenResponse.token}`,\n });\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = gaxios_1.Gaxios.mergeHeaders(opts.headers);\n this.addUserProjectAndAuthHeaders(opts.headers, requestHeaders);\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * GCP access tokens are retrieved from authclient object/source credential.\n * Then GCP access tokens are exchanged for downscoped access tokens via the\n * token exchange endpoint.\n * @return A promise that resolves with the fresh downscoped access token.\n */\n async refreshAccessTokenAsync() {\n // Retrieve GCP access token from source credential.\n const subjectToken = (await this.authClient.getAccessToken()).token;\n // Construct the STS credentials options.\n const stsCredentialsOptions = {\n grantType: STS_GRANT_TYPE,\n requestedTokenType: STS_REQUEST_TOKEN_TYPE,\n subjectToken: subjectToken,\n subjectTokenType: STS_SUBJECT_TOKEN_TYPE,\n };\n // Exchange the source AuthClient access token for a Downscoped access\n // token.\n const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, undefined, this.credentialAccessBoundary);\n /**\n * The STS endpoint will only return the expiration time for the downscoped\n * access token if the original access token represents a service account.\n * The downscoped token's expiration time will always match the source\n * credential expiration. When no expires_in is returned, we can copy the\n * source credential's expiration time.\n */\n const sourceCredExpireDate = this.authClient.credentials?.expiry_date || null;\n const expiryDate = stsResponse.expires_in\n ? new Date().getTime() + stsResponse.expires_in * 1000\n : sourceCredExpireDate;\n // Save response in cached access token.\n this.cachedDownscopedAccessToken = {\n access_token: stsResponse.access_token,\n expiry_date: expiryDate,\n res: stsResponse.res,\n };\n // Save credentials.\n this.credentials = {};\n Object.assign(this.credentials, this.cachedDownscopedAccessToken);\n delete this.credentials.res;\n // Trigger tokens event to notify external listeners.\n this.emit('tokens', {\n refresh_token: null,\n expiry_date: this.cachedDownscopedAccessToken.expiry_date,\n access_token: this.cachedDownscopedAccessToken.access_token,\n token_type: 'Bearer',\n id_token: null,\n });\n // Return the cached access token.\n return this.cachedDownscopedAccessToken;\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param downscopedAccessToken The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(downscopedAccessToken) {\n const now = new Date().getTime();\n return downscopedAccessToken.expiry_date\n ? now >=\n downscopedAccessToken.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.DownscopedClient = DownscopedClient;\n//# sourceMappingURL=downscopedclient.js.map",
67
+ "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PassThroughClient = void 0;\nconst authclient_1 = require(\"./authclient\");\n/**\n * An AuthClient without any Authentication information. Useful for:\n * - Anonymous access\n * - Local Emulators\n * - Testing Environments\n *\n */\nclass PassThroughClient extends authclient_1.AuthClient {\n /**\n * Creates a request without any authentication headers or checks.\n *\n * @remarks\n *\n * In testing environments it may be useful to change the provided\n * {@link AuthClient.transporter} for any desired request overrides/handling.\n *\n * @param opts\n * @returns The response of the request.\n */\n async request(opts) {\n return this.transporter.request(opts);\n }\n /**\n * A required method of the base class.\n * Always will return an empty object.\n *\n * @returns {}\n */\n async getAccessToken() {\n return {};\n }\n /**\n * A required method of the base class.\n * Always will return an empty object.\n *\n * @returns {}\n */\n async getRequestHeaders() {\n return new Headers();\n }\n}\nexports.PassThroughClient = PassThroughClient;\n//# sourceMappingURL=passthrough.js.map",
68
+ "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleAuth = exports.auth = exports.PassThroughClient = exports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = exports.ExecutableError = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsRequestSigner = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.ClientAuthentication = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gaxios = exports.gcpMetadata = void 0;\n// Copyright 2017 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nconst googleauth_1 = require(\"./auth/googleauth\");\nObject.defineProperty(exports, \"GoogleAuth\", { enumerable: true, get: function () { return googleauth_1.GoogleAuth; } });\n// Export common deps to ensure types/instances are the exact match. Useful\n// for consistently configuring the library across versions.\nexports.gcpMetadata = require(\"gcp-metadata\");\nexports.gaxios = require(\"gaxios\");\nvar authclient_1 = require(\"./auth/authclient\");\nObject.defineProperty(exports, \"AuthClient\", { enumerable: true, get: function () { return authclient_1.AuthClient; } });\nObject.defineProperty(exports, \"DEFAULT_UNIVERSE\", { enumerable: true, get: function () { return authclient_1.DEFAULT_UNIVERSE; } });\nvar computeclient_1 = require(\"./auth/computeclient\");\nObject.defineProperty(exports, \"Compute\", { enumerable: true, get: function () { return computeclient_1.Compute; } });\nvar envDetect_1 = require(\"./auth/envDetect\");\nObject.defineProperty(exports, \"GCPEnv\", { enumerable: true, get: function () { return envDetect_1.GCPEnv; } });\nvar iam_1 = require(\"./auth/iam\");\nObject.defineProperty(exports, \"IAMAuth\", { enumerable: true, get: function () { return iam_1.IAMAuth; } });\nvar idtokenclient_1 = require(\"./auth/idtokenclient\");\nObject.defineProperty(exports, \"IdTokenClient\", { enumerable: true, get: function () { return idtokenclient_1.IdTokenClient; } });\nvar jwtaccess_1 = require(\"./auth/jwtaccess\");\nObject.defineProperty(exports, \"JWTAccess\", { enumerable: true, get: function () { return jwtaccess_1.JWTAccess; } });\nvar jwtclient_1 = require(\"./auth/jwtclient\");\nObject.defineProperty(exports, \"JWT\", { enumerable: true, get: function () { return jwtclient_1.JWT; } });\nvar impersonated_1 = require(\"./auth/impersonated\");\nObject.defineProperty(exports, \"Impersonated\", { enumerable: true, get: function () { return impersonated_1.Impersonated; } });\nvar oauth2client_1 = require(\"./auth/oauth2client\");\nObject.defineProperty(exports, \"CodeChallengeMethod\", { enumerable: true, get: function () { return oauth2client_1.CodeChallengeMethod; } });\nObject.defineProperty(exports, \"OAuth2Client\", { enumerable: true, get: function () { return oauth2client_1.OAuth2Client; } });\nObject.defineProperty(exports, \"ClientAuthentication\", { enumerable: true, get: function () { return oauth2client_1.ClientAuthentication; } });\nvar loginticket_1 = require(\"./auth/loginticket\");\nObject.defineProperty(exports, \"LoginTicket\", { enumerable: true, get: function () { return loginticket_1.LoginTicket; } });\nvar refreshclient_1 = require(\"./auth/refreshclient\");\nObject.defineProperty(exports, \"UserRefreshClient\", { enumerable: true, get: function () { return refreshclient_1.UserRefreshClient; } });\nvar awsclient_1 = require(\"./auth/awsclient\");\nObject.defineProperty(exports, \"AwsClient\", { enumerable: true, get: function () { return awsclient_1.AwsClient; } });\nvar awsrequestsigner_1 = require(\"./auth/awsrequestsigner\");\nObject.defineProperty(exports, \"AwsRequestSigner\", { enumerable: true, get: function () { return awsrequestsigner_1.AwsRequestSigner; } });\nvar identitypoolclient_1 = require(\"./auth/identitypoolclient\");\nObject.defineProperty(exports, \"IdentityPoolClient\", { enumerable: true, get: function () { return identitypoolclient_1.IdentityPoolClient; } });\nvar externalclient_1 = require(\"./auth/externalclient\");\nObject.defineProperty(exports, \"ExternalAccountClient\", { enumerable: true, get: function () { return externalclient_1.ExternalAccountClient; } });\nvar baseexternalclient_1 = require(\"./auth/baseexternalclient\");\nObject.defineProperty(exports, \"BaseExternalAccountClient\", { enumerable: true, get: function () { return baseexternalclient_1.BaseExternalAccountClient; } });\nvar downscopedclient_1 = require(\"./auth/downscopedclient\");\nObject.defineProperty(exports, \"DownscopedClient\", { enumerable: true, get: function () { return downscopedclient_1.DownscopedClient; } });\nvar pluggable_auth_client_1 = require(\"./auth/pluggable-auth-client\");\nObject.defineProperty(exports, \"PluggableAuthClient\", { enumerable: true, get: function () { return pluggable_auth_client_1.PluggableAuthClient; } });\nObject.defineProperty(exports, \"ExecutableError\", { enumerable: true, get: function () { return pluggable_auth_client_1.ExecutableError; } });\nvar externalAccountAuthorizedUserClient_1 = require(\"./auth/externalAccountAuthorizedUserClient\");\nObject.defineProperty(exports, \"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE\", { enumerable: true, get: function () { return externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE; } });\nObject.defineProperty(exports, \"ExternalAccountAuthorizedUserClient\", { enumerable: true, get: function () { return externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient; } });\nvar passthrough_1 = require(\"./auth/passthrough\");\nObject.defineProperty(exports, \"PassThroughClient\", { enumerable: true, get: function () { return passthrough_1.PassThroughClient; } });\nconst auth = new googleauth_1.GoogleAuth();\nexports.auth = auth;\n//# sourceMappingURL=index.js.map"
69
+ ],
70
+ "mappings": ";wFAEA,IAAI,GAAS,OAAO,UAAU,eAC1B,GAAQ,OAAO,UAAU,SACzB,GAAiB,OAAO,eACxB,GAAO,OAAO,yBAEd,GAAU,QAAgB,CAAC,EAAK,CACnC,GAAI,OAAO,MAAM,UAAY,WAC5B,OAAO,MAAM,QAAQ,CAAG,EAGzB,OAAO,GAAM,KAAK,CAAG,IAAM,kBAGxB,GAAgB,QAAsB,CAAC,EAAK,CAC/C,GAAI,CAAC,GAAO,GAAM,KAAK,CAAG,IAAM,kBAC/B,MAAO,GAGR,IAAI,EAAoB,GAAO,KAAK,EAAK,aAAa,EAClD,EAAmB,EAAI,aAAe,EAAI,YAAY,WAAa,GAAO,KAAK,EAAI,YAAY,UAAW,eAAe,EAE7H,GAAI,EAAI,aAAe,CAAC,GAAqB,CAAC,EAC7C,MAAO,GAKR,IAAI,EACJ,IAAK,KAAO,EAAK,CAEjB,OAAO,OAAO,EAAQ,KAAe,GAAO,KAAK,EAAK,CAAG,GAItD,GAAc,QAAoB,CAAC,EAAQ,EAAS,CACvD,GAAI,IAAkB,EAAQ,OAAS,YACtC,GAAe,EAAQ,EAAQ,KAAM,CACpC,WAAY,GACZ,aAAc,GACd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