@apiuikit/web-component 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeSamples-Dm277WGX-CiKryuS0.js → CodeSamples-DM23Rux1-ekmYilIR.js} +1048 -1066
- package/dist/{LinkedInExtension-BL-4T9tt-CFjbqkhZ.js → LinkedInExtension-BL-4T9tt-CPTJWNAI.js} +1 -1
- package/dist/{LogoExtension-Bhw9grDi-DFPgcRdp.js → LogoExtension-DgzRHghk-C-gboZmI.js} +3 -3
- package/dist/{XExtension-GyRtdHLL-hbNYWxJs.js → XExtension-GyRtdHLL-B7d4Tyjo.js} +1 -1
- package/dist/elements/asyncapi-info.js +1 -1
- package/dist/elements/asyncapi-messages.js +1 -1
- package/dist/elements/asyncapi-operations.js +1 -1
- package/dist/elements/asyncapi-renderer.js +1 -1
- package/dist/elements/asyncapi-servers.js +1 -1
- package/dist/elements/asyncapi.js +4 -4
- package/dist/elements/openapi-endpoints.js +1 -1
- package/dist/elements/openapi-info.js +1 -1
- package/dist/elements/openapi-renderer.js +1 -1
- package/dist/elements/openapi-servers.js +1 -1
- package/dist/elements/openapi-webhooks.js +1 -1
- package/dist/elements/openapi.js +5 -5
- package/dist/elements/schemas.js +4 -4
- package/dist/{index-ButmLtm3-BxvUFOqt.js → index-B6iEqqD5-pOAlv4zA.js} +1 -1
- package/dist/{index-ByTEMZ1h-D8WOAtLD.js → index-JrbC06_1-Gmece7-V.js} +1 -1
- package/dist/{protoToJsonSchema-Bu1_KtXF-DMb0R0EM.js → protoToJsonSchema-DSwxELWE-DBlwJigZ.js} +1 -1
- package/dist/{protobufSchemaParser--9dltEfO-BJdsvVd_.js → protobufSchemaParser-CXhrG3bk-BLghei1k.js} +9 -9
- package/dist/{registerElement-qkr8S33y.js → registerElement-DbKXLDu_.js} +10432 -10372
- package/dist/web-component.css +1 -1
- package/dist/web-component.es.js +22755 -22713
- package/dist/web-component.iife.js +310 -310
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { n as xn, r as re, c as Zt, h as En, e as Pn, j as me, x as Cn, f as An, k as Rn, w as rt, v as qn } from "./registerElement-DbKXLDu_.js";
|
|
2
|
+
function Jr(e, t = /* @__PURE__ */ new Set()) {
|
|
3
3
|
if (t.has(e)) return e;
|
|
4
4
|
if (e.type === "object" && e.properties && typeof e.properties == "object") {
|
|
5
5
|
t.add(e);
|
|
6
6
|
try {
|
|
7
7
|
const r = {};
|
|
8
8
|
for (const [n, l] of Object.entries(e.properties)) {
|
|
9
|
-
const a = /id$/i.test(n) && l.type === "string" && !l.format && !l.examples,
|
|
10
|
-
r[n] = a ? { ...l, format: "uuid" } :
|
|
9
|
+
const a = /id$/i.test(n) && l.type === "string" && !l.format && !l.examples, i = l.type === "string" && !l.format && !l.examples && !l.enum;
|
|
10
|
+
r[n] = a ? { ...l, format: "uuid" } : i ? { ...l, examples: ["string"] } : Jr(l, t);
|
|
11
11
|
}
|
|
12
12
|
return { ...e, properties: r };
|
|
13
13
|
} finally {
|
|
@@ -16,10 +16,10 @@ function Qr(e, t = /* @__PURE__ */ new Set()) {
|
|
|
16
16
|
}
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
async function
|
|
19
|
+
async function Nn(e) {
|
|
20
20
|
try {
|
|
21
21
|
const { generate: t } = await import("./index-DCDYBZcY-B5md4zhj.js");
|
|
22
|
-
return await t(
|
|
22
|
+
return await t(Jr(e), {
|
|
23
23
|
seed: 42,
|
|
24
24
|
useExamplesValue: !0,
|
|
25
25
|
optionalsProbability: 1
|
|
@@ -28,7 +28,7 @@ async function Hn(e) {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const er = "", tr = `
|
|
32
32
|
`;
|
|
33
33
|
var k = class {
|
|
34
34
|
/**
|
|
@@ -36,7 +36,7 @@ var k = class {
|
|
|
36
36
|
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
|
|
37
37
|
*/
|
|
38
38
|
constructor({ indent: e, join: t } = {}) {
|
|
39
|
-
this.postProcessors = [], this.code = [], this.indentationCharacter =
|
|
39
|
+
this.postProcessors = [], this.code = [], this.indentationCharacter = er, this.lineJoin = tr, this.indentLine = (r, n = 0) => `${this.indentationCharacter.repeat(n)}${r}`, this.unshift = (r, n) => {
|
|
40
40
|
const l = this.indentLine(r, n);
|
|
41
41
|
this.code.unshift(l);
|
|
42
42
|
}, this.push = (r, n) => {
|
|
@@ -53,45 +53,45 @@ var k = class {
|
|
|
53
53
|
return this.postProcessors.reduce((n, l) => l(n), r);
|
|
54
54
|
}, this.addPostProcessor = (r) => {
|
|
55
55
|
this.postProcessors = [...this.postProcessors, r];
|
|
56
|
-
}, this.indentationCharacter = e ||
|
|
56
|
+
}, this.indentationCharacter = e || er, this.lineJoin = t ?? tr;
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, Ln = function(e) {
|
|
59
59
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
60
|
-
},
|
|
60
|
+
}, Un = function(e) {
|
|
61
61
|
var t = typeof e;
|
|
62
62
|
return e !== null && (t === "object" || t === "function");
|
|
63
|
-
},
|
|
64
|
-
Object.defineProperty(
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
var
|
|
63
|
+
}, Jt = {};
|
|
64
|
+
Object.defineProperty(Jt, "__esModule", { value: !0 });
|
|
65
|
+
Jt.default = (e) => Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t));
|
|
66
|
+
const Dn = Ln, _n = Un, Hn = Jt.default;
|
|
67
|
+
var In = (e, t, r) => {
|
|
68
68
|
const n = [];
|
|
69
|
-
return (function l(a,
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
|
|
69
|
+
return (function l(a, i, o) {
|
|
70
|
+
i = i || {}, i.indent = i.indent || " ", o = o || "";
|
|
71
|
+
let s;
|
|
72
|
+
i.inlineCharacterLimit === void 0 ? s = {
|
|
73
73
|
newLine: `
|
|
74
74
|
`,
|
|
75
75
|
newLineOrSpace: `
|
|
76
76
|
`,
|
|
77
77
|
pad: o,
|
|
78
|
-
indent: o +
|
|
79
|
-
} :
|
|
78
|
+
indent: o + i.indent
|
|
79
|
+
} : s = {
|
|
80
80
|
newLine: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
|
|
81
81
|
newLineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
|
|
82
82
|
pad: "@@__STRINGIFY_OBJECT_PAD__@@",
|
|
83
83
|
indent: "@@__STRINGIFY_OBJECT_INDENT__@@"
|
|
84
84
|
};
|
|
85
85
|
const c = (p) => {
|
|
86
|
-
if (
|
|
86
|
+
if (i.inlineCharacterLimit === void 0)
|
|
87
87
|
return p;
|
|
88
|
-
const f = p.replace(new RegExp(
|
|
89
|
-
return f.length <=
|
|
90
|
-
`).replace(new RegExp(
|
|
88
|
+
const f = p.replace(new RegExp(s.newLine, "g"), "").replace(new RegExp(s.newLineOrSpace, "g"), " ").replace(new RegExp(s.pad + "|" + s.indent, "g"), "");
|
|
89
|
+
return f.length <= i.inlineCharacterLimit ? f : p.replace(new RegExp(s.newLine + "|" + s.newLineOrSpace, "g"), `
|
|
90
|
+
`).replace(new RegExp(s.pad, "g"), o).replace(new RegExp(s.indent, "g"), o + i.indent);
|
|
91
91
|
};
|
|
92
92
|
if (n.indexOf(a) !== -1)
|
|
93
93
|
return '"[Circular]"';
|
|
94
|
-
if (a == null || typeof a == "number" || typeof a == "boolean" || typeof a == "function" || typeof a == "symbol" ||
|
|
94
|
+
if (a == null || typeof a == "number" || typeof a == "boolean" || typeof a == "function" || typeof a == "symbol" || Dn(a))
|
|
95
95
|
return String(a);
|
|
96
96
|
if (a instanceof Date)
|
|
97
97
|
return `new Date('${a.toISOString()}')`;
|
|
@@ -99,40 +99,40 @@ var Jn = (e, t, r) => {
|
|
|
99
99
|
if (a.length === 0)
|
|
100
100
|
return "[]";
|
|
101
101
|
n.push(a);
|
|
102
|
-
const p = "[" +
|
|
103
|
-
const
|
|
104
|
-
let
|
|
105
|
-
return
|
|
106
|
-
}).join("") +
|
|
102
|
+
const p = "[" + s.newLine + a.map((f, u) => {
|
|
103
|
+
const h = a.length - 1 === u ? s.newLine : "," + s.newLineOrSpace;
|
|
104
|
+
let d = l(f, i, o + i.indent);
|
|
105
|
+
return i.transform && (d = i.transform(a, u, d)), s.indent + d + h;
|
|
106
|
+
}).join("") + s.pad + "]";
|
|
107
107
|
return n.pop(), c(p);
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
let p = Object.keys(a).concat(
|
|
111
|
-
if (
|
|
109
|
+
if (_n(a)) {
|
|
110
|
+
let p = Object.keys(a).concat(Hn(a));
|
|
111
|
+
if (i.filter && (p = p.filter((u) => i.filter(a, u))), p.length === 0)
|
|
112
112
|
return "{}";
|
|
113
113
|
n.push(a);
|
|
114
|
-
const f = "{" +
|
|
115
|
-
const
|
|
116
|
-
let y = l(a[u],
|
|
117
|
-
return
|
|
118
|
-
}).join("") +
|
|
114
|
+
const f = "{" + s.newLine + p.map((u, h) => {
|
|
115
|
+
const d = p.length - 1 === h ? s.newLine : "," + s.newLineOrSpace, m = typeof u == "symbol", b = !m && /^[a-z$_][a-z$_0-9]*$/i.test(u), j = m || b ? u : l(u, i);
|
|
116
|
+
let y = l(a[u], i, o + i.indent);
|
|
117
|
+
return i.transform && (y = i.transform(a, u, y)), s.indent + String(j) + ": " + y + d;
|
|
118
|
+
}).join("") + s.pad + "}";
|
|
119
119
|
return n.pop(), c(f);
|
|
120
120
|
}
|
|
121
121
|
return a = String(a).replace(/[\r\n]/g, (p) => p === `
|
|
122
|
-
` ? "\\n" : "\\r"),
|
|
122
|
+
` ? "\\n" : "\\r"), i.singleQuotes === !1 ? (a = a.replace(/"/g, '\\"'), `"${a}"`) : (a = a.replace(/\\?'/g, "\\'"), `'${a}'`);
|
|
123
123
|
})(e, t, r);
|
|
124
124
|
};
|
|
125
|
-
const ae = /* @__PURE__ */
|
|
125
|
+
const ae = /* @__PURE__ */ Rn(In), W = (e, t) => Object.keys(e).find((r) => r.toLowerCase() === t.toLowerCase()), le = (e, t) => {
|
|
126
126
|
const r = W(e, t);
|
|
127
127
|
if (r)
|
|
128
128
|
return e[r];
|
|
129
|
-
}, nt = (e, t) => !!W(e, t),
|
|
129
|
+
}, nt = (e, t) => !!W(e, t), Mn = (e) => [
|
|
130
130
|
"application/json",
|
|
131
131
|
"application/x-json",
|
|
132
132
|
"text/json",
|
|
133
133
|
"text/x-json",
|
|
134
134
|
"+json"
|
|
135
|
-
].some((t) => e.indexOf(t) > -1),
|
|
135
|
+
].some((t) => e.indexOf(t) > -1), Fn = {
|
|
136
136
|
info: {
|
|
137
137
|
key: "agent",
|
|
138
138
|
title: "Agent",
|
|
@@ -152,12 +152,12 @@ const ae = /* @__PURE__ */ Dn(Jn), W = (e, t) => Object.keys(e).find((r) => r.to
|
|
|
152
152
|
join: `
|
|
153
153
|
`,
|
|
154
154
|
...l
|
|
155
|
-
}, { blank:
|
|
156
|
-
o("Write code that makes the HTTP request described below. Use my preferred programming language and HTTP client library — if I haven't told you what those are, ask me before writing any code."),
|
|
155
|
+
}, { blank: i, push: o, join: s } = new k(a);
|
|
156
|
+
o("Write code that makes the HTTP request described below. Use my preferred programming language and HTTP client library — if I haven't told you what those are, ask me before writing any code."), i(), o(`Method: ${e}`), o(`URL: ${t}`);
|
|
157
157
|
const c = Object.keys(r);
|
|
158
|
-
return c.length && (
|
|
158
|
+
return c.length && (i(), o("Headers:"), c.forEach((p) => {
|
|
159
159
|
o(`${p}: ${r[p]}`, 1);
|
|
160
|
-
})), n.text && (
|
|
160
|
+
})), n.text && (i(), o(`Body (${n.mimeType}):`), o(n.text)), i(), o("The request the code makes must match the method, URL, headers, and body exactly as described above."), a.markdownURL && (i(), o(`Check ${a.markdownURL} for more info.`)), s();
|
|
161
161
|
}
|
|
162
162
|
} }
|
|
163
163
|
};
|
|
@@ -166,7 +166,7 @@ function Me(e, t = {}) {
|
|
|
166
166
|
return [...e.toString()].map((a) => a === "\b" ? `${n}b` : a === " " ? `${n}t` : a === `
|
|
167
167
|
` ? l ? `${n}n` : a : a === "\f" ? `${n}f` : a === "\r" ? l ? `${n}r` : a : a === n ? n + n : a === r ? n + r : a < " " || a > "~" ? JSON.stringify(a).slice(1, -1) : a).join("");
|
|
168
168
|
}
|
|
169
|
-
const Ae = (e) => Me(e, { delimiter: "'" }), D = (e) => Me(e, { delimiter: '"' }),
|
|
169
|
+
const Ae = (e) => Me(e, { delimiter: "'" }), D = (e) => Me(e, { delimiter: '"' }), Bn = {
|
|
170
170
|
info: {
|
|
171
171
|
key: "c",
|
|
172
172
|
title: "C",
|
|
@@ -182,32 +182,32 @@ const Ae = (e) => Me(e, { delimiter: "'" }), D = (e) => Me(e, { delimiter: '"' }
|
|
|
182
182
|
extname: ".c"
|
|
183
183
|
},
|
|
184
184
|
convert: ({ method: e, fullUrl: t, headersObj: r, allHeaders: n, postData: l }) => {
|
|
185
|
-
const { push: a, blank:
|
|
186
|
-
a("CURL *hnd = curl_easy_init();"),
|
|
187
|
-
const
|
|
188
|
-
return
|
|
185
|
+
const { push: a, blank: i, join: o } = new k();
|
|
186
|
+
a("CURL *hnd = curl_easy_init();"), i(), a(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${e.toUpperCase()}");`), a("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"), a(`curl_easy_setopt(hnd, CURLOPT_URL, "${t}");`);
|
|
187
|
+
const s = Object.keys(r);
|
|
188
|
+
return s.length && (i(), a("struct curl_slist *headers = NULL;"), s.forEach((c) => {
|
|
189
189
|
a(`headers = curl_slist_append(headers, "${c}: ${D(r[c])}");`);
|
|
190
|
-
}), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), n.cookie && (
|
|
190
|
+
}), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), n.cookie && (i(), a(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${n.cookie}");`)), l.text && (i(), a(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(l.text)});`)), i(), a("CURLcode ret = curl_easy_perform(hnd);"), o();
|
|
191
191
|
}
|
|
192
192
|
} }
|
|
193
193
|
};
|
|
194
|
-
var
|
|
194
|
+
var rr = class {
|
|
195
195
|
constructor(e) {
|
|
196
196
|
this.name = "", this.toString = () => `:${this.name}`, this.name = e;
|
|
197
197
|
}
|
|
198
|
-
},
|
|
198
|
+
}, Wn = class {
|
|
199
199
|
constructor(e) {
|
|
200
200
|
this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = e;
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
|
-
const
|
|
203
|
+
const zr = (e) => e === void 0 ? null : e === null ? "null" : e.constructor.name.toLowerCase(), Kr = (e) => e === void 0 ? !0 : zr(e) === "object" ? Object.keys(e).length === 0 : !1, nr = (e) => (Object.keys(e).filter((t) => Kr(e[t])).forEach((t) => {
|
|
204
204
|
delete e[t];
|
|
205
205
|
}), e), Qe = (e, t) => {
|
|
206
206
|
const r = " ".repeat(e);
|
|
207
207
|
return t.replace(/\n/g, `
|
|
208
208
|
${r}`);
|
|
209
|
-
},
|
|
210
|
-
switch (
|
|
209
|
+
}, qt = (e) => {
|
|
210
|
+
switch (zr(e)) {
|
|
211
211
|
case "string":
|
|
212
212
|
return `"${e.replace(/"/g, '\\"')}"`;
|
|
213
213
|
case "file":
|
|
@@ -219,18 +219,18 @@ ${r}`);
|
|
|
219
219
|
case "regexp":
|
|
220
220
|
return `#"${e.source}"`;
|
|
221
221
|
case "object": {
|
|
222
|
-
const t = Object.keys(e).reduce((r, n) => `${r}:${n} ${Qe(n.length + 2,
|
|
222
|
+
const t = Object.keys(e).reduce((r, n) => `${r}:${n} ${Qe(n.length + 2, qt(e[n]))}
|
|
223
223
|
`, "").trim();
|
|
224
224
|
return `{${Qe(1, t)}}`;
|
|
225
225
|
}
|
|
226
226
|
case "array": {
|
|
227
|
-
const t = e.reduce((r, n) => `${r} ${
|
|
227
|
+
const t = e.reduce((r, n) => `${r} ${qt(n)}`, "").trim();
|
|
228
228
|
return `[${Qe(1, t)}]`;
|
|
229
229
|
}
|
|
230
230
|
default:
|
|
231
231
|
return e.toString();
|
|
232
232
|
}
|
|
233
|
-
},
|
|
233
|
+
}, Jn = {
|
|
234
234
|
info: {
|
|
235
235
|
key: "clojure",
|
|
236
236
|
title: "Clojure",
|
|
@@ -245,7 +245,7 @@ ${r}`);
|
|
|
245
245
|
extname: ".clj"
|
|
246
246
|
},
|
|
247
247
|
convert: ({ queryObj: e, method: t, postData: r, url: n, allHeaders: l }, a) => {
|
|
248
|
-
const { push:
|
|
248
|
+
const { push: i, join: o } = new k({ indent: a == null ? void 0 : a.indent }), s = [
|
|
249
249
|
"get",
|
|
250
250
|
"post",
|
|
251
251
|
"put",
|
|
@@ -254,8 +254,8 @@ ${r}`);
|
|
|
254
254
|
"head",
|
|
255
255
|
"options"
|
|
256
256
|
];
|
|
257
|
-
if (t = t.toLowerCase(), !
|
|
258
|
-
return
|
|
257
|
+
if (t = t.toLowerCase(), !s.includes(t))
|
|
258
|
+
return i("Method not supported"), o();
|
|
259
259
|
const c = {
|
|
260
260
|
headers: l,
|
|
261
261
|
"query-params": e
|
|
@@ -263,7 +263,7 @@ ${r}`);
|
|
|
263
263
|
switch (r.mimeType) {
|
|
264
264
|
case "application/json":
|
|
265
265
|
{
|
|
266
|
-
c["content-type"] = new
|
|
266
|
+
c["content-type"] = new rr("json"), c["form-params"] = r.jsonObj;
|
|
267
267
|
const p = W(c.headers, "content-type");
|
|
268
268
|
p && delete c.headers[p];
|
|
269
269
|
}
|
|
@@ -286,7 +286,7 @@ ${r}`);
|
|
|
286
286
|
if (r.params) {
|
|
287
287
|
c.multipart = r.params.map((f) => f.fileName && !f.value ? {
|
|
288
288
|
name: f.name,
|
|
289
|
-
content: new
|
|
289
|
+
content: new Wn(f.fileName)
|
|
290
290
|
} : {
|
|
291
291
|
name: f.name,
|
|
292
292
|
content: f.value
|
|
@@ -299,22 +299,22 @@ ${r}`);
|
|
|
299
299
|
switch (le(c.headers, "accept")) {
|
|
300
300
|
case "application/json":
|
|
301
301
|
{
|
|
302
|
-
c.accept = new
|
|
302
|
+
c.accept = new rr("json");
|
|
303
303
|
const p = W(c.headers, "accept");
|
|
304
304
|
p && delete c.headers[p];
|
|
305
305
|
}
|
|
306
306
|
break;
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
309
|
-
`),
|
|
308
|
+
if (i(`(require '[clj-http.client :as client])
|
|
309
|
+
`), Kr(nr(c))) i(`(client/${t} "${n}")`);
|
|
310
310
|
else {
|
|
311
|
-
const p = 11 + t.length + n.length, f = Qe(p,
|
|
312
|
-
|
|
311
|
+
const p = 11 + t.length + n.length, f = Qe(p, qt(nr(c)));
|
|
312
|
+
i(`(client/${t} "${n}" ${f})`);
|
|
313
313
|
}
|
|
314
314
|
return o();
|
|
315
315
|
}
|
|
316
316
|
} }
|
|
317
|
-
},
|
|
317
|
+
}, zn = {
|
|
318
318
|
info: {
|
|
319
319
|
key: "crystal",
|
|
320
320
|
title: "Crystal",
|
|
@@ -329,12 +329,12 @@ ${r}`);
|
|
|
329
329
|
extname: ".cr"
|
|
330
330
|
},
|
|
331
331
|
convert: ({ method: e, fullUrl: t, postData: r, allHeaders: n }, l = {}) => {
|
|
332
|
-
const { insecureSkipVerify: a = !1 } = l, { push:
|
|
333
|
-
|
|
332
|
+
const { insecureSkipVerify: a = !1 } = l, { push: i, blank: o, join: s } = new k();
|
|
333
|
+
i('require "http/client"'), o(), i(`url = "${t}"`);
|
|
334
334
|
const c = Object.keys(n);
|
|
335
|
-
c.length && (
|
|
336
|
-
|
|
337
|
-
}),
|
|
335
|
+
c.length && (i("headers = HTTP::Headers{"), c.forEach((m) => {
|
|
336
|
+
i(` "${m}" => "${D(n[m])}"`);
|
|
337
|
+
}), i("}")), r.text && i(`reqBody = ${JSON.stringify(r.text)}`), o();
|
|
338
338
|
const p = e.toUpperCase(), f = [
|
|
339
339
|
"GET",
|
|
340
340
|
"POST",
|
|
@@ -343,11 +343,11 @@ ${r}`);
|
|
|
343
343
|
"PATCH",
|
|
344
344
|
"PUT",
|
|
345
345
|
"OPTIONS"
|
|
346
|
-
], u = c.length ? ", headers: headers" : "",
|
|
347
|
-
return f.includes(p) ?
|
|
346
|
+
], u = c.length ? ", headers: headers" : "", h = r.text ? ", body: reqBody" : "", d = a ? ", tls: OpenSSL::SSL::Context::Client.insecure" : "";
|
|
347
|
+
return f.includes(p) ? i(`response = HTTP::Client.${p.toLowerCase()} url${u}${h}${d}`) : i(`response = HTTP::Client.exec "${p}", url${u}${h}${d}`), i("puts response.body"), s();
|
|
348
348
|
}
|
|
349
349
|
} }
|
|
350
|
-
},
|
|
350
|
+
}, Kn = (e) => {
|
|
351
351
|
let t = le(e, "accept-encoding");
|
|
352
352
|
if (!t) return [];
|
|
353
353
|
const r = {
|
|
@@ -356,14 +356,14 @@ ${r}`);
|
|
|
356
356
|
}, n = [];
|
|
357
357
|
return typeof t == "string" && (t = [t]), t.forEach((l) => {
|
|
358
358
|
l.split(",").forEach((a) => {
|
|
359
|
-
const
|
|
360
|
-
if (
|
|
361
|
-
const o = r[
|
|
359
|
+
const i = /\s*([^;\s]+)/.exec(a);
|
|
360
|
+
if (i) {
|
|
361
|
+
const o = r[i[1]];
|
|
362
362
|
o && n.push(o);
|
|
363
363
|
}
|
|
364
364
|
});
|
|
365
365
|
}), n;
|
|
366
|
-
},
|
|
366
|
+
}, Vn = {
|
|
367
367
|
info: {
|
|
368
368
|
key: "httpclient",
|
|
369
369
|
title: "HttpClient",
|
|
@@ -372,14 +372,14 @@ ${r}`);
|
|
|
372
372
|
extname: ".cs"
|
|
373
373
|
},
|
|
374
374
|
convert: ({ allHeaders: e, postData: t, method: r, fullUrl: n }, l) => {
|
|
375
|
-
var a,
|
|
376
|
-
const { push: o, join:
|
|
375
|
+
var a, i;
|
|
376
|
+
const { push: o, join: s } = new k({ indent: {
|
|
377
377
|
indent: " ",
|
|
378
378
|
...l
|
|
379
379
|
}.indent });
|
|
380
380
|
o("using System.Net.Http.Headers;");
|
|
381
381
|
let c = "";
|
|
382
|
-
const p = !!e.cookie, f =
|
|
382
|
+
const p = !!e.cookie, f = Kn(e);
|
|
383
383
|
(p || f.length) && (c = "clientHandler", o("var clientHandler = new HttpClientHandler"), o("{"), p && o("UseCookies = false,", 1), f.length && o(`AutomaticDecompression = ${f.join(" | ")},`, 1), o("};")), o(`var client = new HttpClient(${c});`), o("var request = new HttpRequestMessage"), o("{");
|
|
384
384
|
const u = [
|
|
385
385
|
"GET",
|
|
@@ -392,8 +392,8 @@ ${r}`);
|
|
|
392
392
|
"TRACE"
|
|
393
393
|
];
|
|
394
394
|
r = r.toUpperCase(), r && u.includes(r) ? r = `HttpMethod.${r[0]}${r.substring(1).toLowerCase()}` : r = `new HttpMethod("${r}")`, o(`Method = ${r},`, 1), o(`RequestUri = new Uri("${n}"),`, 1);
|
|
395
|
-
const
|
|
396
|
-
switch (
|
|
395
|
+
const h = Object.keys(e).filter((d) => {
|
|
396
|
+
switch (d.toLowerCase()) {
|
|
397
397
|
case "content-type":
|
|
398
398
|
case "content-length":
|
|
399
399
|
case "accept-encoding":
|
|
@@ -402,33 +402,33 @@ ${r}`);
|
|
|
402
402
|
return !0;
|
|
403
403
|
}
|
|
404
404
|
});
|
|
405
|
-
if (
|
|
406
|
-
o(`{ "${
|
|
405
|
+
if (h.length && (o("Headers =", 1), o("{", 1), h.forEach((d) => {
|
|
406
|
+
o(`{ "${d}", "${D(e[d])}" },`, 2);
|
|
407
407
|
}), o("},", 1)), t.text) {
|
|
408
|
-
const
|
|
409
|
-
switch (
|
|
408
|
+
const d = t.mimeType;
|
|
409
|
+
switch (d) {
|
|
410
410
|
case "application/x-www-form-urlencoded":
|
|
411
411
|
o("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), o("{", 1), (a = t.params) == null || a.forEach((m) => {
|
|
412
412
|
o(`{ "${m.name}", "${m.value}" },`, 2);
|
|
413
413
|
}), o("}),", 1);
|
|
414
414
|
break;
|
|
415
415
|
case "multipart/form-data":
|
|
416
|
-
o("Content = new MultipartFormDataContent", 1), o("{", 1), (
|
|
416
|
+
o("Content = new MultipartFormDataContent", 1), o("{", 1), (i = t.params) == null || i.forEach((m) => {
|
|
417
417
|
o(`new StringContent(${JSON.stringify(m.value || "")})`, 2), o("{", 2), o("Headers =", 3), o("{", 3), m.contentType && o(`ContentType = new MediaTypeHeaderValue("${m.contentType}"),`, 4), o('ContentDisposition = new ContentDispositionHeaderValue("form-data")', 4), o("{", 4), o(`Name = "${m.name}",`, 5), m.fileName && o(`FileName = "${m.fileName}",`, 5), o("}", 4), o("}", 3), o("},", 2);
|
|
418
418
|
}), o("},", 1);
|
|
419
419
|
break;
|
|
420
420
|
default:
|
|
421
|
-
o(`Content = new StringContent(${JSON.stringify(t.text || "")})`, 1), o("{", 1), o("Headers =", 2), o("{", 2), o(`ContentType = new MediaTypeHeaderValue("${
|
|
421
|
+
o(`Content = new StringContent(${JSON.stringify(t.text || "")})`, 1), o("{", 1), o("Headers =", 2), o("{", 2), o(`ContentType = new MediaTypeHeaderValue("${d}")`, 3), o("}", 2), o("}", 1);
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
return o("};"), o("using (var response = await client.SendAsync(request))"), o("{"), o("response.EnsureSuccessStatusCode();", 1), o("var body = await response.Content.ReadAsStringAsync();", 1), o("Console.WriteLine(body);", 1), o("}"),
|
|
425
|
+
return o("};"), o("using (var response = await client.SendAsync(request))"), o("{"), o("response.EnsureSuccessStatusCode();", 1), o("var body = await response.Content.ReadAsStringAsync();", 1), o("Console.WriteLine(body);", 1), o("}"), s();
|
|
426
426
|
}
|
|
427
427
|
};
|
|
428
|
-
function
|
|
428
|
+
function Gn(e) {
|
|
429
429
|
return e[0].toUpperCase() + e.slice(1).toLowerCase();
|
|
430
430
|
}
|
|
431
|
-
const
|
|
431
|
+
const Qn = {
|
|
432
432
|
info: {
|
|
433
433
|
key: "csharp",
|
|
434
434
|
title: "C#",
|
|
@@ -436,7 +436,7 @@ const to = {
|
|
|
436
436
|
cli: "dotnet"
|
|
437
437
|
},
|
|
438
438
|
clientsById: {
|
|
439
|
-
httpclient:
|
|
439
|
+
httpclient: Vn,
|
|
440
440
|
restsharp: {
|
|
441
441
|
info: {
|
|
442
442
|
key: "restsharp",
|
|
@@ -447,7 +447,7 @@ const to = {
|
|
|
447
447
|
installation: () => "dotnet add package RestSharp"
|
|
448
448
|
},
|
|
449
449
|
convert: ({ method: e, fullUrl: t, headersObj: r, cookies: n, postData: l, uriObj: a }) => {
|
|
450
|
-
const { push:
|
|
450
|
+
const { push: i, join: o } = new k();
|
|
451
451
|
if (![
|
|
452
452
|
"GET",
|
|
453
453
|
"POST",
|
|
@@ -457,46 +457,46 @@ const to = {
|
|
|
457
457
|
"HEAD",
|
|
458
458
|
"OPTIONS"
|
|
459
459
|
].includes(e.toUpperCase())) return "Method not supported";
|
|
460
|
-
|
|
460
|
+
i(`using RestSharp;
|
|
461
461
|
|
|
462
|
-
`),
|
|
463
|
-
const
|
|
464
|
-
switch (
|
|
462
|
+
`), i(`var options = new RestClientOptions("${t}");`), i("var client = new RestClient(options);"), i('var request = new RestRequest("");');
|
|
463
|
+
const s = l.mimeType && l.mimeType === "multipart/form-data";
|
|
464
|
+
switch (s && i("request.AlwaysMultipartFormData = true;"), Object.keys(r).forEach((c) => {
|
|
465
465
|
if (l.mimeType && c.toLowerCase() === "content-type" && l.text) {
|
|
466
|
-
|
|
466
|
+
s && l.boundary && i(`request.FormBoundary = "${l.boundary}";`);
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
|
-
|
|
469
|
+
i(`request.AddHeader("${c}", "${D(r[c])}");`);
|
|
470
470
|
}), n.forEach(({ name: c, value: p }) => {
|
|
471
|
-
|
|
471
|
+
i(`request.AddCookie("${c}", "${D(p)}", "${a.pathname}", "${a.host}");`);
|
|
472
472
|
}), l.mimeType) {
|
|
473
473
|
case "multipart/form-data":
|
|
474
474
|
if (!l.params) break;
|
|
475
475
|
l.params.forEach((c) => {
|
|
476
|
-
c.fileName ?
|
|
476
|
+
c.fileName ? i(`request.AddFile("${c.name}", "${c.fileName}");`) : i(`request.AddParameter("${c.name}", "${c.value}");`);
|
|
477
477
|
});
|
|
478
478
|
break;
|
|
479
479
|
case "application/x-www-form-urlencoded":
|
|
480
480
|
if (!l.params) break;
|
|
481
481
|
l.params.forEach((c) => {
|
|
482
|
-
|
|
482
|
+
i(`request.AddParameter("${c.name}", "${c.value}");`);
|
|
483
483
|
});
|
|
484
484
|
break;
|
|
485
485
|
case "application/json":
|
|
486
486
|
if (!l.text) break;
|
|
487
|
-
|
|
487
|
+
i(`request.AddJsonBody(${JSON.stringify(l.text)}, false);`);
|
|
488
488
|
break;
|
|
489
489
|
default:
|
|
490
490
|
if (!l.text) break;
|
|
491
|
-
|
|
491
|
+
i(`request.AddStringBody("${l.text}", "${l.mimeType}");`);
|
|
492
492
|
}
|
|
493
|
-
return
|
|
494
|
-
`),
|
|
493
|
+
return i(`var response = await client.${Gn(e)}Async(request);
|
|
494
|
+
`), i(`Console.WriteLine("{0}", response.Content);
|
|
495
495
|
`), o();
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
},
|
|
499
|
+
}, Yn = {
|
|
500
500
|
info: {
|
|
501
501
|
key: "go",
|
|
502
502
|
title: "Go",
|
|
@@ -512,18 +512,18 @@ const to = {
|
|
|
512
512
|
extname: ".go"
|
|
513
513
|
},
|
|
514
514
|
convert: ({ postData: e, method: t, allHeaders: r, fullUrl: n }, l = {}) => {
|
|
515
|
-
const { blank: a, push:
|
|
516
|
-
c && (
|
|
515
|
+
const { blank: a, push: i, join: o } = new k({ indent: " " }), { showBoilerplate: s = !0, checkErrors: c = !1, printBody: p = !0, timeout: f = -1, insecureSkipVerify: u = !1 } = l, h = c ? "err" : "_", d = s ? 1 : 0, m = () => {
|
|
516
|
+
c && (i("if err != nil {", d), i("panic(err)", d + 1), i("}", d));
|
|
517
517
|
};
|
|
518
|
-
|
|
518
|
+
s && (i("package main"), a(), i("import ("), i('"fmt"', d), f > 0 && i('"time"', d), u && i('"crypto/tls"', d), e.text && i('"strings"', d), i('"net/http"', d), p && i('"io"', d), i(")"), a(), i("func main() {"), a()), u && (i("insecureTransport := http.DefaultTransport.(*http.Transport).Clone()", d), i("insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}", d));
|
|
519
519
|
const b = f > 0, j = b || u, y = j ? "client" : "http.DefaultClient";
|
|
520
|
-
return j && (
|
|
521
|
-
|
|
522
|
-
}), a()),
|
|
520
|
+
return j && (i("client := http.Client{", d), b && i(`Timeout: time.Duration(${f} * time.Second),`, d + 1), u && i("Transport: insecureTransport,", d + 1), i("}", d), a()), i(`url := "${n}"`, d), a(), e.text ? (i(`payload := strings.NewReader(${JSON.stringify(e.text)})`, d), a(), i(`req, ${h} := http.NewRequest("${t}", url, payload)`, d), a()) : (i(`req, ${h} := http.NewRequest("${t}", url, nil)`, d), a()), m(), Object.keys(r).length && (Object.keys(r).forEach((g) => {
|
|
521
|
+
i(`req.Header.Add("${g}", "${D(r[g])}")`, d);
|
|
522
|
+
}), a()), i(`res, ${h} := ${y}.Do(req)`, d), m(), p && (a(), i("defer res.Body.Close()", d), i(`body, ${h} := io.ReadAll(res.Body)`, d), m()), a(), p && i("fmt.Println(string(body))", d), s && (a(), i("}")), o();
|
|
523
523
|
}
|
|
524
524
|
} }
|
|
525
|
-
},
|
|
526
|
-
`,
|
|
525
|
+
}, or = `\r
|
|
526
|
+
`, Xn = {
|
|
527
527
|
info: {
|
|
528
528
|
key: "http",
|
|
529
529
|
title: "HTTP",
|
|
@@ -537,27 +537,27 @@ const to = {
|
|
|
537
537
|
description: "HTTP/1.1 request string in accordance with RFC 7230",
|
|
538
538
|
extname: null
|
|
539
539
|
},
|
|
540
|
-
convert: ({ method: e, fullUrl: t, uriObj: r, httpVersion: n, allHeaders: l, postData: a },
|
|
540
|
+
convert: ({ method: e, fullUrl: t, uriObj: r, httpVersion: n, allHeaders: l, postData: a }, i) => {
|
|
541
541
|
const o = {
|
|
542
542
|
absoluteURI: !1,
|
|
543
543
|
autoContentLength: !0,
|
|
544
544
|
autoHost: !0,
|
|
545
|
-
...
|
|
546
|
-
}, { blank:
|
|
545
|
+
...i
|
|
546
|
+
}, { blank: s, push: c, join: p } = new k({
|
|
547
547
|
indent: "",
|
|
548
|
-
join:
|
|
548
|
+
join: or
|
|
549
549
|
});
|
|
550
550
|
c(`${e} ${o.absoluteURI ? t : r.path} ${n}`);
|
|
551
551
|
const f = Object.keys(l);
|
|
552
|
-
f.forEach((
|
|
553
|
-
const m =
|
|
554
|
-
c(`${m}: ${l[
|
|
555
|
-
}), o.autoHost && !f.includes("host") && c(`Host: ${r.host}`), o.autoContentLength && a.text && !f.includes("content-length") && c(`Content-Length: ${Buffer.byteLength(a.text, "ascii").toString()}`),
|
|
556
|
-
const u = p(),
|
|
557
|
-
return `${u}${
|
|
552
|
+
f.forEach((d) => {
|
|
553
|
+
const m = d.toLowerCase().replace(/(^|-)(\w)/g, (b) => b.toUpperCase());
|
|
554
|
+
c(`${m}: ${l[d]}`);
|
|
555
|
+
}), o.autoHost && !f.includes("host") && c(`Host: ${r.host}`), o.autoContentLength && a.text && !f.includes("content-length") && c(`Content-Length: ${Buffer.byteLength(a.text, "ascii").toString()}`), s();
|
|
556
|
+
const u = p(), h = a.text || "";
|
|
557
|
+
return `${u}${or}${h}`;
|
|
558
558
|
}
|
|
559
559
|
} }
|
|
560
|
-
},
|
|
560
|
+
}, Zn = {
|
|
561
561
|
info: {
|
|
562
562
|
key: "java",
|
|
563
563
|
title: "Java",
|
|
@@ -573,13 +573,13 @@ const to = {
|
|
|
573
573
|
extname: ".java"
|
|
574
574
|
},
|
|
575
575
|
convert: ({ method: e, allHeaders: t, postData: r, fullUrl: n }, l) => {
|
|
576
|
-
const { blank: a, push:
|
|
576
|
+
const { blank: a, push: i, join: o } = new k({ indent: {
|
|
577
577
|
indent: " ",
|
|
578
578
|
...l
|
|
579
579
|
}.indent });
|
|
580
|
-
return
|
|
581
|
-
|
|
582
|
-
}), r.text &&
|
|
580
|
+
return i("AsyncHttpClient client = new DefaultAsyncHttpClient();"), i(`client.prepare("${e.toUpperCase()}", "${n}")`), Object.keys(t).forEach((s) => {
|
|
581
|
+
i(`.setHeader("${s}", "${D(t[s])}")`, 1);
|
|
582
|
+
}), r.text && i(`.setBody(${JSON.stringify(r.text)})`, 1), i(".execute()", 1), i(".toCompletableFuture()", 1), i(".thenAccept(System.out::println)", 1), i(".join();", 1), a(), i("client.close();"), o();
|
|
583
583
|
}
|
|
584
584
|
},
|
|
585
585
|
nethttp: {
|
|
@@ -591,13 +591,13 @@ const to = {
|
|
|
591
591
|
extname: ".java"
|
|
592
592
|
},
|
|
593
593
|
convert: ({ allHeaders: e, fullUrl: t, method: r, postData: n }, l) => {
|
|
594
|
-
const { push: a, join:
|
|
594
|
+
const { push: a, join: i } = new k({ indent: {
|
|
595
595
|
indent: " ",
|
|
596
596
|
...l
|
|
597
597
|
}.indent });
|
|
598
598
|
return a("HttpRequest request = HttpRequest.newBuilder()"), a(`.uri(URI.create("${t}"))`, 2), Object.keys(e).forEach((o) => {
|
|
599
599
|
a(`.header("${o}", "${D(e[o])}")`, 2);
|
|
600
|
-
}), n.text ? a(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(n.text)}))`, 2) : a(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), a(".build();", 2), a("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"), a("System.out.println(response.body());"),
|
|
600
|
+
}), n.text ? a(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(n.text)}))`, 2) : a(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), a(".build();", 2), a("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"), a("System.out.println(response.body());"), i();
|
|
601
601
|
}
|
|
602
602
|
},
|
|
603
603
|
okhttp: {
|
|
@@ -609,10 +609,10 @@ const to = {
|
|
|
609
609
|
extname: ".java"
|
|
610
610
|
},
|
|
611
611
|
convert: ({ postData: e, method: t, fullUrl: r, allHeaders: n }, l) => {
|
|
612
|
-
const { push: a, blank:
|
|
612
|
+
const { push: a, blank: i, join: o } = new k({ indent: {
|
|
613
613
|
indent: " ",
|
|
614
614
|
...l
|
|
615
|
-
}.indent }),
|
|
615
|
+
}.indent }), s = [
|
|
616
616
|
"GET",
|
|
617
617
|
"POST",
|
|
618
618
|
"PUT",
|
|
@@ -625,9 +625,9 @@ const to = {
|
|
|
625
625
|
"DELETE",
|
|
626
626
|
"PATCH"
|
|
627
627
|
];
|
|
628
|
-
return a("OkHttpClient client = new OkHttpClient();"),
|
|
628
|
+
return a("OkHttpClient client = new OkHttpClient();"), i(), e.text && (e.boundary ? a(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`) : a(`MediaType mediaType = MediaType.parse("${e.mimeType}");`), a(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)), a("Request request = new Request.Builder()"), a(`.url("${r}")`, 1), s.includes(t.toUpperCase()) ? c.includes(t.toUpperCase()) ? e.text ? a(`.${t.toLowerCase()}(body)`, 1) : a(`.${t.toLowerCase()}(null)`, 1) : a(`.${t.toLowerCase()}()`, 1) : e.text ? a(`.method("${t.toUpperCase()}", body)`, 1) : a(`.method("${t.toUpperCase()}", null)`, 1), Object.keys(n).forEach((p) => {
|
|
629
629
|
a(`.addHeader("${p}", "${D(n[p])}")`, 1);
|
|
630
|
-
}), a(".build();", 1),
|
|
630
|
+
}), a(".build();", 1), i(), a("Response response = client.newCall(request).execute();"), o();
|
|
631
631
|
}
|
|
632
632
|
},
|
|
633
633
|
unirest: {
|
|
@@ -639,7 +639,7 @@ const to = {
|
|
|
639
639
|
extname: ".java"
|
|
640
640
|
},
|
|
641
641
|
convert: ({ method: e, allHeaders: t, postData: r, fullUrl: n }, l) => {
|
|
642
|
-
const { join: a, push:
|
|
642
|
+
const { join: a, push: i } = new k({ indent: {
|
|
643
643
|
indent: " ",
|
|
644
644
|
...l
|
|
645
645
|
}.indent });
|
|
@@ -651,13 +651,13 @@ const to = {
|
|
|
651
651
|
"PATCH",
|
|
652
652
|
"HEAD",
|
|
653
653
|
"OPTIONS"
|
|
654
|
-
].includes(e.toUpperCase()) ?
|
|
655
|
-
|
|
656
|
-
}), r.text &&
|
|
654
|
+
].includes(e.toUpperCase()) ? i(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${n}")`) : i(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${n}")`), Object.keys(t).forEach((o) => {
|
|
655
|
+
i(`.header("${o}", "${D(t[o])}")`, 1);
|
|
656
|
+
}), r.text && i(`.body(${JSON.stringify(r.text)})`, 1), i(".asString();", 1), a();
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
},
|
|
660
|
+
}, eo = {
|
|
661
661
|
info: {
|
|
662
662
|
key: "javascript",
|
|
663
663
|
title: "JavaScript",
|
|
@@ -674,19 +674,19 @@ const to = {
|
|
|
674
674
|
},
|
|
675
675
|
convert: ({ postData: e, allHeaders: t, method: r, fullUrl: n }, l) => {
|
|
676
676
|
var a;
|
|
677
|
-
const
|
|
677
|
+
const i = {
|
|
678
678
|
indent: " ",
|
|
679
679
|
cors: !0,
|
|
680
680
|
...l
|
|
681
|
-
}, { blank: o, push:
|
|
681
|
+
}, { blank: o, push: s, join: c } = new k({ indent: i.indent });
|
|
682
682
|
switch (e.mimeType) {
|
|
683
683
|
case "application/json":
|
|
684
|
-
|
|
684
|
+
s(`const data = JSON.stringify(${ae(e.jsonObj, { indent: i.indent })});`), o();
|
|
685
685
|
break;
|
|
686
686
|
case "multipart/form-data":
|
|
687
687
|
if (!e.params) break;
|
|
688
|
-
if (
|
|
689
|
-
|
|
688
|
+
if (s("const data = new FormData();"), e.params.forEach((p) => {
|
|
689
|
+
s(`data.append('${p.name}', '${p.value || p.fileName || ""}');`);
|
|
690
690
|
}), nt(t, "content-type") && (a = le(t, "content-type")) != null && a.includes("boundary")) {
|
|
691
691
|
const p = W(t, "content-type");
|
|
692
692
|
p && delete t[p];
|
|
@@ -694,11 +694,11 @@ const to = {
|
|
|
694
694
|
o();
|
|
695
695
|
break;
|
|
696
696
|
default:
|
|
697
|
-
|
|
697
|
+
s(`const data = ${e.text ? `'${e.text}'` : "null"};`), o();
|
|
698
698
|
}
|
|
699
|
-
return
|
|
700
|
-
|
|
701
|
-
}), o(),
|
|
699
|
+
return s("const xhr = new XMLHttpRequest();"), i.cors && s("xhr.withCredentials = true;"), o(), s("xhr.addEventListener('readystatechange', function () {"), s("if (this.readyState === this.DONE) {", 1), s("console.log(this.responseText);", 2), s("}", 1), s("});"), o(), s(`xhr.open('${r}', '${n}');`), Object.keys(t).forEach((p) => {
|
|
700
|
+
s(`xhr.setRequestHeader('${p}', '${Ae(t[p])}');`);
|
|
701
|
+
}), o(), s("xhr.send(data);"), c();
|
|
702
702
|
}
|
|
703
703
|
},
|
|
704
704
|
axios: {
|
|
@@ -711,11 +711,11 @@ const to = {
|
|
|
711
711
|
installation: () => "npm install axios --save"
|
|
712
712
|
},
|
|
713
713
|
convert: ({ allHeaders: e, method: t, url: r, queryObj: n, postData: l }, a) => {
|
|
714
|
-
const { blank:
|
|
714
|
+
const { blank: i, push: o, join: s, addPostProcessor: c } = new k({ indent: {
|
|
715
715
|
indent: " ",
|
|
716
716
|
...a
|
|
717
717
|
}.indent });
|
|
718
|
-
o("import axios from 'axios';"),
|
|
718
|
+
o("import axios from 'axios';"), i();
|
|
719
719
|
const p = {
|
|
720
720
|
method: t,
|
|
721
721
|
url: r
|
|
@@ -724,7 +724,7 @@ const to = {
|
|
|
724
724
|
case "application/x-www-form-urlencoded":
|
|
725
725
|
l.params && (o("const encodedParams = new URLSearchParams();"), l.params.forEach((f) => {
|
|
726
726
|
o(`encodedParams.set('${f.name}', '${f.value}');`);
|
|
727
|
-
}),
|
|
727
|
+
}), i(), p.data = "encodedParams,", c((f) => f.replace(/'encodedParams,'/, "encodedParams,")));
|
|
728
728
|
break;
|
|
729
729
|
case "application/json":
|
|
730
730
|
l.jsonObj && (p.data = l.jsonObj);
|
|
@@ -733,7 +733,7 @@ const to = {
|
|
|
733
733
|
if (!l.params) break;
|
|
734
734
|
o("const form = new FormData();"), l.params.forEach((f) => {
|
|
735
735
|
o(`form.append('${f.name}', '${f.value || f.fileName || ""}');`);
|
|
736
|
-
}),
|
|
736
|
+
}), i(), p.data = "[form]";
|
|
737
737
|
break;
|
|
738
738
|
default:
|
|
739
739
|
l.text && (p.data = l.text);
|
|
@@ -741,7 +741,7 @@ const to = {
|
|
|
741
741
|
return o(`const options = ${ae(p, {
|
|
742
742
|
indent: " ",
|
|
743
743
|
inlineCharacterLimit: 80
|
|
744
|
-
}).replace('"[form]"', "form")};`),
|
|
744
|
+
}).replace('"[form]"', "form")};`), i(), o("try {"), o("const { data } = await axios.request(options);", 1), o("console.log(data);", 1), o("} catch (error) {"), o("console.error(error);", 1), o("}"), s();
|
|
745
745
|
}
|
|
746
746
|
},
|
|
747
747
|
fetch: {
|
|
@@ -757,7 +757,7 @@ const to = {
|
|
|
757
757
|
indent: " ",
|
|
758
758
|
credentials: null,
|
|
759
759
|
...l
|
|
760
|
-
}, { blank:
|
|
760
|
+
}, { blank: i, join: o, push: s } = new k({ indent: a.indent }), c = { method: e };
|
|
761
761
|
switch (Object.keys(t).length && (c.headers = t), a.credentials !== null && (c.credentials = a.credentials), r.mimeType) {
|
|
762
762
|
case "application/x-www-form-urlencoded":
|
|
763
763
|
c.body = r.paramsObj ? r.paramsObj : r.text;
|
|
@@ -768,15 +768,15 @@ const to = {
|
|
|
768
768
|
case "multipart/form-data": {
|
|
769
769
|
if (!r.params) break;
|
|
770
770
|
const p = W(t, "content-type");
|
|
771
|
-
p && delete t[p],
|
|
772
|
-
|
|
773
|
-
}),
|
|
771
|
+
p && delete t[p], s("const form = new FormData();"), r.params.forEach((f) => {
|
|
772
|
+
s(`form.append('${f.name}', '${f.value || f.fileName || ""}');`);
|
|
773
|
+
}), i();
|
|
774
774
|
break;
|
|
775
775
|
}
|
|
776
776
|
default:
|
|
777
777
|
r.text && (c.body = r.text);
|
|
778
778
|
}
|
|
779
|
-
return c.headers && !Object.keys(c.headers).length && delete c.headers,
|
|
779
|
+
return c.headers && !Object.keys(c.headers).length && delete c.headers, s(`const options = ${ae(c, {
|
|
780
780
|
indent: a.indent,
|
|
781
781
|
inlineCharacterLimit: 80,
|
|
782
782
|
transform: (p, f, u) => {
|
|
@@ -786,7 +786,7 @@ const to = {
|
|
|
786
786
|
}
|
|
787
787
|
return u;
|
|
788
788
|
}
|
|
789
|
-
})};`),
|
|
789
|
+
})};`), i(), r.params && r.mimeType === "multipart/form-data" && (s("options.body = form;"), i()), s(`fetch('${n}', options)`), s(".then(res => res.json())", 1), s(".then(res => console.log(res))", 1), s(".catch(err => console.error(err));", 1), o();
|
|
790
790
|
}
|
|
791
791
|
},
|
|
792
792
|
jquery: {
|
|
@@ -799,10 +799,10 @@ const to = {
|
|
|
799
799
|
},
|
|
800
800
|
convert: ({ fullUrl: e, method: t, allHeaders: r, postData: n }, l) => {
|
|
801
801
|
var a;
|
|
802
|
-
const
|
|
802
|
+
const i = {
|
|
803
803
|
indent: " ",
|
|
804
804
|
...l
|
|
805
|
-
}, { blank: o, push:
|
|
805
|
+
}, { blank: o, push: s, join: c } = new k({ indent: i.indent }), p = {
|
|
806
806
|
async: !0,
|
|
807
807
|
crossDomain: !0,
|
|
808
808
|
url: e,
|
|
@@ -818,8 +818,8 @@ const to = {
|
|
|
818
818
|
break;
|
|
819
819
|
case "multipart/form-data":
|
|
820
820
|
if (!n.params) break;
|
|
821
|
-
if (
|
|
822
|
-
|
|
821
|
+
if (s("const form = new FormData();"), n.params.forEach((f) => {
|
|
822
|
+
s(`form.append('${f.name}', '${f.value || f.fileName || ""}');`);
|
|
823
823
|
}), p.processData = !1, p.contentType = !1, p.mimeType = "multipart/form-data", p.data = "[form]", nt(r, "content-type") && (a = le(r, "content-type")) != null && a.includes("boundary")) {
|
|
824
824
|
const f = W(r, "content-type");
|
|
825
825
|
f && delete p.headers[f];
|
|
@@ -829,11 +829,11 @@ const to = {
|
|
|
829
829
|
default:
|
|
830
830
|
n.text && (p.data = n.text);
|
|
831
831
|
}
|
|
832
|
-
return
|
|
832
|
+
return s(`const settings = ${ae(p, { indent: i.indent }).replace("'[form]'", "form")};`), o(), s("$.ajax(settings).done(res => {"), s("console.log(res);", 1), s("});"), c();
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
},
|
|
836
|
+
}, to = {
|
|
837
837
|
info: {
|
|
838
838
|
key: "json",
|
|
839
839
|
title: "JSON",
|
|
@@ -874,7 +874,7 @@ const to = {
|
|
|
874
874
|
return typeof n > "u" || n === "" ? "No JSON body" : JSON.stringify(n, null, r.indent);
|
|
875
875
|
}
|
|
876
876
|
} }
|
|
877
|
-
},
|
|
877
|
+
}, ro = {
|
|
878
878
|
info: {
|
|
879
879
|
key: "kotlin",
|
|
880
880
|
title: "Kotlin",
|
|
@@ -889,10 +889,10 @@ const to = {
|
|
|
889
889
|
extname: ".kt"
|
|
890
890
|
},
|
|
891
891
|
convert: ({ postData: e, fullUrl: t, method: r, allHeaders: n }, l) => {
|
|
892
|
-
const { blank: a, join:
|
|
892
|
+
const { blank: a, join: i, push: o } = new k({ indent: {
|
|
893
893
|
indent: " ",
|
|
894
894
|
...l
|
|
895
|
-
}.indent }),
|
|
895
|
+
}.indent }), s = [
|
|
896
896
|
"GET",
|
|
897
897
|
"POST",
|
|
898
898
|
"PUT",
|
|
@@ -905,12 +905,12 @@ const to = {
|
|
|
905
905
|
"DELETE",
|
|
906
906
|
"PATCH"
|
|
907
907
|
];
|
|
908
|
-
return o("val client = OkHttpClient()"), a(), e.text && (e.boundary ? o(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`) : o(`val mediaType = MediaType.parse("${e.mimeType}")`), o(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)), o("val request = Request.Builder()"), o(`.url("${t}")`, 1),
|
|
908
|
+
return o("val client = OkHttpClient()"), a(), e.text && (e.boundary ? o(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`) : o(`val mediaType = MediaType.parse("${e.mimeType}")`), o(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)), o("val request = Request.Builder()"), o(`.url("${t}")`, 1), s.includes(r.toUpperCase()) ? c.includes(r.toUpperCase()) ? e.text ? o(`.${r.toLowerCase()}(body)`, 1) : o(`.${r.toLowerCase()}(null)`, 1) : o(`.${r.toLowerCase()}()`, 1) : e.text ? o(`.method("${r.toUpperCase()}", body)`, 1) : o(`.method("${r.toUpperCase()}", null)`, 1), Object.keys(n).forEach((p) => {
|
|
909
909
|
o(`.addHeader("${p}", "${D(n[p])}")`, 1);
|
|
910
|
-
}), o(".build()", 1), a(), o("val response = client.newCall(request).execute()"),
|
|
910
|
+
}), o(".build()", 1), a(), o("val response = client.newCall(request).execute()"), i();
|
|
911
911
|
}
|
|
912
912
|
} }
|
|
913
|
-
},
|
|
913
|
+
}, no = {
|
|
914
914
|
info: {
|
|
915
915
|
key: "node",
|
|
916
916
|
title: "Node.js",
|
|
@@ -928,14 +928,14 @@ const to = {
|
|
|
928
928
|
},
|
|
929
929
|
convert: ({ uriObj: e, method: t, allHeaders: r, postData: n }, l = {}) => {
|
|
930
930
|
var a;
|
|
931
|
-
const { indent:
|
|
931
|
+
const { indent: i = " " } = l, { blank: o, join: s, push: c, unshift: p } = new k({ indent: i }), f = {
|
|
932
932
|
method: t,
|
|
933
933
|
hostname: e.hostname,
|
|
934
934
|
port: e.port,
|
|
935
935
|
path: e.path,
|
|
936
936
|
headers: r
|
|
937
937
|
};
|
|
938
|
-
switch (c(`const http = require('${(a = e.protocol) == null ? void 0 : a.replace(":", "")}');`), o(), c(`const options = ${ae(f, { indent:
|
|
938
|
+
switch (c(`const http = require('${(a = e.protocol) == null ? void 0 : a.replace(":", "")}');`), o(), c(`const options = ${ae(f, { indent: i })};`), o(), c("const req = http.request(options, function (res) {"), c("const chunks = [];", 1), o(), c("res.on('data', function (chunk) {", 1), c("chunks.push(chunk);", 2), c("});", 1), o(), c("res.on('end', function () {", 1), c("const body = Buffer.concat(chunks);", 2), c("console.log(body.toString());", 2), c("});", 1), c("});"), o(), n.mimeType) {
|
|
939
939
|
case "application/x-www-form-urlencoded":
|
|
940
940
|
n.paramsObj && (p("const qs = require('querystring');"), c(`req.write(qs.stringify(${ae(n.paramsObj, {
|
|
941
941
|
indent: " ",
|
|
@@ -949,9 +949,9 @@ const to = {
|
|
|
949
949
|
})}));`);
|
|
950
950
|
break;
|
|
951
951
|
default:
|
|
952
|
-
n.text && c(`req.write(${ae(n.text, { indent:
|
|
952
|
+
n.text && c(`req.write(${ae(n.text, { indent: i })});`);
|
|
953
953
|
}
|
|
954
|
-
return c("req.end();"),
|
|
954
|
+
return c("req.end();"), s();
|
|
955
955
|
}
|
|
956
956
|
},
|
|
957
957
|
axios: {
|
|
@@ -964,7 +964,7 @@ const to = {
|
|
|
964
964
|
installation: () => "npm install axios --save"
|
|
965
965
|
},
|
|
966
966
|
convert: ({ method: e, fullUrl: t, allHeaders: r, postData: n }, l) => {
|
|
967
|
-
const { blank: a, join:
|
|
967
|
+
const { blank: a, join: i, push: o, addPostProcessor: s } = new k({ indent: {
|
|
968
968
|
indent: " ",
|
|
969
969
|
...l
|
|
970
970
|
}.indent });
|
|
@@ -977,7 +977,7 @@ const to = {
|
|
|
977
977
|
case "application/x-www-form-urlencoded":
|
|
978
978
|
n.params && (o("const encodedParams = new URLSearchParams();"), n.params.forEach((p) => {
|
|
979
979
|
o(`encodedParams.set('${p.name}', '${p.value}');`);
|
|
980
|
-
}), a(), c.data = "encodedParams,",
|
|
980
|
+
}), a(), c.data = "encodedParams,", s((p) => p.replace(/'encodedParams,'/, "encodedParams,")));
|
|
981
981
|
break;
|
|
982
982
|
case "application/json":
|
|
983
983
|
n.jsonObj && (c.data = n.jsonObj);
|
|
@@ -988,7 +988,7 @@ const to = {
|
|
|
988
988
|
return o(`const options = ${ae(c, {
|
|
989
989
|
indent: " ",
|
|
990
990
|
inlineCharacterLimit: 80
|
|
991
|
-
})};`), a(), o("axios"), o(".request(options)", 1), o(".then(res => console.log(res.data))", 1), o(".catch(err => console.error(err));", 1),
|
|
991
|
+
})};`), a(), o("axios"), o(".request(options)", 1), o(".then(res => console.log(res.data))", 1), o(".catch(err => console.error(err));", 1), i();
|
|
992
992
|
}
|
|
993
993
|
},
|
|
994
994
|
fetch: {
|
|
@@ -1000,21 +1000,21 @@ const to = {
|
|
|
1000
1000
|
extname: ".js"
|
|
1001
1001
|
},
|
|
1002
1002
|
convert: ({ method: e, fullUrl: t, postData: r, headersObj: n, cookies: l }, a) => {
|
|
1003
|
-
var
|
|
1003
|
+
var i;
|
|
1004
1004
|
const o = {
|
|
1005
1005
|
indent: " ",
|
|
1006
1006
|
...a
|
|
1007
1007
|
};
|
|
1008
|
-
let
|
|
1009
|
-
const { blank: c, push: p, join: f, unshift: u } = new k({ indent: o.indent }),
|
|
1010
|
-
switch (Object.keys(n).length && (
|
|
1008
|
+
let s = !1;
|
|
1009
|
+
const { blank: c, push: p, join: f, unshift: u } = new k({ indent: o.indent }), h = t, d = { method: e };
|
|
1010
|
+
switch (Object.keys(n).length && (d.headers = n), r.mimeType) {
|
|
1011
1011
|
case "application/x-www-form-urlencoded":
|
|
1012
|
-
p("const encodedParams = new URLSearchParams();"), (
|
|
1012
|
+
p("const encodedParams = new URLSearchParams();"), (i = r.params) == null || i.forEach((m) => {
|
|
1013
1013
|
p(`encodedParams.set('${m.name}', '${m.value}');`);
|
|
1014
|
-
}),
|
|
1014
|
+
}), d.body = "encodedParams", c();
|
|
1015
1015
|
break;
|
|
1016
1016
|
case "application/json":
|
|
1017
|
-
r.jsonObj && (
|
|
1017
|
+
r.jsonObj && (d.body = r.jsonObj);
|
|
1018
1018
|
break;
|
|
1019
1019
|
case "multipart/form-data": {
|
|
1020
1020
|
if (!r.params) break;
|
|
@@ -1024,41 +1024,41 @@ const to = {
|
|
|
1024
1024
|
p(`formData.append('${b.name}', '${b.value}');`);
|
|
1025
1025
|
return;
|
|
1026
1026
|
}
|
|
1027
|
-
b.fileName && (
|
|
1028
|
-
}),
|
|
1027
|
+
b.fileName && (s = !0, p(`formData.append('${b.name}', await new Response(fs.createReadStream('${b.fileName}')).blob());`));
|
|
1028
|
+
}), d.body = "formData", c();
|
|
1029
1029
|
break;
|
|
1030
1030
|
}
|
|
1031
1031
|
default:
|
|
1032
|
-
r.text && (
|
|
1032
|
+
r.text && (d.body = r.text);
|
|
1033
1033
|
}
|
|
1034
1034
|
if (l.length) {
|
|
1035
1035
|
const m = l.map(({ name: b, value: j }) => `${encodeURIComponent(b)}=${encodeURIComponent(j)}`).join("; ");
|
|
1036
|
-
|
|
1036
|
+
d.headers || (d.headers = {}), d.headers.cookie = m;
|
|
1037
1037
|
}
|
|
1038
|
-
return p(`const url = '${
|
|
1038
|
+
return p(`const url = '${h}';`), d.headers && !Object.keys(d.headers).length && delete d.headers, p(`const options = ${ae(d, {
|
|
1039
1039
|
indent: " ",
|
|
1040
1040
|
inlineCharacterLimit: 80,
|
|
1041
1041
|
transform: (m, b, j) => b === "body" && r.mimeType === "application/json" ? `JSON.stringify(${j})` : j
|
|
1042
|
-
})};`), c(),
|
|
1042
|
+
})};`), c(), s && u(`import fs from 'fs';
|
|
1043
1043
|
`), p("fetch(url, options)"), p(".then(res => res.json())", 1), p(".then(json => console.log(json))", 1), p(".catch(err => console.error(err));", 1), f().replace(/'encodedParams'/, "encodedParams").replace(/'formData'/, "formData");
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
}, bt = (e, t, r, n) => {
|
|
1048
1048
|
const l = `${e} *${t} = `;
|
|
1049
|
-
return `${l}${
|
|
1050
|
-
},
|
|
1049
|
+
return `${l}${Nt(r, n ? l.length : void 0)};`;
|
|
1050
|
+
}, Nt = (e, t) => {
|
|
1051
1051
|
const r = t === void 0 ? ", " : `,
|
|
1052
1052
|
${" ".repeat(t)}`;
|
|
1053
1053
|
switch (Object.prototype.toString.call(e)) {
|
|
1054
1054
|
case "[object Number]":
|
|
1055
1055
|
return `@${e}`;
|
|
1056
1056
|
case "[object Array]":
|
|
1057
|
-
return `@[ ${e.map((n) =>
|
|
1057
|
+
return `@[ ${e.map((n) => Nt(n)).join(r)} ]`;
|
|
1058
1058
|
case "[object Object]": {
|
|
1059
1059
|
const n = [];
|
|
1060
1060
|
return Object.keys(e).forEach((l) => {
|
|
1061
|
-
n.push(`@"${l}": ${
|
|
1061
|
+
n.push(`@"${l}": ${Nt(e[l])}`);
|
|
1062
1062
|
}), `@{ ${n.join(r)} }`;
|
|
1063
1063
|
}
|
|
1064
1064
|
case "[object Boolean]":
|
|
@@ -1066,7 +1066,7 @@ const to = {
|
|
|
1066
1066
|
default:
|
|
1067
1067
|
return e == null ? "" : `@"${e.toString().replace(/"/g, '\\"')}"`;
|
|
1068
1068
|
}
|
|
1069
|
-
},
|
|
1069
|
+
}, oo = {
|
|
1070
1070
|
info: {
|
|
1071
1071
|
key: "objc",
|
|
1072
1072
|
title: "Objective-C",
|
|
@@ -1082,39 +1082,39 @@ const to = {
|
|
|
1082
1082
|
},
|
|
1083
1083
|
convert: ({ allHeaders: e, postData: t, method: r, fullUrl: n }, l) => {
|
|
1084
1084
|
var a;
|
|
1085
|
-
const
|
|
1085
|
+
const i = {
|
|
1086
1086
|
indent: " ",
|
|
1087
1087
|
pretty: !0,
|
|
1088
1088
|
timeout: 10,
|
|
1089
1089
|
...l
|
|
1090
|
-
}, { push: o, join:
|
|
1090
|
+
}, { push: o, join: s, blank: c } = new k({ indent: i.indent }), p = {
|
|
1091
1091
|
hasHeaders: !1,
|
|
1092
1092
|
hasBody: !1
|
|
1093
1093
|
};
|
|
1094
|
-
if (o("#import <Foundation/Foundation.h>"), Object.keys(e).length && (p.hasHeaders = !0, c(), o(bt("NSDictionary", "headers", e,
|
|
1094
|
+
if (o("#import <Foundation/Foundation.h>"), Object.keys(e).length && (p.hasHeaders = !0, c(), o(bt("NSDictionary", "headers", e, i.pretty))), t.text || t.jsonObj || t.params)
|
|
1095
1095
|
switch (p.hasBody = !0, t.mimeType) {
|
|
1096
1096
|
case "application/x-www-form-urlencoded":
|
|
1097
1097
|
if ((a = t.params) != null && a.length) {
|
|
1098
1098
|
c();
|
|
1099
1099
|
const [f, ...u] = t.params;
|
|
1100
|
-
o(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${f.name}=${f.value}" dataUsingEncoding:NSUTF8StringEncoding]];`), u.forEach(({ name:
|
|
1101
|
-
o(`[postData appendData:[@"&${
|
|
1100
|
+
o(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${f.name}=${f.value}" dataUsingEncoding:NSUTF8StringEncoding]];`), u.forEach(({ name: h, value: d }) => {
|
|
1101
|
+
o(`[postData appendData:[@"&${h}=${d}" dataUsingEncoding:NSUTF8StringEncoding]];`);
|
|
1102
1102
|
});
|
|
1103
1103
|
} else p.hasBody = !1;
|
|
1104
1104
|
break;
|
|
1105
1105
|
case "application/json":
|
|
1106
|
-
t.jsonObj && (o(bt("NSDictionary", "parameters", t.jsonObj,
|
|
1106
|
+
t.jsonObj && (o(bt("NSDictionary", "parameters", t.jsonObj, i.pretty)), c(), o("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));
|
|
1107
1107
|
break;
|
|
1108
1108
|
case "multipart/form-data":
|
|
1109
|
-
o(bt("NSArray", "parameters", t.params || [],
|
|
1109
|
+
o(bt("NSArray", "parameters", t.params || [], i.pretty)), o(`NSString *boundary = @"${t.boundary}";`), c(), o("NSError *error;"), o("NSMutableString *body = [NSMutableString string];"), o("for (NSDictionary *param in parameters) {"), o('[body appendFormat:@"--%@\\r\\n", boundary];', 1), o('if (param[@"fileName"]) {', 1), o('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];', 2), o('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2), o('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];', 2), o("if (error) {", 2), o('NSLog(@"%@", error);', 3), o("}", 2), o("} else {", 1), o('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];', 2), o('[body appendFormat:@"%@", param[@"value"]];', 2), o("}", 1), o("}"), o('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'), o("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");
|
|
1110
1110
|
break;
|
|
1111
1111
|
default:
|
|
1112
1112
|
c(), o(`NSData *postData = [[NSData alloc] initWithData:[@"${t.text}" dataUsingEncoding:NSUTF8StringEncoding]];`);
|
|
1113
1113
|
}
|
|
1114
|
-
return c(), o(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${n}"]`), o(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), o(` timeoutInterval:${
|
|
1114
|
+
return c(), o(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${n}"]`), o(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), o(` timeoutInterval:${i.timeout.toFixed(1)}];`), o(`[request setHTTPMethod:@"${r}"];`), p.hasHeaders && o("[request setAllHTTPHeaderFields:headers];"), p.hasBody && o("[request setHTTPBody:postData];"), c(), o("NSURLSession *session = [NSURLSession sharedSession];"), o("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"), o(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"), o(" if (error) {", 1), o(' NSLog(@"%@", error);', 2), o(" } else {", 1), o(" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;", 2), o(' NSLog(@"%@", httpResponse);', 2), o(" }", 1), o(" }];"), o("[dataTask resume];"), s();
|
|
1115
1115
|
}
|
|
1116
1116
|
} }
|
|
1117
|
-
},
|
|
1117
|
+
}, ao = {
|
|
1118
1118
|
info: {
|
|
1119
1119
|
key: "ocaml",
|
|
1120
1120
|
title: "OCaml",
|
|
@@ -1133,7 +1133,7 @@ const to = {
|
|
|
1133
1133
|
const a = {
|
|
1134
1134
|
indent: " ",
|
|
1135
1135
|
...l
|
|
1136
|
-
},
|
|
1136
|
+
}, i = [
|
|
1137
1137
|
"get",
|
|
1138
1138
|
"post",
|
|
1139
1139
|
"head",
|
|
@@ -1141,12 +1141,12 @@ const to = {
|
|
|
1141
1141
|
"patch",
|
|
1142
1142
|
"put",
|
|
1143
1143
|
"options"
|
|
1144
|
-
], { push: o, blank:
|
|
1145
|
-
o("open Cohttp_lwt_unix"), o("open Cohttp"), o("open Lwt"),
|
|
1144
|
+
], { push: o, blank: s, join: c } = new k({ indent: a.indent });
|
|
1145
|
+
o("open Cohttp_lwt_unix"), o("open Cohttp"), o("open Lwt"), s(), o(`let uri = Uri.of_string "${e}" in`);
|
|
1146
1146
|
const p = Object.keys(t);
|
|
1147
1147
|
return p.length === 1 ? o(`let headers = Header.add (Header.init ()) "${p[0]}" "${D(t[p[0]])}" in`) : p.length > 1 && (o("let headers = Header.add_list (Header.init ()) ["), p.forEach((f) => {
|
|
1148
1148
|
o(`("${f}", "${D(t[f])}");`, 1);
|
|
1149
|
-
}), o("] in")), r.text && o(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`),
|
|
1149
|
+
}), o("] in")), r.text && o(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`), s(), o(`Client.call ${p.length ? "~headers " : ""}${r.text ? "~body " : ""}${i.includes(n.toLowerCase()) ? `\`${n.toUpperCase()}` : `(Code.method_of_string "${n}")`} uri`), o(">>= fun (res, body_stream) ->"), o("(* Do stuff with the result *)", 1), c();
|
|
1150
1150
|
}
|
|
1151
1151
|
} }
|
|
1152
1152
|
}, A = (e, t, r) => {
|
|
@@ -1182,7 +1182,7 @@ ${r}]`;
|
|
|
1182
1182
|
default:
|
|
1183
1183
|
return "null";
|
|
1184
1184
|
}
|
|
1185
|
-
},
|
|
1185
|
+
}, ar = [
|
|
1186
1186
|
"ACL",
|
|
1187
1187
|
"BASELINE_CONTROL",
|
|
1188
1188
|
"CHECKIN",
|
|
@@ -1210,7 +1210,7 @@ ${r}]`;
|
|
|
1210
1210
|
"UNLOCK",
|
|
1211
1211
|
"UPDATE",
|
|
1212
1212
|
"VERSION_CONTROL"
|
|
1213
|
-
],
|
|
1213
|
+
], io = {
|
|
1214
1214
|
info: {
|
|
1215
1215
|
key: "php",
|
|
1216
1216
|
title: "PHP",
|
|
@@ -1226,9 +1226,9 @@ ${r}]`;
|
|
|
1226
1226
|
description: "PHP with ext-curl",
|
|
1227
1227
|
extname: ".php"
|
|
1228
1228
|
},
|
|
1229
|
-
convert: ({ uriObj: e, postData: t, fullUrl: r, method: n, httpVersion: l, cookies: a, headersObj:
|
|
1230
|
-
const { closingTag:
|
|
1231
|
-
u || (m(
|
|
1229
|
+
convert: ({ uriObj: e, postData: t, fullUrl: r, method: n, httpVersion: l, cookies: a, headersObj: i }, o = {}) => {
|
|
1230
|
+
const { closingTag: s = !1, indent: c = " ", maxRedirects: p = 10, namedErrors: f = !1, noTags: u = !1, shortTags: h = !1, timeout: d = 30 } = o, { push: m, blank: b, join: j } = new k({ indent: c });
|
|
1231
|
+
u || (m(h ? "<?" : "<?php"), b()), m("$curl = curl_init();"), b();
|
|
1232
1232
|
const y = [
|
|
1233
1233
|
{
|
|
1234
1234
|
escape: !0,
|
|
@@ -1258,7 +1258,7 @@ ${r}]`;
|
|
|
1258
1258
|
{
|
|
1259
1259
|
escape: !1,
|
|
1260
1260
|
name: "CURLOPT_TIMEOUT",
|
|
1261
|
-
value:
|
|
1261
|
+
value: d
|
|
1262
1262
|
},
|
|
1263
1263
|
{
|
|
1264
1264
|
escape: !1,
|
|
@@ -1287,9 +1287,9 @@ ${c}`
|
|
|
1287
1287
|
});
|
|
1288
1288
|
const w = a.map(($) => `${encodeURIComponent($.name)}=${encodeURIComponent($.value)}`);
|
|
1289
1289
|
w.length && g.push(`CURLOPT_COOKIE => "${w.join("; ")}",`);
|
|
1290
|
-
const O = Object.keys(
|
|
1290
|
+
const O = Object.keys(i).sort().map(($) => `"${$}: ${D(i[$])}"`);
|
|
1291
1291
|
return O.length && (g.push("CURLOPT_HTTPHEADER => ["), g.push(O.join(`,
|
|
1292
|
-
${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = curl_exec($curl);"), m("$err = curl_error($curl);"), b(), m("curl_close($curl);"), b(), m("if ($err) {"), m(f ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), m("} else {"), m("echo $response;", 1), m("}"), !u &&
|
|
1292
|
+
${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = curl_exec($curl);"), m("$err = curl_error($curl);"), b(), m("curl_close($curl);"), b(), m("if ($err) {"), m(f ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), m("} else {"), m("echo $response;", 1), m("}"), !u && s && (b(), m("?>")), j();
|
|
1293
1293
|
}
|
|
1294
1294
|
},
|
|
1295
1295
|
guzzle: {
|
|
@@ -1302,15 +1302,15 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1302
1302
|
installation: () => "composer require guzzlehttp/guzzle"
|
|
1303
1303
|
},
|
|
1304
1304
|
convert: ({ postData: e, fullUrl: t, method: r, cookies: n, headersObj: l }, a) => {
|
|
1305
|
-
var
|
|
1305
|
+
var i;
|
|
1306
1306
|
const o = {
|
|
1307
1307
|
closingTag: !1,
|
|
1308
1308
|
indent: " ",
|
|
1309
1309
|
noTags: !1,
|
|
1310
1310
|
shortTags: !1,
|
|
1311
1311
|
...a
|
|
1312
|
-
}, { push:
|
|
1313
|
-
switch (o.noTags ||
|
|
1312
|
+
}, { push: s, blank: c, join: p } = new k({ indent: o.indent }), { code: f, push: u, join: h } = new k({ indent: o.indent });
|
|
1313
|
+
switch (o.noTags || s(o.shortTags ? "<?" : "<?php"), s("require_once('vendor/autoload.php');"), c(), e.mimeType) {
|
|
1314
1314
|
case "application/x-www-form-urlencoded":
|
|
1315
1315
|
u(`'form_params' => ${A(e.paramsObj, o.indent + o.indent, o.indent)},`, 1);
|
|
1316
1316
|
break;
|
|
@@ -1328,7 +1328,7 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1328
1328
|
name: j.name,
|
|
1329
1329
|
contents: j.value
|
|
1330
1330
|
});
|
|
1331
|
-
}), b.length && (u(`'multipart' => ${A(b, o.indent + o.indent, o.indent)}`, 1), nt(l, "content-type") && (
|
|
1331
|
+
}), b.length && (u(`'multipart' => ${A(b, o.indent + o.indent, o.indent)}`, 1), nt(l, "content-type") && (i = le(l, "content-type")) != null && i.indexOf("boundary"))) {
|
|
1332
1332
|
const j = W(l, "content-type");
|
|
1333
1333
|
j && delete l[j];
|
|
1334
1334
|
}
|
|
@@ -1337,9 +1337,9 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1337
1337
|
default:
|
|
1338
1338
|
e.text && u(`'body' => ${A(e.text)},`, 1);
|
|
1339
1339
|
}
|
|
1340
|
-
const
|
|
1341
|
-
return m.length &&
|
|
1342
|
-
`)), u("],", 1)),
|
|
1340
|
+
const d = Object.keys(l).sort().map((b) => `${o.indent}${o.indent}'${b}' => '${Ae(l[b])}',`), m = n.map((b) => `${encodeURIComponent(b.name)}=${encodeURIComponent(b.value)}`).join("; ");
|
|
1341
|
+
return m.length && d.push(`${o.indent}${o.indent}'cookie' => '${Ae(m)}',`), d.length && (u("'headers' => [", 1), u(d.join(`
|
|
1342
|
+
`)), u("],", 1)), s("$client = new \\GuzzleHttp\\Client();"), c(), f.length ? (s(`$response = $client->request('${r}', '${t}', [`), s(h()), s("]);")) : s(`$response = $client->request('${r}', '${t}');`), c(), s("echo $response->getBody();"), !o.noTags && o.closingTag && (c(), s("?>")), p();
|
|
1343
1343
|
}
|
|
1344
1344
|
},
|
|
1345
1345
|
http1: {
|
|
@@ -1350,19 +1350,19 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1350
1350
|
description: "PHP with pecl/http v1",
|
|
1351
1351
|
extname: ".php"
|
|
1352
1352
|
},
|
|
1353
|
-
convert: ({ method: e, url: t, postData: r, queryObj: n, headersObj: l, cookiesObj: a },
|
|
1354
|
-
const { closingTag: o = !1, indent:
|
|
1355
|
-
switch (c || (f(p ? "<?" : "<?php"), u()),
|
|
1353
|
+
convert: ({ method: e, url: t, postData: r, queryObj: n, headersObj: l, cookiesObj: a }, i = {}) => {
|
|
1354
|
+
const { closingTag: o = !1, indent: s = " ", noTags: c = !1, shortTags: p = !1 } = i, { push: f, blank: u, join: h } = new k({ indent: s });
|
|
1355
|
+
switch (c || (f(p ? "<?" : "<?php"), u()), ar.includes(e.toUpperCase()) || f(`HttpRequest::methodRegister('${e}');`), f("$request = new HttpRequest();"), f(`$request->setUrl(${A(t)});`), ar.includes(e.toUpperCase()) ? f(`$request->setMethod(HTTP_METH_${e.toUpperCase()});`) : f(`$request->setMethod(HttpRequest::HTTP_METH_${e.toUpperCase()});`), u(), Object.keys(n).length && (f(`$request->setQueryData(${A(n, s)});`), u()), Object.keys(l).length && (f(`$request->setHeaders(${A(l, s)});`), u()), Object.keys(a).length && (f(`$request->setCookies(${A(a, s)});`), u()), r.mimeType) {
|
|
1356
1356
|
case "application/x-www-form-urlencoded":
|
|
1357
|
-
f(`$request->setContentType(${A(r.mimeType)});`), f(`$request->setPostFields(${A(r.paramsObj,
|
|
1357
|
+
f(`$request->setContentType(${A(r.mimeType)});`), f(`$request->setPostFields(${A(r.paramsObj, s)});`), u();
|
|
1358
1358
|
break;
|
|
1359
1359
|
case "application/json":
|
|
1360
|
-
f(`$request->setContentType(${A(r.mimeType)});`), f(`$request->setBody(json_encode(${A(r.jsonObj,
|
|
1360
|
+
f(`$request->setContentType(${A(r.mimeType)});`), f(`$request->setBody(json_encode(${A(r.jsonObj, s)}));`), u();
|
|
1361
1361
|
break;
|
|
1362
1362
|
default:
|
|
1363
1363
|
r.text && (f(`$request->setBody(${A(r.text)});`), u());
|
|
1364
1364
|
}
|
|
1365
|
-
return f("try {"), f("$response = $request->send();", 1), u(), f("echo $response->getBody();", 1), f("} catch (HttpException $ex) {"), f("echo $ex;", 1), f("}"), !c && o && (u(), f("?>")),
|
|
1365
|
+
return f("try {"), f("$response = $request->send();", 1), u(), f("echo $response->getBody();", 1), f("} catch (HttpException $ex) {"), f("echo $ex;", 1), f("}"), !c && o && (u(), f("?>")), h();
|
|
1366
1366
|
}
|
|
1367
1367
|
},
|
|
1368
1368
|
http2: {
|
|
@@ -1373,13 +1373,13 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1373
1373
|
description: "PHP with pecl/http v2",
|
|
1374
1374
|
extname: ".php"
|
|
1375
1375
|
},
|
|
1376
|
-
convert: ({ postData: e, headersObj: t, method: r, queryObj: n, cookiesObj: l, url: a },
|
|
1376
|
+
convert: ({ postData: e, headersObj: t, method: r, queryObj: n, cookiesObj: l, url: a }, i = {}) => {
|
|
1377
1377
|
var o;
|
|
1378
|
-
const { closingTag:
|
|
1378
|
+
const { closingTag: s = !1, indent: c = " ", noTags: p = !1, shortTags: f = !1 } = i, { push: u, blank: h, join: d } = new k({ indent: c });
|
|
1379
1379
|
let m = !1;
|
|
1380
|
-
switch (p || (u(f ? "<?" : "<?php"),
|
|
1380
|
+
switch (p || (u(f ? "<?" : "<?php"), h()), u("$client = new http\\Client;"), u("$request = new http\\Client\\Request;"), h(), e.mimeType) {
|
|
1381
1381
|
case "application/x-www-form-urlencoded":
|
|
1382
|
-
u("$body = new http\\Message\\Body;"), u(`$body->append(new http\\QueryString(${A(e.paramsObj, c)}));`),
|
|
1382
|
+
u("$body = new http\\Message\\Body;"), u(`$body->append(new http\\QueryString(${A(e.paramsObj, c)}));`), h(), m = !0;
|
|
1383
1383
|
break;
|
|
1384
1384
|
case "multipart/form-data": {
|
|
1385
1385
|
if (!e.params) break;
|
|
@@ -1401,21 +1401,21 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1401
1401
|
const w = W(t, "content-type");
|
|
1402
1402
|
w && delete t[w];
|
|
1403
1403
|
}
|
|
1404
|
-
|
|
1404
|
+
h(), m = !0;
|
|
1405
1405
|
break;
|
|
1406
1406
|
}
|
|
1407
1407
|
case "application/json":
|
|
1408
1408
|
u("$body = new http\\Message\\Body;"), u(`$body->append(json_encode(${A(e.jsonObj, c)}));`), m = !0;
|
|
1409
1409
|
break;
|
|
1410
1410
|
default:
|
|
1411
|
-
e.text && (u("$body = new http\\Message\\Body;"), u(`$body->append(${A(e.text)});`),
|
|
1411
|
+
e.text && (u("$body = new http\\Message\\Body;"), u(`$body->append(${A(e.text)});`), h(), m = !0);
|
|
1412
1412
|
}
|
|
1413
|
-
return u(`$request->setRequestUrl(${A(a)});`), u(`$request->setRequestMethod(${A(r)});`), m && (u("$request->setBody($body);"),
|
|
1413
|
+
return u(`$request->setRequestUrl(${A(a)});`), u(`$request->setRequestMethod(${A(r)});`), m && (u("$request->setBody($body);"), h()), Object.keys(n).length && (u(`$request->setQuery(new http\\QueryString(${A(n, c)}));`), h()), Object.keys(t).length && (u(`$request->setHeaders(${A(t, c)});`), h()), Object.keys(l).length && (h(), u(`$client->setCookies(${A(l, c)});`), h()), u("$client->enqueue($request)->send();"), u("$response = $client->getResponse();"), h(), u("echo $response->getBody();"), !p && s && (h(), u("?>")), d();
|
|
1414
1414
|
}
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
|
-
},
|
|
1418
|
-
const { push:
|
|
1417
|
+
}, Vr = (e) => ({ method: t, headersObj: r, cookies: n, uriObj: l, fullUrl: a, postData: i, allHeaders: o }) => {
|
|
1418
|
+
const { push: s, join: c } = new k();
|
|
1419
1419
|
if (![
|
|
1420
1420
|
"GET",
|
|
1421
1421
|
"POST",
|
|
@@ -1426,15 +1426,15 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1426
1426
|
"OPTIONS"
|
|
1427
1427
|
].includes(t.toUpperCase())) return "Method not supported";
|
|
1428
1428
|
const p = [], f = Object.keys(r);
|
|
1429
|
-
return f.length && (
|
|
1430
|
-
u !== "connection" &&
|
|
1431
|
-
}), p.push("-Headers $headers")), n.length && (
|
|
1432
|
-
|
|
1433
|
-
}), p.push("-WebSession $session")),
|
|
1429
|
+
return f.length && (s("$headers=@{}"), f.forEach((u) => {
|
|
1430
|
+
u !== "connection" && s(`$headers.Add("${u}", "${Me(r[u], { escapeChar: "`" })}")`);
|
|
1431
|
+
}), p.push("-Headers $headers")), n.length && (s("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), n.forEach((u) => {
|
|
1432
|
+
s("$cookie = New-Object System.Net.Cookie"), s(`$cookie.Name = '${u.name}'`), s(`$cookie.Value = '${u.value}'`), s(`$cookie.Domain = '${l.host}'`), s("$session.Cookies.Add($cookie)");
|
|
1433
|
+
}), p.push("-WebSession $session")), i.text && (p.push(`-ContentType '${Me(le(o, "content-type"), {
|
|
1434
1434
|
delimiter: "'",
|
|
1435
1435
|
escapeChar: "`"
|
|
1436
|
-
})}'`), p.push(`-Body '${
|
|
1437
|
-
},
|
|
1436
|
+
})}'`), p.push(`-Body '${i.text}'`)), s(`$response = ${e} -Uri '${a}' -Method ${t} ${p.join(" ")}`.trim()), c();
|
|
1437
|
+
}, so = {
|
|
1438
1438
|
info: {
|
|
1439
1439
|
key: "restmethod",
|
|
1440
1440
|
title: "Invoke-RestMethod",
|
|
@@ -1442,8 +1442,8 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1442
1442
|
description: "Powershell Invoke-RestMethod client",
|
|
1443
1443
|
extname: ".ps1"
|
|
1444
1444
|
},
|
|
1445
|
-
convert:
|
|
1446
|
-
},
|
|
1445
|
+
convert: Vr("Invoke-RestMethod")
|
|
1446
|
+
}, lo = {
|
|
1447
1447
|
info: {
|
|
1448
1448
|
key: "powershell",
|
|
1449
1449
|
title: "Powershell",
|
|
@@ -1458,17 +1458,17 @@ ${c}${c}`), 1), g.push("],")), m(g.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1458
1458
|
description: "Powershell Invoke-WebRequest client",
|
|
1459
1459
|
extname: ".ps1"
|
|
1460
1460
|
},
|
|
1461
|
-
convert:
|
|
1461
|
+
convert: Vr("Invoke-WebRequest")
|
|
1462
1462
|
},
|
|
1463
|
-
restmethod:
|
|
1463
|
+
restmethod: so
|
|
1464
1464
|
}
|
|
1465
1465
|
};
|
|
1466
|
-
function
|
|
1467
|
-
const a = n.repeat(l),
|
|
1468
|
-
${a}` : ", ",
|
|
1469
|
-
return r ? `${
|
|
1466
|
+
function ir(e, t, r, n, l) {
|
|
1467
|
+
const a = n.repeat(l), i = n.repeat(l - 1), o = r ? `,
|
|
1468
|
+
${a}` : ", ", s = e === "object" ? "{" : "[", c = e === "object" ? "}" : "]";
|
|
1469
|
+
return r ? `${s}
|
|
1470
1470
|
${a}${t.join(o)}
|
|
1471
|
-
${
|
|
1471
|
+
${i}${c}` : e === "object" && t.length > 0 ? `${s} ${t.join(o)} ${c}` : `${s}${t.join(o)}${c}`;
|
|
1472
1472
|
}
|
|
1473
1473
|
const Te = (e, t, r) => {
|
|
1474
1474
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(e)) {
|
|
@@ -1476,12 +1476,12 @@ const Te = (e, t, r) => {
|
|
|
1476
1476
|
return e;
|
|
1477
1477
|
case "[object Array]": {
|
|
1478
1478
|
let n = !1;
|
|
1479
|
-
return
|
|
1479
|
+
return ir("array", e.map((l) => (Object.prototype.toString.call(l) === "[object Object]" && (n = Object.keys(l).length > 1), Te(l, t, r))), n, t.indent, r);
|
|
1480
1480
|
}
|
|
1481
1481
|
case "[object Object]": {
|
|
1482
1482
|
const n = [];
|
|
1483
1483
|
for (const l in e) n.push(`"${l}": ${Te(e[l], t, r)}`);
|
|
1484
|
-
return
|
|
1484
|
+
return ir("object", n, t.pretty && n.length > 1, t.indent, r);
|
|
1485
1485
|
}
|
|
1486
1486
|
case "[object Null]":
|
|
1487
1487
|
return "None";
|
|
@@ -1490,7 +1490,7 @@ const Te = (e, t, r) => {
|
|
|
1490
1490
|
default:
|
|
1491
1491
|
return e == null ? "" : `"${e.toString().replace(/"/g, '\\"')}"`;
|
|
1492
1492
|
}
|
|
1493
|
-
},
|
|
1493
|
+
}, co = [
|
|
1494
1494
|
"HEAD",
|
|
1495
1495
|
"GET",
|
|
1496
1496
|
"POST",
|
|
@@ -1498,7 +1498,7 @@ const Te = (e, t, r) => {
|
|
|
1498
1498
|
"PATCH",
|
|
1499
1499
|
"DELETE",
|
|
1500
1500
|
"OPTIONS"
|
|
1501
|
-
],
|
|
1501
|
+
], po = {
|
|
1502
1502
|
info: {
|
|
1503
1503
|
key: "python",
|
|
1504
1504
|
title: "Python",
|
|
@@ -1519,55 +1519,55 @@ const Te = (e, t, r) => {
|
|
|
1519
1519
|
indent: " ",
|
|
1520
1520
|
pretty: !0,
|
|
1521
1521
|
...l
|
|
1522
|
-
}, { push:
|
|
1523
|
-
|
|
1522
|
+
}, { push: i, blank: o, join: s, addPostProcessor: c } = new k({ indent: a.indent });
|
|
1523
|
+
i("import requests"), o(), i(`url = "${e}"`), o();
|
|
1524
1524
|
const p = r;
|
|
1525
1525
|
let f = {};
|
|
1526
1526
|
const u = {};
|
|
1527
|
-
let
|
|
1527
|
+
let h = !1, d = !1, m = !1;
|
|
1528
1528
|
switch (t.mimeType) {
|
|
1529
1529
|
case "application/json":
|
|
1530
|
-
t.jsonObj && (
|
|
1530
|
+
t.jsonObj && (i(`payload = ${Te(t.jsonObj, a)}`), m = !0, d = !0);
|
|
1531
1531
|
break;
|
|
1532
1532
|
case "multipart/form-data":
|
|
1533
1533
|
if (!t.params) break;
|
|
1534
1534
|
if (f = {}, t.params.forEach((y) => {
|
|
1535
|
-
y.fileName ? (y.contentType ? u[y.name] = `('${y.fileName}', open('${y.fileName}', 'rb'), '${y.contentType}')` : u[y.name] = `('${y.fileName}', open('${y.fileName}', 'rb'))`,
|
|
1536
|
-
}),
|
|
1537
|
-
|
|
1535
|
+
y.fileName ? (y.contentType ? u[y.name] = `('${y.fileName}', open('${y.fileName}', 'rb'), '${y.contentType}')` : u[y.name] = `('${y.fileName}', open('${y.fileName}', 'rb'))`, h = !0) : (f[y.name] = y.value, d = !0);
|
|
1536
|
+
}), h) {
|
|
1537
|
+
i(`files = ${Te(u, a)}`), d && i(`payload = ${Te(f, a)}`);
|
|
1538
1538
|
const y = W(p, "content-type");
|
|
1539
1539
|
y && delete p[y];
|
|
1540
1540
|
} else {
|
|
1541
1541
|
const y = JSON.stringify(t.text);
|
|
1542
|
-
y && (
|
|
1542
|
+
y && (i(`payload = ${y}`), d = !0);
|
|
1543
1543
|
}
|
|
1544
1544
|
c((y) => y.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g, '("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g, '("$1", open("$2", "rb"), "$3")'));
|
|
1545
1545
|
break;
|
|
1546
1546
|
default: {
|
|
1547
1547
|
if (t.mimeType === "application/x-www-form-urlencoded" && t.paramsObj) {
|
|
1548
|
-
|
|
1548
|
+
i(`payload = ${Te(t.paramsObj, a)}`), d = !0;
|
|
1549
1549
|
break;
|
|
1550
1550
|
}
|
|
1551
1551
|
const y = JSON.stringify(t.text);
|
|
1552
|
-
y && (
|
|
1552
|
+
y && (i(`payload = ${y}`), d = !0);
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
1555
|
const b = Object.keys(p).length;
|
|
1556
|
-
if (b === 0 && (
|
|
1556
|
+
if (b === 0 && (d || h)) o();
|
|
1557
1557
|
else if (b === 1) Object.keys(p).forEach((y) => {
|
|
1558
|
-
|
|
1558
|
+
i(`headers = {"${y}": "${D(p[y])}"}`), o();
|
|
1559
1559
|
});
|
|
1560
1560
|
else if (b > 1) {
|
|
1561
1561
|
let y = 1;
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
}),
|
|
1562
|
+
i("headers = {"), Object.keys(p).forEach((g) => {
|
|
1563
|
+
i(y !== b ? `"${g}": "${D(p[g])}",` : `"${g}": "${D(p[g])}"`, 1), y += 1;
|
|
1564
|
+
}), i("}"), o();
|
|
1565
1565
|
}
|
|
1566
|
-
let j =
|
|
1567
|
-
return
|
|
1566
|
+
let j = co.includes(n) ? `response = requests.${n.toLowerCase()}(url` : `response = requests.request("${n}", url`;
|
|
1567
|
+
return d && (m ? j += ", json=payload" : j += ", data=payload"), h && (j += ", files=files"), b > 0 && (j += ", headers=headers"), j += ")", i(j), o(), i("print(response.text)"), s();
|
|
1568
1568
|
}
|
|
1569
1569
|
} }
|
|
1570
|
-
},
|
|
1570
|
+
}, uo = {
|
|
1571
1571
|
info: {
|
|
1572
1572
|
key: "r",
|
|
1573
1573
|
title: "R",
|
|
@@ -1582,30 +1582,30 @@ const Te = (e, t, r) => {
|
|
|
1582
1582
|
extname: ".r"
|
|
1583
1583
|
},
|
|
1584
1584
|
convert: ({ url: e, queryObj: t, queryString: r, postData: n, allHeaders: l, method: a }) => {
|
|
1585
|
-
const { push:
|
|
1586
|
-
|
|
1585
|
+
const { push: i, blank: o, join: s } = new k();
|
|
1586
|
+
i("library(httr)"), o(), i(`url <- "${e}"`), o();
|
|
1587
1587
|
const c = t;
|
|
1588
1588
|
delete t.key;
|
|
1589
1589
|
const p = Object.keys(c).length;
|
|
1590
|
-
r.length === 1 ? (
|
|
1591
|
-
$ !== p - 1 ?
|
|
1592
|
-
}),
|
|
1590
|
+
r.length === 1 ? (i(`queryString <- list(${Object.keys(c)} = "${Object.values(c).toString()}")`), o()) : r.length > 1 && (i("queryString <- list("), Object.keys(c).forEach((O, $) => {
|
|
1591
|
+
$ !== p - 1 ? i(` ${O} = "${c[O].toString()}",`) : i(` ${O} = "${c[O].toString()}"`);
|
|
1592
|
+
}), i(")"), o());
|
|
1593
1593
|
const f = JSON.stringify(n.text);
|
|
1594
|
-
if (f && (
|
|
1594
|
+
if (f && (i(`payload <- ${f}`), o()), n.text || n.jsonObj || n.params) switch (n.mimeType) {
|
|
1595
1595
|
case "application/x-www-form-urlencoded":
|
|
1596
|
-
|
|
1596
|
+
i('encode <- "form"'), o();
|
|
1597
1597
|
break;
|
|
1598
1598
|
case "application/json":
|
|
1599
|
-
|
|
1599
|
+
i('encode <- "json"'), o();
|
|
1600
1600
|
break;
|
|
1601
1601
|
case "multipart/form-data":
|
|
1602
|
-
|
|
1602
|
+
i('encode <- "multipart"'), o();
|
|
1603
1603
|
break;
|
|
1604
1604
|
default:
|
|
1605
|
-
|
|
1605
|
+
i('encode <- "raw"'), o();
|
|
1606
1606
|
break;
|
|
1607
1607
|
}
|
|
1608
|
-
const u = le(l, "cookie"),
|
|
1608
|
+
const u = le(l, "cookie"), h = le(l, "accept"), d = u ? `set_cookies(\`${String(u).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, m = h ? `accept("${D(h)}")` : void 0, b = `content_type("${D(n.mimeType)}")`, j = Object.entries(l).filter(([O]) => ![
|
|
1609
1609
|
"cookie",
|
|
1610
1610
|
"accept",
|
|
1611
1611
|
"content-type"
|
|
@@ -1616,12 +1616,12 @@ const Te = (e, t, r) => {
|
|
|
1616
1616
|
y,
|
|
1617
1617
|
b,
|
|
1618
1618
|
m,
|
|
1619
|
-
|
|
1619
|
+
d
|
|
1620
1620
|
].filter((O) => !!O).join(", ");
|
|
1621
|
-
return w && (g += `, ${w}`), (n.text || n.jsonObj || n.params) && (g += ", encode = encode"), g += ")",
|
|
1621
|
+
return w && (g += `, ${w}`), (n.text || n.jsonObj || n.params) && (g += ", encode = encode"), g += ")", i(g), o(), i('content(response, "text")'), s();
|
|
1622
1622
|
}
|
|
1623
1623
|
} }
|
|
1624
|
-
},
|
|
1624
|
+
}, fo = {
|
|
1625
1625
|
info: {
|
|
1626
1626
|
key: "ruby",
|
|
1627
1627
|
title: "Ruby",
|
|
@@ -1637,9 +1637,9 @@ const Te = (e, t, r) => {
|
|
|
1637
1637
|
extname: ".rb"
|
|
1638
1638
|
},
|
|
1639
1639
|
convert: ({ uriObj: e, method: t, fullUrl: r, postData: n, allHeaders: l }) => {
|
|
1640
|
-
const { push: a, blank:
|
|
1641
|
-
a("require 'uri'"), a("require 'net/http'"),
|
|
1642
|
-
const
|
|
1640
|
+
const { push: a, blank: i, join: o } = new k();
|
|
1641
|
+
a("require 'uri'"), a("require 'net/http'"), i();
|
|
1642
|
+
const s = t.toUpperCase(), c = [
|
|
1643
1643
|
"GET",
|
|
1644
1644
|
"POST",
|
|
1645
1645
|
"HEAD",
|
|
@@ -1652,12 +1652,12 @@ const Te = (e, t, r) => {
|
|
|
1652
1652
|
"UNLOCK",
|
|
1653
1653
|
"MOVE",
|
|
1654
1654
|
"TRACE"
|
|
1655
|
-
], p =
|
|
1656
|
-
c.includes(
|
|
1655
|
+
], p = s.charAt(0) + s.substring(1).toLowerCase();
|
|
1656
|
+
c.includes(s) || (a(`class Net::HTTP::${p} < Net::HTTPRequest`), a(` METHOD = '${s.toUpperCase()}'`), a(` REQUEST_HAS_BODY = '${n.text ? "true" : "false"}'`), a(" RESPONSE_HAS_BODY = true"), a("end"), i()), a(`url = URI("${r}")`), i(), a("http = Net::HTTP.new(url.host, url.port)"), e.protocol === "https:" && a("http.use_ssl = true"), i(), a(`request = Net::HTTP::${p}.new(url)`);
|
|
1657
1657
|
const f = Object.keys(l);
|
|
1658
1658
|
return f.length && f.forEach((u) => {
|
|
1659
1659
|
a(`request["${u}"] = '${Ae(l[u])}'`);
|
|
1660
|
-
}), n.text && a(`request.body = ${JSON.stringify(n.text)}`),
|
|
1660
|
+
}), n.text && a(`request.body = ${JSON.stringify(n.text)}`), i(), a("response = http.request(request)"), a("puts response.read_body"), o();
|
|
1661
1661
|
}
|
|
1662
1662
|
},
|
|
1663
1663
|
faraday: {
|
|
@@ -1669,7 +1669,7 @@ const Te = (e, t, r) => {
|
|
|
1669
1669
|
extname: ".rb"
|
|
1670
1670
|
},
|
|
1671
1671
|
convert: ({ uriObj: e, queryObj: t, method: r, postData: n, allHeaders: l }) => {
|
|
1672
|
-
const { push: a, blank:
|
|
1672
|
+
const { push: a, blank: i, join: o } = new k(), s = r.toUpperCase();
|
|
1673
1673
|
if (![
|
|
1674
1674
|
"GET",
|
|
1675
1675
|
"POST",
|
|
@@ -1683,11 +1683,11 @@ const Te = (e, t, r) => {
|
|
|
1683
1683
|
"UNLOCK",
|
|
1684
1684
|
"MOVE",
|
|
1685
1685
|
"TRACE"
|
|
1686
|
-
].includes(
|
|
1687
|
-
return a(`# Faraday cannot currently run ${
|
|
1688
|
-
a("require 'faraday'"),
|
|
1686
|
+
].includes(s))
|
|
1687
|
+
return a(`# Faraday cannot currently run ${s} requests. Please use another client.`), o();
|
|
1688
|
+
a("require 'faraday'"), i(), n.mimeType === "application/x-www-form-urlencoded" && n.params && (a("data = {"), n.params.forEach((p) => {
|
|
1689
1689
|
a(` :${p.name} => ${JSON.stringify(p.value)},`);
|
|
1690
|
-
}), a("}"),
|
|
1690
|
+
}), a("}"), i()), a("conn = Faraday.new("), a(` url: '${e.protocol}//${e.host}',`), (l["content-type"] || l["Content-Type"]) && a(` headers: {'Content-Type' => '${l["content-type"] || l["Content-Type"]}'}`), a(")"), i(), a(`response = conn.${s.toLowerCase()}('${e.pathname}') do |req|`);
|
|
1691
1691
|
const c = Object.keys(l);
|
|
1692
1692
|
switch (c.length && c.forEach((p) => {
|
|
1693
1693
|
p.toLowerCase() !== "content-type" && a(` req.headers['${p}'] = '${Ae(l[p])}'`);
|
|
@@ -1704,17 +1704,17 @@ const Te = (e, t, r) => {
|
|
|
1704
1704
|
default:
|
|
1705
1705
|
n.text && a(` req.body = ${JSON.stringify(n.text)}`);
|
|
1706
1706
|
}
|
|
1707
|
-
return a("end"),
|
|
1707
|
+
return a("end"), i(), a("puts response.status"), a("puts response.body"), o();
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
1710
|
}
|
|
1711
1711
|
};
|
|
1712
|
-
function
|
|
1713
|
-
const a = n.repeat(l),
|
|
1714
|
-
${a}` : ", ",
|
|
1715
|
-
return r ? `${
|
|
1712
|
+
function sr(e, t, r, n, l) {
|
|
1713
|
+
const a = n.repeat(l), i = n.repeat(l - 1), o = r ? `,
|
|
1714
|
+
${a}` : ", ", s = e === "object" ? "json!({" : "(", c = e === "object" ? "})" : ")";
|
|
1715
|
+
return r ? `${s}
|
|
1716
1716
|
${a}${t.join(o)}
|
|
1717
|
-
${
|
|
1717
|
+
${i}${c}` : `${s}${t.join(o)}${c}`;
|
|
1718
1718
|
}
|
|
1719
1719
|
const ke = (e, t, r) => {
|
|
1720
1720
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(e)) {
|
|
@@ -1723,12 +1723,12 @@ const ke = (e, t, r) => {
|
|
|
1723
1723
|
case "[object Array]": {
|
|
1724
1724
|
if (e.length === 0) return "json!([])";
|
|
1725
1725
|
let n = !1;
|
|
1726
|
-
return
|
|
1726
|
+
return sr("array", e.map((l) => (Object.prototype.toString.call(l) === "[object Object]" && (n = Object.keys(l).length > 1), ke(l, t, r))), n, t.indent, r);
|
|
1727
1727
|
}
|
|
1728
1728
|
case "[object Object]": {
|
|
1729
1729
|
const n = [];
|
|
1730
1730
|
for (const l in e) n.push(`"${l}": ${ke(e[l], t, r)}`);
|
|
1731
|
-
return
|
|
1731
|
+
return sr("object", n, t.pretty && n.length > 1, t.indent, r);
|
|
1732
1732
|
}
|
|
1733
1733
|
case "[object Null]":
|
|
1734
1734
|
return "json!(null)";
|
|
@@ -1737,7 +1737,7 @@ const ke = (e, t, r) => {
|
|
|
1737
1737
|
default:
|
|
1738
1738
|
return e == null ? "" : `"${e.toString().replace(/"/g, '\\"')}"`;
|
|
1739
1739
|
}
|
|
1740
|
-
},
|
|
1740
|
+
}, ho = {
|
|
1741
1741
|
info: {
|
|
1742
1742
|
key: "reqwest",
|
|
1743
1743
|
title: "reqwest",
|
|
@@ -1746,88 +1746,88 @@ const ke = (e, t, r) => {
|
|
|
1746
1746
|
extname: ".rs"
|
|
1747
1747
|
},
|
|
1748
1748
|
convert: ({ queryObj: e, url: t, postData: r, allHeaders: n, method: l }, a) => {
|
|
1749
|
-
const
|
|
1749
|
+
const i = {
|
|
1750
1750
|
indent: " ",
|
|
1751
1751
|
pretty: !0,
|
|
1752
1752
|
...a
|
|
1753
1753
|
};
|
|
1754
1754
|
let o = 0;
|
|
1755
|
-
const { push:
|
|
1756
|
-
|
|
1757
|
-
let
|
|
1755
|
+
const { push: s, blank: c, join: p, pushToLast: f, unshift: u } = new k({ indent: i.indent });
|
|
1756
|
+
s("use reqwest;", o), c(), s("#[tokio::main]", o), s("pub async fn main() {", o), o += 1, s(`let url = "${t}";`, o), c();
|
|
1757
|
+
let h = !1;
|
|
1758
1758
|
if (Object.keys(e).length) {
|
|
1759
|
-
|
|
1760
|
-
for (const [$, E] of Object.entries(e)) if (Array.isArray(E)) for (const S of E)
|
|
1761
|
-
else
|
|
1762
|
-
o -= 1,
|
|
1759
|
+
h = !0, s("let querystring = [", o), o += 1;
|
|
1760
|
+
for (const [$, E] of Object.entries(e)) if (Array.isArray(E)) for (const S of E) s(`("${$}", "${decodeURIComponent(S)}"),`, o);
|
|
1761
|
+
else s(`("${$}", "${decodeURIComponent(String(E))}"),`, o);
|
|
1762
|
+
o -= 1, s("];", o), c();
|
|
1763
1763
|
}
|
|
1764
|
-
let
|
|
1764
|
+
let d = {};
|
|
1765
1765
|
const m = {};
|
|
1766
1766
|
let b = !1, j = !1, y = !1, g = !1, w = !1;
|
|
1767
1767
|
switch (r.mimeType) {
|
|
1768
1768
|
case "application/json":
|
|
1769
|
-
r.jsonObj &&
|
|
1769
|
+
r.jsonObj && s(`let payload = ${ke(r.jsonObj, i, o)};`, o), g = !0;
|
|
1770
1770
|
break;
|
|
1771
1771
|
case "multipart/form-data":
|
|
1772
1772
|
if (w = !0, !r.params) {
|
|
1773
|
-
|
|
1773
|
+
s("let form = reqwest::multipart::Form::new()", o), s('.text("", "");', o + 1);
|
|
1774
1774
|
break;
|
|
1775
1775
|
}
|
|
1776
|
-
if (
|
|
1777
|
-
$.fileName ? (m[$.name] = $.fileName, b = !0) :
|
|
1776
|
+
if (d = {}, r.params.forEach(($) => {
|
|
1777
|
+
$.fileName ? (m[$.name] = $.fileName, b = !0) : d[$.name] = $.value;
|
|
1778
1778
|
}), b) {
|
|
1779
|
-
for (const $ of
|
|
1779
|
+
for (const $ of yo) s($, o);
|
|
1780
1780
|
c();
|
|
1781
1781
|
}
|
|
1782
|
-
|
|
1783
|
-
for (const [$, E] of Object.entries(m))
|
|
1784
|
-
for (const [$, E] of Object.entries(
|
|
1782
|
+
s("let form = reqwest::multipart::Form::new()", o);
|
|
1783
|
+
for (const [$, E] of Object.entries(m)) s(`.part("${$}", file_to_part("${E}").await)`, o + 1);
|
|
1784
|
+
for (const [$, E] of Object.entries(d)) s(`.text("${$}", "${E}")`, o + 1);
|
|
1785
1785
|
f(";");
|
|
1786
1786
|
break;
|
|
1787
1787
|
default:
|
|
1788
1788
|
if (r.mimeType === "application/x-www-form-urlencoded" && r.paramsObj) {
|
|
1789
|
-
|
|
1789
|
+
s(`let payload = ${ke(r.paramsObj, i, o)};`, o), j = !0;
|
|
1790
1790
|
break;
|
|
1791
1791
|
}
|
|
1792
1792
|
if (r.text) {
|
|
1793
|
-
|
|
1793
|
+
s(`let payload = ${ke(r.text, i, o)};`, o), y = !0;
|
|
1794
1794
|
break;
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
1797
|
(j || g) && u("use serde_json::json;"), (j || g || y || w) && c();
|
|
1798
1798
|
const O = Object.entries(n).filter(([$]) => !($.toLowerCase() === "content-type" && w));
|
|
1799
|
-
switch (
|
|
1799
|
+
switch (s("let client = reqwest::Client::new();", o), l) {
|
|
1800
1800
|
case "POST":
|
|
1801
|
-
|
|
1801
|
+
s("let response = client.post(url)", o);
|
|
1802
1802
|
break;
|
|
1803
1803
|
case "GET":
|
|
1804
|
-
|
|
1804
|
+
s("let response = client.get(url)", o);
|
|
1805
1805
|
break;
|
|
1806
1806
|
default:
|
|
1807
|
-
|
|
1807
|
+
s(`let response = client.request(reqwest::Method::from_str("${l}").unwrap(), url)`, o), u("use std::str::FromStr;");
|
|
1808
1808
|
break;
|
|
1809
1809
|
}
|
|
1810
|
-
|
|
1811
|
-
for (const [$, E] of O)
|
|
1812
|
-
return g &&
|
|
1810
|
+
h && s(".query(&querystring)", o + 1), w && s(".multipart(form)", o + 1);
|
|
1811
|
+
for (const [$, E] of O) s(`.header("${$}", ${ke(E, i)})`, o + 1);
|
|
1812
|
+
return g && s(".json(&payload)", o + 1), j && s(".form(&payload)", o + 1), y && s(".body(payload)", o + 1), s(".send()", o + 1), s(".await;", o + 1), c(), s("let results = response.unwrap()", o), s(".json::<serde_json::Value>()", o + 1), s(".await", o + 1), s(".unwrap();", o + 1), c(), s('println!("{}", results);', o), s(`}
|
|
1813
1813
|
`), p();
|
|
1814
1814
|
}
|
|
1815
|
-
},
|
|
1815
|
+
}, yo = [
|
|
1816
1816
|
"async fn file_to_part(file_name: &'static str) -> reqwest::multipart::Part {",
|
|
1817
1817
|
" let bytes = tokio::fs::read(file_name).await.unwrap();",
|
|
1818
1818
|
" reqwest::multipart::Part::bytes(bytes)",
|
|
1819
1819
|
" .file_name(file_name)",
|
|
1820
1820
|
' .mime_str("text/plain").unwrap()',
|
|
1821
1821
|
"}"
|
|
1822
|
-
],
|
|
1822
|
+
], mo = {
|
|
1823
1823
|
info: {
|
|
1824
1824
|
key: "rust",
|
|
1825
1825
|
title: "Rust",
|
|
1826
1826
|
default: "reqwest",
|
|
1827
1827
|
cli: "rust"
|
|
1828
1828
|
},
|
|
1829
|
-
clientsById: { reqwest:
|
|
1830
|
-
}, M = (e = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(e) ? e : `'${e.replace(/'/g, "'\\''")}'`,
|
|
1829
|
+
clientsById: { reqwest: ho }
|
|
1830
|
+
}, M = (e = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(e) ? e : `'${e.replace(/'/g, "'\\''")}'`, bo = (e) => e.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), go = {
|
|
1831
1831
|
"http1.0": "0",
|
|
1832
1832
|
"url ": "",
|
|
1833
1833
|
cookie: "b",
|
|
@@ -1837,13 +1837,13 @@ const ke = (e, t, r) => {
|
|
|
1837
1837
|
header: "H",
|
|
1838
1838
|
insecure: "k",
|
|
1839
1839
|
request: "X"
|
|
1840
|
-
},
|
|
1840
|
+
}, jo = (e) => (t) => {
|
|
1841
1841
|
if (e) {
|
|
1842
|
-
const r =
|
|
1842
|
+
const r = go[t];
|
|
1843
1843
|
return r ? `-${r}` : "";
|
|
1844
1844
|
}
|
|
1845
1845
|
return `--${t}`;
|
|
1846
|
-
},
|
|
1846
|
+
}, $o = {
|
|
1847
1847
|
info: {
|
|
1848
1848
|
key: "shell",
|
|
1849
1849
|
title: "Shell",
|
|
@@ -1859,15 +1859,15 @@ const ke = (e, t, r) => {
|
|
|
1859
1859
|
description: "cURL is a command line tool and library for transferring data with URL syntax",
|
|
1860
1860
|
extname: ".sh"
|
|
1861
1861
|
},
|
|
1862
|
-
convert: ({ fullUrl: e, method: t, httpVersion: r, headersObj: n, allHeaders: l, postData: a },
|
|
1862
|
+
convert: ({ fullUrl: e, method: t, httpVersion: r, headersObj: n, allHeaders: l, postData: a }, i = {}) => {
|
|
1863
1863
|
var o;
|
|
1864
|
-
const { binary:
|
|
1864
|
+
const { binary: s = !1, globOff: c = !1, indent: p = " ", insecureSkipVerify: f = !1, short: u = !1 } = i, h = " ", { push: d, join: m } = new k({
|
|
1865
1865
|
...typeof p == "string" ? { indent: p } : {},
|
|
1866
1866
|
join: p !== !1 ? ` \\
|
|
1867
1867
|
${p}` : " "
|
|
1868
|
-
}), b =
|
|
1868
|
+
}), b = jo(u);
|
|
1869
1869
|
let j = M(e);
|
|
1870
|
-
if (
|
|
1870
|
+
if (d(`curl ${b("request")} ${t}`), c && (j = unescape(j), d(b("globoff"))), d(`${b("url ")}${j}`), f && d(b("insecure")), r === "HTTP/1.0" && d(b("http1.0")), le(l, "accept-encoding") && d("--compressed"), a.mimeType === "multipart/form-data") {
|
|
1871
1871
|
const y = W(n, "content-type");
|
|
1872
1872
|
if (y) {
|
|
1873
1873
|
const g = n[y];
|
|
@@ -1879,34 +1879,34 @@ ${p}` : " "
|
|
|
1879
1879
|
}
|
|
1880
1880
|
switch (Object.keys(n).sort().forEach((y) => {
|
|
1881
1881
|
const g = `${y}: ${n[y]}`;
|
|
1882
|
-
|
|
1883
|
-
}), l.cookie &&
|
|
1882
|
+
d(`${b("header")} ${M(g)}`);
|
|
1883
|
+
}), l.cookie && d(`${b("cookie")} ${M(l.cookie)}`), a.mimeType) {
|
|
1884
1884
|
case "multipart/form-data":
|
|
1885
1885
|
(o = a.params) == null || o.forEach((y) => {
|
|
1886
1886
|
let g = "";
|
|
1887
|
-
y.fileName ? g = `${y.name}='@${y.fileName}'` : g = M(`${y.name}=${y.value}`),
|
|
1887
|
+
y.fileName ? g = `${y.name}='@${y.fileName}'` : g = M(`${y.name}=${y.value}`), d(`${b("form")} ${g}`);
|
|
1888
1888
|
});
|
|
1889
1889
|
break;
|
|
1890
1890
|
case "application/x-www-form-urlencoded":
|
|
1891
1891
|
a.params ? a.params.forEach((y) => {
|
|
1892
1892
|
const g = encodeURIComponent(y.name), w = g !== y.name ? g : y.name;
|
|
1893
|
-
|
|
1894
|
-
}) :
|
|
1893
|
+
d(`${s ? "--data-binary" : "--data-urlencode"} ${M(`${w}=${y.value}`)}`);
|
|
1894
|
+
}) : d(`${s ? "--data-binary" : b("data")} ${M(a.text)}`);
|
|
1895
1895
|
break;
|
|
1896
1896
|
default: {
|
|
1897
1897
|
if (!a.text) break;
|
|
1898
1898
|
let y = !1;
|
|
1899
|
-
if (
|
|
1899
|
+
if (Mn(a.mimeType) && a.text.length > 20)
|
|
1900
1900
|
try {
|
|
1901
1901
|
const g = JSON.parse(a.text);
|
|
1902
|
-
y = !0, a.text.indexOf("'") > 0 ?
|
|
1903
|
-
${JSON.stringify(g, null,
|
|
1904
|
-
EOF`) :
|
|
1905
|
-
${JSON.stringify(g, null,
|
|
1902
|
+
y = !0, a.text.indexOf("'") > 0 ? d(`${s ? "--data-binary" : b("data")} @- <<EOF
|
|
1903
|
+
${JSON.stringify(g, null, h)}
|
|
1904
|
+
EOF`) : d(`${s ? "--data-binary" : b("data")} '
|
|
1905
|
+
${JSON.stringify(g, null, h)}
|
|
1906
1906
|
'`);
|
|
1907
1907
|
} catch {
|
|
1908
1908
|
}
|
|
1909
|
-
y ||
|
|
1909
|
+
y || d(`${s ? "--data-binary" : b("data")} ${M(a.text)}`);
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
1912
|
return m();
|
|
@@ -1921,9 +1921,9 @@ ${JSON.stringify(g, null, d)}
|
|
|
1921
1921
|
extname: ".sh",
|
|
1922
1922
|
installation: () => "brew install httpie"
|
|
1923
1923
|
},
|
|
1924
|
-
convert: ({ allHeaders: e, postData: t, queryObj: r, fullUrl: n, method: l, url: a },
|
|
1924
|
+
convert: ({ allHeaders: e, postData: t, queryObj: r, fullUrl: n, method: l, url: a }, i) => {
|
|
1925
1925
|
var o;
|
|
1926
|
-
const
|
|
1926
|
+
const s = {
|
|
1927
1927
|
body: !1,
|
|
1928
1928
|
cert: !1,
|
|
1929
1929
|
headers: !1,
|
|
@@ -1936,26 +1936,26 @@ ${JSON.stringify(g, null, d)}
|
|
|
1936
1936
|
timeout: !1,
|
|
1937
1937
|
verbose: !1,
|
|
1938
1938
|
verify: !1,
|
|
1939
|
-
...
|
|
1939
|
+
...i
|
|
1940
1940
|
}, { push: c, join: p, unshift: f } = new k({
|
|
1941
|
-
indent:
|
|
1942
|
-
join:
|
|
1943
|
-
${
|
|
1941
|
+
indent: s.indent,
|
|
1942
|
+
join: s.indent !== !1 ? ` \\
|
|
1943
|
+
${s.indent}` : " "
|
|
1944
1944
|
});
|
|
1945
1945
|
let u = !1;
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1946
|
+
const h = [];
|
|
1947
|
+
s.headers && h.push(s.short ? "-h" : "--headers"), s.body && h.push(s.short ? "-b" : "--body"), s.verbose && h.push(s.short ? "-v" : "--verbose"), s.print && h.push(`${s.short ? "-p" : "--print"}=${s.print}`), s.verify && h.push(`--verify=${s.verify}`), s.cert && h.push(`--cert=${s.cert}`), s.pretty && h.push(`--pretty=${s.pretty}`), s.style && h.push(`--style=${s.style}`), s.timeout && h.push(`--timeout=${s.timeout}`), s.queryParams && Object.keys(r).forEach((m) => {
|
|
1948
1948
|
const b = r[m];
|
|
1949
1949
|
Array.isArray(b) ? b.forEach((j) => {
|
|
1950
1950
|
c(`${m}==${M(j)}`);
|
|
1951
1951
|
}) : c(`${m}==${M(b)}`);
|
|
1952
1952
|
}), Object.keys(e).sort().forEach((m) => {
|
|
1953
1953
|
c(`${m}:${M(e[m])}`);
|
|
1954
|
-
}), t.mimeType === "application/x-www-form-urlencoded" ? (o = t.params) != null && o.length && (
|
|
1954
|
+
}), t.mimeType === "application/x-www-form-urlencoded" ? (o = t.params) != null && o.length && (h.push(s.short ? "-f" : "--form"), t.params.forEach((m) => {
|
|
1955
1955
|
c(`${m.name}=${M(m.value)}`);
|
|
1956
1956
|
})) : u = !0;
|
|
1957
|
-
const
|
|
1958
|
-
return a = M(
|
|
1957
|
+
const d = h.length ? `${h.join(" ")} ` : "";
|
|
1958
|
+
return a = M(s.queryParams ? a : n), f(`http ${d}${l} ${a}`), u && t.text && f(`echo ${M(t.text)} | `), p();
|
|
1959
1959
|
}
|
|
1960
1960
|
},
|
|
1961
1961
|
wget: {
|
|
@@ -1972,37 +1972,37 @@ ${i.indent}` : " "
|
|
|
1972
1972
|
short: !1,
|
|
1973
1973
|
verbose: !1,
|
|
1974
1974
|
...l
|
|
1975
|
-
}, { push:
|
|
1975
|
+
}, { push: i, join: o } = new k({
|
|
1976
1976
|
...typeof a.indent == "string" ? { indent: a.indent } : {},
|
|
1977
1977
|
join: a.indent !== !1 ? ` \\
|
|
1978
1978
|
${a.indent}` : " "
|
|
1979
1979
|
});
|
|
1980
|
-
return a.verbose ?
|
|
1981
|
-
const c = `${
|
|
1982
|
-
|
|
1983
|
-
}), t.text &&
|
|
1980
|
+
return a.verbose ? i(`wget ${a.short ? "-v" : "--verbose"}`) : i(`wget ${a.short ? "-q" : "--quiet"}`), i(`--method ${M(e)}`), Object.keys(r).forEach((s) => {
|
|
1981
|
+
const c = `${s}: ${r[s]}`;
|
|
1982
|
+
i(`--header ${M(c)}`);
|
|
1983
|
+
}), t.text && i(`--body-data ${bo(M(t.text))}`), i(a.short ? "-O" : "--output-document"), i(`- ${M(n)}`), o();
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
|
-
},
|
|
1988
|
-
const l =
|
|
1987
|
+
}, lr = (e, t) => t.repeat(e), cr = (e, t, r, n) => {
|
|
1988
|
+
const l = lr(n, r), a = lr(n - 1, r), i = t ? `,
|
|
1989
1989
|
${l}` : ", ";
|
|
1990
1990
|
return t ? `[
|
|
1991
|
-
${l}${e.join(
|
|
1992
|
-
${a}]` : `[${e.join(
|
|
1993
|
-
},
|
|
1991
|
+
${l}${e.join(i)}
|
|
1992
|
+
${a}]` : `[${e.join(i)}]`;
|
|
1993
|
+
}, pr = (e, t, r) => `let ${e} = ${ot(t, r)}`, ot = (e, t, r) => {
|
|
1994
1994
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(e)) {
|
|
1995
1995
|
case "[object Number]":
|
|
1996
1996
|
return e;
|
|
1997
1997
|
case "[object Array]": {
|
|
1998
1998
|
let n = !1;
|
|
1999
1999
|
const l = e.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (n = Object.keys(a).length > 1), ot(a, t, r)));
|
|
2000
|
-
return
|
|
2000
|
+
return cr(l, n, t.indent, r);
|
|
2001
2001
|
}
|
|
2002
2002
|
case "[object Object]": {
|
|
2003
2003
|
const n = [];
|
|
2004
2004
|
for (const l in e) n.push(`"${l}": ${ot(e[l], t, r)}`);
|
|
2005
|
-
return
|
|
2005
|
+
return cr(n, t.pretty && n.length > 1, t.indent, r);
|
|
2006
2006
|
}
|
|
2007
2007
|
case "[object Boolean]":
|
|
2008
2008
|
return e.toString();
|
|
@@ -2010,27 +2010,27 @@ ${a}]` : `[${e.join(s)}]`;
|
|
|
2010
2010
|
return e == null ? "nil" : `"${e.toString().replace(/"/g, '\\"')}"`;
|
|
2011
2011
|
}
|
|
2012
2012
|
}, xe = {
|
|
2013
|
-
agent:
|
|
2014
|
-
c:
|
|
2015
|
-
clojure:
|
|
2016
|
-
crystal:
|
|
2017
|
-
csharp:
|
|
2018
|
-
go:
|
|
2019
|
-
http:
|
|
2020
|
-
java:
|
|
2021
|
-
javascript:
|
|
2022
|
-
json:
|
|
2023
|
-
kotlin:
|
|
2024
|
-
node:
|
|
2025
|
-
objc:
|
|
2026
|
-
ocaml:
|
|
2027
|
-
php:
|
|
2028
|
-
powershell:
|
|
2029
|
-
python:
|
|
2030
|
-
r:
|
|
2031
|
-
ruby:
|
|
2032
|
-
rust:
|
|
2033
|
-
shell:
|
|
2013
|
+
agent: Fn,
|
|
2014
|
+
c: Bn,
|
|
2015
|
+
clojure: Jn,
|
|
2016
|
+
crystal: zn,
|
|
2017
|
+
csharp: Qn,
|
|
2018
|
+
go: Yn,
|
|
2019
|
+
http: Xn,
|
|
2020
|
+
java: Zn,
|
|
2021
|
+
javascript: eo,
|
|
2022
|
+
json: to,
|
|
2023
|
+
kotlin: ro,
|
|
2024
|
+
node: no,
|
|
2025
|
+
objc: oo,
|
|
2026
|
+
ocaml: ao,
|
|
2027
|
+
php: io,
|
|
2028
|
+
powershell: lo,
|
|
2029
|
+
python: po,
|
|
2030
|
+
r: uo,
|
|
2031
|
+
ruby: fo,
|
|
2032
|
+
rust: mo,
|
|
2033
|
+
shell: $o,
|
|
2034
2034
|
swift: {
|
|
2035
2035
|
info: {
|
|
2036
2036
|
key: "swift",
|
|
@@ -2046,67 +2046,67 @@ ${a}]` : `[${e.join(s)}]`;
|
|
|
2046
2046
|
extname: ".swift"
|
|
2047
2047
|
},
|
|
2048
2048
|
convert: ({ allHeaders: e, postData: t, uriObj: r, queryObj: n, method: l }, a) => {
|
|
2049
|
-
var
|
|
2049
|
+
var i;
|
|
2050
2050
|
const o = {
|
|
2051
2051
|
indent: " ",
|
|
2052
2052
|
pretty: !0,
|
|
2053
2053
|
timeout: 10,
|
|
2054
2054
|
...a
|
|
2055
|
-
}, { push:
|
|
2056
|
-
|
|
2055
|
+
}, { push: s, blank: c, join: p } = new k({ indent: o.indent });
|
|
2056
|
+
s("import Foundation"), c();
|
|
2057
2057
|
const f = t.text || t.jsonObj || t.params;
|
|
2058
2058
|
if (f) switch (t.mimeType) {
|
|
2059
2059
|
case "application/x-www-form-urlencoded":
|
|
2060
|
-
if ((
|
|
2061
|
-
const
|
|
2062
|
-
o.pretty ? (
|
|
2063
|
-
|
|
2064
|
-
}),
|
|
2060
|
+
if ((i = t.params) != null && i.length) {
|
|
2061
|
+
const h = t.params.map((d) => `"${d.name}": "${d.value}"`);
|
|
2062
|
+
o.pretty ? (s("let parameters = ["), h.forEach((d) => {
|
|
2063
|
+
s(`${d},`, 1);
|
|
2064
|
+
}), s("]")) : s(`let parameters = [${h.join(", ")}]`), s('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), s("let postData = Data(joinedParameters.utf8)"), c();
|
|
2065
2065
|
}
|
|
2066
2066
|
break;
|
|
2067
2067
|
case "application/json":
|
|
2068
|
-
t.jsonObj && (
|
|
2068
|
+
t.jsonObj && (s(`${pr("parameters", t.jsonObj, o)} as [String : Any?]`), c(), s("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"), c());
|
|
2069
2069
|
break;
|
|
2070
2070
|
case "multipart/form-data":
|
|
2071
|
-
|
|
2071
|
+
s(pr("parameters", t.params, o)), c(), s(`let boundary = "${t.boundary}"`), c(), s('var body = ""'), s("for param in parameters {"), s('let paramName = param["name"]!', 1), s('body += "--\\(boundary)\\r\\n"', 1), s('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1), s('if let filename = param["fileName"] {', 1), s('let contentType = param["contentType"]!', 2), s("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)", 2), s('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2), s('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2), s("body += fileContent", 2), s('} else if let paramValue = param["value"] {', 1), s('body += "\\r\\n\\r\\n\\(paramValue)"', 2), s("}", 1), s("}"), c(), s("let postData = Data(body.utf8)"), c();
|
|
2072
2072
|
break;
|
|
2073
2073
|
default:
|
|
2074
|
-
|
|
2074
|
+
s(`let postData = Data("${t.text}".utf8)`), c();
|
|
2075
2075
|
}
|
|
2076
|
-
|
|
2076
|
+
s(`let url = URL(string: "${r.href}")!`);
|
|
2077
2077
|
const u = n ? Object.entries(n) : [];
|
|
2078
|
-
return u.length < 1 ?
|
|
2079
|
-
const
|
|
2078
|
+
return u.length < 1 ? s("var request = URLRequest(url: url)") : (s("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"), s("let queryItems: [URLQueryItem] = ["), u.forEach((h) => {
|
|
2079
|
+
const d = h[0], m = h[1];
|
|
2080
2080
|
switch (Object.prototype.toString.call(m)) {
|
|
2081
2081
|
case "[object String]":
|
|
2082
|
-
|
|
2082
|
+
s(`URLQueryItem(name: "${d}", value: "${m}"),`, 1);
|
|
2083
2083
|
break;
|
|
2084
2084
|
case "[object Array]":
|
|
2085
2085
|
m.forEach((b) => {
|
|
2086
|
-
|
|
2086
|
+
s(`URLQueryItem(name: "${d}", value: "${b}"),`, 1);
|
|
2087
2087
|
});
|
|
2088
2088
|
break;
|
|
2089
2089
|
}
|
|
2090
|
-
}),
|
|
2090
|
+
}), s("]"), s("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"), c(), s("var request = URLRequest(url: components.url!)")), s(`request.httpMethod = "${l}"`), s(`request.timeoutInterval = ${o.timeout}`), Object.keys(e).length && s(`request.allHTTPHeaderFields = ${ot(e, o)}`), f && s("request.httpBody = postData"), c(), s("let (data, _) = try await URLSession.shared.data(for: request)"), s("print(String(decoding: data, as: UTF8.self))"), p();
|
|
2091
2091
|
}
|
|
2092
2092
|
} }
|
|
2093
2093
|
}
|
|
2094
|
-
},
|
|
2094
|
+
}, ur = (e, t) => {
|
|
2095
2095
|
const r = e[t.name];
|
|
2096
2096
|
return r === void 0 ? (e[t.name] = t.value, e) : Array.isArray(r) ? (r.push(t.value), e) : (e[t.name] = [r, t.value], e);
|
|
2097
2097
|
};
|
|
2098
2098
|
var at = { exports: {} };
|
|
2099
2099
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
2100
|
-
var
|
|
2100
|
+
var vo = at.exports;
|
|
2101
2101
|
(function(e, t) {
|
|
2102
2102
|
(function(r) {
|
|
2103
2103
|
var n = t && !t.nodeType && t, l = e && !e.nodeType && e, a = typeof rt == "object" && rt;
|
|
2104
2104
|
(a.global === a || a.window === a || a.self === a) && (r = a);
|
|
2105
|
-
var
|
|
2105
|
+
var i, o = 2147483647, s = 36, c = 1, p = 26, f = 38, u = 700, h = 72, d = 128, m = "-", b = /^xn--/, j = /[^\x20-\x7E]/, y = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
|
|
2106
2106
|
overflow: "Overflow: input needs wider integers to process",
|
|
2107
2107
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
2108
2108
|
"invalid-input": "Invalid input"
|
|
2109
|
-
}, w =
|
|
2109
|
+
}, w = s - c, O = Math.floor, $ = String.fromCharCode, E;
|
|
2110
2110
|
function S(v) {
|
|
2111
2111
|
throw new RangeError(g[v]);
|
|
2112
2112
|
}
|
|
@@ -2133,39 +2133,39 @@ var ko = at.exports;
|
|
|
2133
2133
|
}).join("");
|
|
2134
2134
|
}
|
|
2135
2135
|
function L(v) {
|
|
2136
|
-
return v - 48 < 10 ? v - 22 : v - 65 < 26 ? v - 65 : v - 97 < 26 ? v - 97 :
|
|
2136
|
+
return v - 48 < 10 ? v - 22 : v - 65 < 26 ? v - 65 : v - 97 < 26 ? v - 97 : s;
|
|
2137
2137
|
}
|
|
2138
2138
|
function J(v, T) {
|
|
2139
2139
|
return v + 22 + 75 * (v < 26) - ((T != 0) << 5);
|
|
2140
2140
|
}
|
|
2141
2141
|
function F(v, T, P) {
|
|
2142
2142
|
var R = 0;
|
|
2143
|
-
for (v = P ? O(v / u) : v >> 1, v += O(v / T); v > w * p >> 1; R +=
|
|
2143
|
+
for (v = P ? O(v / u) : v >> 1, v += O(v / T); v > w * p >> 1; R += s)
|
|
2144
2144
|
v = O(v / w);
|
|
2145
2145
|
return O(R + (w + 1) * v / (v + f));
|
|
2146
2146
|
}
|
|
2147
|
-
function
|
|
2148
|
-
var T = [], P = v.length, R, N = 0, z =
|
|
2149
|
-
for (
|
|
2147
|
+
function K(v) {
|
|
2148
|
+
var T = [], P = v.length, R, N = 0, z = d, I = h, V, X, te, ce, B, G, Z, fe, ye;
|
|
2149
|
+
for (V = v.lastIndexOf(m), V < 0 && (V = 0), X = 0; X < V; ++X)
|
|
2150
2150
|
v.charCodeAt(X) >= 128 && S("not-basic"), T.push(v.charCodeAt(X));
|
|
2151
|
-
for (te =
|
|
2152
|
-
for (ce = N, B = 1, G =
|
|
2153
|
-
ye =
|
|
2151
|
+
for (te = V > 0 ? V + 1 : 0; te < P; ) {
|
|
2152
|
+
for (ce = N, B = 1, G = s; te >= P && S("invalid-input"), Z = L(v.charCodeAt(te++)), (Z >= s || Z > O((o - N) / B)) && S("overflow"), N += Z * B, fe = G <= I ? c : G >= I + p ? p : G - I, !(Z < fe); G += s)
|
|
2153
|
+
ye = s - fe, B > O(o / ye) && S("overflow"), B *= ye;
|
|
2154
2154
|
R = T.length + 1, I = F(N - ce, R, ce == 0), O(N / R) > o - z && S("overflow"), z += O(N / R), N %= R, T.splice(N++, 0, z);
|
|
2155
2155
|
}
|
|
2156
2156
|
return Y(T);
|
|
2157
2157
|
}
|
|
2158
2158
|
function ue(v) {
|
|
2159
|
-
var T, P, R, N, z, I,
|
|
2160
|
-
for (v = Q(v), Z = v.length, T =
|
|
2159
|
+
var T, P, R, N, z, I, V, X, te, ce, B, G = [], Z, fe, ye, mt;
|
|
2160
|
+
for (v = Q(v), Z = v.length, T = d, P = 0, z = h, I = 0; I < Z; ++I)
|
|
2161
2161
|
B = v[I], B < 128 && G.push($(B));
|
|
2162
2162
|
for (R = N = G.length, N && G.push(m); R < Z; ) {
|
|
2163
|
-
for (
|
|
2164
|
-
B = v[I], B >= T && B <
|
|
2165
|
-
for (fe = R + 1,
|
|
2163
|
+
for (V = o, I = 0; I < Z; ++I)
|
|
2164
|
+
B = v[I], B >= T && B < V && (V = B);
|
|
2165
|
+
for (fe = R + 1, V - T > O((o - P) / fe) && S("overflow"), P += (V - T) * fe, T = V, I = 0; I < Z; ++I)
|
|
2166
2166
|
if (B = v[I], B < T && ++P > o && S("overflow"), B == T) {
|
|
2167
|
-
for (X = P, te =
|
|
2168
|
-
mt = X - ce, ye =
|
|
2167
|
+
for (X = P, te = s; ce = te <= z ? c : te >= z + p ? p : te - z, !(X < ce); te += s)
|
|
2168
|
+
mt = X - ce, ye = s - ce, G.push(
|
|
2169
2169
|
$(J(ce + mt % ye, 0))
|
|
2170
2170
|
), X = O(mt / ye);
|
|
2171
2171
|
G.push($(J(X, 0))), z = F(P, fe, R == N), P = 0, ++R;
|
|
@@ -2176,7 +2176,7 @@ var ko = at.exports;
|
|
|
2176
2176
|
}
|
|
2177
2177
|
function yt(v) {
|
|
2178
2178
|
return _(v, function(T) {
|
|
2179
|
-
return b.test(T) ?
|
|
2179
|
+
return b.test(T) ? K(T.slice(4).toLowerCase()) : T;
|
|
2180
2180
|
});
|
|
2181
2181
|
}
|
|
2182
2182
|
function ze(v) {
|
|
@@ -2184,7 +2184,7 @@ var ko = at.exports;
|
|
|
2184
2184
|
return j.test(T) ? "xn--" + ue(T) : T;
|
|
2185
2185
|
});
|
|
2186
2186
|
}
|
|
2187
|
-
if (
|
|
2187
|
+
if (i = {
|
|
2188
2188
|
/**
|
|
2189
2189
|
* A string representing the current Punycode.js version number.
|
|
2190
2190
|
* @memberOf punycode
|
|
@@ -2202,59 +2202,59 @@ var ko = at.exports;
|
|
|
2202
2202
|
decode: Q,
|
|
2203
2203
|
encode: Y
|
|
2204
2204
|
},
|
|
2205
|
-
decode:
|
|
2205
|
+
decode: K,
|
|
2206
2206
|
encode: ue,
|
|
2207
2207
|
toASCII: ze,
|
|
2208
2208
|
toUnicode: yt
|
|
2209
2209
|
}, n && l)
|
|
2210
2210
|
if (e.exports == n)
|
|
2211
|
-
l.exports =
|
|
2211
|
+
l.exports = i;
|
|
2212
2212
|
else
|
|
2213
|
-
for (E in
|
|
2214
|
-
|
|
2213
|
+
for (E in i)
|
|
2214
|
+
i.hasOwnProperty(E) && (n[E] = i[E]);
|
|
2215
2215
|
else
|
|
2216
|
-
r.punycode =
|
|
2217
|
-
})(
|
|
2216
|
+
r.punycode = i;
|
|
2217
|
+
})(vo);
|
|
2218
2218
|
})(at, at.exports);
|
|
2219
|
-
var
|
|
2220
|
-
const
|
|
2221
|
-
Object.assign(
|
|
2222
|
-
const
|
|
2219
|
+
var wo = at.exports, Ne = TypeError;
|
|
2220
|
+
const Gr = (e) => String(e);
|
|
2221
|
+
Object.assign(Gr, { custom: Symbol.for("nodejs.util.inspect.custom") });
|
|
2222
|
+
const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2223
2223
|
__proto__: null,
|
|
2224
|
-
default:
|
|
2225
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2226
|
-
var
|
|
2224
|
+
default: Gr
|
|
2225
|
+
}, Symbol.toStringTag, { value: "Module" })), So = /* @__PURE__ */ qn(Oo);
|
|
2226
|
+
var zt = typeof Map == "function" && Map.prototype, gt = Object.getOwnPropertyDescriptor && zt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, it = zt && gt && typeof gt.get == "function" ? gt.get : null, fr = zt && Map.prototype.forEach, Kt = typeof Set == "function" && Set.prototype, jt = Object.getOwnPropertyDescriptor && Kt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, st = Kt && jt && typeof jt.get == "function" ? jt.get : null, hr = Kt && Set.prototype.forEach, To = typeof WeakMap == "function" && WeakMap.prototype, De = To ? WeakMap.prototype.has : null, ko = typeof WeakSet == "function" && WeakSet.prototype, _e = ko ? WeakSet.prototype.has : null, xo = typeof WeakRef == "function" && WeakRef.prototype, dr = xo ? WeakRef.prototype.deref : null, Eo = Boolean.prototype.valueOf, Po = Object.prototype.toString, Co = Function.prototype.toString, Ao = String.prototype.match, Vt = String.prototype.slice, he = String.prototype.replace, Ro = String.prototype.toUpperCase, yr = String.prototype.toLowerCase, Qr = RegExp.prototype.test, mr = Array.prototype.concat, ie = Array.prototype.join, qo = Array.prototype.slice, br = Math.floor, Lt = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, $t = Object.getOwnPropertySymbols, Ut = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, Re = typeof Symbol == "function" && typeof Symbol.iterator == "object", He = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === Re || !0) ? Symbol.toStringTag : null, Yr = Object.prototype.propertyIsEnumerable, gr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e) {
|
|
2227
2227
|
return e.__proto__;
|
|
2228
2228
|
} : null);
|
|
2229
|
-
function
|
|
2230
|
-
if (e === 1 / 0 || e === -1 / 0 || e !== e || e && e > -1e3 && e < 1e3 ||
|
|
2229
|
+
function jr(e, t) {
|
|
2230
|
+
if (e === 1 / 0 || e === -1 / 0 || e !== e || e && e > -1e3 && e < 1e3 || Qr.call(/e/, t))
|
|
2231
2231
|
return t;
|
|
2232
2232
|
var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
2233
2233
|
if (typeof e == "number") {
|
|
2234
|
-
var n = e < 0 ? -
|
|
2234
|
+
var n = e < 0 ? -br(-e) : br(e);
|
|
2235
2235
|
if (n !== e) {
|
|
2236
|
-
var l = String(n), a =
|
|
2237
|
-
return
|
|
2236
|
+
var l = String(n), a = Vt.call(t, l.length + 1);
|
|
2237
|
+
return he.call(l, r, "$&_") + "." + he.call(he.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
|
-
return
|
|
2240
|
+
return he.call(t, r, "$&_");
|
|
2241
2241
|
}
|
|
2242
|
-
var
|
|
2242
|
+
var Dt = So, $r = Dt.custom, vr = en($r) ? $r : null, Xr = {
|
|
2243
2243
|
__proto__: null,
|
|
2244
2244
|
double: '"',
|
|
2245
2245
|
single: "'"
|
|
2246
|
-
},
|
|
2246
|
+
}, No = {
|
|
2247
2247
|
__proto__: null,
|
|
2248
2248
|
double: /(["\\])/g,
|
|
2249
2249
|
single: /(['\\])/g
|
|
2250
2250
|
}, pt = function e(t, r, n, l) {
|
|
2251
2251
|
var a = r || {};
|
|
2252
|
-
if (pe(a, "quoteStyle") && !pe(
|
|
2252
|
+
if (pe(a, "quoteStyle") && !pe(Xr, a.quoteStyle))
|
|
2253
2253
|
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
2254
2254
|
if (pe(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
|
|
2255
2255
|
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
2256
|
-
var
|
|
2257
|
-
if (typeof
|
|
2256
|
+
var i = pe(a, "customInspect") ? a.customInspect : !0;
|
|
2257
|
+
if (typeof i != "boolean" && i !== "symbol")
|
|
2258
2258
|
throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
2259
2259
|
if (pe(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
|
|
2260
2260
|
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
@@ -2268,168 +2268,168 @@ var Ht = Po, wr = Ht.custom, Or = an(wr) ? wr : null, nn = {
|
|
|
2268
2268
|
if (typeof t == "boolean")
|
|
2269
2269
|
return t ? "true" : "false";
|
|
2270
2270
|
if (typeof t == "string")
|
|
2271
|
-
return
|
|
2271
|
+
return rn(t, a);
|
|
2272
2272
|
if (typeof t == "number") {
|
|
2273
2273
|
if (t === 0)
|
|
2274
2274
|
return 1 / 0 / t > 0 ? "0" : "-0";
|
|
2275
|
-
var
|
|
2276
|
-
return o ?
|
|
2275
|
+
var s = String(t);
|
|
2276
|
+
return o ? jr(t, s) : s;
|
|
2277
2277
|
}
|
|
2278
2278
|
if (typeof t == "bigint") {
|
|
2279
2279
|
var c = String(t) + "n";
|
|
2280
|
-
return o ?
|
|
2280
|
+
return o ? jr(t, c) : c;
|
|
2281
2281
|
}
|
|
2282
2282
|
var p = typeof a.depth > "u" ? 5 : a.depth;
|
|
2283
2283
|
if (typeof n > "u" && (n = 0), n >= p && p > 0 && typeof t == "object")
|
|
2284
|
-
return
|
|
2285
|
-
var f =
|
|
2284
|
+
return _t(t) ? "[Array]" : "[Object]";
|
|
2285
|
+
var f = Xo(a, n);
|
|
2286
2286
|
if (typeof l > "u")
|
|
2287
2287
|
l = [];
|
|
2288
|
-
else if (
|
|
2288
|
+
else if (tn(l, t) >= 0)
|
|
2289
2289
|
return "[Circular]";
|
|
2290
2290
|
function u(L, J, F) {
|
|
2291
|
-
if (J && (l =
|
|
2292
|
-
var
|
|
2291
|
+
if (J && (l = qo.call(l), l.push(J)), F) {
|
|
2292
|
+
var K = {
|
|
2293
2293
|
depth: a.depth
|
|
2294
2294
|
};
|
|
2295
|
-
return pe(a, "quoteStyle") && (
|
|
2295
|
+
return pe(a, "quoteStyle") && (K.quoteStyle = a.quoteStyle), e(L, K, n + 1, l);
|
|
2296
2296
|
}
|
|
2297
2297
|
return e(L, a, n + 1, l);
|
|
2298
2298
|
}
|
|
2299
|
-
if (typeof t == "function" && !
|
|
2300
|
-
var
|
|
2301
|
-
return "[Function" + (
|
|
2299
|
+
if (typeof t == "function" && !wr(t)) {
|
|
2300
|
+
var h = Bo(t), d = Ke(t, u);
|
|
2301
|
+
return "[Function" + (h ? ": " + h : " (anonymous)") + "]" + (d.length > 0 ? " { " + ie.call(d, ", ") + " }" : "");
|
|
2302
2302
|
}
|
|
2303
|
-
if (
|
|
2304
|
-
var m = Re ?
|
|
2303
|
+
if (en(t)) {
|
|
2304
|
+
var m = Re ? he.call(String(t), /^(Symbol\(.*\))_[^)]*$/, "$1") : Ut.call(t);
|
|
2305
2305
|
return typeof t == "object" && !Re ? Le(m) : m;
|
|
2306
2306
|
}
|
|
2307
|
-
if (
|
|
2308
|
-
for (var b = "<" +
|
|
2309
|
-
b += " " + j[y].name + "=" +
|
|
2310
|
-
return b += ">", t.childNodes && t.childNodes.length && (b += "..."), b += "</" +
|
|
2307
|
+
if (Go(t)) {
|
|
2308
|
+
for (var b = "<" + yr.call(String(t.nodeName)), j = t.attributes || [], y = 0; y < j.length; y++)
|
|
2309
|
+
b += " " + j[y].name + "=" + Zr(Lo(j[y].value), "double", a);
|
|
2310
|
+
return b += ">", t.childNodes && t.childNodes.length && (b += "..."), b += "</" + yr.call(String(t.nodeName)) + ">", b;
|
|
2311
2311
|
}
|
|
2312
|
-
if (
|
|
2312
|
+
if (_t(t)) {
|
|
2313
2313
|
if (t.length === 0)
|
|
2314
2314
|
return "[]";
|
|
2315
|
-
var g =
|
|
2316
|
-
return f && !
|
|
2315
|
+
var g = Ke(t, u);
|
|
2316
|
+
return f && !Yo(g) ? "[" + Ht(g, f) + "]" : "[ " + ie.call(g, ", ") + " ]";
|
|
2317
2317
|
}
|
|
2318
|
-
if (
|
|
2319
|
-
var w =
|
|
2320
|
-
return !("cause" in Error.prototype) && "cause" in t && !
|
|
2318
|
+
if (Do(t)) {
|
|
2319
|
+
var w = Ke(t, u);
|
|
2320
|
+
return !("cause" in Error.prototype) && "cause" in t && !Yr.call(t, "cause") ? "{ [" + String(t) + "] " + ie.call(mr.call("[cause]: " + u(t.cause), w), ", ") + " }" : w.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + ie.call(w, ", ") + " }";
|
|
2321
2321
|
}
|
|
2322
|
-
if (typeof t == "object" &&
|
|
2323
|
-
if (
|
|
2324
|
-
return
|
|
2325
|
-
if (
|
|
2322
|
+
if (typeof t == "object" && i) {
|
|
2323
|
+
if (vr && typeof t[vr] == "function" && Dt)
|
|
2324
|
+
return Dt(t, { depth: p - n });
|
|
2325
|
+
if (i !== "symbol" && typeof t.inspect == "function")
|
|
2326
2326
|
return t.inspect();
|
|
2327
2327
|
}
|
|
2328
|
-
if (
|
|
2328
|
+
if (Wo(t)) {
|
|
2329
2329
|
var O = [];
|
|
2330
|
-
return
|
|
2330
|
+
return fr && fr.call(t, function(L, J) {
|
|
2331
2331
|
O.push(u(J, t, !0) + " => " + u(L, t));
|
|
2332
|
-
}),
|
|
2332
|
+
}), Or("Map", it.call(t), O, f);
|
|
2333
2333
|
}
|
|
2334
|
-
if (
|
|
2334
|
+
if (Ko(t)) {
|
|
2335
2335
|
var $ = [];
|
|
2336
|
-
return
|
|
2336
|
+
return hr && hr.call(t, function(L) {
|
|
2337
2337
|
$.push(u(L, t));
|
|
2338
|
-
}),
|
|
2338
|
+
}), Or("Set", st.call(t), $, f);
|
|
2339
2339
|
}
|
|
2340
|
-
if (
|
|
2340
|
+
if (Jo(t))
|
|
2341
2341
|
return vt("WeakMap");
|
|
2342
|
-
if (
|
|
2342
|
+
if (Vo(t))
|
|
2343
2343
|
return vt("WeakSet");
|
|
2344
|
-
if (
|
|
2344
|
+
if (zo(t))
|
|
2345
2345
|
return vt("WeakRef");
|
|
2346
|
-
if (
|
|
2346
|
+
if (Ho(t))
|
|
2347
2347
|
return Le(u(Number(t)));
|
|
2348
|
-
if (
|
|
2349
|
-
return Le(u(
|
|
2350
|
-
if (
|
|
2351
|
-
return Le(
|
|
2352
|
-
if (
|
|
2348
|
+
if (Mo(t))
|
|
2349
|
+
return Le(u(Lt.call(t)));
|
|
2350
|
+
if (Io(t))
|
|
2351
|
+
return Le(Eo.call(t));
|
|
2352
|
+
if (_o(t))
|
|
2353
2353
|
return Le(u(String(t)));
|
|
2354
2354
|
if (typeof window < "u" && t === window)
|
|
2355
2355
|
return "{ [object Window] }";
|
|
2356
2356
|
if (typeof globalThis < "u" && t === globalThis || typeof rt < "u" && t === rt)
|
|
2357
2357
|
return "{ [object globalThis] }";
|
|
2358
|
-
if (!
|
|
2359
|
-
var E =
|
|
2360
|
-
return E.length === 0 ? Y + "{}" : f ? Y + "{" +
|
|
2358
|
+
if (!Uo(t) && !wr(t)) {
|
|
2359
|
+
var E = Ke(t, u), S = gr ? gr(t) === Object.prototype : t instanceof Object || t.constructor === Object, C = t instanceof Object ? "" : "null prototype", _ = !S && He && Object(t) === t && He in t ? Vt.call(de(t), 8, -1) : C ? "Object" : "", Q = S || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "", Y = Q + (_ || C ? "[" + ie.call(mr.call([], _ || [], C || []), ": ") + "] " : "");
|
|
2360
|
+
return E.length === 0 ? Y + "{}" : f ? Y + "{" + Ht(E, f) + "}" : Y + "{ " + ie.call(E, ", ") + " }";
|
|
2361
2361
|
}
|
|
2362
2362
|
return String(t);
|
|
2363
2363
|
};
|
|
2364
|
-
function
|
|
2365
|
-
var n = r.quoteStyle || t, l =
|
|
2364
|
+
function Zr(e, t, r) {
|
|
2365
|
+
var n = r.quoteStyle || t, l = Xr[n];
|
|
2366
2366
|
return l + e + l;
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2369
|
-
return
|
|
2368
|
+
function Lo(e) {
|
|
2369
|
+
return he.call(String(e), /"/g, """);
|
|
2370
2370
|
}
|
|
2371
2371
|
function ve(e) {
|
|
2372
2372
|
return !He || !(typeof e == "object" && (He in e || typeof e[He] < "u"));
|
|
2373
2373
|
}
|
|
2374
|
-
function
|
|
2375
|
-
return
|
|
2374
|
+
function _t(e) {
|
|
2375
|
+
return de(e) === "[object Array]" && ve(e);
|
|
2376
2376
|
}
|
|
2377
|
-
function
|
|
2378
|
-
return
|
|
2377
|
+
function Uo(e) {
|
|
2378
|
+
return de(e) === "[object Date]" && ve(e);
|
|
2379
2379
|
}
|
|
2380
|
-
function
|
|
2381
|
-
return
|
|
2380
|
+
function wr(e) {
|
|
2381
|
+
return de(e) === "[object RegExp]" && ve(e);
|
|
2382
2382
|
}
|
|
2383
|
-
function
|
|
2384
|
-
return
|
|
2383
|
+
function Do(e) {
|
|
2384
|
+
return de(e) === "[object Error]" && ve(e);
|
|
2385
2385
|
}
|
|
2386
|
-
function
|
|
2387
|
-
return
|
|
2386
|
+
function _o(e) {
|
|
2387
|
+
return de(e) === "[object String]" && ve(e);
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2390
|
-
return
|
|
2389
|
+
function Ho(e) {
|
|
2390
|
+
return de(e) === "[object Number]" && ve(e);
|
|
2391
2391
|
}
|
|
2392
|
-
function
|
|
2393
|
-
return
|
|
2392
|
+
function Io(e) {
|
|
2393
|
+
return de(e) === "[object Boolean]" && ve(e);
|
|
2394
2394
|
}
|
|
2395
|
-
function
|
|
2395
|
+
function en(e) {
|
|
2396
2396
|
if (Re)
|
|
2397
2397
|
return e && typeof e == "object" && e instanceof Symbol;
|
|
2398
2398
|
if (typeof e == "symbol")
|
|
2399
2399
|
return !0;
|
|
2400
|
-
if (!e || typeof e != "object" || !
|
|
2400
|
+
if (!e || typeof e != "object" || !Ut)
|
|
2401
2401
|
return !1;
|
|
2402
2402
|
try {
|
|
2403
|
-
return
|
|
2403
|
+
return Ut.call(e), !0;
|
|
2404
2404
|
} catch {
|
|
2405
2405
|
}
|
|
2406
2406
|
return !1;
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2409
|
-
if (!e || typeof e != "object" || !
|
|
2408
|
+
function Mo(e) {
|
|
2409
|
+
if (!e || typeof e != "object" || !Lt)
|
|
2410
2410
|
return !1;
|
|
2411
2411
|
try {
|
|
2412
|
-
return
|
|
2412
|
+
return Lt.call(e), !0;
|
|
2413
2413
|
} catch {
|
|
2414
2414
|
}
|
|
2415
2415
|
return !1;
|
|
2416
2416
|
}
|
|
2417
|
-
var
|
|
2417
|
+
var Fo = Object.prototype.hasOwnProperty || function(e) {
|
|
2418
2418
|
return e in this;
|
|
2419
2419
|
};
|
|
2420
2420
|
function pe(e, t) {
|
|
2421
|
-
return
|
|
2421
|
+
return Fo.call(e, t);
|
|
2422
2422
|
}
|
|
2423
|
-
function
|
|
2424
|
-
return
|
|
2423
|
+
function de(e) {
|
|
2424
|
+
return Po.call(e);
|
|
2425
2425
|
}
|
|
2426
|
-
function
|
|
2426
|
+
function Bo(e) {
|
|
2427
2427
|
if (e.name)
|
|
2428
2428
|
return e.name;
|
|
2429
|
-
var t =
|
|
2429
|
+
var t = Ao.call(Co.call(e), /^function\s*([\w$]+)/);
|
|
2430
2430
|
return t ? t[1] : null;
|
|
2431
2431
|
}
|
|
2432
|
-
function
|
|
2432
|
+
function tn(e, t) {
|
|
2433
2433
|
if (e.indexOf)
|
|
2434
2434
|
return e.indexOf(t);
|
|
2435
2435
|
for (var r = 0, n = e.length; r < n; r++)
|
|
@@ -2437,7 +2437,7 @@ function sn(e, t) {
|
|
|
2437
2437
|
return r;
|
|
2438
2438
|
return -1;
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2440
|
+
function Wo(e) {
|
|
2441
2441
|
if (!it || !e || typeof e != "object")
|
|
2442
2442
|
return !1;
|
|
2443
2443
|
try {
|
|
@@ -2452,7 +2452,7 @@ function Go(e) {
|
|
|
2452
2452
|
}
|
|
2453
2453
|
return !1;
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function Jo(e) {
|
|
2456
2456
|
if (!De || !e || typeof e != "object")
|
|
2457
2457
|
return !1;
|
|
2458
2458
|
try {
|
|
@@ -2467,16 +2467,16 @@ function Qo(e) {
|
|
|
2467
2467
|
}
|
|
2468
2468
|
return !1;
|
|
2469
2469
|
}
|
|
2470
|
-
function
|
|
2471
|
-
if (!
|
|
2470
|
+
function zo(e) {
|
|
2471
|
+
if (!dr || !e || typeof e != "object")
|
|
2472
2472
|
return !1;
|
|
2473
2473
|
try {
|
|
2474
|
-
return
|
|
2474
|
+
return dr.call(e), !0;
|
|
2475
2475
|
} catch {
|
|
2476
2476
|
}
|
|
2477
2477
|
return !1;
|
|
2478
2478
|
}
|
|
2479
|
-
function
|
|
2479
|
+
function Ko(e) {
|
|
2480
2480
|
if (!st || !e || typeof e != "object")
|
|
2481
2481
|
return !1;
|
|
2482
2482
|
try {
|
|
@@ -2491,7 +2491,7 @@ function Xo(e) {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
return !1;
|
|
2493
2493
|
}
|
|
2494
|
-
function
|
|
2494
|
+
function Vo(e) {
|
|
2495
2495
|
if (!_e || !e || typeof e != "object")
|
|
2496
2496
|
return !1;
|
|
2497
2497
|
try {
|
|
@@ -2506,20 +2506,20 @@ function Zo(e) {
|
|
|
2506
2506
|
}
|
|
2507
2507
|
return !1;
|
|
2508
2508
|
}
|
|
2509
|
-
function
|
|
2509
|
+
function Go(e) {
|
|
2510
2510
|
return !e || typeof e != "object" ? !1 : typeof HTMLElement < "u" && e instanceof HTMLElement ? !0 : typeof e.nodeName == "string" && typeof e.getAttribute == "function";
|
|
2511
2511
|
}
|
|
2512
|
-
function
|
|
2512
|
+
function rn(e, t) {
|
|
2513
2513
|
if (e.length > t.maxStringLength) {
|
|
2514
2514
|
var r = e.length - t.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
|
|
2515
|
-
return
|
|
2515
|
+
return rn(Vt.call(e, 0, t.maxStringLength), t) + n;
|
|
2516
2516
|
}
|
|
2517
|
-
var l =
|
|
2517
|
+
var l = No[t.quoteStyle || "single"];
|
|
2518
2518
|
l.lastIndex = 0;
|
|
2519
|
-
var a =
|
|
2520
|
-
return
|
|
2519
|
+
var a = he.call(he.call(e, l, "\\$1"), /[\x00-\x1f]/g, Qo);
|
|
2520
|
+
return Zr(a, "single", t);
|
|
2521
2521
|
}
|
|
2522
|
-
function
|
|
2522
|
+
function Qo(e) {
|
|
2523
2523
|
var t = e.charCodeAt(0), r = {
|
|
2524
2524
|
8: "b",
|
|
2525
2525
|
9: "t",
|
|
@@ -2527,7 +2527,7 @@ function ta(e) {
|
|
|
2527
2527
|
12: "f",
|
|
2528
2528
|
13: "r"
|
|
2529
2529
|
}[t];
|
|
2530
|
-
return r ? "\\" + r : "\\x" + (t < 16 ? "0" : "") +
|
|
2530
|
+
return r ? "\\" + r : "\\x" + (t < 16 ? "0" : "") + Ro.call(t.toString(16));
|
|
2531
2531
|
}
|
|
2532
2532
|
function Le(e) {
|
|
2533
2533
|
return "Object(" + e + ")";
|
|
@@ -2535,18 +2535,18 @@ function Le(e) {
|
|
|
2535
2535
|
function vt(e) {
|
|
2536
2536
|
return e + " { ? }";
|
|
2537
2537
|
}
|
|
2538
|
-
function
|
|
2539
|
-
var l = n ?
|
|
2538
|
+
function Or(e, t, r, n) {
|
|
2539
|
+
var l = n ? Ht(r, n) : ie.call(r, ", ");
|
|
2540
2540
|
return e + " (" + t + ") {" + l + "}";
|
|
2541
2541
|
}
|
|
2542
|
-
function
|
|
2542
|
+
function Yo(e) {
|
|
2543
2543
|
for (var t = 0; t < e.length; t++)
|
|
2544
|
-
if (
|
|
2544
|
+
if (tn(e[t], `
|
|
2545
2545
|
`) >= 0)
|
|
2546
2546
|
return !1;
|
|
2547
2547
|
return !0;
|
|
2548
2548
|
}
|
|
2549
|
-
function
|
|
2549
|
+
function Xo(e, t) {
|
|
2550
2550
|
var r;
|
|
2551
2551
|
if (e.indent === " ")
|
|
2552
2552
|
r = " ";
|
|
@@ -2559,7 +2559,7 @@ function na(e, t) {
|
|
|
2559
2559
|
prev: ie.call(Array(t + 1), r)
|
|
2560
2560
|
};
|
|
2561
2561
|
}
|
|
2562
|
-
function
|
|
2562
|
+
function Ht(e, t) {
|
|
2563
2563
|
if (e.length === 0)
|
|
2564
2564
|
return "";
|
|
2565
2565
|
var r = `
|
|
@@ -2567,37 +2567,37 @@ function Mt(e, t) {
|
|
|
2567
2567
|
return r + ie.call(e, "," + r) + `
|
|
2568
2568
|
` + t.prev;
|
|
2569
2569
|
}
|
|
2570
|
-
function
|
|
2571
|
-
var r =
|
|
2570
|
+
function Ke(e, t) {
|
|
2571
|
+
var r = _t(e), n = [];
|
|
2572
2572
|
if (r) {
|
|
2573
2573
|
n.length = e.length;
|
|
2574
2574
|
for (var l = 0; l < e.length; l++)
|
|
2575
2575
|
n[l] = pe(e, l) ? t(e[l], e) : "";
|
|
2576
2576
|
}
|
|
2577
|
-
var a = typeof $t == "function" ? $t(e) : [],
|
|
2577
|
+
var a = typeof $t == "function" ? $t(e) : [], i;
|
|
2578
2578
|
if (Re) {
|
|
2579
|
-
|
|
2579
|
+
i = {};
|
|
2580
2580
|
for (var o = 0; o < a.length; o++)
|
|
2581
|
-
|
|
2581
|
+
i["$" + a[o]] = a[o];
|
|
2582
2582
|
}
|
|
2583
|
-
for (var
|
|
2584
|
-
pe(e,
|
|
2583
|
+
for (var s in e)
|
|
2584
|
+
pe(e, s) && (r && String(Number(s)) === s && s < e.length || Re && i["$" + s] instanceof Symbol || (Qr.call(/[^\w$]/, s) ? n.push(t(s, e) + ": " + t(e[s], e)) : n.push(s + ": " + t(e[s], e))));
|
|
2585
2585
|
if (typeof $t == "function")
|
|
2586
2586
|
for (var c = 0; c < a.length; c++)
|
|
2587
|
-
|
|
2587
|
+
Yr.call(e, a[c]) && n.push("[" + t(a[c]) + "]: " + t(e[a[c]], e));
|
|
2588
2588
|
return n;
|
|
2589
2589
|
}
|
|
2590
|
-
var
|
|
2590
|
+
var Zo = pt, ea = Ne, ut = function(e, t, r) {
|
|
2591
2591
|
for (var n = e, l; (l = n.next) != null; n = l)
|
|
2592
2592
|
if (l.key === t)
|
|
2593
2593
|
return n.next = l.next, r || (l.next = /** @type {NonNullable<typeof list.next>} */
|
|
2594
2594
|
e.next, e.next = l), l;
|
|
2595
|
-
},
|
|
2595
|
+
}, ta = function(e, t) {
|
|
2596
2596
|
if (e) {
|
|
2597
2597
|
var r = ut(e, t);
|
|
2598
2598
|
return r && r.value;
|
|
2599
2599
|
}
|
|
2600
|
-
},
|
|
2600
|
+
}, ra = function(e, t, r) {
|
|
2601
2601
|
var n = ut(e, t);
|
|
2602
2602
|
n ? n.value = r : e.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
|
|
2603
2603
|
{
|
|
@@ -2606,31 +2606,31 @@ var oa = pt, aa = Ne, ut = function(e, t, r) {
|
|
|
2606
2606
|
next: e.next,
|
|
2607
2607
|
value: r
|
|
2608
2608
|
};
|
|
2609
|
-
},
|
|
2609
|
+
}, na = function(e, t) {
|
|
2610
2610
|
return e ? !!ut(e, t) : !1;
|
|
2611
|
-
},
|
|
2611
|
+
}, oa = function(e, t) {
|
|
2612
2612
|
if (e)
|
|
2613
2613
|
return ut(e, t, !0);
|
|
2614
|
-
},
|
|
2614
|
+
}, aa = function() {
|
|
2615
2615
|
var e, t = {
|
|
2616
2616
|
assert: function(r) {
|
|
2617
2617
|
if (!t.has(r))
|
|
2618
|
-
throw new
|
|
2618
|
+
throw new ea("Side channel does not contain " + Zo(r));
|
|
2619
2619
|
},
|
|
2620
2620
|
delete: function(r) {
|
|
2621
|
-
var n =
|
|
2621
|
+
var n = oa(e, r);
|
|
2622
2622
|
return n && e && !e.next && (e = void 0), !!n;
|
|
2623
2623
|
},
|
|
2624
2624
|
get: function(r) {
|
|
2625
|
-
return
|
|
2625
|
+
return ta(e, r);
|
|
2626
2626
|
},
|
|
2627
2627
|
has: function(r) {
|
|
2628
|
-
return
|
|
2628
|
+
return na(e, r);
|
|
2629
2629
|
},
|
|
2630
2630
|
set: function(r, n) {
|
|
2631
2631
|
e || (e = {
|
|
2632
2632
|
next: void 0
|
|
2633
|
-
}),
|
|
2633
|
+
}), ra(
|
|
2634
2634
|
/** @type {NonNullable<typeof $o>} */
|
|
2635
2635
|
e,
|
|
2636
2636
|
r,
|
|
@@ -2639,27 +2639,27 @@ var oa = pt, aa = Ne, ut = function(e, t, r) {
|
|
|
2639
2639
|
}
|
|
2640
2640
|
};
|
|
2641
2641
|
return t;
|
|
2642
|
-
},
|
|
2642
|
+
}, nn = Object, ia = Error, sa = EvalError, la = RangeError, ca = ReferenceError, pa = SyntaxError, ua = URIError, fa = Math.abs, ha = Math.floor, da = Math.max, ya = Math.min, ma = Math.pow, ba = Math.round, ga = Number.isNaN || function(e) {
|
|
2643
2643
|
return e !== e;
|
|
2644
|
-
},
|
|
2645
|
-
return
|
|
2646
|
-
},
|
|
2644
|
+
}, ja = ga, $a = function(e) {
|
|
2645
|
+
return ja(e) || e === 0 ? e : e < 0 ? -1 : 1;
|
|
2646
|
+
}, va = Object.getOwnPropertyDescriptor, Ye = va;
|
|
2647
2647
|
if (Ye)
|
|
2648
2648
|
try {
|
|
2649
2649
|
Ye([], "length");
|
|
2650
2650
|
} catch {
|
|
2651
2651
|
Ye = null;
|
|
2652
2652
|
}
|
|
2653
|
-
var
|
|
2653
|
+
var on = Ye, Xe = Object.defineProperty || !1;
|
|
2654
2654
|
if (Xe)
|
|
2655
2655
|
try {
|
|
2656
2656
|
Xe({}, "a", { value: 1 });
|
|
2657
2657
|
} catch {
|
|
2658
2658
|
Xe = !1;
|
|
2659
2659
|
}
|
|
2660
|
-
var
|
|
2661
|
-
function
|
|
2662
|
-
return
|
|
2660
|
+
var an = Xe, Sr, Tr;
|
|
2661
|
+
function wa() {
|
|
2662
|
+
return Tr || (Tr = 1, Sr = function() {
|
|
2663
2663
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
2664
2664
|
return !1;
|
|
2665
2665
|
if (typeof Symbol.iterator == "symbol")
|
|
@@ -2677,130 +2677,112 @@ function xa() {
|
|
|
2677
2677
|
if (a.length !== 1 || a[0] !== t || !Object.prototype.propertyIsEnumerable.call(e, t))
|
|
2678
2678
|
return !1;
|
|
2679
2679
|
if (typeof Object.getOwnPropertyDescriptor == "function") {
|
|
2680
|
-
var
|
|
2680
|
+
var i = (
|
|
2681
2681
|
/** @type {PropertyDescriptor} */
|
|
2682
2682
|
Object.getOwnPropertyDescriptor(e, t)
|
|
2683
2683
|
);
|
|
2684
|
-
if (
|
|
2684
|
+
if (i.value !== n || i.enumerable !== !0)
|
|
2685
2685
|
return !1;
|
|
2686
2686
|
}
|
|
2687
2687
|
return !0;
|
|
2688
|
-
}),
|
|
2688
|
+
}), Sr;
|
|
2689
2689
|
}
|
|
2690
|
-
var wt,
|
|
2691
|
-
function
|
|
2692
|
-
if (
|
|
2693
|
-
|
|
2694
|
-
var e = typeof Symbol < "u" && Symbol, t =
|
|
2690
|
+
var wt, kr;
|
|
2691
|
+
function Oa() {
|
|
2692
|
+
if (kr) return wt;
|
|
2693
|
+
kr = 1;
|
|
2694
|
+
var e = typeof Symbol < "u" && Symbol, t = wa();
|
|
2695
2695
|
return wt = function() {
|
|
2696
2696
|
return typeof e != "function" || typeof Symbol != "function" || typeof e("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : t();
|
|
2697
2697
|
}, wt;
|
|
2698
2698
|
}
|
|
2699
|
-
var
|
|
2700
|
-
function
|
|
2701
|
-
return
|
|
2699
|
+
var xr, Er;
|
|
2700
|
+
function sn() {
|
|
2701
|
+
return Er || (Er = 1, xr = typeof Reflect < "u" && Reflect.getPrototypeOf || null), xr;
|
|
2702
2702
|
}
|
|
2703
|
-
var Ot,
|
|
2704
|
-
function
|
|
2705
|
-
if (
|
|
2706
|
-
|
|
2707
|
-
var e =
|
|
2703
|
+
var Ot, Pr;
|
|
2704
|
+
function ln() {
|
|
2705
|
+
if (Pr) return Ot;
|
|
2706
|
+
Pr = 1;
|
|
2707
|
+
var e = nn;
|
|
2708
2708
|
return Ot = e.getPrototypeOf || null, Ot;
|
|
2709
2709
|
}
|
|
2710
|
-
var
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
for (var c = a(arguments, 1), p, f = function() {
|
|
2734
|
-
if (this instanceof p) {
|
|
2735
|
-
var b = i.apply(
|
|
2736
|
-
this,
|
|
2737
|
-
l(c, arguments)
|
|
2738
|
-
);
|
|
2739
|
-
return Object(b) === b ? b : this;
|
|
2740
|
-
}
|
|
2741
|
-
return i.apply(
|
|
2742
|
-
o,
|
|
2743
|
-
l(c, arguments)
|
|
2710
|
+
var Sa = "Function.prototype.bind called on incompatible ", Ta = Object.prototype.toString, ka = Math.max, xa = "[object Function]", Cr = function(e, t) {
|
|
2711
|
+
for (var r = [], n = 0; n < e.length; n += 1)
|
|
2712
|
+
r[n] = e[n];
|
|
2713
|
+
for (var l = 0; l < t.length; l += 1)
|
|
2714
|
+
r[l + e.length] = t[l];
|
|
2715
|
+
return r;
|
|
2716
|
+
}, Ea = function(e, t) {
|
|
2717
|
+
for (var r = [], n = t, l = 0; n < e.length; n += 1, l += 1)
|
|
2718
|
+
r[l] = e[n];
|
|
2719
|
+
return r;
|
|
2720
|
+
}, Pa = function(e, t) {
|
|
2721
|
+
for (var r = "", n = 0; n < e.length; n += 1)
|
|
2722
|
+
r += e[n], n + 1 < e.length && (r += t);
|
|
2723
|
+
return r;
|
|
2724
|
+
}, Ca = function(e) {
|
|
2725
|
+
var t = this;
|
|
2726
|
+
if (typeof t != "function" || Ta.apply(t) !== xa)
|
|
2727
|
+
throw new TypeError(Sa + t);
|
|
2728
|
+
for (var r = Ea(arguments, 1), n, l = function() {
|
|
2729
|
+
if (this instanceof n) {
|
|
2730
|
+
var c = t.apply(
|
|
2731
|
+
this,
|
|
2732
|
+
Cr(r, arguments)
|
|
2744
2733
|
);
|
|
2745
|
-
|
|
2746
|
-
d[h] = "$" + h;
|
|
2747
|
-
if (p = Function("binder", "return function (" + s(d, ",") + "){ return binder.apply(this,arguments); }")(f), i.prototype) {
|
|
2748
|
-
var m = function() {
|
|
2749
|
-
};
|
|
2750
|
-
m.prototype = i.prototype, p.prototype = new m(), m.prototype = null;
|
|
2734
|
+
return Object(c) === c ? c : this;
|
|
2751
2735
|
}
|
|
2752
|
-
return
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
function hn() {
|
|
2768
|
-
return Dr || (Dr = 1, Ur = Function.prototype.apply), Ur;
|
|
2736
|
+
return t.apply(
|
|
2737
|
+
e,
|
|
2738
|
+
Cr(r, arguments)
|
|
2739
|
+
);
|
|
2740
|
+
}, a = ka(0, t.length - r.length), i = [], o = 0; o < a; o++)
|
|
2741
|
+
i[o] = "$" + o;
|
|
2742
|
+
if (n = Function("binder", "return function (" + Pa(i, ",") + "){ return binder.apply(this,arguments); }")(l), t.prototype) {
|
|
2743
|
+
var s = function() {
|
|
2744
|
+
};
|
|
2745
|
+
s.prototype = t.prototype, n.prototype = new s(), s.prototype = null;
|
|
2746
|
+
}
|
|
2747
|
+
return n;
|
|
2748
|
+
}, Aa = Ca, ft = Function.prototype.bind || Aa, Gt = Function.prototype.call, Ar, Rr;
|
|
2749
|
+
function cn() {
|
|
2750
|
+
return Rr || (Rr = 1, Ar = Function.prototype.apply), Ar;
|
|
2769
2751
|
}
|
|
2770
|
-
var
|
|
2752
|
+
var Ra = typeof Reflect < "u" && Reflect && Reflect.apply, qa = ft, Na = cn(), La = Gt, Ua = Ra, Da = Ua || qa.call(La, Na), _a = ft, Ha = Ne, Ia = Gt, Ma = Da, pn = function(e) {
|
|
2771
2753
|
if (e.length < 1 || typeof e[0] != "function")
|
|
2772
|
-
throw new
|
|
2773
|
-
return
|
|
2774
|
-
},
|
|
2775
|
-
function
|
|
2776
|
-
if (
|
|
2777
|
-
|
|
2778
|
-
var e =
|
|
2754
|
+
throw new Ha("a function is required");
|
|
2755
|
+
return Ma(_a, Ia, e);
|
|
2756
|
+
}, St, qr;
|
|
2757
|
+
function Fa() {
|
|
2758
|
+
if (qr) return St;
|
|
2759
|
+
qr = 1;
|
|
2760
|
+
var e = pn, t = on, r;
|
|
2779
2761
|
try {
|
|
2780
2762
|
r = /** @type {{ __proto__?: typeof Array.prototype }} */
|
|
2781
2763
|
[].__proto__ === Array.prototype;
|
|
2782
|
-
} catch (
|
|
2783
|
-
if (!
|
|
2784
|
-
throw
|
|
2764
|
+
} catch (i) {
|
|
2765
|
+
if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
|
|
2766
|
+
throw i;
|
|
2785
2767
|
}
|
|
2786
2768
|
var n = !!r && t && t(
|
|
2787
2769
|
Object.prototype,
|
|
2788
2770
|
/** @type {keyof typeof Object.prototype} */
|
|
2789
2771
|
"__proto__"
|
|
2790
2772
|
), l = Object, a = l.getPrototypeOf;
|
|
2791
|
-
return
|
|
2773
|
+
return St = n && typeof n.get == "function" ? e([n.get]) : typeof a == "function" ? (
|
|
2792
2774
|
/** @type {import('./get')} */
|
|
2793
|
-
(function(
|
|
2794
|
-
return a(
|
|
2775
|
+
(function(i) {
|
|
2776
|
+
return a(i == null ? i : l(i));
|
|
2795
2777
|
})
|
|
2796
|
-
) : !1,
|
|
2778
|
+
) : !1, St;
|
|
2797
2779
|
}
|
|
2798
|
-
var
|
|
2799
|
-
function
|
|
2800
|
-
if (
|
|
2801
|
-
|
|
2802
|
-
var e =
|
|
2803
|
-
return
|
|
2780
|
+
var Tt, Nr;
|
|
2781
|
+
function Ba() {
|
|
2782
|
+
if (Nr) return Tt;
|
|
2783
|
+
Nr = 1;
|
|
2784
|
+
var e = sn(), t = ln(), r = /* @__PURE__ */ Fa();
|
|
2785
|
+
return Tt = e ? function(n) {
|
|
2804
2786
|
return e(n);
|
|
2805
2787
|
} : t ? function(n) {
|
|
2806
2788
|
if (!n || typeof n != "object" && typeof n != "function")
|
|
@@ -2808,33 +2790,33 @@ function Ma() {
|
|
|
2808
2790
|
return t(n);
|
|
2809
2791
|
} : r ? function(n) {
|
|
2810
2792
|
return r(n);
|
|
2811
|
-
} : null,
|
|
2793
|
+
} : null, Tt;
|
|
2812
2794
|
}
|
|
2813
|
-
var
|
|
2814
|
-
function
|
|
2815
|
-
if (
|
|
2816
|
-
|
|
2817
|
-
var e = Function.prototype.call, t = Object.prototype.hasOwnProperty, r = ft
|
|
2818
|
-
return
|
|
2795
|
+
var kt, Lr;
|
|
2796
|
+
function Wa() {
|
|
2797
|
+
if (Lr) return kt;
|
|
2798
|
+
Lr = 1;
|
|
2799
|
+
var e = Function.prototype.call, t = Object.prototype.hasOwnProperty, r = ft;
|
|
2800
|
+
return kt = r.call(e, t), kt;
|
|
2819
2801
|
}
|
|
2820
|
-
var x,
|
|
2802
|
+
var x, Ja = nn, za = ia, Ka = sa, Va = la, Ga = ca, qe = pa, Pe = Ne, Qa = ua, Ya = fa, Xa = ha, Za = da, ei = ya, ti = ma, ri = ba, ni = $a, un = Function, xt = function(e) {
|
|
2821
2803
|
try {
|
|
2822
|
-
return
|
|
2804
|
+
return un('"use strict"; return (' + e + ").constructor;")();
|
|
2823
2805
|
} catch {
|
|
2824
2806
|
}
|
|
2825
|
-
}, Fe =
|
|
2807
|
+
}, Fe = on, oi = an, Et = function() {
|
|
2826
2808
|
throw new Pe();
|
|
2827
|
-
},
|
|
2809
|
+
}, ai = Fe ? (function() {
|
|
2828
2810
|
try {
|
|
2829
|
-
return arguments.callee,
|
|
2811
|
+
return arguments.callee, Et;
|
|
2830
2812
|
} catch {
|
|
2831
2813
|
try {
|
|
2832
2814
|
return Fe(arguments, "callee").get;
|
|
2833
2815
|
} catch {
|
|
2834
|
-
return
|
|
2816
|
+
return Et;
|
|
2835
2817
|
}
|
|
2836
2818
|
}
|
|
2837
|
-
})() :
|
|
2819
|
+
})() : Et, we = Oa()(), H = Ba(), ii = ln(), si = sn(), fn = cn(), Be = Gt, Se = {}, li = typeof Uint8Array > "u" || !H ? x : H(Uint8Array), $e = {
|
|
2838
2820
|
__proto__: null,
|
|
2839
2821
|
"%AggregateError%": typeof AggregateError > "u" ? x : AggregateError,
|
|
2840
2822
|
"%Array%": Array,
|
|
@@ -2856,15 +2838,15 @@ var x, Ba = cn, Wa = ua, Ja = fa, za = da, Va = ha, qe = ya, Pe = Ne, Ka = ma, G
|
|
|
2856
2838
|
"%decodeURIComponent%": decodeURIComponent,
|
|
2857
2839
|
"%encodeURI%": encodeURI,
|
|
2858
2840
|
"%encodeURIComponent%": encodeURIComponent,
|
|
2859
|
-
"%Error%":
|
|
2841
|
+
"%Error%": za,
|
|
2860
2842
|
"%eval%": eval,
|
|
2861
2843
|
// eslint-disable-line no-eval
|
|
2862
|
-
"%EvalError%":
|
|
2844
|
+
"%EvalError%": Ka,
|
|
2863
2845
|
"%Float16Array%": typeof Float16Array > "u" ? x : Float16Array,
|
|
2864
2846
|
"%Float32Array%": typeof Float32Array > "u" ? x : Float32Array,
|
|
2865
2847
|
"%Float64Array%": typeof Float64Array > "u" ? x : Float64Array,
|
|
2866
2848
|
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? x : FinalizationRegistry,
|
|
2867
|
-
"%Function%":
|
|
2849
|
+
"%Function%": un,
|
|
2868
2850
|
"%GeneratorFunction%": Se,
|
|
2869
2851
|
"%Int8Array%": typeof Int8Array > "u" ? x : Int8Array,
|
|
2870
2852
|
"%Int16Array%": typeof Int16Array > "u" ? x : Int16Array,
|
|
@@ -2877,14 +2859,14 @@ var x, Ba = cn, Wa = ua, Ja = fa, za = da, Va = ha, qe = ya, Pe = Ne, Ka = ma, G
|
|
|
2877
2859
|
"%MapIteratorPrototype%": typeof Map > "u" || !we || !H ? x : H((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
2878
2860
|
"%Math%": Math,
|
|
2879
2861
|
"%Number%": Number,
|
|
2880
|
-
"%Object%":
|
|
2862
|
+
"%Object%": Ja,
|
|
2881
2863
|
"%Object.getOwnPropertyDescriptor%": Fe,
|
|
2882
2864
|
"%parseFloat%": parseFloat,
|
|
2883
2865
|
"%parseInt%": parseInt,
|
|
2884
2866
|
"%Promise%": typeof Promise > "u" ? x : Promise,
|
|
2885
2867
|
"%Proxy%": typeof Proxy > "u" ? x : Proxy,
|
|
2886
|
-
"%RangeError%":
|
|
2887
|
-
"%ReferenceError%":
|
|
2868
|
+
"%RangeError%": Va,
|
|
2869
|
+
"%ReferenceError%": Ga,
|
|
2888
2870
|
"%Reflect%": typeof Reflect > "u" ? x : Reflect,
|
|
2889
2871
|
"%RegExp%": RegExp,
|
|
2890
2872
|
"%Set%": typeof Set > "u" ? x : Set,
|
|
@@ -2894,45 +2876,45 @@ var x, Ba = cn, Wa = ua, Ja = fa, za = da, Va = ha, qe = ya, Pe = Ne, Ka = ma, G
|
|
|
2894
2876
|
"%StringIteratorPrototype%": we && H ? H(""[Symbol.iterator]()) : x,
|
|
2895
2877
|
"%Symbol%": we ? Symbol : x,
|
|
2896
2878
|
"%SyntaxError%": qe,
|
|
2897
|
-
"%ThrowTypeError%":
|
|
2898
|
-
"%TypedArray%":
|
|
2879
|
+
"%ThrowTypeError%": ai,
|
|
2880
|
+
"%TypedArray%": li,
|
|
2899
2881
|
"%TypeError%": Pe,
|
|
2900
2882
|
"%Uint8Array%": typeof Uint8Array > "u" ? x : Uint8Array,
|
|
2901
2883
|
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? x : Uint8ClampedArray,
|
|
2902
2884
|
"%Uint16Array%": typeof Uint16Array > "u" ? x : Uint16Array,
|
|
2903
2885
|
"%Uint32Array%": typeof Uint32Array > "u" ? x : Uint32Array,
|
|
2904
|
-
"%URIError%":
|
|
2886
|
+
"%URIError%": Qa,
|
|
2905
2887
|
"%WeakMap%": typeof WeakMap > "u" ? x : WeakMap,
|
|
2906
2888
|
"%WeakRef%": typeof WeakRef > "u" ? x : WeakRef,
|
|
2907
2889
|
"%WeakSet%": typeof WeakSet > "u" ? x : WeakSet,
|
|
2908
2890
|
"%Function.prototype.call%": Be,
|
|
2909
|
-
"%Function.prototype.apply%":
|
|
2910
|
-
"%Object.defineProperty%":
|
|
2911
|
-
"%Object.getPrototypeOf%":
|
|
2912
|
-
"%Math.abs%":
|
|
2913
|
-
"%Math.floor%":
|
|
2914
|
-
"%Math.max%":
|
|
2915
|
-
"%Math.min%":
|
|
2916
|
-
"%Math.pow%":
|
|
2917
|
-
"%Math.round%":
|
|
2918
|
-
"%Math.sign%":
|
|
2919
|
-
"%Reflect.getPrototypeOf%":
|
|
2891
|
+
"%Function.prototype.apply%": fn,
|
|
2892
|
+
"%Object.defineProperty%": oi,
|
|
2893
|
+
"%Object.getPrototypeOf%": ii,
|
|
2894
|
+
"%Math.abs%": Ya,
|
|
2895
|
+
"%Math.floor%": Xa,
|
|
2896
|
+
"%Math.max%": Za,
|
|
2897
|
+
"%Math.min%": ei,
|
|
2898
|
+
"%Math.pow%": ti,
|
|
2899
|
+
"%Math.round%": ri,
|
|
2900
|
+
"%Math.sign%": ni,
|
|
2901
|
+
"%Reflect.getPrototypeOf%": si
|
|
2920
2902
|
};
|
|
2921
2903
|
if (H)
|
|
2922
2904
|
try {
|
|
2923
2905
|
null.error;
|
|
2924
2906
|
} catch (e) {
|
|
2925
|
-
var
|
|
2926
|
-
$e["%Error.prototype%"] =
|
|
2907
|
+
var ci = H(H(e));
|
|
2908
|
+
$e["%Error.prototype%"] = ci;
|
|
2927
2909
|
}
|
|
2928
|
-
var
|
|
2910
|
+
var pi = function e(t) {
|
|
2929
2911
|
var r;
|
|
2930
2912
|
if (t === "%AsyncFunction%")
|
|
2931
|
-
r =
|
|
2913
|
+
r = xt("async function () {}");
|
|
2932
2914
|
else if (t === "%GeneratorFunction%")
|
|
2933
|
-
r =
|
|
2915
|
+
r = xt("function* () {}");
|
|
2934
2916
|
else if (t === "%AsyncGeneratorFunction%")
|
|
2935
|
-
r =
|
|
2917
|
+
r = xt("async function* () {}");
|
|
2936
2918
|
else if (t === "%AsyncGenerator%") {
|
|
2937
2919
|
var n = e("%AsyncGeneratorFunction%");
|
|
2938
2920
|
n && (r = n.prototype);
|
|
@@ -2941,7 +2923,7 @@ var li = function e(t) {
|
|
|
2941
2923
|
l && H && (r = H(l.prototype));
|
|
2942
2924
|
}
|
|
2943
2925
|
return $e[t] = r, r;
|
|
2944
|
-
},
|
|
2926
|
+
}, Ur = {
|
|
2945
2927
|
__proto__: null,
|
|
2946
2928
|
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
2947
2929
|
"%ArrayPrototype%": ["Array", "prototype"],
|
|
@@ -2994,21 +2976,21 @@ var li = function e(t) {
|
|
|
2994
2976
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
2995
2977
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
2996
2978
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
2997
|
-
}, We = ft
|
|
2979
|
+
}, We = ft, lt = /* @__PURE__ */ Wa(), ui = We.call(Be, Array.prototype.concat), fi = We.call(fn, Array.prototype.splice), Dr = We.call(Be, String.prototype.replace), ct = We.call(Be, String.prototype.slice), hi = We.call(Be, RegExp.prototype.exec), di = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, yi = /\\(\\)?/g, mi = function(e) {
|
|
2998
2980
|
var t = ct(e, 0, 1), r = ct(e, -1);
|
|
2999
2981
|
if (t === "%" && r !== "%")
|
|
3000
2982
|
throw new qe("invalid intrinsic syntax, expected closing `%`");
|
|
3001
2983
|
if (r === "%" && t !== "%")
|
|
3002
2984
|
throw new qe("invalid intrinsic syntax, expected opening `%`");
|
|
3003
2985
|
var n = [];
|
|
3004
|
-
return
|
|
3005
|
-
n[n.length] =
|
|
2986
|
+
return Dr(e, di, function(l, a, i, o) {
|
|
2987
|
+
n[n.length] = i ? Dr(o, yi, "$1") : a || l;
|
|
3006
2988
|
}), n;
|
|
3007
|
-
},
|
|
2989
|
+
}, bi = function(e, t) {
|
|
3008
2990
|
var r = e, n;
|
|
3009
|
-
if (lt(
|
|
2991
|
+
if (lt(Ur, r) && (n = Ur[r], r = "%" + n[0] + "%"), lt($e, r)) {
|
|
3010
2992
|
var l = $e[r];
|
|
3011
|
-
if (l === Se && (l =
|
|
2993
|
+
if (l === Se && (l = pi(r)), typeof l > "u" && !t)
|
|
3012
2994
|
throw new Pe("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
3013
2995
|
return {
|
|
3014
2996
|
alias: n,
|
|
@@ -3017,105 +2999,105 @@ var li = function e(t) {
|
|
|
3017
2999
|
};
|
|
3018
3000
|
}
|
|
3019
3001
|
throw new qe("intrinsic " + e + " does not exist!");
|
|
3020
|
-
},
|
|
3002
|
+
}, Qt = function(e, t) {
|
|
3021
3003
|
if (typeof e != "string" || e.length === 0)
|
|
3022
3004
|
throw new Pe("intrinsic name must be a non-empty string");
|
|
3023
3005
|
if (arguments.length > 1 && typeof t != "boolean")
|
|
3024
3006
|
throw new Pe('"allowMissing" argument must be a boolean');
|
|
3025
|
-
if (
|
|
3007
|
+
if (hi(/^%?[^%]*%?$/, e) === null)
|
|
3026
3008
|
throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
3027
|
-
var r =
|
|
3028
|
-
|
|
3009
|
+
var r = mi(e), n = r.length > 0 ? r[0] : "", l = bi("%" + n + "%", t), a = l.name, i = l.value, o = !1, s = l.alias;
|
|
3010
|
+
s && (n = s[0], fi(r, ui([0, 1], s)));
|
|
3029
3011
|
for (var c = 1, p = !0; c < r.length; c += 1) {
|
|
3030
|
-
var f = r[c], u = ct(f, 0, 1),
|
|
3031
|
-
if ((u === '"' || u === "'" || u === "`" ||
|
|
3012
|
+
var f = r[c], u = ct(f, 0, 1), h = ct(f, -1);
|
|
3013
|
+
if ((u === '"' || u === "'" || u === "`" || h === '"' || h === "'" || h === "`") && u !== h)
|
|
3032
3014
|
throw new qe("property names with quotes must have matching quotes");
|
|
3033
3015
|
if ((f === "constructor" || !p) && (o = !0), n += "." + f, a = "%" + n + "%", lt($e, a))
|
|
3034
|
-
|
|
3035
|
-
else if (
|
|
3036
|
-
if (!(f in
|
|
3016
|
+
i = $e[a];
|
|
3017
|
+
else if (i != null) {
|
|
3018
|
+
if (!(f in i)) {
|
|
3037
3019
|
if (!t)
|
|
3038
3020
|
throw new Pe("base intrinsic for " + e + " exists, but the property is not available.");
|
|
3039
3021
|
return;
|
|
3040
3022
|
}
|
|
3041
3023
|
if (Fe && c + 1 >= r.length) {
|
|
3042
|
-
var
|
|
3043
|
-
p = !!
|
|
3024
|
+
var d = Fe(i, f);
|
|
3025
|
+
p = !!d, p && "get" in d && !("originalValue" in d.get) ? i = d.get : i = i[f];
|
|
3044
3026
|
} else
|
|
3045
|
-
p = lt(
|
|
3046
|
-
p && !o && ($e[a] =
|
|
3027
|
+
p = lt(i, f), i = i[f];
|
|
3028
|
+
p && !o && ($e[a] = i);
|
|
3047
3029
|
}
|
|
3048
3030
|
}
|
|
3049
|
-
return
|
|
3050
|
-
},
|
|
3031
|
+
return i;
|
|
3032
|
+
}, hn = Qt, dn = pn, gi = dn([hn("%String.prototype.indexOf%")]), yn = function(e, t) {
|
|
3051
3033
|
var r = (
|
|
3052
3034
|
/** @type {(this: unknown, ...args: unknown[]) => unknown} */
|
|
3053
|
-
|
|
3035
|
+
hn(e, !!t)
|
|
3054
3036
|
);
|
|
3055
|
-
return typeof r == "function" &&
|
|
3037
|
+
return typeof r == "function" && gi(e, ".prototype.") > -1 ? dn(
|
|
3056
3038
|
/** @type {const} */
|
|
3057
3039
|
[r]
|
|
3058
3040
|
) : r;
|
|
3059
|
-
},
|
|
3041
|
+
}, ji = Qt, Je = yn, $i = pt, vi = Ne, _r = ji("%Map%", !0), wi = Je("Map.prototype.get", !0), Oi = Je("Map.prototype.set", !0), Si = Je("Map.prototype.has", !0), Ti = Je("Map.prototype.delete", !0), ki = Je("Map.prototype.size", !0), mn = !!_r && /** @type {Exclude<import('.'), false>} */
|
|
3060
3042
|
function() {
|
|
3061
3043
|
var e, t = {
|
|
3062
3044
|
assert: function(r) {
|
|
3063
3045
|
if (!t.has(r))
|
|
3064
|
-
throw new
|
|
3046
|
+
throw new vi("Side channel does not contain " + $i(r));
|
|
3065
3047
|
},
|
|
3066
3048
|
delete: function(r) {
|
|
3067
3049
|
if (e) {
|
|
3068
|
-
var n =
|
|
3069
|
-
return
|
|
3050
|
+
var n = Ti(e, r);
|
|
3051
|
+
return ki(e) === 0 && (e = void 0), n;
|
|
3070
3052
|
}
|
|
3071
3053
|
return !1;
|
|
3072
3054
|
},
|
|
3073
3055
|
get: function(r) {
|
|
3074
3056
|
if (e)
|
|
3075
|
-
return
|
|
3057
|
+
return wi(e, r);
|
|
3076
3058
|
},
|
|
3077
3059
|
has: function(r) {
|
|
3078
|
-
return e ?
|
|
3060
|
+
return e ? Si(e, r) : !1;
|
|
3079
3061
|
},
|
|
3080
3062
|
set: function(r, n) {
|
|
3081
|
-
e || (e = new
|
|
3063
|
+
e || (e = new _r()), Oi(e, r, n);
|
|
3082
3064
|
}
|
|
3083
3065
|
};
|
|
3084
3066
|
return t;
|
|
3085
|
-
},
|
|
3067
|
+
}, xi = Qt, ht = yn, Ei = pt, Ve = mn, Pi = Ne, Oe = xi("%WeakMap%", !0), Ci = ht("WeakMap.prototype.get", !0), Ai = ht("WeakMap.prototype.set", !0), Ri = ht("WeakMap.prototype.has", !0), qi = ht("WeakMap.prototype.delete", !0), Ni = Oe ? (
|
|
3086
3068
|
/** @type {Exclude<import('.'), false>} */
|
|
3087
3069
|
(function() {
|
|
3088
3070
|
var e, t, r = {
|
|
3089
3071
|
assert: function(n) {
|
|
3090
3072
|
if (!r.has(n))
|
|
3091
|
-
throw new
|
|
3073
|
+
throw new Pi("Side channel does not contain " + Ei(n));
|
|
3092
3074
|
},
|
|
3093
3075
|
delete: function(n) {
|
|
3094
3076
|
if (Oe && n && (typeof n == "object" || typeof n == "function")) {
|
|
3095
3077
|
if (e)
|
|
3096
|
-
return
|
|
3097
|
-
} else if (
|
|
3078
|
+
return qi(e, n);
|
|
3079
|
+
} else if (Ve && t)
|
|
3098
3080
|
return t.delete(n);
|
|
3099
3081
|
return !1;
|
|
3100
3082
|
},
|
|
3101
3083
|
get: function(n) {
|
|
3102
|
-
return Oe && n && (typeof n == "object" || typeof n == "function") && e ?
|
|
3084
|
+
return Oe && n && (typeof n == "object" || typeof n == "function") && e ? Ci(e, n) : t && t.get(n);
|
|
3103
3085
|
},
|
|
3104
3086
|
has: function(n) {
|
|
3105
|
-
return Oe && n && (typeof n == "object" || typeof n == "function") && e ?
|
|
3087
|
+
return Oe && n && (typeof n == "object" || typeof n == "function") && e ? Ri(e, n) : !!t && t.has(n);
|
|
3106
3088
|
},
|
|
3107
3089
|
set: function(n, l) {
|
|
3108
|
-
Oe && n && (typeof n == "object" || typeof n == "function") ? (e || (e = new Oe()),
|
|
3090
|
+
Oe && n && (typeof n == "object" || typeof n == "function") ? (e || (e = new Oe()), Ai(e, n, l)) : Ve && (t || (t = Ve()), t.set(n, l));
|
|
3109
3091
|
}
|
|
3110
3092
|
};
|
|
3111
3093
|
return r;
|
|
3112
3094
|
})
|
|
3113
|
-
) :
|
|
3095
|
+
) : Ve, Li = Ne, Ui = pt, Di = aa, _i = mn, Hi = Ni, Ii = Hi || _i || Di, bn = function() {
|
|
3114
3096
|
var e, t = {
|
|
3115
3097
|
assert: function(r) {
|
|
3116
3098
|
if (!t.has(r)) {
|
|
3117
|
-
var n = r && Object(r) === r ? "the given object key" :
|
|
3118
|
-
throw new
|
|
3099
|
+
var n = r && Object(r) === r ? "the given object key" : Ui(r);
|
|
3100
|
+
throw new Li("Side channel does not contain " + n);
|
|
3119
3101
|
}
|
|
3120
3102
|
},
|
|
3121
3103
|
delete: function(r) {
|
|
@@ -3128,38 +3110,38 @@ function() {
|
|
|
3128
3110
|
return !!e && e.has(r);
|
|
3129
3111
|
},
|
|
3130
3112
|
set: function(r, n) {
|
|
3131
|
-
e || (e =
|
|
3113
|
+
e || (e = Ii()), e.set(r, n);
|
|
3132
3114
|
}
|
|
3133
3115
|
};
|
|
3134
3116
|
return t;
|
|
3135
|
-
},
|
|
3117
|
+
}, Mi = String.prototype.replace, Fi = /%20/g, Pt = {
|
|
3136
3118
|
RFC1738: "RFC1738",
|
|
3137
3119
|
RFC3986: "RFC3986"
|
|
3138
|
-
},
|
|
3139
|
-
default:
|
|
3120
|
+
}, Yt = {
|
|
3121
|
+
default: Pt.RFC3986,
|
|
3140
3122
|
formatters: {
|
|
3141
3123
|
RFC1738: function(e) {
|
|
3142
|
-
return
|
|
3124
|
+
return Mi.call(e, Fi, "+");
|
|
3143
3125
|
},
|
|
3144
3126
|
RFC3986: function(e) {
|
|
3145
3127
|
return String(e);
|
|
3146
3128
|
}
|
|
3147
3129
|
},
|
|
3148
|
-
RFC1738:
|
|
3149
|
-
RFC3986:
|
|
3150
|
-
},
|
|
3151
|
-
return
|
|
3130
|
+
RFC1738: Pt.RFC1738,
|
|
3131
|
+
RFC3986: Pt.RFC3986
|
|
3132
|
+
}, Bi = Yt, gn = bn, Hr = an, Ct = Object.prototype.hasOwnProperty, be = Array.isArray, dt = gn(), ge = function(e, t) {
|
|
3133
|
+
return dt.set(e, t), e;
|
|
3152
3134
|
}, je = function(e) {
|
|
3153
|
-
return
|
|
3135
|
+
return dt.has(e);
|
|
3154
3136
|
}, Ue = function(e) {
|
|
3155
|
-
return
|
|
3156
|
-
},
|
|
3157
|
-
|
|
3137
|
+
return dt.get(e);
|
|
3138
|
+
}, It = function(e, t) {
|
|
3139
|
+
dt.set(e, t);
|
|
3158
3140
|
}, ne = (function() {
|
|
3159
3141
|
for (var e = [], t = 0; t < 256; ++t)
|
|
3160
3142
|
e[e.length] = "%" + ((t < 16 ? "0" : "") + t.toString(16)).toUpperCase();
|
|
3161
3143
|
return e;
|
|
3162
|
-
})(),
|
|
3144
|
+
})(), Wi = function(e) {
|
|
3163
3145
|
for (; e.length > 1; ) {
|
|
3164
3146
|
var t = e.pop(), r = t.obj[t.prop];
|
|
3165
3147
|
if (be(r)) {
|
|
@@ -3172,14 +3154,14 @@ function() {
|
|
|
3172
3154
|
for (var r = t && t.plainObjects ? { __proto__: null } : {}, n = 0; n < e.length; ++n)
|
|
3173
3155
|
typeof e[n] < "u" && (r[n] = e[n]);
|
|
3174
3156
|
return r;
|
|
3175
|
-
},
|
|
3176
|
-
t === "__proto__" &&
|
|
3157
|
+
}, Mt = function(e, t, r) {
|
|
3158
|
+
t === "__proto__" && Hr ? Hr(e, t, {
|
|
3177
3159
|
configurable: !0,
|
|
3178
3160
|
enumerable: !0,
|
|
3179
3161
|
value: r,
|
|
3180
3162
|
writable: !0
|
|
3181
3163
|
}) : e[t] = r;
|
|
3182
|
-
},
|
|
3164
|
+
}, Ji = function e(t, r, n) {
|
|
3183
3165
|
if (!r)
|
|
3184
3166
|
return t;
|
|
3185
3167
|
if (typeof r != "object" && typeof r != "function") {
|
|
@@ -3194,11 +3176,11 @@ function() {
|
|
|
3194
3176
|
} else if (t && typeof t == "object")
|
|
3195
3177
|
if (je(t)) {
|
|
3196
3178
|
var a = Ue(t) + 1;
|
|
3197
|
-
t[a] = r,
|
|
3179
|
+
t[a] = r, It(t, a);
|
|
3198
3180
|
} else {
|
|
3199
3181
|
if (n && n.strictMerge)
|
|
3200
3182
|
return [t, r];
|
|
3201
|
-
(n && (n.plainObjects || n.allowPrototypes) || !
|
|
3183
|
+
(n && (n.plainObjects || n.allowPrototypes) || !Ct.call(Object.prototype, r)) && (t[r] = !0);
|
|
3202
3184
|
}
|
|
3203
3185
|
else
|
|
3204
3186
|
return [t, r];
|
|
@@ -3206,9 +3188,9 @@ function() {
|
|
|
3206
3188
|
}
|
|
3207
3189
|
if (!t || typeof t != "object") {
|
|
3208
3190
|
if (je(r)) {
|
|
3209
|
-
for (var
|
|
3210
|
-
var c = parseInt(s
|
|
3211
|
-
o[c + 1] = r[s
|
|
3191
|
+
for (var i = Object.keys(r), o = n && n.plainObjects ? { __proto__: null, 0: t } : { 0: t }, s = 0; s < i.length; s++) {
|
|
3192
|
+
var c = parseInt(i[s], 10);
|
|
3193
|
+
o[c + 1] = r[i[s]];
|
|
3212
3194
|
}
|
|
3213
3195
|
return ge(o, Ue(r) + 1);
|
|
3214
3196
|
}
|
|
@@ -3222,12 +3204,12 @@ function() {
|
|
|
3222
3204
|
}
|
|
3223
3205
|
var f = t;
|
|
3224
3206
|
if (be(t) && !be(r) && (f = Ee(t, n)), be(t) && be(r)) {
|
|
3225
|
-
if (r.forEach(function(u,
|
|
3226
|
-
if (
|
|
3227
|
-
var
|
|
3228
|
-
|
|
3207
|
+
if (r.forEach(function(u, h) {
|
|
3208
|
+
if (Ct.call(t, h)) {
|
|
3209
|
+
var d = t[h];
|
|
3210
|
+
d && typeof d == "object" && u && typeof u == "object" ? t[h] = e(d, u, n) : t[t.length] = u;
|
|
3229
3211
|
} else
|
|
3230
|
-
t[
|
|
3212
|
+
t[h] = u;
|
|
3231
3213
|
}), n && typeof n.arrayLimit == "number" && t.length > n.arrayLimit) {
|
|
3232
3214
|
if (n.throwOnLimitExceeded)
|
|
3233
3215
|
throw new RangeError("Array limit exceeded. Only " + n.arrayLimit + " element" + (n.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
@@ -3235,19 +3217,19 @@ function() {
|
|
|
3235
3217
|
}
|
|
3236
3218
|
return t;
|
|
3237
3219
|
}
|
|
3238
|
-
return Object.keys(r).reduce(function(u,
|
|
3239
|
-
var
|
|
3240
|
-
if (
|
|
3241
|
-
var m = parseInt(
|
|
3242
|
-
String(m) ===
|
|
3220
|
+
return Object.keys(r).reduce(function(u, h) {
|
|
3221
|
+
var d = r[h];
|
|
3222
|
+
if (Ct.call(u, h) ? Mt(u, h, e(u[h], d, n)) : Mt(u, h, d), je(r) && !je(u) && ge(u, Ue(r)), je(u)) {
|
|
3223
|
+
var m = parseInt(h, 10);
|
|
3224
|
+
String(m) === h && m >= 0 && m > Ue(u) && It(u, m);
|
|
3243
3225
|
}
|
|
3244
3226
|
return u;
|
|
3245
3227
|
}, f);
|
|
3246
|
-
},
|
|
3228
|
+
}, zi = function(e, t) {
|
|
3247
3229
|
return Object.keys(t).reduce(function(r, n) {
|
|
3248
|
-
return
|
|
3230
|
+
return Mt(r, n, t[n]), r;
|
|
3249
3231
|
}, e);
|
|
3250
|
-
},
|
|
3232
|
+
}, Ki = function(e, t, r) {
|
|
3251
3233
|
var n = e.replace(/\+/g, " ");
|
|
3252
3234
|
if (r === "iso-8859-1")
|
|
3253
3235
|
return n.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
@@ -3256,24 +3238,24 @@ function() {
|
|
|
3256
3238
|
} catch {
|
|
3257
3239
|
return n;
|
|
3258
3240
|
}
|
|
3259
|
-
}, Ge = 1024,
|
|
3241
|
+
}, Ge = 1024, Vi = function(e, t, r, n, l) {
|
|
3260
3242
|
if (e.length === 0)
|
|
3261
3243
|
return e;
|
|
3262
3244
|
var a = e;
|
|
3263
3245
|
if (typeof e == "symbol" ? a = Symbol.prototype.toString.call(e) : typeof e != "string" && (a = String(e)), r === "iso-8859-1")
|
|
3264
|
-
return escape(a).replace(/%u[0-9a-f]{4}/gi, function(
|
|
3265
|
-
return "%26%23" + parseInt(
|
|
3246
|
+
return escape(a).replace(/%u[0-9a-f]{4}/gi, function(h) {
|
|
3247
|
+
return "%26%23" + parseInt(h.slice(2), 16) + "%3B";
|
|
3266
3248
|
});
|
|
3267
|
-
for (var
|
|
3268
|
-
var
|
|
3249
|
+
for (var i = "", o = 0; o < a.length; o += Ge) {
|
|
3250
|
+
var s = a.length >= Ge ? a.slice(o, o + Ge) : a;
|
|
3269
3251
|
if (o + Ge < a.length) {
|
|
3270
|
-
var c =
|
|
3271
|
-
c >= 55296 && c <= 56319 && (
|
|
3252
|
+
var c = s.charCodeAt(s.length - 1);
|
|
3253
|
+
c >= 55296 && c <= 56319 && (s = s.slice(0, -1), o -= 1);
|
|
3272
3254
|
}
|
|
3273
|
-
for (var p = [], f = 0; f <
|
|
3274
|
-
var u =
|
|
3275
|
-
if (u === 45 || u === 46 || u === 95 || u === 126 || u >= 48 && u <= 57 || u >= 65 && u <= 90 || u >= 97 && u <= 122 || l ===
|
|
3276
|
-
p[p.length] =
|
|
3255
|
+
for (var p = [], f = 0; f < s.length; ++f) {
|
|
3256
|
+
var u = s.charCodeAt(f);
|
|
3257
|
+
if (u === 45 || u === 46 || u === 95 || u === 126 || u >= 48 && u <= 57 || u >= 65 && u <= 90 || u >= 97 && u <= 122 || l === Bi.RFC1738 && (u === 40 || u === 41)) {
|
|
3258
|
+
p[p.length] = s.charAt(f);
|
|
3277
3259
|
continue;
|
|
3278
3260
|
}
|
|
3279
3261
|
if (u < 128) {
|
|
@@ -3288,57 +3270,57 @@ function() {
|
|
|
3288
3270
|
p[p.length] = ne[224 | u >> 12] + ne[128 | u >> 6 & 63] + ne[128 | u & 63];
|
|
3289
3271
|
continue;
|
|
3290
3272
|
}
|
|
3291
|
-
f += 1, u = 65536 + ((u & 1023) << 10 |
|
|
3273
|
+
f += 1, u = 65536 + ((u & 1023) << 10 | s.charCodeAt(f) & 1023), p[p.length] = ne[240 | u >> 18] + ne[128 | u >> 12 & 63] + ne[128 | u >> 6 & 63] + ne[128 | u & 63];
|
|
3292
3274
|
}
|
|
3293
|
-
|
|
3275
|
+
i += p.join("");
|
|
3294
3276
|
}
|
|
3295
|
-
return
|
|
3296
|
-
},
|
|
3297
|
-
for (var t = [{ obj: { o: e }, prop: "o" }], r =
|
|
3298
|
-
for (var l = t[n], a = l.obj[l.prop],
|
|
3299
|
-
var
|
|
3300
|
-
typeof c == "object" && c !== null && !r.has(c) && (t[t.length] = { obj: a, prop:
|
|
3277
|
+
return i;
|
|
3278
|
+
}, Gi = function(e) {
|
|
3279
|
+
for (var t = [{ obj: { o: e }, prop: "o" }], r = gn(), n = 0; n < t.length; ++n)
|
|
3280
|
+
for (var l = t[n], a = l.obj[l.prop], i = Object.keys(a), o = 0; o < i.length; ++o) {
|
|
3281
|
+
var s = i[o], c = a[s];
|
|
3282
|
+
typeof c == "object" && c !== null && !r.has(c) && (t[t.length] = { obj: a, prop: s }, r.set(c, !0));
|
|
3301
3283
|
}
|
|
3302
|
-
return
|
|
3303
|
-
},
|
|
3284
|
+
return Wi(t), e;
|
|
3285
|
+
}, Qi = function(e) {
|
|
3304
3286
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
3305
|
-
},
|
|
3287
|
+
}, Yi = function(e) {
|
|
3306
3288
|
return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
|
|
3307
|
-
},
|
|
3289
|
+
}, Xi = function(e, t, r, n, l) {
|
|
3308
3290
|
if (je(e)) {
|
|
3309
3291
|
if (l)
|
|
3310
3292
|
throw new RangeError("Array limit exceeded. Only " + r + " element" + (r === 1 ? "" : "s") + " allowed in an array.");
|
|
3311
3293
|
var a = Ue(e) + 1;
|
|
3312
|
-
return e[a] = t,
|
|
3294
|
+
return e[a] = t, It(e, a), e;
|
|
3313
3295
|
}
|
|
3314
|
-
var
|
|
3315
|
-
if (
|
|
3296
|
+
var i = [].concat(e, t);
|
|
3297
|
+
if (i.length > r) {
|
|
3316
3298
|
if (l)
|
|
3317
3299
|
throw new RangeError("Array limit exceeded. Only " + r + " element" + (r === 1 ? "" : "s") + " allowed in an array.");
|
|
3318
|
-
return ge(Ee(
|
|
3300
|
+
return ge(Ee(i, { plainObjects: n }), i.length - 1);
|
|
3319
3301
|
}
|
|
3320
|
-
return
|
|
3321
|
-
},
|
|
3302
|
+
return i;
|
|
3303
|
+
}, Zi = function(e, t) {
|
|
3322
3304
|
if (be(e)) {
|
|
3323
3305
|
for (var r = [], n = 0; n < e.length; n += 1)
|
|
3324
3306
|
r[r.length] = t(e[n]);
|
|
3325
3307
|
return r;
|
|
3326
3308
|
}
|
|
3327
3309
|
return t(e);
|
|
3328
|
-
},
|
|
3310
|
+
}, jn = {
|
|
3329
3311
|
arrayToObject: Ee,
|
|
3330
|
-
assign:
|
|
3331
|
-
combine:
|
|
3332
|
-
compact:
|
|
3333
|
-
decode:
|
|
3334
|
-
encode:
|
|
3335
|
-
isBuffer:
|
|
3312
|
+
assign: zi,
|
|
3313
|
+
combine: Xi,
|
|
3314
|
+
compact: Gi,
|
|
3315
|
+
decode: Ki,
|
|
3316
|
+
encode: Vi,
|
|
3317
|
+
isBuffer: Yi,
|
|
3336
3318
|
isOverflow: je,
|
|
3337
|
-
isRegExp:
|
|
3319
|
+
isRegExp: Qi,
|
|
3338
3320
|
markOverflow: ge,
|
|
3339
|
-
maybeMap:
|
|
3340
|
-
merge:
|
|
3341
|
-
},
|
|
3321
|
+
maybeMap: Zi,
|
|
3322
|
+
merge: Ji
|
|
3323
|
+
}, $n = bn, Ze = jn, Ie = Yt, es = Object.prototype.hasOwnProperty, vn = {
|
|
3342
3324
|
brackets: function(e) {
|
|
3343
3325
|
return e + "[]";
|
|
3344
3326
|
},
|
|
@@ -3349,9 +3331,9 @@ function() {
|
|
|
3349
3331
|
repeat: function(e) {
|
|
3350
3332
|
return e;
|
|
3351
3333
|
}
|
|
3352
|
-
}, oe = Array.isArray,
|
|
3353
|
-
|
|
3354
|
-
},
|
|
3334
|
+
}, oe = Array.isArray, ts = Array.prototype.push, wn = function(e, t) {
|
|
3335
|
+
ts.apply(e, oe(t) ? t : [t]);
|
|
3336
|
+
}, rs = Date.prototype.toISOString, Ir = Ie.default, U = {
|
|
3355
3337
|
addQueryPrefix: !1,
|
|
3356
3338
|
allowDots: !1,
|
|
3357
3339
|
allowEmptyArrays: !1,
|
|
@@ -3365,38 +3347,38 @@ function() {
|
|
|
3365
3347
|
encoder: Ze.encode,
|
|
3366
3348
|
encodeValuesOnly: !1,
|
|
3367
3349
|
filter: void 0,
|
|
3368
|
-
format:
|
|
3369
|
-
formatter: Ie.formatters[
|
|
3350
|
+
format: Ir,
|
|
3351
|
+
formatter: Ie.formatters[Ir],
|
|
3370
3352
|
// deprecated
|
|
3371
3353
|
indices: !1,
|
|
3372
3354
|
serializeDate: function(e) {
|
|
3373
|
-
return
|
|
3355
|
+
return rs.call(e);
|
|
3374
3356
|
},
|
|
3375
3357
|
skipNulls: !1,
|
|
3376
3358
|
strictNullHandling: !1
|
|
3377
|
-
},
|
|
3359
|
+
}, ns = function(e) {
|
|
3378
3360
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
3379
|
-
},
|
|
3380
|
-
for (var g = t, w = y, O = 0, $ = !1; (w = w.get(
|
|
3361
|
+
}, At = {}, os = function e(t, r, n, l, a, i, o, s, c, p, f, u, h, d, m, b, j, y) {
|
|
3362
|
+
for (var g = t, w = y, O = 0, $ = !1; (w = w.get(At)) !== void 0 && !$; ) {
|
|
3381
3363
|
var E = w.get(t);
|
|
3382
3364
|
if (O += 1, typeof E < "u") {
|
|
3383
3365
|
if (E === O)
|
|
3384
3366
|
throw new RangeError("Cyclic object value");
|
|
3385
3367
|
$ = !0;
|
|
3386
3368
|
}
|
|
3387
|
-
typeof w.get(
|
|
3369
|
+
typeof w.get(At) > "u" && (O = 0);
|
|
3388
3370
|
}
|
|
3389
|
-
if (typeof p == "function" ? g = p(r, g) : g instanceof Date ? g =
|
|
3390
|
-
return v instanceof Date ?
|
|
3371
|
+
if (typeof p == "function" ? g = p(r, g) : g instanceof Date ? g = h(g) : n === "comma" && oe(g) && (g = Ze.maybeMap(g, function(v) {
|
|
3372
|
+
return v instanceof Date ? h(v) : v;
|
|
3391
3373
|
})), g === null) {
|
|
3392
|
-
if (
|
|
3393
|
-
return m(c && !b ? c(r, U.encoder, j, "key",
|
|
3374
|
+
if (i)
|
|
3375
|
+
return m(c && !b ? c(r, U.encoder, j, "key", d) : r);
|
|
3394
3376
|
g = "";
|
|
3395
3377
|
}
|
|
3396
|
-
if (
|
|
3378
|
+
if (ns(g) || Ze.isBuffer(g)) {
|
|
3397
3379
|
if (c) {
|
|
3398
|
-
var S = b ? r : c(r, U.encoder, j, "key",
|
|
3399
|
-
return [m(S) + "=" + m(c(g, U.encoder, j, "value",
|
|
3380
|
+
var S = b ? r : c(r, U.encoder, j, "key", d);
|
|
3381
|
+
return [m(S) + "=" + m(c(g, U.encoder, j, "value", d))];
|
|
3400
3382
|
}
|
|
3401
3383
|
return [m(r) + "=" + m(String(g))];
|
|
3402
3384
|
}
|
|
@@ -3414,30 +3396,30 @@ function() {
|
|
|
3414
3396
|
var Q = Object.keys(g);
|
|
3415
3397
|
_ = f ? Q.sort(f) : Q;
|
|
3416
3398
|
}
|
|
3417
|
-
var Y =
|
|
3399
|
+
var Y = s ? String(r).replace(/\./g, "%2E") : String(r), L = l && oe(g) && g.length === 1 ? Y + "[]" : Y;
|
|
3418
3400
|
if (a && oe(g) && g.length === 0)
|
|
3419
3401
|
return L + "[]";
|
|
3420
3402
|
for (var J = 0; J < _.length; ++J) {
|
|
3421
|
-
var F = _[J],
|
|
3422
|
-
if (!(o &&
|
|
3423
|
-
var ue = u &&
|
|
3403
|
+
var F = _[J], K = typeof F == "object" && F && typeof F.value < "u" ? F.value : g[F];
|
|
3404
|
+
if (!(o && K === null)) {
|
|
3405
|
+
var ue = u && s ? String(F).replace(/\./g, "%2E") : String(F), yt = oe(g) ? typeof n == "function" ? n(L, ue) : L : L + (u ? "." + ue : "[" + ue + "]");
|
|
3424
3406
|
y.set(t, O);
|
|
3425
|
-
var ze =
|
|
3426
|
-
ze.set(
|
|
3427
|
-
|
|
3407
|
+
var ze = $n();
|
|
3408
|
+
ze.set(At, y), wn(C, e(
|
|
3409
|
+
K,
|
|
3428
3410
|
yt,
|
|
3429
3411
|
n,
|
|
3430
3412
|
l,
|
|
3431
3413
|
a,
|
|
3432
|
-
s,
|
|
3433
|
-
o,
|
|
3434
3414
|
i,
|
|
3415
|
+
o,
|
|
3416
|
+
s,
|
|
3435
3417
|
n === "comma" && b && oe(g) ? null : c,
|
|
3436
3418
|
p,
|
|
3437
3419
|
f,
|
|
3438
3420
|
u,
|
|
3439
|
-
d,
|
|
3440
3421
|
h,
|
|
3422
|
+
d,
|
|
3441
3423
|
m,
|
|
3442
3424
|
b,
|
|
3443
3425
|
j,
|
|
@@ -3446,7 +3428,7 @@ function() {
|
|
|
3446
3428
|
}
|
|
3447
3429
|
}
|
|
3448
3430
|
return C;
|
|
3449
|
-
},
|
|
3431
|
+
}, as = function(e) {
|
|
3450
3432
|
if (!e)
|
|
3451
3433
|
return U;
|
|
3452
3434
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
@@ -3460,19 +3442,19 @@ function() {
|
|
|
3460
3442
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
3461
3443
|
var r = Ie.default;
|
|
3462
3444
|
if (typeof e.format < "u") {
|
|
3463
|
-
if (!
|
|
3445
|
+
if (!es.call(Ie.formatters, e.format))
|
|
3464
3446
|
throw new TypeError("Unknown format option provided.");
|
|
3465
3447
|
r = e.format;
|
|
3466
3448
|
}
|
|
3467
3449
|
var n = Ie.formatters[r], l = U.filter;
|
|
3468
3450
|
(typeof e.filter == "function" || oe(e.filter)) && (l = e.filter);
|
|
3469
3451
|
var a;
|
|
3470
|
-
if (e.arrayFormat in
|
|
3452
|
+
if (e.arrayFormat in vn ? a = e.arrayFormat : "indices" in e ? a = e.indices ? "indices" : "repeat" : a = U.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
|
|
3471
3453
|
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
3472
|
-
var
|
|
3454
|
+
var i = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : U.allowDots : !!e.allowDots;
|
|
3473
3455
|
return {
|
|
3474
3456
|
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : U.addQueryPrefix,
|
|
3475
|
-
allowDots:
|
|
3457
|
+
allowDots: i,
|
|
3476
3458
|
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : U.allowEmptyArrays,
|
|
3477
3459
|
arrayFormat: a,
|
|
3478
3460
|
charset: t,
|
|
@@ -3491,23 +3473,23 @@ function() {
|
|
|
3491
3473
|
sort: typeof e.sort == "function" ? e.sort : null,
|
|
3492
3474
|
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : U.strictNullHandling
|
|
3493
3475
|
};
|
|
3494
|
-
},
|
|
3495
|
-
var r = e, n =
|
|
3476
|
+
}, is = function(e, t) {
|
|
3477
|
+
var r = e, n = as(t), l, a;
|
|
3496
3478
|
typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : oe(n.filter) && (a = n.filter, l = a);
|
|
3497
|
-
var
|
|
3479
|
+
var i = [];
|
|
3498
3480
|
if (typeof r != "object" || r === null)
|
|
3499
3481
|
return "";
|
|
3500
|
-
var o =
|
|
3482
|
+
var o = vn[n.arrayFormat], s = o === "comma" && n.commaRoundTrip;
|
|
3501
3483
|
l || (l = Object.keys(r)), n.sort && l.sort(n.sort);
|
|
3502
|
-
for (var c =
|
|
3484
|
+
for (var c = $n(), p = 0; p < l.length; ++p) {
|
|
3503
3485
|
var f = l[p];
|
|
3504
3486
|
if (!(typeof f > "u" || f === null)) {
|
|
3505
3487
|
var u = r[f];
|
|
3506
|
-
n.skipNulls && u === null ||
|
|
3488
|
+
n.skipNulls && u === null || wn(i, os(
|
|
3507
3489
|
u,
|
|
3508
3490
|
f,
|
|
3509
3491
|
o,
|
|
3510
|
-
|
|
3492
|
+
s,
|
|
3511
3493
|
n.allowEmptyArrays,
|
|
3512
3494
|
n.strictNullHandling,
|
|
3513
3495
|
n.skipNulls,
|
|
@@ -3525,9 +3507,9 @@ function() {
|
|
|
3525
3507
|
));
|
|
3526
3508
|
}
|
|
3527
3509
|
}
|
|
3528
|
-
var
|
|
3529
|
-
return n.charsetSentinel && (n.charset === "iso-8859-1" ?
|
|
3530
|
-
}, se =
|
|
3510
|
+
var h = i.join(n.delimiter), d = n.addQueryPrefix === !0 ? "?" : "";
|
|
3511
|
+
return n.charsetSentinel && (n.charset === "iso-8859-1" ? d += "utf8=%26%2310003%3B" + n.delimiter : d += "utf8=%E2%9C%93" + n.delimiter), h.length > 0 ? d + h : "";
|
|
3512
|
+
}, se = jn, et = Object.prototype.hasOwnProperty, Rt = Array.isArray, q = {
|
|
3531
3513
|
allowDots: !1,
|
|
3532
3514
|
allowEmptyArrays: !1,
|
|
3533
3515
|
allowPrototypes: !1,
|
|
@@ -3550,11 +3532,11 @@ function() {
|
|
|
3550
3532
|
strictMerge: !0,
|
|
3551
3533
|
strictNullHandling: !1,
|
|
3552
3534
|
throwOnLimitExceeded: !1
|
|
3553
|
-
},
|
|
3535
|
+
}, ss = function(e) {
|
|
3554
3536
|
return e.replace(/&#(\d+);/g, function(t, r) {
|
|
3555
3537
|
return String.fromCharCode(parseInt(r, 10));
|
|
3556
3538
|
});
|
|
3557
|
-
},
|
|
3539
|
+
}, On = function(e, t, r, n) {
|
|
3558
3540
|
if (e && typeof e == "string" && t.comma && e.indexOf(",") > -1) {
|
|
3559
3541
|
if (n && t.throwOnLimitExceeded)
|
|
3560
3542
|
for (var l = 0, a = e.indexOf(","); a > -1; ) {
|
|
@@ -3567,7 +3549,7 @@ function() {
|
|
|
3567
3549
|
if (t.throwOnLimitExceeded && r >= t.arrayLimit)
|
|
3568
3550
|
throw new RangeError("Array limit exceeded. Only " + t.arrayLimit + " element" + (t.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
3569
3551
|
return e;
|
|
3570
|
-
},
|
|
3552
|
+
}, ls = "utf8=%26%2310003%3B", cs = "utf8=%E2%9C%93", ps = function(e, t) {
|
|
3571
3553
|
var r = { __proto__: null }, n = t.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
|
|
3572
3554
|
n = n.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
3573
3555
|
var l = t.parameterLimit === 1 / 0 ? void 0 : t.parameterLimit, a = n.split(
|
|
@@ -3576,68 +3558,68 @@ function() {
|
|
|
3576
3558
|
);
|
|
3577
3559
|
if (t.throwOnLimitExceeded && typeof l < "u" && a.length > l)
|
|
3578
3560
|
throw new RangeError("Parameter limit exceeded. Only " + l + " parameter" + (l === 1 ? "" : "s") + " allowed.");
|
|
3579
|
-
var
|
|
3561
|
+
var i = -1, o, s = t.charset;
|
|
3580
3562
|
if (t.charsetSentinel)
|
|
3581
3563
|
for (o = 0; o < a.length; ++o)
|
|
3582
|
-
a[o].indexOf("utf8=") === 0 && (a[o] ===
|
|
3564
|
+
a[o].indexOf("utf8=") === 0 && (a[o] === cs ? s = "utf-8" : a[o] === ls && (s = "iso-8859-1"), i = o, o = a.length);
|
|
3583
3565
|
for (o = 0; o < a.length; ++o)
|
|
3584
|
-
if (o !==
|
|
3585
|
-
var c = a[o], p = c.indexOf("]="), f = p === -1 ? c.indexOf("=") : p + 1, u,
|
|
3586
|
-
if (f === -1 ? (u = t.decoder(c, q.decoder,
|
|
3587
|
-
|
|
3566
|
+
if (o !== i) {
|
|
3567
|
+
var c = a[o], p = c.indexOf("]="), f = p === -1 ? c.indexOf("=") : p + 1, u, h;
|
|
3568
|
+
if (f === -1 ? (u = t.decoder(c, q.decoder, s, "key"), h = t.strictNullHandling ? null : "") : (u = t.decoder(c.slice(0, f), q.decoder, s, "key"), u !== null && (h = se.maybeMap(
|
|
3569
|
+
On(
|
|
3588
3570
|
c.slice(f + 1),
|
|
3589
3571
|
t,
|
|
3590
|
-
|
|
3572
|
+
Rt(r[u]) ? r[u].length : 0,
|
|
3591
3573
|
c.indexOf("[]=") === -1
|
|
3592
3574
|
),
|
|
3593
3575
|
function(m) {
|
|
3594
|
-
return t.decoder(m, q.decoder,
|
|
3576
|
+
return t.decoder(m, q.decoder, s, "value");
|
|
3595
3577
|
}
|
|
3596
|
-
))),
|
|
3597
|
-
var
|
|
3598
|
-
|
|
3578
|
+
))), h && t.interpretNumericEntities && s === "iso-8859-1" && (h = ss(String(h))), c.indexOf("[]=") > -1 && (h = Rt(h) ? [h] : h), t.comma && Rt(h) && h.length > t.arrayLimit && (h = se.combine([], h, t.arrayLimit, t.plainObjects, t.throwOnLimitExceeded)), u !== null) {
|
|
3579
|
+
var d = et.call(r, u);
|
|
3580
|
+
d && (t.duplicates === "combine" || c.indexOf("[]=") > -1) ? r[u] = se.combine(
|
|
3599
3581
|
r[u],
|
|
3600
|
-
|
|
3582
|
+
h,
|
|
3601
3583
|
t.arrayLimit,
|
|
3602
3584
|
t.plainObjects,
|
|
3603
3585
|
t.throwOnLimitExceeded
|
|
3604
|
-
) : (!
|
|
3586
|
+
) : (!d || t.duplicates === "last") && (r[u] = h);
|
|
3605
3587
|
}
|
|
3606
3588
|
}
|
|
3607
3589
|
return r;
|
|
3608
|
-
},
|
|
3590
|
+
}, us = function(e, t, r, n) {
|
|
3609
3591
|
var l = 0;
|
|
3610
3592
|
if (e.length > 0 && e[e.length - 1] === "[]") {
|
|
3611
3593
|
var a = e.slice(0, -1).join("");
|
|
3612
3594
|
l = Array.isArray(t) && t[a] ? t[a].length : 0;
|
|
3613
3595
|
}
|
|
3614
|
-
for (var
|
|
3615
|
-
var
|
|
3596
|
+
for (var i = n ? t : On(t, r, l), o = e.length - 1; o >= 0; --o) {
|
|
3597
|
+
var s, c = e[o];
|
|
3616
3598
|
if (c === "[]" && r.parseArrays)
|
|
3617
|
-
se.isOverflow(
|
|
3599
|
+
se.isOverflow(i) ? s = i : s = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : se.combine(
|
|
3618
3600
|
[],
|
|
3619
|
-
|
|
3601
|
+
i,
|
|
3620
3602
|
r.arrayLimit,
|
|
3621
3603
|
r.plainObjects,
|
|
3622
3604
|
r.throwOnLimitExceeded
|
|
3623
3605
|
);
|
|
3624
3606
|
else {
|
|
3625
|
-
|
|
3626
|
-
var p = c.charAt(0) === "[" && c.charAt(c.length - 1) === "]" ? c.slice(1, -1) : c, f = r.decodeDotInKeys ? p.replace(/%2E/g, ".") : p, u = parseInt(f, 10),
|
|
3607
|
+
s = r.plainObjects ? { __proto__: null } : {};
|
|
3608
|
+
var p = c.charAt(0) === "[" && c.charAt(c.length - 1) === "]" ? c.slice(1, -1) : c, f = r.decodeDotInKeys ? p.replace(/%2E/g, ".") : p, u = parseInt(f, 10), h = !isNaN(u) && c !== f && String(u) === f && u >= 0 && r.parseArrays;
|
|
3627
3609
|
if (!r.parseArrays && f === "")
|
|
3628
|
-
|
|
3629
|
-
else if (
|
|
3630
|
-
|
|
3610
|
+
s = { 0: i };
|
|
3611
|
+
else if (h && u < r.arrayLimit)
|
|
3612
|
+
s = [], s[u] = i;
|
|
3631
3613
|
else {
|
|
3632
|
-
if (
|
|
3614
|
+
if (h && r.throwOnLimitExceeded)
|
|
3633
3615
|
throw new RangeError("Array limit exceeded. Only " + r.arrayLimit + " element" + (r.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
3634
|
-
|
|
3616
|
+
h ? (s[u] = i, se.markOverflow(s, u)) : f !== "__proto__" && (s[f] = i);
|
|
3635
3617
|
}
|
|
3636
3618
|
}
|
|
3637
|
-
|
|
3619
|
+
i = s;
|
|
3638
3620
|
}
|
|
3639
|
-
return
|
|
3640
|
-
},
|
|
3621
|
+
return i;
|
|
3622
|
+
}, fs = function(e, t) {
|
|
3641
3623
|
var r = t.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e;
|
|
3642
3624
|
if (t.depth <= 0)
|
|
3643
3625
|
return !t.plainObjects && et.call(Object.prototype, r) && !t.allowPrototypes ? void 0 : [r];
|
|
@@ -3647,17 +3629,17 @@ function() {
|
|
|
3647
3629
|
return;
|
|
3648
3630
|
n[n.length] = a;
|
|
3649
3631
|
}
|
|
3650
|
-
for (var
|
|
3651
|
-
for (var c = 1, p = o + 1, f = -1; p <
|
|
3632
|
+
for (var i = r.length, o = l, s = 0; o >= 0 && s < t.depth; ) {
|
|
3633
|
+
for (var c = 1, p = o + 1, f = -1; p < i && f < 0; ) {
|
|
3652
3634
|
var u = r.charCodeAt(p);
|
|
3653
3635
|
u === 91 ? c += 1 : u === 93 && (c -= 1, c === 0 && (f = p)), p += 1;
|
|
3654
3636
|
}
|
|
3655
3637
|
if (f < 0)
|
|
3656
3638
|
return n[n.length] = "[" + r.slice(o) + "]", n;
|
|
3657
|
-
var
|
|
3658
|
-
if (!t.plainObjects && et.call(Object.prototype,
|
|
3639
|
+
var h = r.slice(o, f + 1), d = h.slice(1, -1);
|
|
3640
|
+
if (!t.plainObjects && et.call(Object.prototype, d) && !t.allowPrototypes)
|
|
3659
3641
|
return;
|
|
3660
|
-
n[n.length] =
|
|
3642
|
+
n[n.length] = h, s += 1, o = r.indexOf("[", f + 1);
|
|
3661
3643
|
}
|
|
3662
3644
|
if (o >= 0) {
|
|
3663
3645
|
if (t.strictDepth === !0)
|
|
@@ -3665,13 +3647,13 @@ function() {
|
|
|
3665
3647
|
n[n.length] = "[" + r.slice(o) + "]";
|
|
3666
3648
|
}
|
|
3667
3649
|
return n;
|
|
3668
|
-
},
|
|
3650
|
+
}, hs = function(e, t, r, n) {
|
|
3669
3651
|
if (e) {
|
|
3670
|
-
var l =
|
|
3652
|
+
var l = fs(e, r);
|
|
3671
3653
|
if (l)
|
|
3672
|
-
return
|
|
3654
|
+
return us(l, t, r, n);
|
|
3673
3655
|
}
|
|
3674
|
-
},
|
|
3656
|
+
}, ds = function(e) {
|
|
3675
3657
|
if (!e)
|
|
3676
3658
|
return q;
|
|
3677
3659
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
@@ -3713,24 +3695,24 @@ function() {
|
|
|
3713
3695
|
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : q.strictNullHandling,
|
|
3714
3696
|
throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
|
|
3715
3697
|
};
|
|
3716
|
-
},
|
|
3717
|
-
var r =
|
|
3698
|
+
}, ys = function(e, t) {
|
|
3699
|
+
var r = ds(t);
|
|
3718
3700
|
if (e === "" || e === null || typeof e > "u")
|
|
3719
3701
|
return r.plainObjects ? { __proto__: null } : {};
|
|
3720
|
-
for (var n = typeof e == "string" ?
|
|
3721
|
-
var o = a[
|
|
3722
|
-
l = se.merge(l,
|
|
3702
|
+
for (var n = typeof e == "string" ? ps(e, r) : e, l = r.plainObjects ? { __proto__: null } : {}, a = Object.keys(n), i = 0; i < a.length; ++i) {
|
|
3703
|
+
var o = a[i], s = hs(o, n[o], r, typeof e == "string");
|
|
3704
|
+
l = se.merge(l, s, r);
|
|
3723
3705
|
}
|
|
3724
3706
|
return r.allowSparse === !0 ? l : se.compact(l);
|
|
3725
|
-
},
|
|
3726
|
-
formats:
|
|
3727
|
-
parse:
|
|
3728
|
-
stringify:
|
|
3729
|
-
},
|
|
3707
|
+
}, ms = is, bs = ys, gs = Yt, tt = {
|
|
3708
|
+
formats: gs,
|
|
3709
|
+
parse: bs,
|
|
3710
|
+
stringify: ms
|
|
3711
|
+
}, js = wo;
|
|
3730
3712
|
function ee() {
|
|
3731
3713
|
this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
|
|
3732
3714
|
}
|
|
3733
|
-
var
|
|
3715
|
+
var $s = /^([a-z0-9.+-]+:)/i, vs = /:[0-9]*$/, ws = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, Os = [
|
|
3734
3716
|
"<",
|
|
3735
3717
|
">",
|
|
3736
3718
|
'"',
|
|
@@ -3740,27 +3722,27 @@ var gs = /^([a-z0-9.+-]+:)/i, js = /:[0-9]*$/, $s = /^(\/\/?(?!\/)[^?\s]*)(\?[^\
|
|
|
3740
3722
|
`
|
|
3741
3723
|
`,
|
|
3742
3724
|
" "
|
|
3743
|
-
],
|
|
3725
|
+
], Ss = [
|
|
3744
3726
|
"{",
|
|
3745
3727
|
"}",
|
|
3746
3728
|
"|",
|
|
3747
3729
|
"\\",
|
|
3748
3730
|
"^",
|
|
3749
3731
|
"`"
|
|
3750
|
-
].concat(
|
|
3732
|
+
].concat(Os), Ft = ["'"].concat(Ss), Mr = [
|
|
3751
3733
|
"%",
|
|
3752
3734
|
"/",
|
|
3753
3735
|
"?",
|
|
3754
3736
|
";",
|
|
3755
3737
|
"#"
|
|
3756
|
-
].concat(
|
|
3738
|
+
].concat(Ft), Fr = [
|
|
3757
3739
|
"/",
|
|
3758
3740
|
"?",
|
|
3759
3741
|
"#"
|
|
3760
|
-
],
|
|
3742
|
+
], Ts = 255, Br = /^[+a-z0-9A-Z_-]{0,63}$/, ks = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, xs = {
|
|
3761
3743
|
javascript: !0,
|
|
3762
3744
|
"javascript:": !0
|
|
3763
|
-
},
|
|
3745
|
+
}, Bt = {
|
|
3764
3746
|
javascript: !0,
|
|
3765
3747
|
"javascript:": !0
|
|
3766
3748
|
}, Ce = {
|
|
@@ -3774,8 +3756,8 @@ var gs = /^([a-z0-9.+-]+:)/i, js = /:[0-9]*$/, $s = /^(\/\/?(?!\/)[^?\s]*)(\?[^\
|
|
|
3774
3756
|
"ftp:": !0,
|
|
3775
3757
|
"gopher:": !0,
|
|
3776
3758
|
"file:": !0
|
|
3777
|
-
},
|
|
3778
|
-
function
|
|
3759
|
+
}, Wt = tt;
|
|
3760
|
+
function Xt(e, t, r) {
|
|
3779
3761
|
if (e && typeof e == "object" && e instanceof ee)
|
|
3780
3762
|
return e;
|
|
3781
3763
|
var n = new ee();
|
|
@@ -3784,15 +3766,15 @@ function er(e, t, r) {
|
|
|
3784
3766
|
ee.prototype.parse = function(e, t, r) {
|
|
3785
3767
|
if (typeof e != "string")
|
|
3786
3768
|
throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
|
|
3787
|
-
var n = e.indexOf("?"), l = n !== -1 && n < e.indexOf("#") ? "?" : "#", a = e.split(l),
|
|
3788
|
-
a[0] = a[0].replace(
|
|
3769
|
+
var n = e.indexOf("?"), l = n !== -1 && n < e.indexOf("#") ? "?" : "#", a = e.split(l), i = /\\/g;
|
|
3770
|
+
a[0] = a[0].replace(i, "/"), e = a.join(l);
|
|
3789
3771
|
var o = e;
|
|
3790
3772
|
if (o = o.trim(), !r && e.split("#").length === 1) {
|
|
3791
|
-
var
|
|
3792
|
-
if (
|
|
3793
|
-
return this.path = o, this.href = o, this.pathname =
|
|
3773
|
+
var s = ws.exec(o);
|
|
3774
|
+
if (s)
|
|
3775
|
+
return this.path = o, this.href = o, this.pathname = s[1], s[2] ? (this.search = s[2], t ? this.query = Wt.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "", this.query = {}), this;
|
|
3794
3776
|
}
|
|
3795
|
-
var c =
|
|
3777
|
+
var c = $s.exec(o);
|
|
3796
3778
|
if (c) {
|
|
3797
3779
|
c = c[0];
|
|
3798
3780
|
var p = c.toLowerCase();
|
|
@@ -3800,41 +3782,41 @@ ee.prototype.parse = function(e, t, r) {
|
|
|
3800
3782
|
}
|
|
3801
3783
|
if (r || c || o.match(/^\/\/[^@/]+@[^@/]+/)) {
|
|
3802
3784
|
var f = o.substr(0, 2) === "//";
|
|
3803
|
-
f && !(c &&
|
|
3785
|
+
f && !(c && Bt[c]) && (o = o.substr(2), this.slashes = !0);
|
|
3804
3786
|
}
|
|
3805
|
-
if (!
|
|
3806
|
-
for (var u = -1,
|
|
3807
|
-
var
|
|
3808
|
-
|
|
3787
|
+
if (!Bt[c] && (f || c && !Ce[c])) {
|
|
3788
|
+
for (var u = -1, h = 0; h < Fr.length; h++) {
|
|
3789
|
+
var d = o.indexOf(Fr[h]);
|
|
3790
|
+
d !== -1 && (u === -1 || d < u) && (u = d);
|
|
3809
3791
|
}
|
|
3810
3792
|
var m, b;
|
|
3811
3793
|
u === -1 ? b = o.lastIndexOf("@") : b = o.lastIndexOf("@", u), b !== -1 && (m = o.slice(0, b), o = o.slice(b + 1), this.auth = decodeURIComponent(m)), u = -1;
|
|
3812
|
-
for (var
|
|
3813
|
-
var
|
|
3814
|
-
|
|
3794
|
+
for (var h = 0; h < Mr.length; h++) {
|
|
3795
|
+
var d = o.indexOf(Mr[h]);
|
|
3796
|
+
d !== -1 && (u === -1 || d < u) && (u = d);
|
|
3815
3797
|
}
|
|
3816
3798
|
u === -1 && (u = o.length), this.host = o.slice(0, u), o = o.slice(u), this.parseHost(), this.hostname = this.hostname || "";
|
|
3817
3799
|
var j = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
3818
3800
|
if (!j)
|
|
3819
|
-
for (var y = this.hostname.split(/\./),
|
|
3820
|
-
var w = y[
|
|
3821
|
-
if (w && !w.match(
|
|
3801
|
+
for (var y = this.hostname.split(/\./), h = 0, g = y.length; h < g; h++) {
|
|
3802
|
+
var w = y[h];
|
|
3803
|
+
if (w && !w.match(Br)) {
|
|
3822
3804
|
for (var O = "", $ = 0, E = w.length; $ < E; $++)
|
|
3823
3805
|
w.charCodeAt($) > 127 ? O += "x" : O += w[$];
|
|
3824
|
-
if (!O.match(
|
|
3825
|
-
var S = y.slice(0,
|
|
3806
|
+
if (!O.match(Br)) {
|
|
3807
|
+
var S = y.slice(0, h), C = y.slice(h + 1), _ = w.match(ks);
|
|
3826
3808
|
_ && (S.push(_[1]), C.unshift(_[2])), C.length && (o = "/" + C.join(".") + o), this.hostname = S.join(".");
|
|
3827
3809
|
break;
|
|
3828
3810
|
}
|
|
3829
3811
|
}
|
|
3830
3812
|
}
|
|
3831
|
-
this.hostname.length >
|
|
3813
|
+
this.hostname.length > Ts ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), j || (this.hostname = js.toASCII(this.hostname));
|
|
3832
3814
|
var Q = this.port ? ":" + this.port : "", Y = this.hostname || "";
|
|
3833
3815
|
this.host = Y + Q, this.href += this.host, j && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), o[0] !== "/" && (o = "/" + o));
|
|
3834
3816
|
}
|
|
3835
|
-
if (!
|
|
3836
|
-
for (var
|
|
3837
|
-
var L =
|
|
3817
|
+
if (!xs[p])
|
|
3818
|
+
for (var h = 0, g = Ft.length; h < g; h++) {
|
|
3819
|
+
var L = Ft[h];
|
|
3838
3820
|
if (o.indexOf(L) !== -1) {
|
|
3839
3821
|
var J = encodeURIComponent(L);
|
|
3840
3822
|
J === L && (J = escape(L)), o = o.split(L).join(J);
|
|
@@ -3842,31 +3824,31 @@ ee.prototype.parse = function(e, t, r) {
|
|
|
3842
3824
|
}
|
|
3843
3825
|
var F = o.indexOf("#");
|
|
3844
3826
|
F !== -1 && (this.hash = o.substr(F), o = o.slice(0, F));
|
|
3845
|
-
var
|
|
3846
|
-
if (
|
|
3827
|
+
var K = o.indexOf("?");
|
|
3828
|
+
if (K !== -1 ? (this.search = o.substr(K), this.query = o.substr(K + 1), t && (this.query = Wt.parse(this.query)), o = o.slice(0, K)) : t && (this.search = "", this.query = {}), o && (this.pathname = o), Ce[p] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
|
3847
3829
|
var Q = this.pathname || "", ue = this.search || "";
|
|
3848
3830
|
this.path = Q + ue;
|
|
3849
3831
|
}
|
|
3850
3832
|
return this.href = this.format(), this;
|
|
3851
3833
|
};
|
|
3852
|
-
function
|
|
3853
|
-
return typeof e == "string" && (e =
|
|
3834
|
+
function Es(e) {
|
|
3835
|
+
return typeof e == "string" && (e = Xt(e)), e instanceof ee ? e.format() : ee.prototype.format.call(e);
|
|
3854
3836
|
}
|
|
3855
3837
|
ee.prototype.format = function() {
|
|
3856
3838
|
var e = this.auth || "";
|
|
3857
3839
|
e && (e = encodeURIComponent(e), e = e.replace(/%3A/i, ":"), e += "@");
|
|
3858
3840
|
var t = this.protocol || "", r = this.pathname || "", n = this.hash || "", l = !1, a = "";
|
|
3859
|
-
this.host ? l = e + this.host : this.hostname && (l = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (l += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (a =
|
|
3841
|
+
this.host ? l = e + this.host : this.hostname && (l = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (l += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (a = Wt.stringify(this.query, {
|
|
3860
3842
|
arrayFormat: "repeat",
|
|
3861
3843
|
addQueryPrefix: !1
|
|
3862
3844
|
}));
|
|
3863
|
-
var
|
|
3864
|
-
return t && t.substr(-1) !== ":" && (t += ":"), this.slashes || (!t || Ce[t]) && l !== !1 ? (l = "//" + (l || ""), r && r.charAt(0) !== "/" && (r = "/" + r)) : l || (l = ""), n && n.charAt(0) !== "#" && (n = "#" + n),
|
|
3845
|
+
var i = this.search || a && "?" + a || "";
|
|
3846
|
+
return t && t.substr(-1) !== ":" && (t += ":"), this.slashes || (!t || Ce[t]) && l !== !1 ? (l = "//" + (l || ""), r && r.charAt(0) !== "/" && (r = "/" + r)) : l || (l = ""), n && n.charAt(0) !== "#" && (n = "#" + n), i && i.charAt(0) !== "?" && (i = "?" + i), r = r.replace(/[?#]/g, function(o) {
|
|
3865
3847
|
return encodeURIComponent(o);
|
|
3866
|
-
}),
|
|
3848
|
+
}), i = i.replace("#", "%23"), t + l + r + i + n;
|
|
3867
3849
|
};
|
|
3868
3850
|
ee.prototype.resolve = function(e) {
|
|
3869
|
-
return this.resolveObject(
|
|
3851
|
+
return this.resolveObject(Xt(e, !1, !0)).format();
|
|
3870
3852
|
};
|
|
3871
3853
|
ee.prototype.resolveObject = function(e) {
|
|
3872
3854
|
if (typeof e == "string") {
|
|
@@ -3880,9 +3862,9 @@ ee.prototype.resolveObject = function(e) {
|
|
|
3880
3862
|
if (r.hash = e.hash, e.href === "")
|
|
3881
3863
|
return r.href = r.format(), r;
|
|
3882
3864
|
if (e.slashes && !e.protocol) {
|
|
3883
|
-
for (var
|
|
3884
|
-
var
|
|
3885
|
-
|
|
3865
|
+
for (var i = Object.keys(e), o = 0; o < i.length; o++) {
|
|
3866
|
+
var s = i[o];
|
|
3867
|
+
s !== "protocol" && (r[s] = e[s]);
|
|
3886
3868
|
}
|
|
3887
3869
|
return Ce[r.protocol] && r.hostname && !r.pathname && (r.pathname = "/", r.path = r.pathname), r.href = r.format(), r;
|
|
3888
3870
|
}
|
|
@@ -3894,19 +3876,19 @@ ee.prototype.resolveObject = function(e) {
|
|
|
3894
3876
|
}
|
|
3895
3877
|
return r.href = r.format(), r;
|
|
3896
3878
|
}
|
|
3897
|
-
if (r.protocol = e.protocol, !e.host && !
|
|
3879
|
+
if (r.protocol = e.protocol, !e.host && !Bt[e.protocol]) {
|
|
3898
3880
|
for (var g = (e.pathname || "").split("/"); g.length && !(e.host = g.shift()); )
|
|
3899
3881
|
;
|
|
3900
3882
|
e.host || (e.host = ""), e.hostname || (e.hostname = ""), g[0] !== "" && g.unshift(""), g.length < 2 && g.unshift(""), r.pathname = g.join("/");
|
|
3901
3883
|
} else
|
|
3902
3884
|
r.pathname = e.pathname;
|
|
3903
3885
|
if (r.search = e.search, r.query = e.query, r.host = e.host || "", r.auth = e.auth, r.hostname = e.hostname || e.host, r.port = e.port, r.pathname || r.search) {
|
|
3904
|
-
var u = r.pathname || "",
|
|
3905
|
-
r.path = u +
|
|
3886
|
+
var u = r.pathname || "", h = r.search || "";
|
|
3887
|
+
r.path = u + h;
|
|
3906
3888
|
}
|
|
3907
3889
|
return r.slashes = r.slashes || e.slashes, r.href = r.format(), r;
|
|
3908
3890
|
}
|
|
3909
|
-
var
|
|
3891
|
+
var d = r.pathname && r.pathname.charAt(0) === "/", m = e.host || e.pathname && e.pathname.charAt(0) === "/", b = m || d || r.host && e.pathname, j = b, y = r.pathname && r.pathname.split("/") || [], g = e.pathname && e.pathname.split("/") || [], w = r.protocol && !Ce[r.protocol];
|
|
3910
3892
|
if (w && (r.hostname = "", r.port = null, r.host && (y[0] === "" ? y[0] = r.host : y.unshift(r.host)), r.host = "", e.protocol && (e.hostname = null, e.port = null, e.host && (g[0] === "" ? g[0] = e.host : g.unshift(e.host)), e.host = null), b = b && (g[0] === "" || y[0] === "")), m)
|
|
3911
3893
|
r.host = e.host || e.host === "" ? e.host : r.host, r.hostname = e.hostname || e.hostname === "" ? e.hostname : r.hostname, r.search = e.search, r.query = e.query, y = g;
|
|
3912
3894
|
else if (g.length)
|
|
@@ -3936,20 +3918,20 @@ ee.prototype.resolveObject = function(e) {
|
|
|
3936
3918
|
return b = b || r.host && y.length, b && !_ && y.unshift(""), y.length > 0 ? r.pathname = y.join("/") : (r.pathname = null, r.path = null), (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = e.auth || r.auth, r.slashes = r.slashes || e.slashes, r.href = r.format(), r;
|
|
3937
3919
|
};
|
|
3938
3920
|
ee.prototype.parseHost = function() {
|
|
3939
|
-
var e = this.host, t =
|
|
3921
|
+
var e = this.host, t = vs.exec(e);
|
|
3940
3922
|
t && (t = t[0], t !== ":" && (this.port = t.substr(1)), e = e.substr(0, e.length - t.length)), e && (this.hostname = e);
|
|
3941
3923
|
};
|
|
3942
|
-
var
|
|
3943
|
-
const
|
|
3924
|
+
var Ps = Xt, Wr = Es;
|
|
3925
|
+
const Cs = () => Object.keys(xe).map((e) => ({
|
|
3944
3926
|
...xe[e].info,
|
|
3945
3927
|
clients: Object.keys(xe[e].clientsById).map((t) => xe[e].clientsById[t].info)
|
|
3946
|
-
})),
|
|
3947
|
-
var
|
|
3928
|
+
})), As = (e) => typeof e == "object" && "log" in e && typeof e.log == "object" && "entries" in e.log && Array.isArray(e.log.entries);
|
|
3929
|
+
var Rs = class {
|
|
3948
3930
|
constructor(e, t = {}) {
|
|
3949
3931
|
this.initCalled = !1, this.entries = [], this.requests = [], this.options = {}, this.options = {
|
|
3950
3932
|
harIsAlreadyEncoded: !1,
|
|
3951
3933
|
...t
|
|
3952
|
-
}, this.requests = [],
|
|
3934
|
+
}, this.requests = [], As(e) ? this.entries = e.log.entries : this.entries = [{ request: e }];
|
|
3953
3935
|
}
|
|
3954
3936
|
init() {
|
|
3955
3937
|
return this.initCalled = !0, this.requests = this.entries.map(({ request: e }) => {
|
|
@@ -3978,42 +3960,42 @@ var Cs = class {
|
|
|
3978
3960
|
cookiesObj: {},
|
|
3979
3961
|
allHeaders: {}
|
|
3980
3962
|
};
|
|
3981
|
-
if (a != null && a.queryString.length && (a.queryObj = a.queryString.reduce(
|
|
3982
|
-
const
|
|
3983
|
-
a.headersObj = a.headers.reduce((
|
|
3984
|
-
const j =
|
|
3963
|
+
if (a != null && a.queryString.length && (a.queryObj = a.queryString.reduce(ur, {})), a != null && a.headers.length) {
|
|
3964
|
+
const h = /^HTTP\/2/;
|
|
3965
|
+
a.headersObj = a.headers.reduce((d, { name: m, value: b }) => {
|
|
3966
|
+
const j = h.exec(a.httpVersion) ? m.toLocaleLowerCase() : m;
|
|
3985
3967
|
return {
|
|
3986
|
-
...
|
|
3968
|
+
...d,
|
|
3987
3969
|
[j]: b
|
|
3988
3970
|
};
|
|
3989
3971
|
}, {});
|
|
3990
3972
|
}
|
|
3991
|
-
a != null && a.cookies.length && (a.cookiesObj = a.cookies.reduceRight((
|
|
3992
|
-
...
|
|
3993
|
-
[
|
|
3973
|
+
a != null && a.cookies.length && (a.cookiesObj = a.cookies.reduceRight((h, { name: d, value: m }) => ({
|
|
3974
|
+
...h,
|
|
3975
|
+
[d]: m
|
|
3994
3976
|
}), {}));
|
|
3995
|
-
const
|
|
3996
|
-
switch (
|
|
3977
|
+
const i = (r = a.cookies) == null ? void 0 : r.map(({ name: h, value: d }) => t.harIsAlreadyEncoded ? `${h}=${d}` : `${encodeURIComponent(h)}=${encodeURIComponent(d)}`);
|
|
3978
|
+
switch (i != null && i.length && (a.allHeaders.cookie = i.join("; ")), a.postData.mimeType) {
|
|
3997
3979
|
case "multipart/mixed":
|
|
3998
3980
|
case "multipart/related":
|
|
3999
3981
|
case "multipart/form-data":
|
|
4000
3982
|
case "multipart/alternative":
|
|
4001
3983
|
if (a.postData.text = "", a.postData.mimeType = "multipart/form-data", (n = a.postData) != null && n.params) {
|
|
4002
|
-
const
|
|
3984
|
+
const h = "---011000010111000001101001", d = `${h}--`, m = `\r
|
|
4003
3985
|
`;
|
|
4004
3986
|
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
4005
3987
|
const b = (w) => w.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), j = (w) => w.replace(/\r?\n|\r/g, `\r
|
|
4006
|
-
`), y = [`--${
|
|
3988
|
+
`), y = [`--${h}`];
|
|
4007
3989
|
(l = a.postData) == null || l.params.forEach((w, O) => {
|
|
4008
3990
|
const $ = w.name, E = w.value || "", S = w.fileName || null, C = w.contentType || "application/octet-stream";
|
|
4009
|
-
S ? (y.push(`Content-Disposition: form-data; name="${b(j($))}"; filename="${S}"`), y.push(`Content-Type: ${C}`)) : y.push(`Content-Disposition: form-data; name="${escape(j($))}"`), y.push(""), y.push(j(E)), O !== a.postData.params.length - 1 && y.push(`--${
|
|
4010
|
-
}), y.push(`--${
|
|
3991
|
+
S ? (y.push(`Content-Disposition: form-data; name="${b(j($))}"; filename="${S}"`), y.push(`Content-Type: ${C}`)) : y.push(`Content-Disposition: form-data; name="${escape(j($))}"`), y.push(""), y.push(j(E)), O !== a.postData.params.length - 1 && y.push(`--${h}`);
|
|
3992
|
+
}), y.push(`--${d}`), a.postData.boundary = h, a.postData.text = y.join(m);
|
|
4011
3993
|
const g = W(a.headersObj, "content-type") || "content-type";
|
|
4012
|
-
a.headersObj[g] = `multipart/form-data; boundary=${
|
|
3994
|
+
a.headersObj[g] = `multipart/form-data; boundary=${h}`;
|
|
4013
3995
|
}
|
|
4014
3996
|
break;
|
|
4015
3997
|
case "application/x-www-form-urlencoded":
|
|
4016
|
-
a.postData.params ? (a.postData.paramsObj = a.postData.params.reduce(
|
|
3998
|
+
a.postData.params ? (a.postData.paramsObj = a.postData.params.reduce(ur, {}), a.postData.text = tt.stringify(a.postData.paramsObj)) : a.postData.text = "";
|
|
4017
3999
|
break;
|
|
4018
4000
|
case "text/json":
|
|
4019
4001
|
case "text/x-json":
|
|
@@ -4029,10 +4011,10 @@ var Cs = class {
|
|
|
4029
4011
|
const o = {
|
|
4030
4012
|
...a.allHeaders,
|
|
4031
4013
|
...a.headersObj
|
|
4032
|
-
},
|
|
4014
|
+
}, s = Ps(a.url, !0, !0);
|
|
4033
4015
|
a.queryObj = {
|
|
4034
4016
|
...a.queryObj,
|
|
4035
|
-
...
|
|
4017
|
+
...s.query
|
|
4036
4018
|
};
|
|
4037
4019
|
let c;
|
|
4038
4020
|
t.harIsAlreadyEncoded ? c = tt.stringify(a.queryObj, {
|
|
@@ -4040,16 +4022,16 @@ var Cs = class {
|
|
|
4040
4022
|
indices: !1
|
|
4041
4023
|
}) : c = tt.stringify(a.queryObj, { indices: !1 });
|
|
4042
4024
|
const p = {
|
|
4043
|
-
...
|
|
4025
|
+
...s,
|
|
4044
4026
|
query: a.queryObj,
|
|
4045
4027
|
search: c,
|
|
4046
|
-
path: c ? `${
|
|
4047
|
-
}, f =
|
|
4048
|
-
...
|
|
4028
|
+
path: c ? `${s.pathname}?${c}` : s.pathname
|
|
4029
|
+
}, f = Wr({
|
|
4030
|
+
...s,
|
|
4049
4031
|
query: null,
|
|
4050
4032
|
search: null
|
|
4051
|
-
}), u =
|
|
4052
|
-
...
|
|
4033
|
+
}), u = Wr({
|
|
4034
|
+
...s,
|
|
4053
4035
|
...p
|
|
4054
4036
|
});
|
|
4055
4037
|
return {
|
|
@@ -4075,27 +4057,27 @@ var Cs = class {
|
|
|
4075
4057
|
return this.requests.map((a) => l != null && l.installation ? l.installation(a, r) : !1);
|
|
4076
4058
|
}
|
|
4077
4059
|
};
|
|
4078
|
-
const
|
|
4079
|
-
function
|
|
4080
|
-
return
|
|
4060
|
+
const Sn = "agent", Tn = "prompt";
|
|
4061
|
+
function qs() {
|
|
4062
|
+
return Cs();
|
|
4081
4063
|
}
|
|
4082
|
-
function
|
|
4064
|
+
function Ns(e) {
|
|
4083
4065
|
var t;
|
|
4084
4066
|
const r = e == null ? void 0 : e[0];
|
|
4085
4067
|
if (!r) return "http://localhost";
|
|
4086
4068
|
let n = r.url;
|
|
4087
4069
|
for (const [l, a] of Object.entries(r.variables ?? {})) {
|
|
4088
|
-
const
|
|
4089
|
-
n = n.replace(new RegExp(`\\{${l}\\}`, "g"), String(
|
|
4070
|
+
const i = a.default ?? ((t = a.enum) == null ? void 0 : t[0]) ?? `{${l}}`;
|
|
4071
|
+
n = n.replace(new RegExp(`\\{${l}\\}`, "g"), String(i));
|
|
4090
4072
|
}
|
|
4091
4073
|
return n;
|
|
4092
4074
|
}
|
|
4093
|
-
function
|
|
4075
|
+
function Ls(e) {
|
|
4094
4076
|
if (e.example !== void 0 || e.examples && Object.keys(e.examples).length > 0) return !0;
|
|
4095
4077
|
const t = e.schema;
|
|
4096
4078
|
return !!((t == null ? void 0 : t.example) !== void 0 || t != null && t.enum && t.enum.length > 0);
|
|
4097
4079
|
}
|
|
4098
|
-
function
|
|
4080
|
+
function kn(e) {
|
|
4099
4081
|
if (e.example !== void 0) return String(e.example);
|
|
4100
4082
|
if (e.examples) {
|
|
4101
4083
|
for (const r of Object.values(e.examples))
|
|
@@ -4105,38 +4087,38 @@ function An(e) {
|
|
|
4105
4087
|
const t = e.schema;
|
|
4106
4088
|
return (t == null ? void 0 : t.example) !== void 0 ? String(t.example) : t != null && t.enum && t.enum.length > 0 ? String(t.enum[0]) : `{${e.name}}`;
|
|
4107
4089
|
}
|
|
4108
|
-
function
|
|
4090
|
+
function Us(e, t, r) {
|
|
4109
4091
|
const n = t.replace(/\{([^}]+)\}/g, (l, a) => {
|
|
4110
|
-
const
|
|
4111
|
-
if (!
|
|
4112
|
-
const o =
|
|
4092
|
+
const i = r.find((s) => s.in === "path" && s.name === a);
|
|
4093
|
+
if (!i) return l;
|
|
4094
|
+
const o = kn(i);
|
|
4113
4095
|
return o === `{${a}}` ? o : encodeURIComponent(o);
|
|
4114
4096
|
});
|
|
4115
4097
|
return `${e.replace(/\/$/, "")}${n}`;
|
|
4116
4098
|
}
|
|
4117
|
-
function
|
|
4099
|
+
function Ds(e, t) {
|
|
4118
4100
|
var r;
|
|
4119
4101
|
const n = e[0];
|
|
4120
4102
|
if (!n || !t) return [];
|
|
4121
4103
|
const l = [];
|
|
4122
4104
|
for (const a of Object.keys(n)) {
|
|
4123
|
-
const
|
|
4124
|
-
if (
|
|
4125
|
-
if (
|
|
4126
|
-
const o =
|
|
4127
|
-
l.push({ location: o, name:
|
|
4128
|
-
} else if (
|
|
4129
|
-
const o = ((r =
|
|
4105
|
+
const i = t[a];
|
|
4106
|
+
if (i)
|
|
4107
|
+
if (i.type === "apiKey") {
|
|
4108
|
+
const o = i.in === "query" || i.in === "cookie" ? i.in : "header";
|
|
4109
|
+
l.push({ location: o, name: i.name, value: "YOUR_API_KEY" });
|
|
4110
|
+
} else if (i.type === "http") {
|
|
4111
|
+
const o = ((r = i.scheme) == null ? void 0 : r.toLowerCase()) === "basic";
|
|
4130
4112
|
l.push({
|
|
4131
4113
|
location: "header",
|
|
4132
4114
|
name: "Authorization",
|
|
4133
4115
|
value: o ? "Basic BASE64_ENCODED_CREDENTIALS" : "Bearer YOUR_ACCESS_TOKEN"
|
|
4134
4116
|
});
|
|
4135
|
-
} else (
|
|
4117
|
+
} else (i.type === "oauth2" || i.type === "openIdConnect") && l.push({ location: "header", name: "Authorization", value: "Bearer YOUR_ACCESS_TOKEN" });
|
|
4136
4118
|
}
|
|
4137
4119
|
return l;
|
|
4138
4120
|
}
|
|
4139
|
-
function
|
|
4121
|
+
function _s(e) {
|
|
4140
4122
|
const t = e == null ? void 0 : e.content;
|
|
4141
4123
|
if (!t) return null;
|
|
4142
4124
|
const r = "application/json" in t ? "application/json" : Object.keys(t)[0];
|
|
@@ -4152,48 +4134,48 @@ function Us(e) {
|
|
|
4152
4134
|
}
|
|
4153
4135
|
return { contentType: r, schema: n.schema, authorExample: l };
|
|
4154
4136
|
}
|
|
4155
|
-
function
|
|
4156
|
-
const t =
|
|
4157
|
-
for (const
|
|
4158
|
-
(
|
|
4159
|
-
for (const
|
|
4160
|
-
|
|
4137
|
+
function Hs(e) {
|
|
4138
|
+
const t = Ns(e.servers), r = Us(t, e.path, e.parameters), n = Ds(e.security, e.securitySchemes), l = [], a = [], i = [];
|
|
4139
|
+
for (const s of n)
|
|
4140
|
+
(s.location === "header" ? l : s.location === "query" ? a : i).push({ name: s.name, value: s.value });
|
|
4141
|
+
for (const s of e.parameters)
|
|
4142
|
+
s.in === "query" && (s.required || Ls(s)) && a.push({ name: s.name, value: kn(s) });
|
|
4161
4143
|
const o = {
|
|
4162
4144
|
method: e.method.toUpperCase(),
|
|
4163
4145
|
url: r,
|
|
4164
4146
|
httpVersion: "HTTP/1.1",
|
|
4165
4147
|
headers: l,
|
|
4166
4148
|
queryString: a,
|
|
4167
|
-
cookies:
|
|
4149
|
+
cookies: i
|
|
4168
4150
|
};
|
|
4169
4151
|
return e.media && e.resolvedBodyValue !== void 0 && (l.push({ name: "Content-Type", value: e.media.contentType }), o.postData = { mimeType: e.media.contentType, text: JSON.stringify(e.resolvedBodyValue, null, 2) }), o;
|
|
4170
4152
|
}
|
|
4171
|
-
function
|
|
4153
|
+
function Is(e, t, r) {
|
|
4172
4154
|
try {
|
|
4173
|
-
const n = new
|
|
4155
|
+
const n = new Rs(e), [l] = n.convert(t, r);
|
|
4174
4156
|
return typeof l == "string" ? l : "";
|
|
4175
4157
|
} catch {
|
|
4176
4158
|
return "";
|
|
4177
4159
|
}
|
|
4178
4160
|
}
|
|
4179
|
-
const
|
|
4180
|
-
function
|
|
4181
|
-
var
|
|
4182
|
-
const { document: o, deref:
|
|
4161
|
+
const Ms = `${Sn}:${Tn}`;
|
|
4162
|
+
function Bs({ method: e, path: t, parameters: r, requestBody: n, security: l, id: a }) {
|
|
4163
|
+
var i;
|
|
4164
|
+
const { document: o, deref: s, showCodeSamples: c } = xn(), p = o, f = re.useId(), u = re.useMemo(() => qs(), []), [h, d] = re.useState(Ms), [m, b] = h.split(":"), j = An(m), y = re.useMemo(() => _s(n), [n]), [g, w] = re.useState(void 0);
|
|
4183
4165
|
re.useEffect(() => {
|
|
4184
4166
|
if (w(void 0), !y || y.authorExample !== void 0 || !y.schema) return;
|
|
4185
4167
|
let S = !1;
|
|
4186
|
-
return
|
|
4168
|
+
return Nn(y.schema).then((C) => {
|
|
4187
4169
|
S || w(C);
|
|
4188
4170
|
}), () => {
|
|
4189
4171
|
S = !0;
|
|
4190
4172
|
};
|
|
4191
4173
|
}, [y]);
|
|
4192
|
-
const [, O] = re.useState(() =>
|
|
4174
|
+
const [, O] = re.useState(() => Zt(j));
|
|
4193
4175
|
re.useEffect(() => {
|
|
4194
|
-
O(
|
|
4176
|
+
O(Zt(j));
|
|
4195
4177
|
let S = !1;
|
|
4196
|
-
return
|
|
4178
|
+
return En(j).then(() => {
|
|
4197
4179
|
S || O(!0);
|
|
4198
4180
|
}), () => {
|
|
4199
4181
|
S = !0;
|
|
@@ -4202,7 +4184,7 @@ function Ms({ method: e, path: t, parameters: r, requestBody: n, security: l, id
|
|
|
4202
4184
|
const $ = re.useMemo(
|
|
4203
4185
|
() => {
|
|
4204
4186
|
var S;
|
|
4205
|
-
return
|
|
4187
|
+
return Hs({
|
|
4206
4188
|
method: e,
|
|
4207
4189
|
path: t,
|
|
4208
4190
|
servers: p.servers,
|
|
@@ -4213,8 +4195,8 @@ function Ms({ method: e, path: t, parameters: r, requestBody: n, security: l, id
|
|
|
4213
4195
|
resolvedBodyValue: (y == null ? void 0 : y.authorExample) ?? g
|
|
4214
4196
|
});
|
|
4215
4197
|
},
|
|
4216
|
-
[e, t, p.servers, r, l, (
|
|
4217
|
-
), E = re.useMemo(() => m ===
|
|
4198
|
+
[e, t, p.servers, r, l, (i = p.components) == null ? void 0 : i.securitySchemes, y, g]
|
|
4199
|
+
), E = re.useMemo(() => m === Sn && b === Tn ? Pn(p, e, t, s) : Is($, m, b), [$, m, b, p, e, t, s]);
|
|
4218
4200
|
return c ? /* @__PURE__ */ me.jsxs("div", { id: `endpoint-${a}-code-samples`, children: [
|
|
4219
4201
|
/* @__PURE__ */ me.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
4220
4202
|
/* @__PURE__ */ me.jsx("label", { htmlFor: f, className: "text-xs font-medium text-foreground-muted uppercase tracking-wider", children: "Example Request" }),
|
|
@@ -4222,17 +4204,17 @@ function Ms({ method: e, path: t, parameters: r, requestBody: n, security: l, id
|
|
|
4222
4204
|
"select",
|
|
4223
4205
|
{
|
|
4224
4206
|
id: f,
|
|
4225
|
-
value:
|
|
4226
|
-
onChange: (S) =>
|
|
4207
|
+
value: h,
|
|
4208
|
+
onChange: (S) => d(S.target.value),
|
|
4227
4209
|
"aria-label": "Code sample language",
|
|
4228
4210
|
className: "text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",
|
|
4229
4211
|
children: u.map((S) => /* @__PURE__ */ me.jsx("optgroup", { label: S.title, children: S.clients.map((C) => /* @__PURE__ */ me.jsx("option", { value: `${S.key}:${C.key}`, children: C.title }, C.key)) }, S.key))
|
|
4230
4212
|
}
|
|
4231
4213
|
)
|
|
4232
4214
|
] }),
|
|
4233
|
-
/* @__PURE__ */ me.jsx(
|
|
4215
|
+
/* @__PURE__ */ me.jsx(Cn, { code: E, language: j })
|
|
4234
4216
|
] }) : null;
|
|
4235
4217
|
}
|
|
4236
4218
|
export {
|
|
4237
|
-
|
|
4219
|
+
Bs as CodeSamples
|
|
4238
4220
|
};
|