@inspectr/ui 0.0.2 → 0.0.3
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/inspectr-ui.es.js +1411 -0
- package/dist/inspectr-ui.umd.js +41 -0
- package/package.json +13 -10
- package/src/assets/inspectr_logo_small.png +0 -0
- package/src/components/InspectrApp.jsx +0 -113
- package/src/components/RequestContent.jsx +0 -113
- package/src/components/RequestDetail.jsx +0 -51
- package/src/components/RequestDetailsPanel.jsx +0 -52
- package/src/components/RequestList.jsx +0 -48
- package/src/components/RequestListItem.jsx +0 -52
- package/src/components/ResponseContent.jsx +0 -89
- package/src/components/SSETest.jsx +0 -22
- package/src/components/SettingsPanel.jsx +0 -107
- package/src/components/index.js +0 -10
- package/src/index.js +0 -2
- package/src/styles/global.css +0 -5
- package/src/utils/getStatusClass.js +0 -9
|
@@ -0,0 +1,1411 @@
|
|
|
1
|
+
import ae, { memo as Pe, useState as Q, useRef as S, useCallback as Se, useEffect as F } from "react";
|
|
2
|
+
var be = { exports: {} }, ce = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var We;
|
|
13
|
+
function it() {
|
|
14
|
+
if (We) return ce;
|
|
15
|
+
We = 1;
|
|
16
|
+
var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
17
|
+
function n(o, s, i) {
|
|
18
|
+
var u = null;
|
|
19
|
+
if (i !== void 0 && (u = "" + i), s.key !== void 0 && (u = "" + s.key), "key" in s) {
|
|
20
|
+
i = {};
|
|
21
|
+
for (var d in s)
|
|
22
|
+
d !== "key" && (i[d] = s[d]);
|
|
23
|
+
} else i = s;
|
|
24
|
+
return s = i.ref, {
|
|
25
|
+
$$typeof: e,
|
|
26
|
+
type: o,
|
|
27
|
+
key: u,
|
|
28
|
+
ref: s !== void 0 ? s : null,
|
|
29
|
+
props: i
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return ce.Fragment = r, ce.jsx = n, ce.jsxs = n, ce;
|
|
33
|
+
}
|
|
34
|
+
var ue = {};
|
|
35
|
+
/**
|
|
36
|
+
* @license React
|
|
37
|
+
* react-jsx-runtime.development.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
var De;
|
|
45
|
+
function lt() {
|
|
46
|
+
return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
+
function e(t) {
|
|
48
|
+
if (t == null) return null;
|
|
49
|
+
if (typeof t == "function")
|
|
50
|
+
return t.$$typeof === $ ? null : t.displayName || t.name || null;
|
|
51
|
+
if (typeof t == "string") return t;
|
|
52
|
+
switch (t) {
|
|
53
|
+
case w:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case E:
|
|
56
|
+
return "Portal";
|
|
57
|
+
case G:
|
|
58
|
+
return "Profiler";
|
|
59
|
+
case y:
|
|
60
|
+
return "StrictMode";
|
|
61
|
+
case X:
|
|
62
|
+
return "Suspense";
|
|
63
|
+
case K:
|
|
64
|
+
return "SuspenseList";
|
|
65
|
+
}
|
|
66
|
+
if (typeof t == "object")
|
|
67
|
+
switch (typeof t.tag == "number" && console.error(
|
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
+
), t.$$typeof) {
|
|
70
|
+
case b:
|
|
71
|
+
return (t.displayName || "Context") + ".Provider";
|
|
72
|
+
case N:
|
|
73
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
74
|
+
case Y:
|
|
75
|
+
var l = t.render;
|
|
76
|
+
return t = t.displayName, t || (t = l.displayName || l.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
77
|
+
case V:
|
|
78
|
+
return l = t.displayName || null, l !== null ? l : e(t.type) || "Memo";
|
|
79
|
+
case f:
|
|
80
|
+
l = t._payload, t = t._init;
|
|
81
|
+
try {
|
|
82
|
+
return e(t(l));
|
|
83
|
+
} catch {
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
function r(t) {
|
|
89
|
+
return "" + t;
|
|
90
|
+
}
|
|
91
|
+
function n(t) {
|
|
92
|
+
try {
|
|
93
|
+
r(t);
|
|
94
|
+
var l = !1;
|
|
95
|
+
} catch {
|
|
96
|
+
l = !0;
|
|
97
|
+
}
|
|
98
|
+
if (l) {
|
|
99
|
+
l = console;
|
|
100
|
+
var c = l.error, h = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
101
|
+
return c.call(
|
|
102
|
+
l,
|
|
103
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
104
|
+
h
|
|
105
|
+
), r(t);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function o() {
|
|
109
|
+
}
|
|
110
|
+
function s() {
|
|
111
|
+
if (H === 0) {
|
|
112
|
+
_ = console.log, Re = console.info, Te = console.warn, Me = console.error, ke = console.group, Le = console.groupCollapsed, Qe = console.groupEnd;
|
|
113
|
+
var t = {
|
|
114
|
+
configurable: !0,
|
|
115
|
+
enumerable: !0,
|
|
116
|
+
value: o,
|
|
117
|
+
writable: !0
|
|
118
|
+
};
|
|
119
|
+
Object.defineProperties(console, {
|
|
120
|
+
info: t,
|
|
121
|
+
log: t,
|
|
122
|
+
warn: t,
|
|
123
|
+
error: t,
|
|
124
|
+
group: t,
|
|
125
|
+
groupCollapsed: t,
|
|
126
|
+
groupEnd: t
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
H++;
|
|
130
|
+
}
|
|
131
|
+
function i() {
|
|
132
|
+
if (H--, H === 0) {
|
|
133
|
+
var t = { configurable: !0, enumerable: !0, writable: !0 };
|
|
134
|
+
Object.defineProperties(console, {
|
|
135
|
+
log: m({}, t, { value: _ }),
|
|
136
|
+
info: m({}, t, { value: Re }),
|
|
137
|
+
warn: m({}, t, { value: Te }),
|
|
138
|
+
error: m({}, t, { value: Me }),
|
|
139
|
+
group: m({}, t, { value: ke }),
|
|
140
|
+
groupCollapsed: m({}, t, { value: Le }),
|
|
141
|
+
groupEnd: m({}, t, { value: Qe })
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
0 > H && console.error(
|
|
145
|
+
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function u(t) {
|
|
149
|
+
if (ye === void 0)
|
|
150
|
+
try {
|
|
151
|
+
throw Error();
|
|
152
|
+
} catch (c) {
|
|
153
|
+
var l = c.stack.trim().match(/\n( *(at )?)/);
|
|
154
|
+
ye = l && l[1] || "", Be = -1 < c.stack.indexOf(`
|
|
155
|
+
at`) ? " (<anonymous>)" : -1 < c.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
156
|
+
}
|
|
157
|
+
return `
|
|
158
|
+
` + ye + t + Be;
|
|
159
|
+
}
|
|
160
|
+
function d(t, l) {
|
|
161
|
+
if (!t || we) return "";
|
|
162
|
+
var c = Ee.get(t);
|
|
163
|
+
if (c !== void 0) return c;
|
|
164
|
+
we = !0, c = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
|
|
165
|
+
var h = null;
|
|
166
|
+
h = z.H, z.H = null, s();
|
|
167
|
+
try {
|
|
168
|
+
var M = {
|
|
169
|
+
DetermineComponentFrameRoot: function() {
|
|
170
|
+
try {
|
|
171
|
+
if (l) {
|
|
172
|
+
var ee = function() {
|
|
173
|
+
throw Error();
|
|
174
|
+
};
|
|
175
|
+
if (Object.defineProperty(ee.prototype, "props", {
|
|
176
|
+
set: function() {
|
|
177
|
+
throw Error();
|
|
178
|
+
}
|
|
179
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
180
|
+
try {
|
|
181
|
+
Reflect.construct(ee, []);
|
|
182
|
+
} catch (Z) {
|
|
183
|
+
var he = Z;
|
|
184
|
+
}
|
|
185
|
+
Reflect.construct(t, [], ee);
|
|
186
|
+
} else {
|
|
187
|
+
try {
|
|
188
|
+
ee.call();
|
|
189
|
+
} catch (Z) {
|
|
190
|
+
he = Z;
|
|
191
|
+
}
|
|
192
|
+
t.call(ee.prototype);
|
|
193
|
+
}
|
|
194
|
+
} else {
|
|
195
|
+
try {
|
|
196
|
+
throw Error();
|
|
197
|
+
} catch (Z) {
|
|
198
|
+
he = Z;
|
|
199
|
+
}
|
|
200
|
+
(ee = t()) && typeof ee.catch == "function" && ee.catch(function() {
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
} catch (Z) {
|
|
204
|
+
if (Z && he && typeof Z.stack == "string")
|
|
205
|
+
return [Z.stack, he.stack];
|
|
206
|
+
}
|
|
207
|
+
return [null, null];
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
M.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
211
|
+
var A = Object.getOwnPropertyDescriptor(
|
|
212
|
+
M.DetermineComponentFrameRoot,
|
|
213
|
+
"name"
|
|
214
|
+
);
|
|
215
|
+
A && A.configurable && Object.defineProperty(
|
|
216
|
+
M.DetermineComponentFrameRoot,
|
|
217
|
+
"name",
|
|
218
|
+
{ value: "DetermineComponentFrameRoot" }
|
|
219
|
+
);
|
|
220
|
+
var p = M.DetermineComponentFrameRoot(), q = p[0], se = p[1];
|
|
221
|
+
if (q && se) {
|
|
222
|
+
var k = q.split(`
|
|
223
|
+
`), oe = se.split(`
|
|
224
|
+
`);
|
|
225
|
+
for (p = A = 0; A < k.length && !k[A].includes(
|
|
226
|
+
"DetermineComponentFrameRoot"
|
|
227
|
+
); )
|
|
228
|
+
A++;
|
|
229
|
+
for (; p < oe.length && !oe[p].includes(
|
|
230
|
+
"DetermineComponentFrameRoot"
|
|
231
|
+
); )
|
|
232
|
+
p++;
|
|
233
|
+
if (A === k.length || p === oe.length)
|
|
234
|
+
for (A = k.length - 1, p = oe.length - 1; 1 <= A && 0 <= p && k[A] !== oe[p]; )
|
|
235
|
+
p--;
|
|
236
|
+
for (; 1 <= A && 0 <= p; A--, p--)
|
|
237
|
+
if (k[A] !== oe[p]) {
|
|
238
|
+
if (A !== 1 || p !== 1)
|
|
239
|
+
do
|
|
240
|
+
if (A--, p--, 0 > p || k[A] !== oe[p]) {
|
|
241
|
+
var le = `
|
|
242
|
+
` + k[A].replace(
|
|
243
|
+
" at new ",
|
|
244
|
+
" at "
|
|
245
|
+
);
|
|
246
|
+
return t.displayName && le.includes("<anonymous>") && (le = le.replace("<anonymous>", t.displayName)), typeof t == "function" && Ee.set(t, le), le;
|
|
247
|
+
}
|
|
248
|
+
while (1 <= A && 0 <= p);
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
} finally {
|
|
253
|
+
we = !1, z.H = h, i(), Error.prepareStackTrace = c;
|
|
254
|
+
}
|
|
255
|
+
return k = (k = t ? t.displayName || t.name : "") ? u(k) : "", typeof t == "function" && Ee.set(t, k), k;
|
|
256
|
+
}
|
|
257
|
+
function g(t) {
|
|
258
|
+
if (t == null) return "";
|
|
259
|
+
if (typeof t == "function") {
|
|
260
|
+
var l = t.prototype;
|
|
261
|
+
return d(
|
|
262
|
+
t,
|
|
263
|
+
!(!l || !l.isReactComponent)
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
if (typeof t == "string") return u(t);
|
|
267
|
+
switch (t) {
|
|
268
|
+
case X:
|
|
269
|
+
return u("Suspense");
|
|
270
|
+
case K:
|
|
271
|
+
return u("SuspenseList");
|
|
272
|
+
}
|
|
273
|
+
if (typeof t == "object")
|
|
274
|
+
switch (t.$$typeof) {
|
|
275
|
+
case Y:
|
|
276
|
+
return t = d(t.render, !1), t;
|
|
277
|
+
case V:
|
|
278
|
+
return g(t.type);
|
|
279
|
+
case f:
|
|
280
|
+
l = t._payload, t = t._init;
|
|
281
|
+
try {
|
|
282
|
+
return g(t(l));
|
|
283
|
+
} catch {
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return "";
|
|
287
|
+
}
|
|
288
|
+
function v() {
|
|
289
|
+
var t = z.A;
|
|
290
|
+
return t === null ? null : t.getOwner();
|
|
291
|
+
}
|
|
292
|
+
function C(t) {
|
|
293
|
+
if (me.call(t, "key")) {
|
|
294
|
+
var l = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
295
|
+
if (l && l.isReactWarning) return !1;
|
|
296
|
+
}
|
|
297
|
+
return t.key !== void 0;
|
|
298
|
+
}
|
|
299
|
+
function P(t, l) {
|
|
300
|
+
function c() {
|
|
301
|
+
Ie || (Ie = !0, console.error(
|
|
302
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
303
|
+
l
|
|
304
|
+
));
|
|
305
|
+
}
|
|
306
|
+
c.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
307
|
+
get: c,
|
|
308
|
+
configurable: !0
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function re() {
|
|
312
|
+
var t = e(this.type);
|
|
313
|
+
return ze[t] || (ze[t] = !0, console.error(
|
|
314
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
315
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
316
|
+
}
|
|
317
|
+
function L(t, l, c, h, M, A) {
|
|
318
|
+
return c = A.ref, t = {
|
|
319
|
+
$$typeof: W,
|
|
320
|
+
type: t,
|
|
321
|
+
key: l,
|
|
322
|
+
props: A,
|
|
323
|
+
_owner: M
|
|
324
|
+
}, (c !== void 0 ? c : null) !== null ? Object.defineProperty(t, "ref", {
|
|
325
|
+
enumerable: !1,
|
|
326
|
+
get: re
|
|
327
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
328
|
+
configurable: !1,
|
|
329
|
+
enumerable: !1,
|
|
330
|
+
writable: !0,
|
|
331
|
+
value: 0
|
|
332
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
333
|
+
configurable: !1,
|
|
334
|
+
enumerable: !1,
|
|
335
|
+
writable: !0,
|
|
336
|
+
value: null
|
|
337
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
338
|
+
}
|
|
339
|
+
function B(t, l, c, h, M, A) {
|
|
340
|
+
if (typeof t == "string" || typeof t == "function" || t === w || t === G || t === y || t === X || t === K || t === x || typeof t == "object" && t !== null && (t.$$typeof === f || t.$$typeof === V || t.$$typeof === b || t.$$typeof === N || t.$$typeof === Y || t.$$typeof === j || t.getModuleId !== void 0)) {
|
|
341
|
+
var p = l.children;
|
|
342
|
+
if (p !== void 0)
|
|
343
|
+
if (h)
|
|
344
|
+
if (O(p)) {
|
|
345
|
+
for (h = 0; h < p.length; h++)
|
|
346
|
+
I(p[h], t);
|
|
347
|
+
Object.freeze && Object.freeze(p);
|
|
348
|
+
} else
|
|
349
|
+
console.error(
|
|
350
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
351
|
+
);
|
|
352
|
+
else I(p, t);
|
|
353
|
+
} else
|
|
354
|
+
p = "", (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (p += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), t === null ? h = "null" : O(t) ? h = "array" : t !== void 0 && t.$$typeof === W ? (h = "<" + (e(t.type) || "Unknown") + " />", p = " Did you accidentally export a JSX literal instead of a component?") : h = typeof t, console.error(
|
|
355
|
+
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
356
|
+
h,
|
|
357
|
+
p
|
|
358
|
+
);
|
|
359
|
+
if (me.call(l, "key")) {
|
|
360
|
+
p = e(t);
|
|
361
|
+
var q = Object.keys(l).filter(function(k) {
|
|
362
|
+
return k !== "key";
|
|
363
|
+
});
|
|
364
|
+
h = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", Je[p + h] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
365
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
366
|
+
let props = %s;
|
|
367
|
+
<%s {...props} />
|
|
368
|
+
React keys must be passed directly to JSX without using spread:
|
|
369
|
+
let props = %s;
|
|
370
|
+
<%s key={someKey} {...props} />`,
|
|
371
|
+
h,
|
|
372
|
+
p,
|
|
373
|
+
q,
|
|
374
|
+
p
|
|
375
|
+
), Je[p + h] = !0);
|
|
376
|
+
}
|
|
377
|
+
if (p = null, c !== void 0 && (n(c), p = "" + c), C(l) && (n(l.key), p = "" + l.key), "key" in l) {
|
|
378
|
+
c = {};
|
|
379
|
+
for (var se in l)
|
|
380
|
+
se !== "key" && (c[se] = l[se]);
|
|
381
|
+
} else c = l;
|
|
382
|
+
return p && P(
|
|
383
|
+
c,
|
|
384
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
385
|
+
), L(t, p, A, M, v(), c);
|
|
386
|
+
}
|
|
387
|
+
function I(t, l) {
|
|
388
|
+
if (typeof t == "object" && t && t.$$typeof !== st) {
|
|
389
|
+
if (O(t))
|
|
390
|
+
for (var c = 0; c < t.length; c++) {
|
|
391
|
+
var h = t[c];
|
|
392
|
+
R(h) && U(h, l);
|
|
393
|
+
}
|
|
394
|
+
else if (R(t))
|
|
395
|
+
t._store && (t._store.validated = 1);
|
|
396
|
+
else if (t === null || typeof t != "object" ? c = null : (c = D && t[D] || t["@@iterator"], c = typeof c == "function" ? c : null), typeof c == "function" && c !== t.entries && (c = c.call(t), c !== t))
|
|
397
|
+
for (; !(t = c.next()).done; )
|
|
398
|
+
R(t.value) && U(t.value, l);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function R(t) {
|
|
402
|
+
return typeof t == "object" && t !== null && t.$$typeof === W;
|
|
403
|
+
}
|
|
404
|
+
function U(t, l) {
|
|
405
|
+
if (t._store && !t._store.validated && t.key == null && (t._store.validated = 1, l = T(l), !Fe[l])) {
|
|
406
|
+
Fe[l] = !0;
|
|
407
|
+
var c = "";
|
|
408
|
+
t && t._owner != null && t._owner !== v() && (c = null, typeof t._owner.tag == "number" ? c = e(t._owner.type) : typeof t._owner.name == "string" && (c = t._owner.name), c = " It was passed a child from " + c + ".");
|
|
409
|
+
var h = z.getCurrentStack;
|
|
410
|
+
z.getCurrentStack = function() {
|
|
411
|
+
var M = g(t.type);
|
|
412
|
+
return h && (M += h() || ""), M;
|
|
413
|
+
}, console.error(
|
|
414
|
+
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
415
|
+
l,
|
|
416
|
+
c
|
|
417
|
+
), z.getCurrentStack = h;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function T(t) {
|
|
421
|
+
var l = "", c = v();
|
|
422
|
+
return c && (c = e(c.type)) && (l = `
|
|
423
|
+
|
|
424
|
+
Check the render method of \`` + c + "`."), l || (t = e(t)) && (l = `
|
|
425
|
+
|
|
426
|
+
Check the top-level render call using <` + t + ">."), l;
|
|
427
|
+
}
|
|
428
|
+
var ne = ae, W = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), b = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), K = Symbol.for("react.suspense_list"), V = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), D = Symbol.iterator, $ = Symbol.for("react.client.reference"), z = ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, me = Object.prototype.hasOwnProperty, m = Object.assign, j = Symbol.for("react.client.reference"), O = Array.isArray, H = 0, _, Re, Te, Me, ke, Le, Qe;
|
|
429
|
+
o.__reactDisabledLog = !0;
|
|
430
|
+
var ye, Be, we = !1, Ee = new (typeof WeakMap == "function" ? WeakMap : Map)(), st = Symbol.for("react.client.reference"), Ie, ze = {}, Je = {}, Fe = {};
|
|
431
|
+
ue.Fragment = w, ue.jsx = function(t, l, c, h, M) {
|
|
432
|
+
return B(t, l, c, !1, h, M);
|
|
433
|
+
}, ue.jsxs = function(t, l, c, h, M) {
|
|
434
|
+
return B(t, l, c, !0, h, M);
|
|
435
|
+
};
|
|
436
|
+
}()), ue;
|
|
437
|
+
}
|
|
438
|
+
var He;
|
|
439
|
+
function ct() {
|
|
440
|
+
return He || (He = 1, process.env.NODE_ENV === "production" ? be.exports = it() : be.exports = lt()), be.exports;
|
|
441
|
+
}
|
|
442
|
+
var a = ct();
|
|
443
|
+
const Ge = (e) => e >= 200 && e < 300 ? "bg-green-200 text-green-800" : e >= 300 && e < 400 ? "bg-blue-200 text-blue-800" : e >= 400 && e < 500 ? "bg-orange-600 text-orange-200" : e >= 500 ? "bg-red-800 text-red-100" : "bg-gray-200 text-gray-800", ut = ["bg-blue-100", "border-l-4", "border-blue-700"].join(" "), dt = ({ request: e, reqId: r, onSelect: n, onRemove: o, selected: s }) => {
|
|
444
|
+
const i = (u) => {
|
|
445
|
+
n(u);
|
|
446
|
+
};
|
|
447
|
+
return /* @__PURE__ */ a.jsx(
|
|
448
|
+
"li",
|
|
449
|
+
{
|
|
450
|
+
className: `flex items-center cursor-pointer hover:bg-gray-200 ${s ? ut : ""}`,
|
|
451
|
+
onClick: () => {
|
|
452
|
+
i(e);
|
|
453
|
+
},
|
|
454
|
+
children: /* @__PURE__ */ a.jsxs("div", { className: "flex items-center p-2 w-full", children: [
|
|
455
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-16 flex justify-center", children: /* @__PURE__ */ a.jsx(
|
|
456
|
+
"span",
|
|
457
|
+
{
|
|
458
|
+
className: `inline-flex px-3 py-1 text-xs font-semibold rounded-full ${Ge(
|
|
459
|
+
e.response.status
|
|
460
|
+
)}`,
|
|
461
|
+
children: e.response.status || "N/A"
|
|
462
|
+
}
|
|
463
|
+
) }),
|
|
464
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-20 text-center font-medium", children: e.request.method || "GET" }),
|
|
465
|
+
/* @__PURE__ */ a.jsx("div", { className: "flex-grow truncate text-left", children: e.endpoint || e.url }),
|
|
466
|
+
/* @__PURE__ */ a.jsxs("div", { className: "w-20 text-gray-500 text-center", children: [
|
|
467
|
+
e.latency,
|
|
468
|
+
"ms"
|
|
469
|
+
] }),
|
|
470
|
+
/* @__PURE__ */ a.jsx(
|
|
471
|
+
"button",
|
|
472
|
+
{
|
|
473
|
+
className: "w-8 h-8 flex items-center justify-center text-red-500 hover:text-red-700",
|
|
474
|
+
onClick: (u) => {
|
|
475
|
+
u.stopPropagation(), o(r);
|
|
476
|
+
},
|
|
477
|
+
children: "✕"
|
|
478
|
+
}
|
|
479
|
+
)
|
|
480
|
+
] })
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}, ft = ({ requests: e, onSelect: r, onRemove: n, clearRequests: o, selectedRequest: s }) => /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
484
|
+
/* @__PURE__ */ a.jsxs("div", { className: "p-4 flex justify-between items-center", children: [
|
|
485
|
+
/* @__PURE__ */ a.jsxs("span", { className: "font-bold text-xl", children: [
|
|
486
|
+
"Requests (",
|
|
487
|
+
e.length,
|
|
488
|
+
")"
|
|
489
|
+
] }),
|
|
490
|
+
/* @__PURE__ */ a.jsx(
|
|
491
|
+
"button",
|
|
492
|
+
{
|
|
493
|
+
className: "px-3 py-1 bg-red-500 text-white rounded text-xs",
|
|
494
|
+
onClick: o,
|
|
495
|
+
children: "Clear All"
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
] }),
|
|
499
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center bg-gray-200 p-2 border-b border-gray-300 text-sm font-bold", children: [
|
|
500
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-16 text-center", children: "Status" }),
|
|
501
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-20 text-center", children: "Method" }),
|
|
502
|
+
/* @__PURE__ */ a.jsx("div", { className: "flex-grow text-left", children: "URL" }),
|
|
503
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-20 text-center", children: "Duration" }),
|
|
504
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-10" })
|
|
505
|
+
] }),
|
|
506
|
+
/* @__PURE__ */ a.jsx("ul", { className: "overflow-y-auto flex-grow", style: { maxHeight: "calc(100vh - 40px - 100px)" }, children: e.map((i, u) => {
|
|
507
|
+
const d = i.id || u;
|
|
508
|
+
return /* @__PURE__ */ a.jsx(
|
|
509
|
+
dt,
|
|
510
|
+
{
|
|
511
|
+
reqId: d,
|
|
512
|
+
request: i,
|
|
513
|
+
onSelect: r,
|
|
514
|
+
onRemove: n,
|
|
515
|
+
selected: s && s.id === d
|
|
516
|
+
},
|
|
517
|
+
d
|
|
518
|
+
);
|
|
519
|
+
}) })
|
|
520
|
+
] }), gt = ({ request: e }) => {
|
|
521
|
+
const r = (n) => {
|
|
522
|
+
if (!n) return "N/A";
|
|
523
|
+
const o = new Date(n), s = o.toLocaleDateString("en-CA", {
|
|
524
|
+
// YYYY-MM-DD format
|
|
525
|
+
year: "numeric",
|
|
526
|
+
month: "2-digit",
|
|
527
|
+
day: "2-digit"
|
|
528
|
+
}), i = o.toLocaleTimeString([], {
|
|
529
|
+
// HH:MM:SS in local time
|
|
530
|
+
hour: "2-digit",
|
|
531
|
+
minute: "2-digit",
|
|
532
|
+
second: "2-digit",
|
|
533
|
+
hour12: !1
|
|
534
|
+
// 24-hour format
|
|
535
|
+
});
|
|
536
|
+
return `${s} at ${i}`;
|
|
537
|
+
};
|
|
538
|
+
return /* @__PURE__ */ a.jsxs("div", { className: "mb-4 p-4 bg-white rounded shadow", children: [
|
|
539
|
+
/* @__PURE__ */ a.jsx("h2", { className: "font-bold text-lg mb-2", children: "Request Details" }),
|
|
540
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex flex-col space-y-1", children: [
|
|
541
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center space-x-2 font-mono text-lg", children: [
|
|
542
|
+
/* @__PURE__ */ a.jsx("span", { className: "font-bold", children: e.request.method }),
|
|
543
|
+
/* @__PURE__ */ a.jsx("span", { className: "text-blue-600", children: e.endpoint }),
|
|
544
|
+
/* @__PURE__ */ a.jsx(
|
|
545
|
+
"span",
|
|
546
|
+
{
|
|
547
|
+
className: `inline-flex px-3 py-1 text-xs font-semibold rounded-full ${Ge(
|
|
548
|
+
e.response.status
|
|
549
|
+
)}`,
|
|
550
|
+
children: e.response.status
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
] }),
|
|
554
|
+
/* @__PURE__ */ a.jsx("div", { className: "text-gray-600", children: e.url }),
|
|
555
|
+
/* @__PURE__ */ a.jsxs("div", { className: "text-gray-500 text-xs", children: [
|
|
556
|
+
"Received on ",
|
|
557
|
+
r(e.timestamp),
|
|
558
|
+
" • Took ",
|
|
559
|
+
e.latency,
|
|
560
|
+
"ms to respond"
|
|
561
|
+
] })
|
|
562
|
+
] })
|
|
563
|
+
] });
|
|
564
|
+
};
|
|
565
|
+
function pt(e, r, n) {
|
|
566
|
+
return r in e ? Object.defineProperty(e, r, {
|
|
567
|
+
value: n,
|
|
568
|
+
enumerable: !0,
|
|
569
|
+
configurable: !0,
|
|
570
|
+
writable: !0
|
|
571
|
+
}) : e[r] = n, e;
|
|
572
|
+
}
|
|
573
|
+
function Ye(e, r) {
|
|
574
|
+
var n = Object.keys(e);
|
|
575
|
+
if (Object.getOwnPropertySymbols) {
|
|
576
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
577
|
+
r && (o = o.filter(function(s) {
|
|
578
|
+
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
579
|
+
})), n.push.apply(n, o);
|
|
580
|
+
}
|
|
581
|
+
return n;
|
|
582
|
+
}
|
|
583
|
+
function Ue(e) {
|
|
584
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
585
|
+
var n = arguments[r] != null ? arguments[r] : {};
|
|
586
|
+
r % 2 ? Ye(Object(n), !0).forEach(function(o) {
|
|
587
|
+
pt(e, o, n[o]);
|
|
588
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ye(Object(n)).forEach(function(o) {
|
|
589
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(n, o));
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
return e;
|
|
593
|
+
}
|
|
594
|
+
function mt(e, r) {
|
|
595
|
+
if (e == null) return {};
|
|
596
|
+
var n = {}, o = Object.keys(e), s, i;
|
|
597
|
+
for (i = 0; i < o.length; i++)
|
|
598
|
+
s = o[i], !(r.indexOf(s) >= 0) && (n[s] = e[s]);
|
|
599
|
+
return n;
|
|
600
|
+
}
|
|
601
|
+
function ht(e, r) {
|
|
602
|
+
if (e == null) return {};
|
|
603
|
+
var n = mt(e, r), o, s;
|
|
604
|
+
if (Object.getOwnPropertySymbols) {
|
|
605
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
606
|
+
for (s = 0; s < i.length; s++)
|
|
607
|
+
o = i[s], !(r.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (n[o] = e[o]);
|
|
608
|
+
}
|
|
609
|
+
return n;
|
|
610
|
+
}
|
|
611
|
+
function bt(e, r) {
|
|
612
|
+
return vt(e) || xt(e, r) || jt(e, r) || At();
|
|
613
|
+
}
|
|
614
|
+
function vt(e) {
|
|
615
|
+
if (Array.isArray(e)) return e;
|
|
616
|
+
}
|
|
617
|
+
function xt(e, r) {
|
|
618
|
+
if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
|
|
619
|
+
var n = [], o = !0, s = !1, i = void 0;
|
|
620
|
+
try {
|
|
621
|
+
for (var u = e[Symbol.iterator](), d; !(o = (d = u.next()).done) && (n.push(d.value), !(r && n.length === r)); o = !0)
|
|
622
|
+
;
|
|
623
|
+
} catch (g) {
|
|
624
|
+
s = !0, i = g;
|
|
625
|
+
} finally {
|
|
626
|
+
try {
|
|
627
|
+
!o && u.return != null && u.return();
|
|
628
|
+
} finally {
|
|
629
|
+
if (s) throw i;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return n;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
function jt(e, r) {
|
|
636
|
+
if (e) {
|
|
637
|
+
if (typeof e == "string") return Ve(e, r);
|
|
638
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
639
|
+
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
640
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ve(e, r);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function Ve(e, r) {
|
|
644
|
+
(r == null || r > e.length) && (r = e.length);
|
|
645
|
+
for (var n = 0, o = new Array(r); n < r; n++) o[n] = e[n];
|
|
646
|
+
return o;
|
|
647
|
+
}
|
|
648
|
+
function At() {
|
|
649
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
650
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
651
|
+
}
|
|
652
|
+
function yt(e, r, n) {
|
|
653
|
+
return r in e ? Object.defineProperty(e, r, {
|
|
654
|
+
value: n,
|
|
655
|
+
enumerable: !0,
|
|
656
|
+
configurable: !0,
|
|
657
|
+
writable: !0
|
|
658
|
+
}) : e[r] = n, e;
|
|
659
|
+
}
|
|
660
|
+
function _e(e, r) {
|
|
661
|
+
var n = Object.keys(e);
|
|
662
|
+
if (Object.getOwnPropertySymbols) {
|
|
663
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
664
|
+
r && (o = o.filter(function(s) {
|
|
665
|
+
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
666
|
+
})), n.push.apply(n, o);
|
|
667
|
+
}
|
|
668
|
+
return n;
|
|
669
|
+
}
|
|
670
|
+
function qe(e) {
|
|
671
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
672
|
+
var n = arguments[r] != null ? arguments[r] : {};
|
|
673
|
+
r % 2 ? _e(Object(n), !0).forEach(function(o) {
|
|
674
|
+
yt(e, o, n[o]);
|
|
675
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : _e(Object(n)).forEach(function(o) {
|
|
676
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(n, o));
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
return e;
|
|
680
|
+
}
|
|
681
|
+
function wt() {
|
|
682
|
+
for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
|
|
683
|
+
r[n] = arguments[n];
|
|
684
|
+
return function(o) {
|
|
685
|
+
return r.reduceRight(function(s, i) {
|
|
686
|
+
return i(s);
|
|
687
|
+
}, o);
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
function de(e) {
|
|
691
|
+
return function r() {
|
|
692
|
+
for (var n = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
|
|
693
|
+
s[i] = arguments[i];
|
|
694
|
+
return s.length >= e.length ? e.apply(this, s) : function() {
|
|
695
|
+
for (var u = arguments.length, d = new Array(u), g = 0; g < u; g++)
|
|
696
|
+
d[g] = arguments[g];
|
|
697
|
+
return r.apply(n, [].concat(s, d));
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
function je(e) {
|
|
702
|
+
return {}.toString.call(e).includes("Object");
|
|
703
|
+
}
|
|
704
|
+
function Et(e) {
|
|
705
|
+
return !Object.keys(e).length;
|
|
706
|
+
}
|
|
707
|
+
function ge(e) {
|
|
708
|
+
return typeof e == "function";
|
|
709
|
+
}
|
|
710
|
+
function Ct(e, r) {
|
|
711
|
+
return Object.prototype.hasOwnProperty.call(e, r);
|
|
712
|
+
}
|
|
713
|
+
function Nt(e, r) {
|
|
714
|
+
return je(r) || te("changeType"), Object.keys(r).some(function(n) {
|
|
715
|
+
return !Ct(e, n);
|
|
716
|
+
}) && te("changeField"), r;
|
|
717
|
+
}
|
|
718
|
+
function Ot(e) {
|
|
719
|
+
ge(e) || te("selectorType");
|
|
720
|
+
}
|
|
721
|
+
function St(e) {
|
|
722
|
+
ge(e) || je(e) || te("handlerType"), je(e) && Object.values(e).some(function(r) {
|
|
723
|
+
return !ge(r);
|
|
724
|
+
}) && te("handlersType");
|
|
725
|
+
}
|
|
726
|
+
function Pt(e) {
|
|
727
|
+
e || te("initialIsRequired"), je(e) || te("initialType"), Et(e) && te("initialContent");
|
|
728
|
+
}
|
|
729
|
+
function Rt(e, r) {
|
|
730
|
+
throw new Error(e[r] || e.default);
|
|
731
|
+
}
|
|
732
|
+
var Tt = {
|
|
733
|
+
initialIsRequired: "initial state is required",
|
|
734
|
+
initialType: "initial state should be an object",
|
|
735
|
+
initialContent: "initial state shouldn't be an empty object",
|
|
736
|
+
handlerType: "handler should be an object or a function",
|
|
737
|
+
handlersType: "all handlers should be a functions",
|
|
738
|
+
selectorType: "selector should be a function",
|
|
739
|
+
changeType: "provided value of changes should be an object",
|
|
740
|
+
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
741
|
+
default: "an unknown error accured in `state-local` package"
|
|
742
|
+
}, te = de(Rt)(Tt), ve = {
|
|
743
|
+
changes: Nt,
|
|
744
|
+
selector: Ot,
|
|
745
|
+
handler: St,
|
|
746
|
+
initial: Pt
|
|
747
|
+
};
|
|
748
|
+
function Mt(e) {
|
|
749
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
750
|
+
ve.initial(e), ve.handler(r);
|
|
751
|
+
var n = {
|
|
752
|
+
current: e
|
|
753
|
+
}, o = de(Qt)(n, r), s = de(Lt)(n), i = de(ve.changes)(e), u = de(kt)(n);
|
|
754
|
+
function d() {
|
|
755
|
+
var v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(C) {
|
|
756
|
+
return C;
|
|
757
|
+
};
|
|
758
|
+
return ve.selector(v), v(n.current);
|
|
759
|
+
}
|
|
760
|
+
function g(v) {
|
|
761
|
+
wt(o, s, i, u)(v);
|
|
762
|
+
}
|
|
763
|
+
return [d, g];
|
|
764
|
+
}
|
|
765
|
+
function kt(e, r) {
|
|
766
|
+
return ge(r) ? r(e.current) : r;
|
|
767
|
+
}
|
|
768
|
+
function Lt(e, r) {
|
|
769
|
+
return e.current = qe(qe({}, e.current), r), r;
|
|
770
|
+
}
|
|
771
|
+
function Qt(e, r, n) {
|
|
772
|
+
return ge(r) ? r(e.current) : Object.keys(n).forEach(function(o) {
|
|
773
|
+
var s;
|
|
774
|
+
return (s = r[o]) === null || s === void 0 ? void 0 : s.call(r, e.current[o]);
|
|
775
|
+
}), n;
|
|
776
|
+
}
|
|
777
|
+
var Bt = {
|
|
778
|
+
create: Mt
|
|
779
|
+
}, It = {
|
|
780
|
+
paths: {
|
|
781
|
+
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
function zt(e) {
|
|
785
|
+
return function r() {
|
|
786
|
+
for (var n = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
|
|
787
|
+
s[i] = arguments[i];
|
|
788
|
+
return s.length >= e.length ? e.apply(this, s) : function() {
|
|
789
|
+
for (var u = arguments.length, d = new Array(u), g = 0; g < u; g++)
|
|
790
|
+
d[g] = arguments[g];
|
|
791
|
+
return r.apply(n, [].concat(s, d));
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
function Jt(e) {
|
|
796
|
+
return {}.toString.call(e).includes("Object");
|
|
797
|
+
}
|
|
798
|
+
function Ft(e) {
|
|
799
|
+
return e || Ze("configIsRequired"), Jt(e) || Ze("configType"), e.urls ? (Wt(), {
|
|
800
|
+
paths: {
|
|
801
|
+
vs: e.urls.monacoBase
|
|
802
|
+
}
|
|
803
|
+
}) : e;
|
|
804
|
+
}
|
|
805
|
+
function Wt() {
|
|
806
|
+
console.warn(Xe.deprecation);
|
|
807
|
+
}
|
|
808
|
+
function Dt(e, r) {
|
|
809
|
+
throw new Error(e[r] || e.default);
|
|
810
|
+
}
|
|
811
|
+
var Xe = {
|
|
812
|
+
configIsRequired: "the configuration object is required",
|
|
813
|
+
configType: "the configuration object should be an object",
|
|
814
|
+
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
815
|
+
deprecation: `Deprecation warning!
|
|
816
|
+
You are using deprecated way of configuration.
|
|
817
|
+
|
|
818
|
+
Instead of using
|
|
819
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
820
|
+
use
|
|
821
|
+
monaco.config({ paths: { vs: '...' } })
|
|
822
|
+
|
|
823
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
824
|
+
`
|
|
825
|
+
}, Ze = zt(Dt)(Xe), Ht = {
|
|
826
|
+
config: Ft
|
|
827
|
+
}, Yt = function() {
|
|
828
|
+
for (var r = arguments.length, n = new Array(r), o = 0; o < r; o++)
|
|
829
|
+
n[o] = arguments[o];
|
|
830
|
+
return function(s) {
|
|
831
|
+
return n.reduceRight(function(i, u) {
|
|
832
|
+
return u(i);
|
|
833
|
+
}, s);
|
|
834
|
+
};
|
|
835
|
+
};
|
|
836
|
+
function Ke(e, r) {
|
|
837
|
+
return Object.keys(r).forEach(function(n) {
|
|
838
|
+
r[n] instanceof Object && e[n] && Object.assign(r[n], Ke(e[n], r[n]));
|
|
839
|
+
}), Ue(Ue({}, e), r);
|
|
840
|
+
}
|
|
841
|
+
var Ut = {
|
|
842
|
+
type: "cancelation",
|
|
843
|
+
msg: "operation is manually canceled"
|
|
844
|
+
};
|
|
845
|
+
function Ce(e) {
|
|
846
|
+
var r = !1, n = new Promise(function(o, s) {
|
|
847
|
+
e.then(function(i) {
|
|
848
|
+
return r ? s(Ut) : o(i);
|
|
849
|
+
}), e.catch(s);
|
|
850
|
+
});
|
|
851
|
+
return n.cancel = function() {
|
|
852
|
+
return r = !0;
|
|
853
|
+
}, n;
|
|
854
|
+
}
|
|
855
|
+
var Vt = Bt.create({
|
|
856
|
+
config: It,
|
|
857
|
+
isInitialized: !1,
|
|
858
|
+
resolve: null,
|
|
859
|
+
reject: null,
|
|
860
|
+
monaco: null
|
|
861
|
+
}), $e = bt(Vt, 2), pe = $e[0], Ae = $e[1];
|
|
862
|
+
function _t(e) {
|
|
863
|
+
var r = Ht.config(e), n = r.monaco, o = ht(r, ["monaco"]);
|
|
864
|
+
Ae(function(s) {
|
|
865
|
+
return {
|
|
866
|
+
config: Ke(s.config, o),
|
|
867
|
+
monaco: n
|
|
868
|
+
};
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
function qt() {
|
|
872
|
+
var e = pe(function(r) {
|
|
873
|
+
var n = r.monaco, o = r.isInitialized, s = r.resolve;
|
|
874
|
+
return {
|
|
875
|
+
monaco: n,
|
|
876
|
+
isInitialized: o,
|
|
877
|
+
resolve: s
|
|
878
|
+
};
|
|
879
|
+
});
|
|
880
|
+
if (!e.isInitialized) {
|
|
881
|
+
if (Ae({
|
|
882
|
+
isInitialized: !0
|
|
883
|
+
}), e.monaco)
|
|
884
|
+
return e.resolve(e.monaco), Ce(Ne);
|
|
885
|
+
if (window.monaco && window.monaco.editor)
|
|
886
|
+
return et(window.monaco), e.resolve(window.monaco), Ce(Ne);
|
|
887
|
+
Yt(Zt, Xt)(Kt);
|
|
888
|
+
}
|
|
889
|
+
return Ce(Ne);
|
|
890
|
+
}
|
|
891
|
+
function Zt(e) {
|
|
892
|
+
return document.body.appendChild(e);
|
|
893
|
+
}
|
|
894
|
+
function Gt(e) {
|
|
895
|
+
var r = document.createElement("script");
|
|
896
|
+
return e && (r.src = e), r;
|
|
897
|
+
}
|
|
898
|
+
function Xt(e) {
|
|
899
|
+
var r = pe(function(o) {
|
|
900
|
+
var s = o.config, i = o.reject;
|
|
901
|
+
return {
|
|
902
|
+
config: s,
|
|
903
|
+
reject: i
|
|
904
|
+
};
|
|
905
|
+
}), n = Gt("".concat(r.config.paths.vs, "/loader.js"));
|
|
906
|
+
return n.onload = function() {
|
|
907
|
+
return e();
|
|
908
|
+
}, n.onerror = r.reject, n;
|
|
909
|
+
}
|
|
910
|
+
function Kt() {
|
|
911
|
+
var e = pe(function(n) {
|
|
912
|
+
var o = n.config, s = n.resolve, i = n.reject;
|
|
913
|
+
return {
|
|
914
|
+
config: o,
|
|
915
|
+
resolve: s,
|
|
916
|
+
reject: i
|
|
917
|
+
};
|
|
918
|
+
}), r = window.require;
|
|
919
|
+
r.config(e.config), r(["vs/editor/editor.main"], function(n) {
|
|
920
|
+
et(n), e.resolve(n);
|
|
921
|
+
}, function(n) {
|
|
922
|
+
e.reject(n);
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
function et(e) {
|
|
926
|
+
pe().monaco || Ae({
|
|
927
|
+
monaco: e
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
function $t() {
|
|
931
|
+
return pe(function(e) {
|
|
932
|
+
var r = e.monaco;
|
|
933
|
+
return r;
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
var Ne = new Promise(function(e, r) {
|
|
937
|
+
return Ae({
|
|
938
|
+
resolve: e,
|
|
939
|
+
reject: r
|
|
940
|
+
});
|
|
941
|
+
}), tt = {
|
|
942
|
+
config: _t,
|
|
943
|
+
init: qt,
|
|
944
|
+
__getMonacoInstance: $t
|
|
945
|
+
}, er = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, Oe = er, tr = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, rr = tr;
|
|
946
|
+
function nr({ children: e }) {
|
|
947
|
+
return ae.createElement("div", { style: rr.container }, e);
|
|
948
|
+
}
|
|
949
|
+
var or = nr, ar = or;
|
|
950
|
+
function sr({ width: e, height: r, isEditorReady: n, loading: o, _ref: s, className: i, wrapperProps: u }) {
|
|
951
|
+
return ae.createElement("section", { style: { ...Oe.wrapper, width: e, height: r }, ...u }, !n && ae.createElement(ar, null, o), ae.createElement("div", { ref: s, style: { ...Oe.fullWidth, ...!n && Oe.hide }, className: i }));
|
|
952
|
+
}
|
|
953
|
+
var ir = sr, rt = Pe(ir);
|
|
954
|
+
function lr(e) {
|
|
955
|
+
F(e, []);
|
|
956
|
+
}
|
|
957
|
+
var nt = lr;
|
|
958
|
+
function cr(e, r, n = !0) {
|
|
959
|
+
let o = S(!0);
|
|
960
|
+
F(o.current || !n ? () => {
|
|
961
|
+
o.current = !1;
|
|
962
|
+
} : e, r);
|
|
963
|
+
}
|
|
964
|
+
var J = cr;
|
|
965
|
+
function fe() {
|
|
966
|
+
}
|
|
967
|
+
function ie(e, r, n, o) {
|
|
968
|
+
return ur(e, o) || dr(e, r, n, o);
|
|
969
|
+
}
|
|
970
|
+
function ur(e, r) {
|
|
971
|
+
return e.editor.getModel(ot(e, r));
|
|
972
|
+
}
|
|
973
|
+
function dr(e, r, n, o) {
|
|
974
|
+
return e.editor.createModel(r, n, o ? ot(e, o) : void 0);
|
|
975
|
+
}
|
|
976
|
+
function ot(e, r) {
|
|
977
|
+
return e.Uri.parse(r);
|
|
978
|
+
}
|
|
979
|
+
function fr({ original: e, modified: r, language: n, originalLanguage: o, modifiedLanguage: s, originalModelPath: i, modifiedModelPath: u, keepCurrentOriginalModel: d = !1, keepCurrentModifiedModel: g = !1, theme: v = "light", loading: C = "Loading...", options: P = {}, height: re = "100%", width: L = "100%", className: B, wrapperProps: I = {}, beforeMount: R = fe, onMount: U = fe }) {
|
|
980
|
+
let [T, ne] = Q(!1), [W, E] = Q(!0), w = S(null), y = S(null), G = S(null), N = S(U), b = S(R), Y = S(!1);
|
|
981
|
+
nt(() => {
|
|
982
|
+
let f = tt.init();
|
|
983
|
+
return f.then((x) => (y.current = x) && E(!1)).catch((x) => (x == null ? void 0 : x.type) !== "cancelation" && console.error("Monaco initialization: error:", x)), () => w.current ? V() : f.cancel();
|
|
984
|
+
}), J(() => {
|
|
985
|
+
if (w.current && y.current) {
|
|
986
|
+
let f = w.current.getOriginalEditor(), x = ie(y.current, e || "", o || n || "text", i || "");
|
|
987
|
+
x !== f.getModel() && f.setModel(x);
|
|
988
|
+
}
|
|
989
|
+
}, [i], T), J(() => {
|
|
990
|
+
if (w.current && y.current) {
|
|
991
|
+
let f = w.current.getModifiedEditor(), x = ie(y.current, r || "", s || n || "text", u || "");
|
|
992
|
+
x !== f.getModel() && f.setModel(x);
|
|
993
|
+
}
|
|
994
|
+
}, [u], T), J(() => {
|
|
995
|
+
let f = w.current.getModifiedEditor();
|
|
996
|
+
f.getOption(y.current.editor.EditorOption.readOnly) ? f.setValue(r || "") : r !== f.getValue() && (f.executeEdits("", [{ range: f.getModel().getFullModelRange(), text: r || "", forceMoveMarkers: !0 }]), f.pushUndoStop());
|
|
997
|
+
}, [r], T), J(() => {
|
|
998
|
+
var f, x;
|
|
999
|
+
(x = (f = w.current) == null ? void 0 : f.getModel()) == null || x.original.setValue(e || "");
|
|
1000
|
+
}, [e], T), J(() => {
|
|
1001
|
+
let { original: f, modified: x } = w.current.getModel();
|
|
1002
|
+
y.current.editor.setModelLanguage(f, o || n || "text"), y.current.editor.setModelLanguage(x, s || n || "text");
|
|
1003
|
+
}, [n, o, s], T), J(() => {
|
|
1004
|
+
var f;
|
|
1005
|
+
(f = y.current) == null || f.editor.setTheme(v);
|
|
1006
|
+
}, [v], T), J(() => {
|
|
1007
|
+
var f;
|
|
1008
|
+
(f = w.current) == null || f.updateOptions(P);
|
|
1009
|
+
}, [P], T);
|
|
1010
|
+
let X = Se(() => {
|
|
1011
|
+
var D;
|
|
1012
|
+
if (!y.current) return;
|
|
1013
|
+
b.current(y.current);
|
|
1014
|
+
let f = ie(y.current, e || "", o || n || "text", i || ""), x = ie(y.current, r || "", s || n || "text", u || "");
|
|
1015
|
+
(D = w.current) == null || D.setModel({ original: f, modified: x });
|
|
1016
|
+
}, [n, r, s, e, o, i, u]), K = Se(() => {
|
|
1017
|
+
var f;
|
|
1018
|
+
!Y.current && G.current && (w.current = y.current.editor.createDiffEditor(G.current, { automaticLayout: !0, ...P }), X(), (f = y.current) == null || f.editor.setTheme(v), ne(!0), Y.current = !0);
|
|
1019
|
+
}, [P, v, X]);
|
|
1020
|
+
F(() => {
|
|
1021
|
+
T && N.current(w.current, y.current);
|
|
1022
|
+
}, [T]), F(() => {
|
|
1023
|
+
!W && !T && K();
|
|
1024
|
+
}, [W, T, K]);
|
|
1025
|
+
function V() {
|
|
1026
|
+
var x, D, $, z;
|
|
1027
|
+
let f = (x = w.current) == null ? void 0 : x.getModel();
|
|
1028
|
+
d || ((D = f == null ? void 0 : f.original) == null || D.dispose()), g || (($ = f == null ? void 0 : f.modified) == null || $.dispose()), (z = w.current) == null || z.dispose();
|
|
1029
|
+
}
|
|
1030
|
+
return ae.createElement(rt, { width: L, height: re, isEditorReady: T, loading: C, _ref: G, className: B, wrapperProps: I });
|
|
1031
|
+
}
|
|
1032
|
+
var gr = fr;
|
|
1033
|
+
Pe(gr);
|
|
1034
|
+
function pr(e) {
|
|
1035
|
+
let r = S();
|
|
1036
|
+
return F(() => {
|
|
1037
|
+
r.current = e;
|
|
1038
|
+
}, [e]), r.current;
|
|
1039
|
+
}
|
|
1040
|
+
var mr = pr, xe = /* @__PURE__ */ new Map();
|
|
1041
|
+
function hr({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: o, language: s, path: i, theme: u = "light", line: d, loading: g = "Loading...", options: v = {}, overrideServices: C = {}, saveViewState: P = !0, keepCurrentModel: re = !1, width: L = "100%", height: B = "100%", className: I, wrapperProps: R = {}, beforeMount: U = fe, onMount: T = fe, onChange: ne, onValidate: W = fe }) {
|
|
1042
|
+
let [E, w] = Q(!1), [y, G] = Q(!0), N = S(null), b = S(null), Y = S(null), X = S(T), K = S(U), V = S(), f = S(o), x = mr(i), D = S(!1), $ = S(!1);
|
|
1043
|
+
nt(() => {
|
|
1044
|
+
let m = tt.init();
|
|
1045
|
+
return m.then((j) => (N.current = j) && G(!1)).catch((j) => (j == null ? void 0 : j.type) !== "cancelation" && console.error("Monaco initialization: error:", j)), () => b.current ? me() : m.cancel();
|
|
1046
|
+
}), J(() => {
|
|
1047
|
+
var j, O, H, _;
|
|
1048
|
+
let m = ie(N.current, e || o || "", r || s || "", i || n || "");
|
|
1049
|
+
m !== ((j = b.current) == null ? void 0 : j.getModel()) && (P && xe.set(x, (O = b.current) == null ? void 0 : O.saveViewState()), (H = b.current) == null || H.setModel(m), P && ((_ = b.current) == null || _.restoreViewState(xe.get(i))));
|
|
1050
|
+
}, [i], E), J(() => {
|
|
1051
|
+
var m;
|
|
1052
|
+
(m = b.current) == null || m.updateOptions(v);
|
|
1053
|
+
}, [v], E), J(() => {
|
|
1054
|
+
!b.current || o === void 0 || (b.current.getOption(N.current.editor.EditorOption.readOnly) ? b.current.setValue(o) : o !== b.current.getValue() && ($.current = !0, b.current.executeEdits("", [{ range: b.current.getModel().getFullModelRange(), text: o, forceMoveMarkers: !0 }]), b.current.pushUndoStop(), $.current = !1));
|
|
1055
|
+
}, [o], E), J(() => {
|
|
1056
|
+
var j, O;
|
|
1057
|
+
let m = (j = b.current) == null ? void 0 : j.getModel();
|
|
1058
|
+
m && s && ((O = N.current) == null || O.editor.setModelLanguage(m, s));
|
|
1059
|
+
}, [s], E), J(() => {
|
|
1060
|
+
var m;
|
|
1061
|
+
d !== void 0 && ((m = b.current) == null || m.revealLine(d));
|
|
1062
|
+
}, [d], E), J(() => {
|
|
1063
|
+
var m;
|
|
1064
|
+
(m = N.current) == null || m.editor.setTheme(u);
|
|
1065
|
+
}, [u], E);
|
|
1066
|
+
let z = Se(() => {
|
|
1067
|
+
var m;
|
|
1068
|
+
if (!(!Y.current || !N.current) && !D.current) {
|
|
1069
|
+
K.current(N.current);
|
|
1070
|
+
let j = i || n, O = ie(N.current, o || e || "", r || s || "", j || "");
|
|
1071
|
+
b.current = (m = N.current) == null ? void 0 : m.editor.create(Y.current, { model: O, automaticLayout: !0, ...v }, C), P && b.current.restoreViewState(xe.get(j)), N.current.editor.setTheme(u), d !== void 0 && b.current.revealLine(d), w(!0), D.current = !0;
|
|
1072
|
+
}
|
|
1073
|
+
}, [e, r, n, o, s, i, v, C, P, u, d]);
|
|
1074
|
+
F(() => {
|
|
1075
|
+
E && X.current(b.current, N.current);
|
|
1076
|
+
}, [E]), F(() => {
|
|
1077
|
+
!y && !E && z();
|
|
1078
|
+
}, [y, E, z]), f.current = o, F(() => {
|
|
1079
|
+
var m, j;
|
|
1080
|
+
E && ne && ((m = V.current) == null || m.dispose(), V.current = (j = b.current) == null ? void 0 : j.onDidChangeModelContent((O) => {
|
|
1081
|
+
$.current || ne(b.current.getValue(), O);
|
|
1082
|
+
}));
|
|
1083
|
+
}, [E, ne]), F(() => {
|
|
1084
|
+
if (E) {
|
|
1085
|
+
let m = N.current.editor.onDidChangeMarkers((j) => {
|
|
1086
|
+
var H;
|
|
1087
|
+
let O = (H = b.current.getModel()) == null ? void 0 : H.uri;
|
|
1088
|
+
if (O && j.find((_) => _.path === O.path)) {
|
|
1089
|
+
let _ = N.current.editor.getModelMarkers({ resource: O });
|
|
1090
|
+
W == null || W(_);
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
return () => {
|
|
1094
|
+
m == null || m.dispose();
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
return () => {
|
|
1098
|
+
};
|
|
1099
|
+
}, [E, W]);
|
|
1100
|
+
function me() {
|
|
1101
|
+
var m, j;
|
|
1102
|
+
(m = V.current) == null || m.dispose(), re ? P && xe.set(i, b.current.saveViewState()) : (j = b.current.getModel()) == null || j.dispose(), b.current.dispose();
|
|
1103
|
+
}
|
|
1104
|
+
return ae.createElement(rt, { width: L, height: B, isEditorReady: E, loading: g, _ref: Y, className: I, wrapperProps: R });
|
|
1105
|
+
}
|
|
1106
|
+
var br = hr, vr = Pe(br), at = vr;
|
|
1107
|
+
const xr = ({ request: e }) => {
|
|
1108
|
+
const [r, n] = Q(!1), [o, s] = Q(!1), i = (v) => Object.entries(v || {}).map(([C, P]) => /* @__PURE__ */ a.jsxs("tr", { children: [
|
|
1109
|
+
/* @__PURE__ */ a.jsx("td", { className: "border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs", children: C }),
|
|
1110
|
+
/* @__PURE__ */ a.jsx("td", { className: "border border-slate-200 px-2 py-1 font-mono text-xs", children: P })
|
|
1111
|
+
] }, C)), u = e.request.payload, d = !u || typeof u == "object" && Object.keys(u).length === 0 || typeof u == "string" && (u.trim() === "" || u.trim() === "{}"), g = (v) => {
|
|
1112
|
+
try {
|
|
1113
|
+
const C = JSON.parse(v);
|
|
1114
|
+
return JSON.stringify(C, null, 2);
|
|
1115
|
+
} catch {
|
|
1116
|
+
return v;
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
return /* @__PURE__ */ a.jsxs("div", { children: [
|
|
1120
|
+
/* @__PURE__ */ a.jsxs("div", { className: "mb-4", children: [
|
|
1121
|
+
/* @__PURE__ */ a.jsxs(
|
|
1122
|
+
"button",
|
|
1123
|
+
{
|
|
1124
|
+
className: "w-full p-2 text-left font-bold bg-gray-200",
|
|
1125
|
+
onClick: () => n(!r),
|
|
1126
|
+
children: [
|
|
1127
|
+
"Query Parameters (",
|
|
1128
|
+
Object.keys(e.request.queryParams || {}).length,
|
|
1129
|
+
")"
|
|
1130
|
+
]
|
|
1131
|
+
}
|
|
1132
|
+
),
|
|
1133
|
+
r && /* @__PURE__ */ a.jsx("div", { className: "p-0", children: /* @__PURE__ */ a.jsxs("table", { className: "w-full border-collapse border border-gray-300", children: [
|
|
1134
|
+
/* @__PURE__ */ a.jsx("thead", { children: /* @__PURE__ */ a.jsxs("tr", { className: "bg-gray-100", children: [
|
|
1135
|
+
/* @__PURE__ */ a.jsx("th", { className: "border border-slate-200 px-2 py-1 w-1/4 text-left", children: "Key" }),
|
|
1136
|
+
/* @__PURE__ */ a.jsx("th", { className: "border border-slate-200 px-2 py-1 text-left", children: "Value" })
|
|
1137
|
+
] }) }),
|
|
1138
|
+
/* @__PURE__ */ a.jsx("tbody", { children: i(e.request.queryParams) })
|
|
1139
|
+
] }) })
|
|
1140
|
+
] }),
|
|
1141
|
+
/* @__PURE__ */ a.jsxs("div", { className: "mb-4", children: [
|
|
1142
|
+
/* @__PURE__ */ a.jsxs(
|
|
1143
|
+
"button",
|
|
1144
|
+
{
|
|
1145
|
+
className: "w-full p-2 text-left font-bold bg-gray-200",
|
|
1146
|
+
onClick: () => s(!o),
|
|
1147
|
+
children: [
|
|
1148
|
+
"Headers (",
|
|
1149
|
+
Object.keys(e.request.headers || {}).length,
|
|
1150
|
+
")"
|
|
1151
|
+
]
|
|
1152
|
+
}
|
|
1153
|
+
),
|
|
1154
|
+
o && /* @__PURE__ */ a.jsx("div", { className: "p-0", children: /* @__PURE__ */ a.jsxs("table", { className: "w-full border-collapse border border-gray-300", children: [
|
|
1155
|
+
/* @__PURE__ */ a.jsx("thead", { children: /* @__PURE__ */ a.jsxs("tr", { className: "bg-gray-100", children: [
|
|
1156
|
+
/* @__PURE__ */ a.jsx("th", { className: "border border-slate-200 px-2 py-1 w-1/4 text-left", children: "Header" }),
|
|
1157
|
+
/* @__PURE__ */ a.jsx("th", { className: "border border-slate-200 px-2 py-1 text-left", children: "Value" })
|
|
1158
|
+
] }) }),
|
|
1159
|
+
/* @__PURE__ */ a.jsx("tbody", { children: i(e.request.headers) })
|
|
1160
|
+
] }) })
|
|
1161
|
+
] }),
|
|
1162
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1163
|
+
/* @__PURE__ */ a.jsx("button", { className: "w-full p-2 text-left font-bold bg-gray-200", children: "Request Body" }),
|
|
1164
|
+
d ? /* @__PURE__ */ a.jsx("div", { className: "hidden" }) : /* @__PURE__ */ a.jsx("div", { className: "bg-white rounded-b shadow p-0 h-100", children: /* @__PURE__ */ a.jsx(
|
|
1165
|
+
at,
|
|
1166
|
+
{
|
|
1167
|
+
height: "100%",
|
|
1168
|
+
defaultLanguage: "json",
|
|
1169
|
+
value: g(u),
|
|
1170
|
+
options: {
|
|
1171
|
+
readOnly: !0,
|
|
1172
|
+
minimap: { enabled: !1 },
|
|
1173
|
+
automaticLayout: !0,
|
|
1174
|
+
fontFamily: '"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',
|
|
1175
|
+
tabSize: 2,
|
|
1176
|
+
scrollBeyondLastLine: !1
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
) })
|
|
1180
|
+
] })
|
|
1181
|
+
] });
|
|
1182
|
+
}, jr = ({ request: e }) => {
|
|
1183
|
+
const [r, n] = Q(!1), o = (d) => Object.entries(d || {}).map(([g, v]) => /* @__PURE__ */ a.jsxs("tr", { children: [
|
|
1184
|
+
/* @__PURE__ */ a.jsx("td", { className: "border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs", children: g }),
|
|
1185
|
+
/* @__PURE__ */ a.jsx("td", { className: "border border-slate-200 px-2 py-1 font-mono text-xs", children: v })
|
|
1186
|
+
] }, g)), s = e.response.payload, i = !s || typeof s == "object" && Object.keys(s).length === 0 || typeof s == "string" && (s.trim() === "" || s.trim() === "{}"), u = (d) => {
|
|
1187
|
+
try {
|
|
1188
|
+
const g = JSON.parse(d);
|
|
1189
|
+
return JSON.stringify(g, null, 2);
|
|
1190
|
+
} catch {
|
|
1191
|
+
return d;
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
return /* @__PURE__ */ a.jsxs("div", { children: [
|
|
1195
|
+
/* @__PURE__ */ a.jsxs("div", { className: "mb-4", children: [
|
|
1196
|
+
/* @__PURE__ */ a.jsxs(
|
|
1197
|
+
"button",
|
|
1198
|
+
{
|
|
1199
|
+
className: "w-full p-2 text-left font-bold bg-gray-200",
|
|
1200
|
+
onClick: () => n(!r),
|
|
1201
|
+
children: [
|
|
1202
|
+
"Headers (",
|
|
1203
|
+
Object.keys(e.response.headers || {}).length,
|
|
1204
|
+
")"
|
|
1205
|
+
]
|
|
1206
|
+
}
|
|
1207
|
+
),
|
|
1208
|
+
r && /* @__PURE__ */ a.jsx("div", { className: "p-0", children: /* @__PURE__ */ a.jsxs("table", { className: "w-full border-collapse border border-gray-300", children: [
|
|
1209
|
+
/* @__PURE__ */ a.jsx("thead", { children: /* @__PURE__ */ a.jsxs("tr", { className: "bg-gray-100", children: [
|
|
1210
|
+
/* @__PURE__ */ a.jsx("th", { className: "border border-slate-200 px-2 py-1 w-1/4 text-left", children: "Header" }),
|
|
1211
|
+
/* @__PURE__ */ a.jsx("th", { className: "border border-slate-200 px-2 py-1 text-left", children: "Value" })
|
|
1212
|
+
] }) }),
|
|
1213
|
+
/* @__PURE__ */ a.jsx("tbody", { children: o(e.response.headers) })
|
|
1214
|
+
] }) })
|
|
1215
|
+
] }),
|
|
1216
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1217
|
+
/* @__PURE__ */ a.jsx("button", { className: "w-full p-2 text-left font-bold bg-gray-200", children: "Response Body" }),
|
|
1218
|
+
i ? /* @__PURE__ */ a.jsx("div", { className: "hidden" }) : /* @__PURE__ */ a.jsx("div", { className: "bg-white rounded-b shadow p-0 h-100", children: /* @__PURE__ */ a.jsx(
|
|
1219
|
+
at,
|
|
1220
|
+
{
|
|
1221
|
+
height: "100%",
|
|
1222
|
+
defaultLanguage: "json",
|
|
1223
|
+
value: u(s),
|
|
1224
|
+
options: {
|
|
1225
|
+
readOnly: !0,
|
|
1226
|
+
minimap: { enabled: !1 },
|
|
1227
|
+
automaticLayout: !0,
|
|
1228
|
+
fontFamily: '"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',
|
|
1229
|
+
tabSize: 2,
|
|
1230
|
+
scrollBeyondLastLine: !1
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
) })
|
|
1234
|
+
] })
|
|
1235
|
+
] });
|
|
1236
|
+
}, Ar = ({ request: e, currentTab: r, setCurrentTab: n }) => e ? /* @__PURE__ */ a.jsxs("div", { children: [
|
|
1237
|
+
/* @__PURE__ */ a.jsx(gt, { request: e }),
|
|
1238
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex space-x-2", children: [
|
|
1239
|
+
/* @__PURE__ */ a.jsx(
|
|
1240
|
+
"button",
|
|
1241
|
+
{
|
|
1242
|
+
className: `px-4 py-2 rounded-t ${r === "request" ? "bg-blue-600 text-white" : "bg-gray-200 text-gray-700"}`,
|
|
1243
|
+
onClick: () => n("request"),
|
|
1244
|
+
children: "Request"
|
|
1245
|
+
}
|
|
1246
|
+
),
|
|
1247
|
+
/* @__PURE__ */ a.jsx(
|
|
1248
|
+
"button",
|
|
1249
|
+
{
|
|
1250
|
+
className: `px-4 py-2 rounded-t ${r === "response" ? "bg-blue-600 text-white" : "bg-gray-200 text-gray-700"}`,
|
|
1251
|
+
onClick: () => n("response"),
|
|
1252
|
+
children: "Response"
|
|
1253
|
+
}
|
|
1254
|
+
)
|
|
1255
|
+
] }),
|
|
1256
|
+
/* @__PURE__ */ a.jsx("div", { className: "p-4 bg-white rounded-b shadow", children: r === "request" ? /* @__PURE__ */ a.jsx(xr, { request: e }) : /* @__PURE__ */ a.jsx(jr, { request: e }) })
|
|
1257
|
+
] }) : /* @__PURE__ */ a.jsx("div", { className: "text-gray-500", children: "No request selected." }), yr = "data:image/png;base64,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", wr = ({ sseEndpoint: e, setSseEndpoint: r, isConnected: n }) => {
|
|
1258
|
+
const [o, s] = Q(!1), [i, u] = Q(e);
|
|
1259
|
+
F(() => {
|
|
1260
|
+
if (typeof window < "u") {
|
|
1261
|
+
const g = localStorage.getItem("sseEndpoint");
|
|
1262
|
+
!e && g && (u(g), r(g));
|
|
1263
|
+
}
|
|
1264
|
+
}, [e, r]);
|
|
1265
|
+
const d = () => {
|
|
1266
|
+
typeof window < "u" && localStorage.setItem("sseEndpoint", i), r(i), s(!1);
|
|
1267
|
+
};
|
|
1268
|
+
return /* @__PURE__ */ a.jsxs("div", { className: "fixed bottom-0 left-0 w-full", children: [
|
|
1269
|
+
/* @__PURE__ */ a.jsxs(
|
|
1270
|
+
"div",
|
|
1271
|
+
{
|
|
1272
|
+
className: "flex items-center justify-between bg-gray-200 px-4 py-2 w-full cursor-pointer select-none",
|
|
1273
|
+
onClick: () => s((g) => !g),
|
|
1274
|
+
children: [
|
|
1275
|
+
/* @__PURE__ */ a.jsx("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ a.jsxs(
|
|
1276
|
+
"span",
|
|
1277
|
+
{
|
|
1278
|
+
className: `px-2 py-1 rounded-full text-xs font-semibold flex items-center ${n ? "bg-green-500" : "bg-red-500"}`,
|
|
1279
|
+
children: [
|
|
1280
|
+
/* @__PURE__ */ a.jsx(
|
|
1281
|
+
"span",
|
|
1282
|
+
{
|
|
1283
|
+
className: `w-2 h-2 rounded-full mr-1 ${n ? "bg-green-800" : "bg-red-800"}`
|
|
1284
|
+
}
|
|
1285
|
+
),
|
|
1286
|
+
n ? "Connected" : "Disconnected"
|
|
1287
|
+
]
|
|
1288
|
+
}
|
|
1289
|
+
) }),
|
|
1290
|
+
/* @__PURE__ */ a.jsxs(
|
|
1291
|
+
"a",
|
|
1292
|
+
{
|
|
1293
|
+
href: "https://github.com/thim81/inspectr",
|
|
1294
|
+
target: "_blank",
|
|
1295
|
+
rel: "noopener noreferrer",
|
|
1296
|
+
className: "flex items-center gap-2",
|
|
1297
|
+
children: [
|
|
1298
|
+
/* @__PURE__ */ a.jsx("img", { src: yr, alt: "Inspectr Logo", className: "h-6" }),
|
|
1299
|
+
/* @__PURE__ */ a.jsx("span", { className: "text-gray-700 font-semibold text-sm", children: "Inspectr" })
|
|
1300
|
+
]
|
|
1301
|
+
}
|
|
1302
|
+
)
|
|
1303
|
+
]
|
|
1304
|
+
}
|
|
1305
|
+
),
|
|
1306
|
+
/* @__PURE__ */ a.jsx(
|
|
1307
|
+
"div",
|
|
1308
|
+
{
|
|
1309
|
+
className: `bg-gray-100 border-t border-gray-300 transition-all duration-300 overflow-hidden ${o ? "max-h-40 opacity-100 py-4" : "max-h-0 opacity-0 py-0"}`,
|
|
1310
|
+
children: /* @__PURE__ */ a.jsxs("div", { className: "px-6", children: [
|
|
1311
|
+
/* @__PURE__ */ a.jsxs("div", { className: "grid grid-cols-2 gap-4 items-center", children: [
|
|
1312
|
+
/* @__PURE__ */ a.jsx("div", { children: /* @__PURE__ */ a.jsx("h2", { className: "text-lg font-semibold text-gray-800 mb-4", children: "Configuration" }) }),
|
|
1313
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1314
|
+
/* @__PURE__ */ a.jsx("label", { className: "text-gray-700 font-semibold whitespace-nowrap", children: "SSE Endpoint:" }),
|
|
1315
|
+
/* @__PURE__ */ a.jsx(
|
|
1316
|
+
"input",
|
|
1317
|
+
{
|
|
1318
|
+
type: "text",
|
|
1319
|
+
value: i,
|
|
1320
|
+
onChange: (g) => u(g.target.value),
|
|
1321
|
+
className: "border p-2 rounded flex-1 bg-white",
|
|
1322
|
+
placeholder: "Enter SSE Endpoint..."
|
|
1323
|
+
}
|
|
1324
|
+
)
|
|
1325
|
+
] })
|
|
1326
|
+
] }),
|
|
1327
|
+
/* @__PURE__ */ a.jsx("div", { className: "flex justify-end mt-4", children: /* @__PURE__ */ a.jsx(
|
|
1328
|
+
"button",
|
|
1329
|
+
{
|
|
1330
|
+
onClick: d,
|
|
1331
|
+
className: "bg-green-600 text-white px-4 py-2 rounded-md",
|
|
1332
|
+
children: "Apply"
|
|
1333
|
+
}
|
|
1334
|
+
) })
|
|
1335
|
+
] })
|
|
1336
|
+
}
|
|
1337
|
+
)
|
|
1338
|
+
] });
|
|
1339
|
+
}, Cr = ({ sseEndpoint: e }) => {
|
|
1340
|
+
const [r, n] = Q([]), [o, s] = Q(null), [i, u] = Q("request"), [d, g] = Q("/api/sse"), [v, C] = Q(!1);
|
|
1341
|
+
F(() => {
|
|
1342
|
+
if (typeof window < "u") {
|
|
1343
|
+
const L = localStorage.getItem("sseEndpoint");
|
|
1344
|
+
!e && L && g(L);
|
|
1345
|
+
}
|
|
1346
|
+
}, [d]), F(() => {
|
|
1347
|
+
const L = () => `req-${Math.random().toString(36).substr(2, 9)}`, B = new EventSource(d);
|
|
1348
|
+
return console.log(`EventSource created with URL: ${d}`), B.onopen = () => {
|
|
1349
|
+
console.log("SSE connection opened"), C(!0);
|
|
1350
|
+
}, B.onmessage = (I) => {
|
|
1351
|
+
try {
|
|
1352
|
+
const R = JSON.parse(I.data);
|
|
1353
|
+
R.id || (R.id = L()), n((U) => (U.length === 0 && s(R), [R, ...U]));
|
|
1354
|
+
} catch (R) {
|
|
1355
|
+
console.error("Error parsing SSE data:", R);
|
|
1356
|
+
}
|
|
1357
|
+
}, B.onerror = (I) => {
|
|
1358
|
+
console.error("SSE error:", I), C(!1);
|
|
1359
|
+
}, () => {
|
|
1360
|
+
console.log("Closing EventSource"), B.close(), C(!1);
|
|
1361
|
+
};
|
|
1362
|
+
}, [d]);
|
|
1363
|
+
const P = () => {
|
|
1364
|
+
n([]), s(null);
|
|
1365
|
+
}, re = (L) => {
|
|
1366
|
+
n(
|
|
1367
|
+
(B) => B.filter((I, R) => I.id ? I.id !== L : R !== L)
|
|
1368
|
+
), o && (o.id || "") === L && s(null);
|
|
1369
|
+
};
|
|
1370
|
+
return /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col h-screen", children: [
|
|
1371
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex flex-grow", children: [
|
|
1372
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-1/3 border-r border-gray-300 overflow-y-auto", children: /* @__PURE__ */ a.jsx(
|
|
1373
|
+
ft,
|
|
1374
|
+
{
|
|
1375
|
+
requests: r,
|
|
1376
|
+
onSelect: s,
|
|
1377
|
+
onRemove: re,
|
|
1378
|
+
clearRequests: P,
|
|
1379
|
+
selectedRequest: o
|
|
1380
|
+
}
|
|
1381
|
+
) }),
|
|
1382
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-2/3 p-4", children: /* @__PURE__ */ a.jsx(
|
|
1383
|
+
Ar,
|
|
1384
|
+
{
|
|
1385
|
+
request: o,
|
|
1386
|
+
currentTab: i,
|
|
1387
|
+
setCurrentTab: u
|
|
1388
|
+
}
|
|
1389
|
+
) })
|
|
1390
|
+
] }),
|
|
1391
|
+
/* @__PURE__ */ a.jsx(
|
|
1392
|
+
wr,
|
|
1393
|
+
{
|
|
1394
|
+
sseEndpoint: d,
|
|
1395
|
+
setSseEndpoint: g,
|
|
1396
|
+
isConnected: v
|
|
1397
|
+
}
|
|
1398
|
+
)
|
|
1399
|
+
] });
|
|
1400
|
+
};
|
|
1401
|
+
export {
|
|
1402
|
+
Cr as InspectrApp,
|
|
1403
|
+
xr as RequestContent,
|
|
1404
|
+
gt as RequestDetail,
|
|
1405
|
+
Ar as RequestDetailsPanel,
|
|
1406
|
+
ft as RequestList,
|
|
1407
|
+
dt as RequestListItem,
|
|
1408
|
+
jr as ResponseContent,
|
|
1409
|
+
wr as SettingsPanel,
|
|
1410
|
+
Ge as getStatusClass
|
|
1411
|
+
};
|