@keystrokehq/cli 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/AGENTS-blurb.md +123 -0
  2. package/LICENSE +42 -0
  3. package/README.md +177 -0
  4. package/THIRD_PARTY_NOTICES.md +16 -0
  5. package/bin/keystroke.mjs +107 -0
  6. package/dist/_manifest-JSRE3H8k.mjs +385 -0
  7. package/dist/agent-bundle-package-DWV6B_5q-BtV7Xycc.mjs +2344 -0
  8. package/dist/agent-manifest-CDnbkR2f.mjs +245 -0
  9. package/dist/agents-CZJGxVqV.mjs +228 -0
  10. package/dist/api-keys-D2lgguuY.mjs +40 -0
  11. package/dist/auth-DN2VusyU.mjs +59 -0
  12. package/dist/auth.handler-CT1BQUvu.mjs +340 -0
  13. package/dist/browser-qwFrUH82.mjs +24 -0
  14. package/dist/build-agents-BmM_AsSd-BGi9wtzt.mjs +514 -0
  15. package/dist/build-metadata-BWS7uhd_-DR8gJjTX.mjs +1422 -0
  16. package/dist/build-progress-DgYKb4hB.mjs +183 -0
  17. package/dist/build-tasks-CdihpudT-D5r5HUHe.mjs +91 -0
  18. package/dist/build-workflows-CfxBnIWh-CdYPv8w2.mjs +370 -0
  19. package/dist/build.handler-4799CjWH.mjs +36 -0
  20. package/dist/chunk-CH6r78ws.mjs +37 -0
  21. package/dist/clear-cache.handler-B9tqSoSM.mjs +11 -0
  22. package/dist/clear.handler-BTIXXPTJ.mjs +42 -0
  23. package/dist/clear.handler-BydlX-zE.mjs +11 -0
  24. package/dist/commander-DfTVqQ-3.mjs +133 -0
  25. package/dist/concurrency-gXn9Rw8x-DNl2YtrS.mjs +20 -0
  26. package/dist/connect-BUXkeH0F.mjs +43 -0
  27. package/dist/connect.handler-CYel9cy6.mjs +430 -0
  28. package/dist/constants-CPpPdSNg.mjs +8 -0
  29. package/dist/context-T7HZuB97.mjs +138 -0
  30. package/dist/credential-env-map-CI8yWHVy.mjs +28 -0
  31. package/dist/credential-schema-mismatch-BKo5PjcQ.mjs +76 -0
  32. package/dist/credentials-CvmjU0lK.mjs +171 -0
  33. package/dist/credentials-OfVHOtG3.mjs +151216 -0
  34. package/dist/current-deployment-workflow-poHt27i3.mjs +94 -0
  35. package/dist/current.handler-B8zKzfPp.mjs +21 -0
  36. package/dist/delete.handler-bAu1iXVQ.mjs +17 -0
  37. package/dist/deploy-7Jjls436.mjs +26 -0
  38. package/dist/deploy-BOPIpRWm.mjs +74 -0
  39. package/dist/deploy-progress-BmGUNFKg.mjs +70 -0
  40. package/dist/deploy.handler-BAzgiNhd.mjs +370 -0
  41. package/dist/detect-env-access-CwkOYeYM-D_BCZqV6.mjs +209 -0
  42. package/dist/diff-utils-NEfcjqxt.mjs +185 -0
  43. package/dist/diff.handler-Du7SY8K4.mjs +47 -0
  44. package/dist/dist-BkJUoBiG.mjs +1116 -0
  45. package/dist/dist-CUK7yBM0.mjs +308 -0
  46. package/dist/env-91KwMKov.mjs +140 -0
  47. package/dist/env.handler-BAzBuMzQ.mjs +277 -0
  48. package/dist/error-boundary-VL-JLfIa.mjs +34 -0
  49. package/dist/file-metadata-D1vm-XY2.mjs +191 -0
  50. package/dist/get-intrinsic-zLxwtrLK.mjs +658 -0
  51. package/dist/import-module-CV84H5fZ-B_CBCmb4.mjs +1747 -0
  52. package/dist/init-DpMCotSK.mjs +45 -0
  53. package/dist/init.handler-CPRnif52.mjs +585 -0
  54. package/dist/inspect.handler-DT_cD036.mjs +146 -0
  55. package/dist/integration-catalog-Bt-L3GjF.mjs +104 -0
  56. package/dist/integrations-DlatPK4W.mjs +79 -0
  57. package/dist/keystroke.d.mts +3 -0
  58. package/dist/keystroke.mjs +707 -0
  59. package/dist/layout-CbMtQ2tm.mjs +67 -0
  60. package/dist/list-enrichment-y-cwizLr.mjs +189 -0
  61. package/dist/list.handler-BTWvCyjA.mjs +52 -0
  62. package/dist/list.handler-CWF_Dj15.mjs +24 -0
  63. package/dist/list.handler-CZ6G2x_G.mjs +75 -0
  64. package/dist/list.handler-DWaQkJaR.mjs +51 -0
  65. package/dist/list.handler-DqbFcBW7.mjs +180 -0
  66. package/dist/list.handler-lq3ZGAn4.mjs +104 -0
  67. package/dist/logs-BEg9L5l8.mjs +28 -0
  68. package/dist/logs.handler-6hoMBzqw.mjs +35 -0
  69. package/dist/logs.handler-BD_dXiL1.mjs +231 -0
  70. package/dist/metadata-layout-GUYIUo0i-_aG2zjue.mjs +5877 -0
  71. package/dist/normalize-path-CojS-CgQ-DLCOvnD1.mjs +20 -0
  72. package/dist/options-CeaTcFxP.mjs +43 -0
  73. package/dist/org-xLzBtt2_.mjs +41 -0
  74. package/dist/output-DM4b7KgY.mjs +72 -0
  75. package/dist/oxc-B3KI3rf_-n9d1hKNq.mjs +119 -0
  76. package/dist/paused.handler-BMFm9Cff.mjs +94 -0
  77. package/dist/project-config-D1qsQlO7.mjs +107 -0
  78. package/dist/projects-CHkRE9rS.mjs +1574 -0
  79. package/dist/projects-Cjb7sovS.mjs +30 -0
  80. package/dist/read-credential-keys-77a91T8M-KA0Iw0Z1.mjs +9 -0
  81. package/dist/register.handler-BPCdor1_.mjs +86 -0
  82. package/dist/requirements.handler-DPXdSks3.mjs +201 -0
  83. package/dist/resolve-project-DDJ29sCF.mjs +35 -0
  84. package/dist/rolldown-runtime-twds-ZHy-BWWzu8VG.mjs +15 -0
  85. package/dist/run-polling-CAgFRdK3.mjs +20 -0
  86. package/dist/runs-D9hNLb9A.mjs +259 -0
  87. package/dist/schedule-BXx3uXwr.mjs +1142 -0
  88. package/dist/schema-17qMfNyI.mjs +18 -0
  89. package/dist/schema-display-CgmeKigW.mjs +130 -0
  90. package/dist/schemas-CDib1RhE.mjs +125 -0
  91. package/dist/skills-sync.handler-DIy8GR16.mjs +34 -0
  92. package/dist/skills.command-CrjI2dN9.mjs +35 -0
  93. package/dist/skills.handler-Bz8bJKql.mjs +9 -0
  94. package/dist/source-analysis-Cj-ADyu--BJQcFPCG.mjs +144 -0
  95. package/dist/spinner-progress-DMVwgqO9.mjs +173 -0
  96. package/dist/src-C0X6u_Mw.mjs +1340 -0
  97. package/dist/src-eHwu-Gfw.mjs +369 -0
  98. package/dist/status.handler-BO4nwvWn.mjs +101 -0
  99. package/dist/switch.handler-D_9213Vf.mjs +51 -0
  100. package/dist/sync-BL_Mo5st.mjs +39 -0
  101. package/dist/sync-keystroke-agent-skills-Kx_H7UTd.mjs +70 -0
  102. package/dist/sync.handler-BUFPdzWz.mjs +82 -0
  103. package/dist/task-B2sZMaZu.mjs +8 -0
  104. package/dist/task-target-build-CBeCKbu2.mjs +432 -0
  105. package/dist/task-target-deploy-C5X-USeR.mjs +4 -0
  106. package/dist/task-target-deploy-CA6elFpF-BEr4gkol.mjs +271 -0
  107. package/dist/task-target-deploy-runner.d.mts +3 -0
  108. package/dist/task-target-deploy-runner.mjs +202 -0
  109. package/dist/test-BHTgR3UA.mjs +698 -0
  110. package/dist/test.handler-BcPQ8b74.mjs +13 -0
  111. package/dist/trigger-artifacts-DQPbQNqC-B4yeeFBY.mjs +239 -0
  112. package/dist/trigger-manifest-CY7brZeg.mjs +30 -0
  113. package/dist/try-deploy.handler-DqybNhXx.mjs +490 -0
  114. package/dist/upload-CkU--iDC.mjs +207 -0
  115. package/dist/upload.handler-DCtiznQp.mjs +441 -0
  116. package/dist/utils-CywxCDM7.mjs +14 -0
  117. package/dist/validate.handler-DOcTaJL0.mjs +280 -0
  118. package/dist/workflow-build-DBQaBfnn.mjs +1819 -0
  119. package/dist/workflow-bundler-BPiqVscj-X1PFFAuP.mjs +167 -0
  120. package/dist/workflows-g9z87AJJ.mjs +799 -0
  121. package/dist/writer-BG8poUm3-BbXlU2kI.mjs +426 -0
  122. package/package.json +87 -0
@@ -0,0 +1,1574 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-CH6r78ws.mjs";
4
+ import { a as require_type, r as require_call_bind_apply_helpers, t as require_get_intrinsic } from "./get-intrinsic-zLxwtrLK.mjs";
5
+ import { ZodError, z } from "zod";
6
+ import ky from "ky";
7
+ z.object({
8
+ SERVER_URL: z.url(),
9
+ KEYSTROKE_API_KEY: z.string().min(1)
10
+ });
11
+ /** Lenient env for client - only requires what's needed when not overridden by config */
12
+ const clientEnvSchema = z.object({
13
+ SERVER_URL: z.url().optional(),
14
+ KEYSTROKE_API_KEY: z.string().min(1).optional(),
15
+ KEYSTROKE_ORG_ID: z.string().min(1).optional()
16
+ });
17
+ function getClientEnv() {
18
+ return clientEnvSchema.parse(process.env);
19
+ }
20
+ //#endregion
21
+ //#region ../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js
22
+ var require_util_inspect = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23
+ module.exports = __require("util").inspect;
24
+ }));
25
+ //#endregion
26
+ //#region ../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js
27
+ var require_object_inspect = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28
+ var hasMap = typeof Map === "function" && Map.prototype;
29
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
30
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
31
+ var mapForEach = hasMap && Map.prototype.forEach;
32
+ var hasSet = typeof Set === "function" && Set.prototype;
33
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
34
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
35
+ var setForEach = hasSet && Set.prototype.forEach;
36
+ var weakMapHas = typeof WeakMap === "function" && WeakMap.prototype ? WeakMap.prototype.has : null;
37
+ var weakSetHas = typeof WeakSet === "function" && WeakSet.prototype ? WeakSet.prototype.has : null;
38
+ var weakRefDeref = typeof WeakRef === "function" && WeakRef.prototype ? WeakRef.prototype.deref : null;
39
+ var booleanValueOf = Boolean.prototype.valueOf;
40
+ var objectToString = Object.prototype.toString;
41
+ var functionToString = Function.prototype.toString;
42
+ var $match = String.prototype.match;
43
+ var $slice = String.prototype.slice;
44
+ var $replace = String.prototype.replace;
45
+ var $toUpperCase = String.prototype.toUpperCase;
46
+ var $toLowerCase = String.prototype.toLowerCase;
47
+ var $test = RegExp.prototype.test;
48
+ var $concat = Array.prototype.concat;
49
+ var $join = Array.prototype.join;
50
+ var $arrSlice = Array.prototype.slice;
51
+ var $floor = Math.floor;
52
+ var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
53
+ var gOPS = Object.getOwnPropertySymbols;
54
+ var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
55
+ var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
56
+ var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
57
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
58
+ var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
59
+ return O.__proto__;
60
+ } : null);
61
+ function addNumericSeparator(num, str) {
62
+ if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) return str;
63
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
64
+ if (typeof num === "number") {
65
+ var int = num < 0 ? -$floor(-num) : $floor(num);
66
+ if (int !== num) {
67
+ var intStr = String(int);
68
+ var dec = $slice.call(str, intStr.length + 1);
69
+ return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
70
+ }
71
+ }
72
+ return $replace.call(str, sepRegex, "$&_");
73
+ }
74
+ var utilInspect = require_util_inspect();
75
+ var inspectCustom = utilInspect.custom;
76
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
77
+ var quotes = {
78
+ __proto__: null,
79
+ "double": "\"",
80
+ single: "'"
81
+ };
82
+ var quoteREs = {
83
+ __proto__: null,
84
+ "double": /(["\\])/g,
85
+ single: /(['\\])/g
86
+ };
87
+ module.exports = function inspect_(obj, options, depth, seen) {
88
+ var opts = options || {};
89
+ if (has(opts, "quoteStyle") && !has(quotes, opts.quoteStyle)) throw new TypeError("option \"quoteStyle\" must be \"single\" or \"double\"");
90
+ if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) throw new TypeError("option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`");
91
+ var customInspect = has(opts, "customInspect") ? opts.customInspect : true;
92
+ if (typeof customInspect !== "boolean" && customInspect !== "symbol") throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
93
+ if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) throw new TypeError("option \"indent\" must be \"\\t\", an integer > 0, or `null`");
94
+ if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") throw new TypeError("option \"numericSeparator\", if provided, must be `true` or `false`");
95
+ var numericSeparator = opts.numericSeparator;
96
+ if (typeof obj === "undefined") return "undefined";
97
+ if (obj === null) return "null";
98
+ if (typeof obj === "boolean") return obj ? "true" : "false";
99
+ if (typeof obj === "string") return inspectString(obj, opts);
100
+ if (typeof obj === "number") {
101
+ if (obj === 0) return Infinity / obj > 0 ? "0" : "-0";
102
+ var str = String(obj);
103
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
104
+ }
105
+ if (typeof obj === "bigint") {
106
+ var bigIntStr = String(obj) + "n";
107
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
108
+ }
109
+ var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
110
+ if (typeof depth === "undefined") depth = 0;
111
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") return isArray(obj) ? "[Array]" : "[Object]";
112
+ var indent = getIndent(opts, depth);
113
+ if (typeof seen === "undefined") seen = [];
114
+ else if (indexOf(seen, obj) >= 0) return "[Circular]";
115
+ function inspect(value, from, noIndent) {
116
+ if (from) {
117
+ seen = $arrSlice.call(seen);
118
+ seen.push(from);
119
+ }
120
+ if (noIndent) {
121
+ var newOpts = { depth: opts.depth };
122
+ if (has(opts, "quoteStyle")) newOpts.quoteStyle = opts.quoteStyle;
123
+ return inspect_(value, newOpts, depth + 1, seen);
124
+ }
125
+ return inspect_(value, opts, depth + 1, seen);
126
+ }
127
+ if (typeof obj === "function" && !isRegExp(obj)) {
128
+ var name = nameOf(obj);
129
+ var keys = arrObjKeys(obj, inspect);
130
+ return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
131
+ }
132
+ if (isSymbol(obj)) {
133
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
134
+ return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
135
+ }
136
+ if (isElement(obj)) {
137
+ var s = "<" + $toLowerCase.call(String(obj.nodeName));
138
+ var attrs = obj.attributes || [];
139
+ for (var i = 0; i < attrs.length; i++) s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
140
+ s += ">";
141
+ if (obj.childNodes && obj.childNodes.length) s += "...";
142
+ s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
143
+ return s;
144
+ }
145
+ if (isArray(obj)) {
146
+ if (obj.length === 0) return "[]";
147
+ var xs = arrObjKeys(obj, inspect);
148
+ if (indent && !singleLineValues(xs)) return "[" + indentedJoin(xs, indent) + "]";
149
+ return "[ " + $join.call(xs, ", ") + " ]";
150
+ }
151
+ if (isError(obj)) {
152
+ var parts = arrObjKeys(obj, inspect);
153
+ if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }";
154
+ if (parts.length === 0) return "[" + String(obj) + "]";
155
+ return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
156
+ }
157
+ if (typeof obj === "object" && customInspect) {
158
+ if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) return utilInspect(obj, { depth: maxDepth - depth });
159
+ else if (customInspect !== "symbol" && typeof obj.inspect === "function") return obj.inspect();
160
+ }
161
+ if (isMap(obj)) {
162
+ var mapParts = [];
163
+ if (mapForEach) mapForEach.call(obj, function(value, key) {
164
+ mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
165
+ });
166
+ return collectionOf("Map", mapSize.call(obj), mapParts, indent);
167
+ }
168
+ if (isSet(obj)) {
169
+ var setParts = [];
170
+ if (setForEach) setForEach.call(obj, function(value) {
171
+ setParts.push(inspect(value, obj));
172
+ });
173
+ return collectionOf("Set", setSize.call(obj), setParts, indent);
174
+ }
175
+ if (isWeakMap(obj)) return weakCollectionOf("WeakMap");
176
+ if (isWeakSet(obj)) return weakCollectionOf("WeakSet");
177
+ if (isWeakRef(obj)) return weakCollectionOf("WeakRef");
178
+ if (isNumber(obj)) return markBoxed(inspect(Number(obj)));
179
+ if (isBigInt(obj)) return markBoxed(inspect(bigIntValueOf.call(obj)));
180
+ if (isBoolean(obj)) return markBoxed(booleanValueOf.call(obj));
181
+ if (isString(obj)) return markBoxed(inspect(String(obj)));
182
+ if (typeof window !== "undefined" && obj === window) return "{ [object Window] }";
183
+ if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) return "{ [object globalThis] }";
184
+ if (!isDate(obj) && !isRegExp(obj)) {
185
+ var ys = arrObjKeys(obj, inspect);
186
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
187
+ var protoTag = obj instanceof Object ? "" : "null prototype";
188
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
189
+ var tag = (isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "") + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
190
+ if (ys.length === 0) return tag + "{}";
191
+ if (indent) return tag + "{" + indentedJoin(ys, indent) + "}";
192
+ return tag + "{ " + $join.call(ys, ", ") + " }";
193
+ }
194
+ return String(obj);
195
+ };
196
+ function wrapQuotes(s, defaultStyle, opts) {
197
+ var quoteChar = quotes[opts.quoteStyle || defaultStyle];
198
+ return quoteChar + s + quoteChar;
199
+ }
200
+ function quote(s) {
201
+ return $replace.call(String(s), /"/g, "&quot;");
202
+ }
203
+ function canTrustToString(obj) {
204
+ return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
205
+ }
206
+ function isArray(obj) {
207
+ return toStr(obj) === "[object Array]" && canTrustToString(obj);
208
+ }
209
+ function isDate(obj) {
210
+ return toStr(obj) === "[object Date]" && canTrustToString(obj);
211
+ }
212
+ function isRegExp(obj) {
213
+ return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
214
+ }
215
+ function isError(obj) {
216
+ return toStr(obj) === "[object Error]" && canTrustToString(obj);
217
+ }
218
+ function isString(obj) {
219
+ return toStr(obj) === "[object String]" && canTrustToString(obj);
220
+ }
221
+ function isNumber(obj) {
222
+ return toStr(obj) === "[object Number]" && canTrustToString(obj);
223
+ }
224
+ function isBoolean(obj) {
225
+ return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
226
+ }
227
+ function isSymbol(obj) {
228
+ if (hasShammedSymbols) return obj && typeof obj === "object" && obj instanceof Symbol;
229
+ if (typeof obj === "symbol") return true;
230
+ if (!obj || typeof obj !== "object" || !symToString) return false;
231
+ try {
232
+ symToString.call(obj);
233
+ return true;
234
+ } catch (e) {}
235
+ return false;
236
+ }
237
+ function isBigInt(obj) {
238
+ if (!obj || typeof obj !== "object" || !bigIntValueOf) return false;
239
+ try {
240
+ bigIntValueOf.call(obj);
241
+ return true;
242
+ } catch (e) {}
243
+ return false;
244
+ }
245
+ var hasOwn = Object.prototype.hasOwnProperty || function(key) {
246
+ return key in this;
247
+ };
248
+ function has(obj, key) {
249
+ return hasOwn.call(obj, key);
250
+ }
251
+ function toStr(obj) {
252
+ return objectToString.call(obj);
253
+ }
254
+ function nameOf(f) {
255
+ if (f.name) return f.name;
256
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
257
+ if (m) return m[1];
258
+ return null;
259
+ }
260
+ function indexOf(xs, x) {
261
+ if (xs.indexOf) return xs.indexOf(x);
262
+ for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i;
263
+ return -1;
264
+ }
265
+ function isMap(x) {
266
+ if (!mapSize || !x || typeof x !== "object") return false;
267
+ try {
268
+ mapSize.call(x);
269
+ try {
270
+ setSize.call(x);
271
+ } catch (s) {
272
+ return true;
273
+ }
274
+ return x instanceof Map;
275
+ } catch (e) {}
276
+ return false;
277
+ }
278
+ function isWeakMap(x) {
279
+ if (!weakMapHas || !x || typeof x !== "object") return false;
280
+ try {
281
+ weakMapHas.call(x, weakMapHas);
282
+ try {
283
+ weakSetHas.call(x, weakSetHas);
284
+ } catch (s) {
285
+ return true;
286
+ }
287
+ return x instanceof WeakMap;
288
+ } catch (e) {}
289
+ return false;
290
+ }
291
+ function isWeakRef(x) {
292
+ if (!weakRefDeref || !x || typeof x !== "object") return false;
293
+ try {
294
+ weakRefDeref.call(x);
295
+ return true;
296
+ } catch (e) {}
297
+ return false;
298
+ }
299
+ function isSet(x) {
300
+ if (!setSize || !x || typeof x !== "object") return false;
301
+ try {
302
+ setSize.call(x);
303
+ try {
304
+ mapSize.call(x);
305
+ } catch (m) {
306
+ return true;
307
+ }
308
+ return x instanceof Set;
309
+ } catch (e) {}
310
+ return false;
311
+ }
312
+ function isWeakSet(x) {
313
+ if (!weakSetHas || !x || typeof x !== "object") return false;
314
+ try {
315
+ weakSetHas.call(x, weakSetHas);
316
+ try {
317
+ weakMapHas.call(x, weakMapHas);
318
+ } catch (s) {
319
+ return true;
320
+ }
321
+ return x instanceof WeakSet;
322
+ } catch (e) {}
323
+ return false;
324
+ }
325
+ function isElement(x) {
326
+ if (!x || typeof x !== "object") return false;
327
+ if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) return true;
328
+ return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
329
+ }
330
+ function inspectString(str, opts) {
331
+ if (str.length > opts.maxStringLength) {
332
+ var remaining = str.length - opts.maxStringLength;
333
+ var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
334
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
335
+ }
336
+ var quoteRE = quoteREs[opts.quoteStyle || "single"];
337
+ quoteRE.lastIndex = 0;
338
+ return wrapQuotes($replace.call($replace.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte), "single", opts);
339
+ }
340
+ function lowbyte(c) {
341
+ var n = c.charCodeAt(0);
342
+ var x = {
343
+ 8: "b",
344
+ 9: "t",
345
+ 10: "n",
346
+ 12: "f",
347
+ 13: "r"
348
+ }[n];
349
+ if (x) return "\\" + x;
350
+ return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16));
351
+ }
352
+ function markBoxed(str) {
353
+ return "Object(" + str + ")";
354
+ }
355
+ function weakCollectionOf(type) {
356
+ return type + " { ? }";
357
+ }
358
+ function collectionOf(type, size, entries, indent) {
359
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
360
+ return type + " (" + size + ") {" + joinedEntries + "}";
361
+ }
362
+ function singleLineValues(xs) {
363
+ for (var i = 0; i < xs.length; i++) if (indexOf(xs[i], "\n") >= 0) return false;
364
+ return true;
365
+ }
366
+ function getIndent(opts, depth) {
367
+ var baseIndent;
368
+ if (opts.indent === " ") baseIndent = " ";
369
+ else if (typeof opts.indent === "number" && opts.indent > 0) baseIndent = $join.call(Array(opts.indent + 1), " ");
370
+ else return null;
371
+ return {
372
+ base: baseIndent,
373
+ prev: $join.call(Array(depth + 1), baseIndent)
374
+ };
375
+ }
376
+ function indentedJoin(xs, indent) {
377
+ if (xs.length === 0) return "";
378
+ var lineJoiner = "\n" + indent.prev + indent.base;
379
+ return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
380
+ }
381
+ function arrObjKeys(obj, inspect) {
382
+ var isArr = isArray(obj);
383
+ var xs = [];
384
+ if (isArr) {
385
+ xs.length = obj.length;
386
+ for (var i = 0; i < obj.length; i++) xs[i] = has(obj, i) ? inspect(obj[i], obj) : "";
387
+ }
388
+ var syms = typeof gOPS === "function" ? gOPS(obj) : [];
389
+ var symMap;
390
+ if (hasShammedSymbols) {
391
+ symMap = {};
392
+ for (var k = 0; k < syms.length; k++) symMap["$" + syms[k]] = syms[k];
393
+ }
394
+ for (var key in obj) {
395
+ if (!has(obj, key)) continue;
396
+ if (isArr && String(Number(key)) === key && key < obj.length) continue;
397
+ if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) continue;
398
+ else if ($test.call(/[^\w$]/, key)) xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
399
+ else xs.push(key + ": " + inspect(obj[key], obj));
400
+ }
401
+ if (typeof gOPS === "function") {
402
+ for (var j = 0; j < syms.length; j++) if (isEnumerable.call(obj, syms[j])) xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj));
403
+ }
404
+ return xs;
405
+ }
406
+ }));
407
+ //#endregion
408
+ //#region ../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js
409
+ var require_side_channel_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
410
+ var inspect = require_object_inspect();
411
+ var $TypeError = require_type();
412
+ /** @type {import('./list.d.ts').listGetNode} */
413
+ var listGetNode = function(list, key, isDelete) {
414
+ /** @type {typeof list | NonNullable<(typeof list)['next']>} */
415
+ var prev = list;
416
+ /** @type {(typeof list)['next']} */
417
+ var curr;
418
+ for (; (curr = prev.next) != null; prev = curr) if (curr.key === key) {
419
+ prev.next = curr.next;
420
+ if (!isDelete) {
421
+ curr.next = list.next;
422
+ list.next = curr;
423
+ }
424
+ return curr;
425
+ }
426
+ };
427
+ /** @type {import('./list.d.ts').listGet} */
428
+ var listGet = function(objects, key) {
429
+ if (!objects) return;
430
+ var node = listGetNode(objects, key);
431
+ return node && node.value;
432
+ };
433
+ /** @type {import('./list.d.ts').listSet} */
434
+ var listSet = function(objects, key, value) {
435
+ var node = listGetNode(objects, key);
436
+ if (node) node.value = value;
437
+ else objects.next = {
438
+ key,
439
+ next: objects.next,
440
+ value
441
+ };
442
+ };
443
+ /** @type {import('./list.d.ts').listHas} */
444
+ var listHas = function(objects, key) {
445
+ if (!objects) return false;
446
+ return !!listGetNode(objects, key);
447
+ };
448
+ /** @type {import('./list.d.ts').listDelete} */
449
+ var listDelete = function(objects, key) {
450
+ if (objects) return listGetNode(objects, key, true);
451
+ };
452
+ /** @type {import('.')} */
453
+ module.exports = function getSideChannelList() {
454
+ /** @typedef {ReturnType<typeof getSideChannelList>} Channel */
455
+ /** @typedef {Parameters<Channel['get']>[0]} K */
456
+ /** @typedef {Parameters<Channel['set']>[1]} V */
457
+ /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
458
+ /** @type {Channel} */
459
+ var channel = {
460
+ assert: function(key) {
461
+ if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
462
+ },
463
+ "delete": function(key) {
464
+ var deletedNode = listDelete($o, key);
465
+ if (deletedNode && $o && !$o.next) $o = void 0;
466
+ return !!deletedNode;
467
+ },
468
+ get: function(key) {
469
+ return listGet($o, key);
470
+ },
471
+ has: function(key) {
472
+ return listHas($o, key);
473
+ },
474
+ set: function(key, value) {
475
+ if (!$o) $o = { next: void 0 };
476
+ listSet($o, key, value);
477
+ }
478
+ };
479
+ return channel;
480
+ };
481
+ }));
482
+ //#endregion
483
+ //#region ../../node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js
484
+ var require_call_bound = /* @__PURE__ */ __commonJSMin(((exports, module) => {
485
+ var GetIntrinsic = require_get_intrinsic();
486
+ var callBindBasic = require_call_bind_apply_helpers();
487
+ /** @type {(thisArg: string, searchString: string, position?: number) => number} */
488
+ var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
489
+ /** @type {import('.')} */
490
+ module.exports = function callBoundIntrinsic(name, allowMissing) {
491
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
492
+ if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) return callBindBasic([intrinsic]);
493
+ return intrinsic;
494
+ };
495
+ }));
496
+ //#endregion
497
+ //#region ../../node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js
498
+ var require_side_channel_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
499
+ var GetIntrinsic = require_get_intrinsic();
500
+ var callBound = require_call_bound();
501
+ var inspect = require_object_inspect();
502
+ var $TypeError = require_type();
503
+ var $Map = GetIntrinsic("%Map%", true);
504
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
505
+ var $mapGet = callBound("Map.prototype.get", true);
506
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
507
+ var $mapSet = callBound("Map.prototype.set", true);
508
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
509
+ var $mapHas = callBound("Map.prototype.has", true);
510
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
511
+ var $mapDelete = callBound("Map.prototype.delete", true);
512
+ /** @type {<K, V>(thisArg: Map<K, V>) => number} */
513
+ var $mapSize = callBound("Map.prototype.size", true);
514
+ /** @type {import('.')} */
515
+ module.exports = !!$Map && function getSideChannelMap() {
516
+ /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
517
+ /** @typedef {Parameters<Channel['get']>[0]} K */
518
+ /** @typedef {Parameters<Channel['set']>[1]} V */
519
+ /** @type {Map<K, V> | undefined} */ var $m;
520
+ /** @type {Channel} */
521
+ var channel = {
522
+ assert: function(key) {
523
+ if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
524
+ },
525
+ "delete": function(key) {
526
+ if ($m) {
527
+ var result = $mapDelete($m, key);
528
+ if ($mapSize($m) === 0) $m = void 0;
529
+ return result;
530
+ }
531
+ return false;
532
+ },
533
+ get: function(key) {
534
+ if ($m) return $mapGet($m, key);
535
+ },
536
+ has: function(key) {
537
+ if ($m) return $mapHas($m, key);
538
+ return false;
539
+ },
540
+ set: function(key, value) {
541
+ if (!$m) $m = new $Map();
542
+ $mapSet($m, key, value);
543
+ }
544
+ };
545
+ return channel;
546
+ };
547
+ }));
548
+ //#endregion
549
+ //#region ../../node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js
550
+ var require_side_channel_weakmap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
551
+ var GetIntrinsic = require_get_intrinsic();
552
+ var callBound = require_call_bound();
553
+ var inspect = require_object_inspect();
554
+ var getSideChannelMap = require_side_channel_map();
555
+ var $TypeError = require_type();
556
+ var $WeakMap = GetIntrinsic("%WeakMap%", true);
557
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
558
+ var $weakMapGet = callBound("WeakMap.prototype.get", true);
559
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
560
+ var $weakMapSet = callBound("WeakMap.prototype.set", true);
561
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
562
+ var $weakMapHas = callBound("WeakMap.prototype.has", true);
563
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
564
+ var $weakMapDelete = callBound("WeakMap.prototype.delete", true);
565
+ /** @type {import('.')} */
566
+ module.exports = $WeakMap ? function getSideChannelWeakMap() {
567
+ /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
568
+ /** @typedef {Parameters<Channel['get']>[0]} K */
569
+ /** @typedef {Parameters<Channel['set']>[1]} V */
570
+ /** @type {WeakMap<K & object, V> | undefined} */ var $wm;
571
+ /** @type {Channel | undefined} */ var $m;
572
+ /** @type {Channel} */
573
+ var channel = {
574
+ assert: function(key) {
575
+ if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
576
+ },
577
+ "delete": function(key) {
578
+ if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
579
+ if ($wm) return $weakMapDelete($wm, key);
580
+ } else if (getSideChannelMap) {
581
+ if ($m) return $m["delete"](key);
582
+ }
583
+ return false;
584
+ },
585
+ get: function(key) {
586
+ if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
587
+ if ($wm) return $weakMapGet($wm, key);
588
+ }
589
+ return $m && $m.get(key);
590
+ },
591
+ has: function(key) {
592
+ if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
593
+ if ($wm) return $weakMapHas($wm, key);
594
+ }
595
+ return !!$m && $m.has(key);
596
+ },
597
+ set: function(key, value) {
598
+ if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
599
+ if (!$wm) $wm = new $WeakMap();
600
+ $weakMapSet($wm, key, value);
601
+ } else if (getSideChannelMap) {
602
+ if (!$m) $m = getSideChannelMap();
603
+ /** @type {NonNullable<typeof $m>} */ $m.set(key, value);
604
+ }
605
+ }
606
+ };
607
+ return channel;
608
+ } : getSideChannelMap;
609
+ }));
610
+ //#endregion
611
+ //#region ../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js
612
+ var require_side_channel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
613
+ var $TypeError = require_type();
614
+ var inspect = require_object_inspect();
615
+ var getSideChannelList = require_side_channel_list();
616
+ var getSideChannelMap = require_side_channel_map();
617
+ var makeChannel = require_side_channel_weakmap() || getSideChannelMap || getSideChannelList;
618
+ /** @type {import('.')} */
619
+ module.exports = function getSideChannel() {
620
+ /** @typedef {ReturnType<typeof getSideChannel>} Channel */
621
+ /** @type {Channel | undefined} */ var $channelData;
622
+ /** @type {Channel} */
623
+ var channel = {
624
+ assert: function(key) {
625
+ if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
626
+ },
627
+ "delete": function(key) {
628
+ return !!$channelData && $channelData["delete"](key);
629
+ },
630
+ get: function(key) {
631
+ return $channelData && $channelData.get(key);
632
+ },
633
+ has: function(key) {
634
+ return !!$channelData && $channelData.has(key);
635
+ },
636
+ set: function(key, value) {
637
+ if (!$channelData) $channelData = makeChannel();
638
+ $channelData.set(key, value);
639
+ }
640
+ };
641
+ return channel;
642
+ };
643
+ }));
644
+ //#endregion
645
+ //#region ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/formats.js
646
+ var require_formats = /* @__PURE__ */ __commonJSMin(((exports, module) => {
647
+ var replace = String.prototype.replace;
648
+ var percentTwenties = /%20/g;
649
+ var Format = {
650
+ RFC1738: "RFC1738",
651
+ RFC3986: "RFC3986"
652
+ };
653
+ module.exports = {
654
+ "default": Format.RFC3986,
655
+ formatters: {
656
+ RFC1738: function(value) {
657
+ return replace.call(value, percentTwenties, "+");
658
+ },
659
+ RFC3986: function(value) {
660
+ return String(value);
661
+ }
662
+ },
663
+ RFC1738: Format.RFC1738,
664
+ RFC3986: Format.RFC3986
665
+ };
666
+ }));
667
+ //#endregion
668
+ //#region ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/utils.js
669
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
670
+ var formats = require_formats();
671
+ var getSideChannel = require_side_channel();
672
+ var has = Object.prototype.hasOwnProperty;
673
+ var isArray = Array.isArray;
674
+ var overflowChannel = getSideChannel();
675
+ var markOverflow = function markOverflow(obj, maxIndex) {
676
+ overflowChannel.set(obj, maxIndex);
677
+ return obj;
678
+ };
679
+ var isOverflow = function isOverflow(obj) {
680
+ return overflowChannel.has(obj);
681
+ };
682
+ var getMaxIndex = function getMaxIndex(obj) {
683
+ return overflowChannel.get(obj);
684
+ };
685
+ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
686
+ overflowChannel.set(obj, maxIndex);
687
+ };
688
+ var hexTable = function() {
689
+ var array = [];
690
+ for (var i = 0; i < 256; ++i) array[array.length] = "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase();
691
+ return array;
692
+ }();
693
+ var compactQueue = function compactQueue(queue) {
694
+ while (queue.length > 1) {
695
+ var item = queue.pop();
696
+ var obj = item.obj[item.prop];
697
+ if (isArray(obj)) {
698
+ var compacted = [];
699
+ for (var j = 0; j < obj.length; ++j) if (typeof obj[j] !== "undefined") compacted[compacted.length] = obj[j];
700
+ item.obj[item.prop] = compacted;
701
+ }
702
+ }
703
+ };
704
+ var arrayToObject = function arrayToObject(source, options) {
705
+ var obj = options && options.plainObjects ? { __proto__: null } : {};
706
+ for (var i = 0; i < source.length; ++i) if (typeof source[i] !== "undefined") obj[i] = source[i];
707
+ return obj;
708
+ };
709
+ var merge = function merge(target, source, options) {
710
+ if (!source) return target;
711
+ if (typeof source !== "object" && typeof source !== "function") {
712
+ if (isArray(target)) {
713
+ var nextIndex = target.length;
714
+ if (options && typeof options.arrayLimit === "number" && nextIndex > options.arrayLimit) return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
715
+ target[nextIndex] = source;
716
+ } else if (target && typeof target === "object") {
717
+ if (isOverflow(target)) {
718
+ var newIndex = getMaxIndex(target) + 1;
719
+ target[newIndex] = source;
720
+ setMaxIndex(target, newIndex);
721
+ } else if (options && options.strictMerge) return [target, source];
722
+ else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
723
+ } else return [target, source];
724
+ return target;
725
+ }
726
+ if (!target || typeof target !== "object") {
727
+ if (isOverflow(source)) {
728
+ var sourceKeys = Object.keys(source);
729
+ var result = options && options.plainObjects ? {
730
+ __proto__: null,
731
+ 0: target
732
+ } : { 0: target };
733
+ for (var m = 0; m < sourceKeys.length; m++) {
734
+ var oldKey = parseInt(sourceKeys[m], 10);
735
+ result[oldKey + 1] = source[sourceKeys[m]];
736
+ }
737
+ return markOverflow(result, getMaxIndex(source) + 1);
738
+ }
739
+ var combined = [target].concat(source);
740
+ if (options && typeof options.arrayLimit === "number" && combined.length > options.arrayLimit) return markOverflow(arrayToObject(combined, options), combined.length - 1);
741
+ return combined;
742
+ }
743
+ var mergeTarget = target;
744
+ if (isArray(target) && !isArray(source)) mergeTarget = arrayToObject(target, options);
745
+ if (isArray(target) && isArray(source)) {
746
+ source.forEach(function(item, i) {
747
+ if (has.call(target, i)) {
748
+ var targetItem = target[i];
749
+ if (targetItem && typeof targetItem === "object" && item && typeof item === "object") target[i] = merge(targetItem, item, options);
750
+ else target[target.length] = item;
751
+ } else target[i] = item;
752
+ });
753
+ return target;
754
+ }
755
+ return Object.keys(source).reduce(function(acc, key) {
756
+ var value = source[key];
757
+ if (has.call(acc, key)) acc[key] = merge(acc[key], value, options);
758
+ else acc[key] = value;
759
+ if (isOverflow(source) && !isOverflow(acc)) markOverflow(acc, getMaxIndex(source));
760
+ if (isOverflow(acc)) {
761
+ var keyNum = parseInt(key, 10);
762
+ if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) setMaxIndex(acc, keyNum);
763
+ }
764
+ return acc;
765
+ }, mergeTarget);
766
+ };
767
+ var assign = function assignSingleSource(target, source) {
768
+ return Object.keys(source).reduce(function(acc, key) {
769
+ acc[key] = source[key];
770
+ return acc;
771
+ }, target);
772
+ };
773
+ var decode = function(str, defaultDecoder, charset) {
774
+ var strWithoutPlus = str.replace(/\+/g, " ");
775
+ if (charset === "iso-8859-1") return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
776
+ try {
777
+ return decodeURIComponent(strWithoutPlus);
778
+ } catch (e) {
779
+ return strWithoutPlus;
780
+ }
781
+ };
782
+ var limit = 1024;
783
+ module.exports = {
784
+ arrayToObject,
785
+ assign,
786
+ combine: function combine(a, b, arrayLimit, plainObjects) {
787
+ if (isOverflow(a)) {
788
+ var newIndex = getMaxIndex(a) + 1;
789
+ a[newIndex] = b;
790
+ setMaxIndex(a, newIndex);
791
+ return a;
792
+ }
793
+ var result = [].concat(a, b);
794
+ if (result.length > arrayLimit) return markOverflow(arrayToObject(result, { plainObjects }), result.length - 1);
795
+ return result;
796
+ },
797
+ compact: function compact(value) {
798
+ var queue = [{
799
+ obj: { o: value },
800
+ prop: "o"
801
+ }];
802
+ var refs = [];
803
+ for (var i = 0; i < queue.length; ++i) {
804
+ var item = queue[i];
805
+ var obj = item.obj[item.prop];
806
+ var keys = Object.keys(obj);
807
+ for (var j = 0; j < keys.length; ++j) {
808
+ var key = keys[j];
809
+ var val = obj[key];
810
+ if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
811
+ queue[queue.length] = {
812
+ obj,
813
+ prop: key
814
+ };
815
+ refs[refs.length] = val;
816
+ }
817
+ }
818
+ }
819
+ compactQueue(queue);
820
+ return value;
821
+ },
822
+ decode,
823
+ encode: function encode(str, defaultEncoder, charset, kind, format) {
824
+ if (str.length === 0) return str;
825
+ var string = str;
826
+ if (typeof str === "symbol") string = Symbol.prototype.toString.call(str);
827
+ else if (typeof str !== "string") string = String(str);
828
+ if (charset === "iso-8859-1") return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
829
+ return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
830
+ });
831
+ var out = "";
832
+ for (var j = 0; j < string.length; j += limit) {
833
+ var segment = string.length >= limit ? string.slice(j, j + limit) : string;
834
+ var arr = [];
835
+ for (var i = 0; i < segment.length; ++i) {
836
+ var c = segment.charCodeAt(i);
837
+ if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
838
+ arr[arr.length] = segment.charAt(i);
839
+ continue;
840
+ }
841
+ if (c < 128) {
842
+ arr[arr.length] = hexTable[c];
843
+ continue;
844
+ }
845
+ if (c < 2048) {
846
+ arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
847
+ continue;
848
+ }
849
+ if (c < 55296 || c >= 57344) {
850
+ arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
851
+ continue;
852
+ }
853
+ i += 1;
854
+ c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
855
+ arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
856
+ }
857
+ out += arr.join("");
858
+ }
859
+ return out;
860
+ },
861
+ isBuffer: function isBuffer(obj) {
862
+ if (!obj || typeof obj !== "object") return false;
863
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
864
+ },
865
+ isOverflow,
866
+ isRegExp: function isRegExp(obj) {
867
+ return Object.prototype.toString.call(obj) === "[object RegExp]";
868
+ },
869
+ markOverflow,
870
+ maybeMap: function maybeMap(val, fn) {
871
+ if (isArray(val)) {
872
+ var mapped = [];
873
+ for (var i = 0; i < val.length; i += 1) mapped[mapped.length] = fn(val[i]);
874
+ return mapped;
875
+ }
876
+ return fn(val);
877
+ },
878
+ merge
879
+ };
880
+ }));
881
+ //#endregion
882
+ //#region ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/stringify.js
883
+ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
884
+ var getSideChannel = require_side_channel();
885
+ var utils = require_utils();
886
+ var formats = require_formats();
887
+ var has = Object.prototype.hasOwnProperty;
888
+ var arrayPrefixGenerators = {
889
+ brackets: function brackets(prefix) {
890
+ return prefix + "[]";
891
+ },
892
+ comma: "comma",
893
+ indices: function indices(prefix, key) {
894
+ return prefix + "[" + key + "]";
895
+ },
896
+ repeat: function repeat(prefix) {
897
+ return prefix;
898
+ }
899
+ };
900
+ var isArray = Array.isArray;
901
+ var push = Array.prototype.push;
902
+ var pushToArray = function(arr, valueOrArray) {
903
+ push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
904
+ };
905
+ var toISO = Date.prototype.toISOString;
906
+ var defaultFormat = formats["default"];
907
+ var defaults = {
908
+ addQueryPrefix: false,
909
+ allowDots: false,
910
+ allowEmptyArrays: false,
911
+ arrayFormat: "indices",
912
+ charset: "utf-8",
913
+ charsetSentinel: false,
914
+ commaRoundTrip: false,
915
+ delimiter: "&",
916
+ encode: true,
917
+ encodeDotInKeys: false,
918
+ encoder: utils.encode,
919
+ encodeValuesOnly: false,
920
+ filter: void 0,
921
+ format: defaultFormat,
922
+ formatter: formats.formatters[defaultFormat],
923
+ indices: false,
924
+ serializeDate: function serializeDate(date) {
925
+ return toISO.call(date);
926
+ },
927
+ skipNulls: false,
928
+ strictNullHandling: false
929
+ };
930
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
931
+ return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
932
+ };
933
+ var sentinel = {};
934
+ var stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
935
+ var obj = object;
936
+ var tmpSc = sideChannel;
937
+ var step = 0;
938
+ var findFlag = false;
939
+ while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
940
+ var pos = tmpSc.get(object);
941
+ step += 1;
942
+ if (typeof pos !== "undefined") if (pos === step) throw new RangeError("Cyclic object value");
943
+ else findFlag = true;
944
+ if (typeof tmpSc.get(sentinel) === "undefined") step = 0;
945
+ }
946
+ if (typeof filter === "function") obj = filter(prefix, obj);
947
+ else if (obj instanceof Date) obj = serializeDate(obj);
948
+ else if (generateArrayPrefix === "comma" && isArray(obj)) obj = utils.maybeMap(obj, function(value) {
949
+ if (value instanceof Date) return serializeDate(value);
950
+ return value;
951
+ });
952
+ if (obj === null) {
953
+ if (strictNullHandling) return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
954
+ obj = "";
955
+ }
956
+ if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
957
+ if (encoder) return [formatter(encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format)) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format))];
958
+ return [formatter(prefix) + "=" + formatter(String(obj))];
959
+ }
960
+ var values = [];
961
+ if (typeof obj === "undefined") return values;
962
+ var objKeys;
963
+ if (generateArrayPrefix === "comma" && isArray(obj)) {
964
+ if (encodeValuesOnly && encoder) obj = utils.maybeMap(obj, encoder);
965
+ objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
966
+ } else if (isArray(filter)) objKeys = filter;
967
+ else {
968
+ var keys = Object.keys(obj);
969
+ objKeys = sort ? keys.sort(sort) : keys;
970
+ }
971
+ var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
972
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
973
+ if (allowEmptyArrays && isArray(obj) && obj.length === 0) return adjustedPrefix + "[]";
974
+ for (var j = 0; j < objKeys.length; ++j) {
975
+ var key = objKeys[j];
976
+ var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
977
+ if (skipNulls && value === null) continue;
978
+ var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
979
+ var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
980
+ sideChannel.set(object, step);
981
+ var valueSideChannel = getSideChannel();
982
+ valueSideChannel.set(sentinel, sideChannel);
983
+ pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
984
+ }
985
+ return values;
986
+ };
987
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
988
+ if (!opts) return defaults;
989
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
990
+ if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
991
+ if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") throw new TypeError("Encoder has to be a function.");
992
+ var charset = opts.charset || defaults.charset;
993
+ if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
994
+ var format = formats["default"];
995
+ if (typeof opts.format !== "undefined") {
996
+ if (!has.call(formats.formatters, opts.format)) throw new TypeError("Unknown format option provided.");
997
+ format = opts.format;
998
+ }
999
+ var formatter = formats.formatters[format];
1000
+ var filter = defaults.filter;
1001
+ if (typeof opts.filter === "function" || isArray(opts.filter)) filter = opts.filter;
1002
+ var arrayFormat;
1003
+ if (opts.arrayFormat in arrayPrefixGenerators) arrayFormat = opts.arrayFormat;
1004
+ else if ("indices" in opts) arrayFormat = opts.indices ? "indices" : "repeat";
1005
+ else arrayFormat = defaults.arrayFormat;
1006
+ if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
1007
+ var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
1008
+ return {
1009
+ addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
1010
+ allowDots,
1011
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
1012
+ arrayFormat,
1013
+ charset,
1014
+ charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
1015
+ commaRoundTrip: !!opts.commaRoundTrip,
1016
+ delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
1017
+ encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
1018
+ encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
1019
+ encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder,
1020
+ encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
1021
+ filter,
1022
+ format,
1023
+ formatter,
1024
+ serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
1025
+ skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
1026
+ sort: typeof opts.sort === "function" ? opts.sort : null,
1027
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
1028
+ };
1029
+ };
1030
+ module.exports = function(object, opts) {
1031
+ var obj = object;
1032
+ var options = normalizeStringifyOptions(opts);
1033
+ var objKeys;
1034
+ var filter;
1035
+ if (typeof options.filter === "function") {
1036
+ filter = options.filter;
1037
+ obj = filter("", obj);
1038
+ } else if (isArray(options.filter)) {
1039
+ filter = options.filter;
1040
+ objKeys = filter;
1041
+ }
1042
+ var keys = [];
1043
+ if (typeof obj !== "object" || obj === null) return "";
1044
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
1045
+ var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
1046
+ if (!objKeys) objKeys = Object.keys(obj);
1047
+ if (options.sort) objKeys.sort(options.sort);
1048
+ var sideChannel = getSideChannel();
1049
+ for (var i = 0; i < objKeys.length; ++i) {
1050
+ var key = objKeys[i];
1051
+ var value = obj[key];
1052
+ if (options.skipNulls && value === null) continue;
1053
+ pushToArray(keys, stringify(value, key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel));
1054
+ }
1055
+ var joined = keys.join(options.delimiter);
1056
+ var prefix = options.addQueryPrefix === true ? "?" : "";
1057
+ if (options.charsetSentinel) if (options.charset === "iso-8859-1") prefix += "utf8=%26%2310003%3B&";
1058
+ else prefix += "utf8=%E2%9C%93&";
1059
+ return joined.length > 0 ? prefix + joined : "";
1060
+ };
1061
+ }));
1062
+ //#endregion
1063
+ //#region ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/parse.js
1064
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1065
+ var utils = require_utils();
1066
+ var has = Object.prototype.hasOwnProperty;
1067
+ var isArray = Array.isArray;
1068
+ var defaults = {
1069
+ allowDots: false,
1070
+ allowEmptyArrays: false,
1071
+ allowPrototypes: false,
1072
+ allowSparse: false,
1073
+ arrayLimit: 20,
1074
+ charset: "utf-8",
1075
+ charsetSentinel: false,
1076
+ comma: false,
1077
+ decodeDotInKeys: false,
1078
+ decoder: utils.decode,
1079
+ delimiter: "&",
1080
+ depth: 5,
1081
+ duplicates: "combine",
1082
+ ignoreQueryPrefix: false,
1083
+ interpretNumericEntities: false,
1084
+ parameterLimit: 1e3,
1085
+ parseArrays: true,
1086
+ plainObjects: false,
1087
+ strictDepth: false,
1088
+ strictMerge: true,
1089
+ strictNullHandling: false,
1090
+ throwOnLimitExceeded: false
1091
+ };
1092
+ var interpretNumericEntities = function(str) {
1093
+ return str.replace(/&#(\d+);/g, function($0, numberStr) {
1094
+ return String.fromCharCode(parseInt(numberStr, 10));
1095
+ });
1096
+ };
1097
+ var parseArrayValue = function(val, options, currentArrayLength) {
1098
+ if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) return val.split(",");
1099
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1100
+ return val;
1101
+ };
1102
+ var isoSentinel = "utf8=%26%2310003%3B";
1103
+ var charsetSentinel = "utf8=%E2%9C%93";
1104
+ var parseValues = function parseQueryStringValues(str, options) {
1105
+ var obj = { __proto__: null };
1106
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
1107
+ cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1108
+ var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
1109
+ var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded && typeof limit !== "undefined" ? limit + 1 : limit);
1110
+ if (options.throwOnLimitExceeded && typeof limit !== "undefined" && parts.length > limit) throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
1111
+ var skipIndex = -1;
1112
+ var i;
1113
+ var charset = options.charset;
1114
+ if (options.charsetSentinel) {
1115
+ for (i = 0; i < parts.length; ++i) if (parts[i].indexOf("utf8=") === 0) {
1116
+ if (parts[i] === charsetSentinel) charset = "utf-8";
1117
+ else if (parts[i] === isoSentinel) charset = "iso-8859-1";
1118
+ skipIndex = i;
1119
+ i = parts.length;
1120
+ }
1121
+ }
1122
+ for (i = 0; i < parts.length; ++i) {
1123
+ if (i === skipIndex) continue;
1124
+ var part = parts[i];
1125
+ var bracketEqualsPos = part.indexOf("]=");
1126
+ var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
1127
+ var key;
1128
+ var val;
1129
+ if (pos === -1) {
1130
+ key = options.decoder(part, defaults.decoder, charset, "key");
1131
+ val = options.strictNullHandling ? null : "";
1132
+ } else {
1133
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
1134
+ if (key !== null) val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
1135
+ return options.decoder(encodedVal, defaults.decoder, charset, "value");
1136
+ });
1137
+ }
1138
+ if (val && options.interpretNumericEntities && charset === "iso-8859-1") val = interpretNumericEntities(String(val));
1139
+ if (part.indexOf("[]=") > -1) val = isArray(val) ? [val] : val;
1140
+ if (options.comma && isArray(val) && val.length > options.arrayLimit) {
1141
+ if (options.throwOnLimitExceeded) throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1142
+ val = utils.combine([], val, options.arrayLimit, options.plainObjects);
1143
+ }
1144
+ if (key !== null) {
1145
+ var existing = has.call(obj, key);
1146
+ if (existing && (options.duplicates === "combine" || part.indexOf("[]=") > -1)) obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
1147
+ else if (!existing || options.duplicates === "last") obj[key] = val;
1148
+ }
1149
+ }
1150
+ return obj;
1151
+ };
1152
+ var parseObject = function(chain, val, options, valuesParsed) {
1153
+ var currentArrayLength = 0;
1154
+ if (chain.length > 0 && chain[chain.length - 1] === "[]") {
1155
+ var parentKey = chain.slice(0, -1).join("");
1156
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
1157
+ }
1158
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
1159
+ for (var i = chain.length - 1; i >= 0; --i) {
1160
+ var obj;
1161
+ var root = chain[i];
1162
+ if (root === "[]" && options.parseArrays) if (utils.isOverflow(leaf)) obj = leaf;
1163
+ else obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
1164
+ else {
1165
+ obj = options.plainObjects ? { __proto__: null } : {};
1166
+ var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
1167
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
1168
+ var index = parseInt(decodedRoot, 10);
1169
+ var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
1170
+ if (!options.parseArrays && decodedRoot === "") obj = { 0: leaf };
1171
+ else if (isValidArrayIndex && index < options.arrayLimit) {
1172
+ obj = [];
1173
+ obj[index] = leaf;
1174
+ } else if (isValidArrayIndex && options.throwOnLimitExceeded) throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1175
+ else if (isValidArrayIndex) {
1176
+ obj[index] = leaf;
1177
+ utils.markOverflow(obj, index);
1178
+ } else if (decodedRoot !== "__proto__") obj[decodedRoot] = leaf;
1179
+ }
1180
+ leaf = obj;
1181
+ }
1182
+ return leaf;
1183
+ };
1184
+ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
1185
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
1186
+ if (options.depth <= 0) {
1187
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
1188
+ if (!options.allowPrototypes) return;
1189
+ }
1190
+ return [key];
1191
+ }
1192
+ var brackets = /(\[[^[\]]*])/;
1193
+ var child = /(\[[^[\]]*])/g;
1194
+ var segment = brackets.exec(key);
1195
+ var parent = segment ? key.slice(0, segment.index) : key;
1196
+ var keys = [];
1197
+ if (parent) {
1198
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
1199
+ if (!options.allowPrototypes) return;
1200
+ }
1201
+ keys[keys.length] = parent;
1202
+ }
1203
+ var i = 0;
1204
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
1205
+ i += 1;
1206
+ var segmentContent = segment[1].slice(1, -1);
1207
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
1208
+ if (!options.allowPrototypes) return;
1209
+ }
1210
+ keys[keys.length] = segment[1];
1211
+ }
1212
+ if (segment) {
1213
+ if (options.strictDepth === true) throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
1214
+ keys[keys.length] = "[" + key.slice(segment.index) + "]";
1215
+ }
1216
+ return keys;
1217
+ };
1218
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
1219
+ if (!givenKey) return;
1220
+ var keys = splitKeyIntoSegments(givenKey, options);
1221
+ if (!keys) return;
1222
+ return parseObject(keys, val, options, valuesParsed);
1223
+ };
1224
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
1225
+ if (!opts) return defaults;
1226
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1227
+ if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
1228
+ if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") throw new TypeError("Decoder has to be a function.");
1229
+ if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1230
+ if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
1231
+ var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
1232
+ var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
1233
+ if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") throw new TypeError("The duplicates option must be either combine, first, or last");
1234
+ return {
1235
+ allowDots: typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots,
1236
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
1237
+ allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
1238
+ allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
1239
+ arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
1240
+ charset,
1241
+ charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
1242
+ comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
1243
+ decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
1244
+ decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
1245
+ delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
1246
+ depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
1247
+ duplicates,
1248
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
1249
+ interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
1250
+ parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
1251
+ parseArrays: opts.parseArrays !== false,
1252
+ plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
1253
+ strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
1254
+ strictMerge: typeof opts.strictMerge === "boolean" ? !!opts.strictMerge : defaults.strictMerge,
1255
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling,
1256
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === "boolean" ? opts.throwOnLimitExceeded : false
1257
+ };
1258
+ };
1259
+ module.exports = function(str, opts) {
1260
+ var options = normalizeParseOptions(opts);
1261
+ if (str === "" || str === null || typeof str === "undefined") return options.plainObjects ? { __proto__: null } : {};
1262
+ var tempObj = typeof str === "string" ? parseValues(str, options) : str;
1263
+ var obj = options.plainObjects ? { __proto__: null } : {};
1264
+ var keys = Object.keys(tempObj);
1265
+ for (var i = 0; i < keys.length; ++i) {
1266
+ var key = keys[i];
1267
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === "string");
1268
+ obj = utils.merge(obj, newObj, options);
1269
+ }
1270
+ if (options.allowSparse === true) return obj;
1271
+ return utils.compact(obj);
1272
+ };
1273
+ }));
1274
+ //#endregion
1275
+ //#region ../../packages/workflow-sdk/src/error.ts
1276
+ var import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
1277
+ var stringify = require_stringify();
1278
+ var parse = require_parse();
1279
+ module.exports = {
1280
+ formats: require_formats(),
1281
+ parse,
1282
+ stringify
1283
+ };
1284
+ })))(), 1);
1285
+ function isDeployCredentialErrorBody(body) {
1286
+ return typeof body === "object" && body !== null && body.status === "credentials_required";
1287
+ }
1288
+ function formatDeployCredentialGateMessage(body) {
1289
+ const lines = ["Deployment blocked: required credentials are missing, incomplete, or out of date with the active deployment."];
1290
+ for (const m of body.missing ?? []) {
1291
+ const label = m.displayName ?? m.resolvedCredentialSetId ?? "credential set";
1292
+ const keyDetail = m.missingKeys && m.missingKeys.length > 0 ? ` (incomplete: missing keys ${m.missingKeys.join(", ")})` : "";
1293
+ const fix = m.connectCommand ?? m.uploadCommand;
1294
+ lines.push(fix ? `- ${label}${keyDetail}. Fix: ${fix}` : `- ${label}${keyDetail}. Connect or upload credentials for this credential set.`);
1295
+ }
1296
+ for (const d of body.schemaDrifts ?? []) if (d.message) lines.push(`- Schema drift: ${d.message}`);
1297
+ return lines.join("\n");
1298
+ }
1299
+ const ISSUE_LIMIT = 5;
1300
+ const FALLBACK_MESSAGE = "An unexpected error occurred";
1301
+ /**
1302
+ * Formats Zod validation issues into a human-readable string.
1303
+ */
1304
+ function formatZodIssues(error) {
1305
+ return error.issues.slice(0, ISSUE_LIMIT).map((issue) => {
1306
+ return `${issue.path.length > 0 ? issue.path.join(".") : "root"}: ${issue.message}`;
1307
+ }).join("; ");
1308
+ }
1309
+ /**
1310
+ * Extracts a human-readable error message from various error types:
1311
+ * - API/HTTP errors (from ky): message/error from response body, or status text
1312
+ * - Zod validation errors: formatted path + message for each issue
1313
+ * - Network errors (TypeError, Failed to fetch): friendly network message
1314
+ * - Generic Error: uses error.message
1315
+ * - Unknown: fallback message
1316
+ *
1317
+ * @param error - Any error (unknown) thrown during SDK operations
1318
+ * @returns Human-readable error message string
1319
+ */
1320
+ async function transformError(error) {
1321
+ if (error instanceof ZodError) {
1322
+ const formatted = formatZodIssues(error);
1323
+ return formatted ? `Validation error: ${formatted}` : "Validation failed";
1324
+ }
1325
+ if (isHTTPError(error)) {
1326
+ const { response } = error;
1327
+ let message = response.statusText || `HTTP ${response.status}`;
1328
+ try {
1329
+ const body = await response.clone().json();
1330
+ if (body?.code === "ORG_HEADER_REQUIRED") return [
1331
+ "Organization context required: You belong to multiple organizations.",
1332
+ "Pass organizationId to createClient(), set KEYSTROKE_ORG_ID env var,",
1333
+ "or use the --org flag in the CLI.",
1334
+ body.hint ? `Server hint: ${body.hint}` : ""
1335
+ ].filter(Boolean).join("\n");
1336
+ if (isDeployCredentialErrorBody(body)) return `Keystroke API Error (${response.status}): ${formatDeployCredentialGateMessage(body)}`;
1337
+ const bodyMessage = body?.message ?? body?.error;
1338
+ if (typeof bodyMessage === "string") message = bodyMessage;
1339
+ } catch {}
1340
+ return `Keystroke API Error (${response.status}): ${message}`;
1341
+ }
1342
+ if (error instanceof TypeError) {
1343
+ if (error.message.toLowerCase().includes("fetch")) return "Network error: Unable to reach the server. Check your connection and try again.";
1344
+ return error.message || "A network error occurred";
1345
+ }
1346
+ if (error instanceof Error) return error.message || FALLBACK_MESSAGE;
1347
+ return FALLBACK_MESSAGE;
1348
+ }
1349
+ function isHTTPError(error) {
1350
+ return typeof error === "object" && error !== null && "response" in error && typeof error.response === "object";
1351
+ }
1352
+ //#endregion
1353
+ //#region ../../packages/workflow-sdk/src/http.ts
1354
+ const REQUEST_START_HEADER = "x-request-start";
1355
+ /** Default beforeRequest hook: injects bearer token and optional org header */
1356
+ const createAuthHook = (apiKey, getApiKey, organizationId, getOrganizationId) => {
1357
+ return async (request) => {
1358
+ try {
1359
+ let key;
1360
+ if (getApiKey) key = await getApiKey();
1361
+ else if (apiKey) key = apiKey;
1362
+ else throw new Error("Keystroke API Key is required (pass apiKey, getApiKey, or set KEYSTROKE_API_KEY)");
1363
+ request.headers.set("Authorization", `Bearer ${key}`);
1364
+ const orgId = getOrganizationId ? await getOrganizationId() : organizationId;
1365
+ if (orgId) request.headers.set("X-Organization-Id", orgId);
1366
+ } catch (error) {
1367
+ console.error("Error creating auth hook:", error);
1368
+ }
1369
+ };
1370
+ };
1371
+ function headersToRecord(headers) {
1372
+ const result = {};
1373
+ headers.forEach((value, key) => {
1374
+ result[key] = value;
1375
+ });
1376
+ return result;
1377
+ }
1378
+ async function tryParseBody(clone) {
1379
+ try {
1380
+ return await clone.json();
1381
+ } catch {
1382
+ return;
1383
+ }
1384
+ }
1385
+ const createRequestLogHook = (onRequest) => {
1386
+ return async (request) => {
1387
+ request.headers.set(REQUEST_START_HEADER, String(Date.now()));
1388
+ const body = await tryParseBody(request.clone());
1389
+ onRequest({
1390
+ method: request.method,
1391
+ url: request.url,
1392
+ headers: headersToRecord(request.headers),
1393
+ body
1394
+ });
1395
+ };
1396
+ };
1397
+ const createResponseLogHook = (onResponse) => {
1398
+ return async (request, _options, response) => {
1399
+ const startRaw = request.headers.get(REQUEST_START_HEADER);
1400
+ const durationMs = startRaw ? Date.now() - Number(startRaw) : 0;
1401
+ const body = await tryParseBody(response.clone());
1402
+ onResponse({
1403
+ method: request.method,
1404
+ url: request.url,
1405
+ status: response.status,
1406
+ durationMs,
1407
+ headers: headersToRecord(response.headers),
1408
+ body
1409
+ });
1410
+ return response;
1411
+ };
1412
+ };
1413
+ /** Default beforeError hook: enriches HTTPError with human-readable message via transformError */
1414
+ const defaultBeforeErrorHook = async (error) => {
1415
+ error.message = await transformError(error);
1416
+ return error;
1417
+ };
1418
+ /**
1419
+ * Custom fetch wrapper that catches network-level errors (e.g. ECONNREFUSED, DNS failures)
1420
+ * and transforms them into clean error messages via transformError.
1421
+ *
1422
+ * ky's `beforeError` hook only fires for HTTPError (non-2xx responses).
1423
+ * Network errors like TypeError: fetch failed bypass hooks entirely,
1424
+ * so we intercept them here at the fetch level.
1425
+ */
1426
+ const createFetchWithErrorTransform = () => {
1427
+ return async (...args) => {
1428
+ try {
1429
+ return await globalThis.fetch(...args);
1430
+ } catch (error) {
1431
+ const url = extractUrl(args[0]);
1432
+ const message = await transformError(error);
1433
+ const detail = url ? `${message} (attempted: ${url})` : message;
1434
+ throw new TypeError(detail, { cause: error });
1435
+ }
1436
+ };
1437
+ };
1438
+ /** Extract a displayable URL (origin + pathname) from fetch input, stripping query params */
1439
+ function extractUrl(input) {
1440
+ try {
1441
+ if (typeof input === "string") {
1442
+ const parsed = new URL(input);
1443
+ return `${parsed.origin}${parsed.pathname}`;
1444
+ }
1445
+ if (input instanceof URL) return `${input.origin}${input.pathname}`;
1446
+ if (input instanceof Request) {
1447
+ const parsed = new URL(input.url);
1448
+ return `${parsed.origin}${parsed.pathname}`;
1449
+ }
1450
+ } catch {
1451
+ if (typeof input === "string") return input;
1452
+ }
1453
+ }
1454
+ /**
1455
+ * Builds a `URLSearchParams` from a plain params object, preserving the
1456
+ * caller's declared types end-to-end so call sites don't need casts.
1457
+ *
1458
+ * Rules:
1459
+ * • `undefined` / `null` values are dropped (the field is absent from the
1460
+ * query string rather than serialized as the literal string "undefined").
1461
+ * • Array values become repeated keys (`status=a&status=b`), which is what
1462
+ * Hono/`c.req.queries()` and Zod's array preprocessors expect.
1463
+ * • Booleans stringify to the literal `"true"` / `"false"` — pair with
1464
+ * `z.stringbool()` on the server, NOT `z.coerce.boolean()` (the latter
1465
+ * treats the string "false" as truthy).
1466
+ * • Numbers stringify via `String()`.
1467
+ *
1468
+ * `URLSearchParams` is a first-class member of ky's `SearchParamsOption`
1469
+ * union, so the returned value is passed to `api.get('…', { searchParams })`
1470
+ * without any casts. The shared `qsSearchParamsHook` below explicitly skips
1471
+ * `URLSearchParams` instances, so this path bypasses the hook entirely.
1472
+ *
1473
+ * Use this from any SDK namespace whose query type has array-valued fields
1474
+ * (e.g. `status: ConnectionStatus | ConnectionStatus[]`) — those are the
1475
+ * cases that otherwise require an `as unknown as Record<...>` cast at the
1476
+ * call site because ky's declared `Record<string, string | number | boolean
1477
+ * | undefined>` does not accept arrays.
1478
+ */
1479
+ function buildSearchParams(params) {
1480
+ if (!params) return void 0;
1481
+ const sp = new URLSearchParams();
1482
+ for (const [key, value] of Object.entries(params)) {
1483
+ if (value === void 0 || value === null) continue;
1484
+ if (Array.isArray(value)) for (const entry of value) {
1485
+ if (entry === void 0 || entry === null) continue;
1486
+ sp.append(key, String(entry));
1487
+ }
1488
+ else sp.append(key, String(value));
1489
+ }
1490
+ return sp.size > 0 ? sp : void 0;
1491
+ }
1492
+ /**
1493
+ * beforeRequest hook that re-serializes searchParams with qs.
1494
+ * ky's built-in URLSearchParams serialization comma-joins arrays (e.g. `projectId=a,b`).
1495
+ * This hook fixes that by rebuilding the query string with repeated keys (e.g. `projectId=a&projectId=b`).
1496
+ *
1497
+ * Only triggers for plain objects — callers that pre-build a `URLSearchParams`
1498
+ * (e.g. via `buildSearchParams` above) bypass this hook.
1499
+ *
1500
+ * Note: NormalizedOptions doesn't declare `searchParams` in its type, but ky passes it through at runtime.
1501
+ */
1502
+ const qsSearchParamsHook = (request, options) => {
1503
+ const sp = options.searchParams;
1504
+ if (sp && typeof sp === "object" && !Array.isArray(sp) && !(sp instanceof URLSearchParams)) {
1505
+ const query = import_lib.default.stringify(sp, {
1506
+ arrayFormat: "repeat",
1507
+ skipNulls: true
1508
+ });
1509
+ const url = new URL(request.url);
1510
+ url.search = query;
1511
+ return new Request(url.toString(), request);
1512
+ }
1513
+ };
1514
+ function createKyInstance(config) {
1515
+ const { prefixUrl, auth, apiKey, getApiKey, organizationId, getOrganizationId, onRequest, onResponse } = config;
1516
+ const authHooks = auth === false ? [] : [createAuthHook(apiKey, getApiKey, organizationId, getOrganizationId)];
1517
+ return ky.create({
1518
+ prefixUrl,
1519
+ retry: 0,
1520
+ timeout: 3e4,
1521
+ fetch: createFetchWithErrorTransform(),
1522
+ hooks: {
1523
+ beforeRequest: [
1524
+ ...authHooks,
1525
+ ...onRequest ? [createRequestLogHook(onRequest)] : [],
1526
+ qsSearchParamsHook
1527
+ ],
1528
+ afterResponse: [...onResponse ? [createResponseLogHook(onResponse)] : []],
1529
+ beforeError: [defaultBeforeErrorHook],
1530
+ beforeRetry: []
1531
+ }
1532
+ });
1533
+ }
1534
+ //#endregion
1535
+ //#region ../../packages/workflow-sdk/src/v1/bundles.ts
1536
+ const bundles = (api) => ({
1537
+ /** Check current deployment artifact metadata for workflows and agents. */
1538
+ getHashes: (params) => api.post("public/bundles/hashes", { json: params }).json(),
1539
+ /** Request presigned upload URLs for workflows and agents in one round-trip. */
1540
+ getPresignedUrl: (params) => api.post("public/bundles/presigned-url", { json: params }).json(),
1541
+ /** Sync project file metadata snapshot independently of bundle registration. */
1542
+ syncFileMetadata: (params) => api.post("public/bundles/file-metadata", { json: params }).json(),
1543
+ /** Upload workflow bundles to storage. Gets presigned URLs then uploads with retry. */
1544
+ upload: async (workflows, purpose, options) => {
1545
+ const { workflows: workflowUrls } = await api.post("public/bundles/presigned-url", { json: {
1546
+ workflows: workflows.map((wf) => ({
1547
+ workflowName: wf.workflowName,
1548
+ bundleHash: wf.bundleHash,
1549
+ bundleSize: wf.bundleSize,
1550
+ bundleFileName: wf.bundleFileName
1551
+ })),
1552
+ purpose
1553
+ } }).json();
1554
+ const { batchUpload } = await import("./upload-CkU--iDC.mjs").then((n) => n.n);
1555
+ return batchUpload(workflows.map((wf) => ({
1556
+ name: wf.workflowName,
1557
+ bundle: wf.bundle,
1558
+ bundlePath: wf.bundlePath
1559
+ })), workflowUrls, options);
1560
+ }
1561
+ });
1562
+ //#endregion
1563
+ //#region ../../packages/workflow-sdk/src/v1/public/auth.ts
1564
+ const auth = (api) => ({
1565
+ /** Verify that the current API key is valid. */
1566
+ validate: () => api.get("public/auth/verify").json(),
1567
+ /** Revoke an API key by ID. The caller must authenticate with the same key. */
1568
+ revoke: (params) => api.delete("public/auth/revoke", { json: params }).json()
1569
+ });
1570
+ //#endregion
1571
+ //#region ../../packages/workflow-sdk/src/v1/public/projects.ts
1572
+ const projects = (api) => ({ deploy: (params) => api.post("public/projects/deployments", { json: params }).json() });
1573
+ //#endregion
1574
+ export { createKyInstance as a, buildSearchParams as i, auth as n, transformError as o, bundles as r, getClientEnv as s, projects as t };