@motiadev/plugin-endpoint 0.8.2-beta.140-628177 → 0.8.2-beta.140-111855
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/README.md +12 -12
- package/dist/api/endpoints-stream.d.ts +22 -0
- package/dist/api/endpoints-stream.d.ts.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/components/configuration-list-item.d.ts.map +1 -1
- package/dist/components/endpoint-badge.d.ts +1 -1
- package/dist/components/endpoint-badge.d.ts.map +1 -1
- package/dist/components/endpoint-item.d.ts.map +1 -1
- package/dist/components/endpoint-path-preview.d.ts.map +1 -1
- package/dist/components/endpoint-path.d.ts.map +1 -1
- package/dist/components/endpoint-tab-label.d.ts +1 -1
- package/dist/components/flow-group.d.ts.map +1 -1
- package/dist/components/json-editor.d.ts.map +1 -1
- package/dist/hooks/use-endpoint-configuration.d.ts +3 -3
- package/dist/hooks/use-get-endpoints.d.ts.map +1 -1
- package/dist/hooks/use-json-schema-to-json.d.ts +1 -1
- package/dist/index.cjs +27 -0
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2243 -9
- package/dist/play/response-code.d.ts.map +1 -1
- package/dist/play/response-content.d.ts +1 -1
- package/dist/play/response-content.d.ts.map +1 -1
- package/dist/play/side-panel-body-tab.d.ts.map +1 -1
- package/dist/play/side-panel-response.d.ts +1 -1
- package/dist/play/side-panel.d.ts.map +1 -1
- package/dist/play/trigger-button.d.ts +1 -1
- package/dist/play/trigger-button.d.ts.map +1 -1
- package/dist/plugin-endpoint.css +1 -0
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +67 -0
- package/dist/spec/spec-body-panel.d.ts +0 -2
- package/dist/spec/spec-body-panel.d.ts.map +1 -1
- package/dist/spec/spec-path-params-panel.d.ts.map +1 -1
- package/dist/spec/spec-query-params-panel.d.ts.map +1 -1
- package/dist/spec/spec-response-schema.d.ts.map +1 -1
- package/dist/spec/spec-side-panel.d.ts.map +1 -1
- package/package.json +31 -20
- package/dist/components/configuration-list-item.js +0 -36
- package/dist/components/configuration-list-item.js.map +0 -1
- package/dist/components/endpoint-badge.js +0 -29
- package/dist/components/endpoint-badge.js.map +0 -1
- package/dist/components/endpoint-item.js +0 -5
- package/dist/components/endpoint-item.js.map +0 -1
- package/dist/components/endpoint-path-preview.js +0 -22
- package/dist/components/endpoint-path-preview.js.map +0 -1
- package/dist/components/endpoint-path.js +0 -26
- package/dist/components/endpoint-path.js.map +0 -1
- package/dist/components/endpoint-tab-label.js +0 -6
- package/dist/components/endpoint-tab-label.js.map +0 -1
- package/dist/components/endpoints-search.js +0 -10
- package/dist/components/endpoints-search.js.map +0 -1
- package/dist/components/flow-group.js +0 -13
- package/dist/components/flow-group.js.map +0 -1
- package/dist/components/json-editor.js +0 -105
- package/dist/components/json-editor.js.map +0 -1
- package/dist/endpoints-page.js +0 -29
- package/dist/endpoints-page.js.map +0 -1
- package/dist/hooks/use-endpoint-configuration.js +0 -142
- package/dist/hooks/use-endpoint-configuration.js.map +0 -1
- package/dist/hooks/use-get-endpoints.js +0 -23
- package/dist/hooks/use-get-endpoints.js.map +0 -1
- package/dist/hooks/use-json-schema-to-json.js +0 -12
- package/dist/hooks/use-json-schema-to-json.js.map +0 -1
- package/dist/hooks/use-path-params.js +0 -5
- package/dist/hooks/use-path-params.js.map +0 -1
- package/dist/hooks/use-path-url.js +0 -15
- package/dist/hooks/use-path-url.js.map +0 -1
- package/dist/hooks/use-state-stream.js +0 -19
- package/dist/hooks/use-state-stream.js.map +0 -1
- package/dist/hooks/utils.js +0 -30
- package/dist/hooks/utils.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/play/reponse-code/utils.js +0 -73
- package/dist/play/reponse-code/utils.js.map +0 -1
- package/dist/play/response-code.js +0 -11
- package/dist/play/response-code.js.map +0 -1
- package/dist/play/response-content.js +0 -38
- package/dist/play/response-content.js.map +0 -1
- package/dist/play/side-panel-body-tab.js +0 -23
- package/dist/play/side-panel-body-tab.js.map +0 -1
- package/dist/play/side-panel-headers-tab.js +0 -26
- package/dist/play/side-panel-headers-tab.js.map +0 -1
- package/dist/play/side-panel-params-tab.js +0 -39
- package/dist/play/side-panel-params-tab.js.map +0 -1
- package/dist/play/side-panel-response.js +0 -21
- package/dist/play/side-panel-response.js.map +0 -1
- package/dist/play/side-panel.js +0 -26
- package/dist/play/side-panel.js.map +0 -1
- package/dist/play/trigger-button.js +0 -40
- package/dist/play/trigger-button.js.map +0 -1
- package/dist/spec/spec-body-panel.js +0 -13
- package/dist/spec/spec-body-panel.js.map +0 -1
- package/dist/spec/spec-path-params-panel.js +0 -11
- package/dist/spec/spec-path-params-panel.js.map +0 -1
- package/dist/spec/spec-query-params-panel.js +0 -10
- package/dist/spec/spec-query-params-panel.js.map +0 -1
- package/dist/spec/spec-response-schema.js +0 -18
- package/dist/spec/spec-response-schema.js.map +0 -1
- package/dist/spec/spec-side-panel.js +0 -22
- package/dist/spec/spec-side-panel.js.map +0 -1
- package/dist/styles.css +0 -1108
- package/dist/types/endpoint.js +0 -2
- package/dist/types/endpoint.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,2243 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
1
|
+
import Te, { memo as z, useMemo as F, useState as _, useEffect as D, Fragment as $e, useRef as Pe, useCallback as R } from "react";
|
|
2
|
+
import { Input as te, cn as N, Panel as se, Tabs as ae, TabsList as ie, TabsTrigger as M, useThemeStore as le, TabsContent as L, Sidebar as qe, Checkbox as Je, Button as O, BackgroundEffect as We, Badge as xe } from "@motiadev/ui";
|
|
3
|
+
import { Search as Ge, X as W, ChevronDown as Ye, CircleX as Qe, Check as Re, AlertCircle as Xe, Trash2 as Ze, Plus as _e, Copy as Ke, Download as et, Loader2 as tt, Play as rt, Book as ot } from "lucide-react";
|
|
4
|
+
import { create as nt } from "zustand";
|
|
5
|
+
import { useStreamGroup as st, useStreamItem as at } from "@motiadev/stream-client-react";
|
|
6
|
+
import Oe from "react18-json-view";
|
|
7
|
+
import { useMonaco as it, Editor as lt } from "@monaco-editor/react";
|
|
8
|
+
import { Prism as ct } from "react-syntax-highlighter";
|
|
9
|
+
var q = { exports: {} }, B = {};
|
|
10
|
+
/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
var ke;
|
|
20
|
+
function dt() {
|
|
21
|
+
if (ke) return B;
|
|
22
|
+
ke = 1;
|
|
23
|
+
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
24
|
+
function o(s, n, a) {
|
|
25
|
+
var c = null;
|
|
26
|
+
if (a !== void 0 && (c = "" + a), n.key !== void 0 && (c = "" + n.key), "key" in n) {
|
|
27
|
+
a = {};
|
|
28
|
+
for (var d in n)
|
|
29
|
+
d !== "key" && (a[d] = n[d]);
|
|
30
|
+
} else a = n;
|
|
31
|
+
return n = a.ref, {
|
|
32
|
+
$$typeof: e,
|
|
33
|
+
type: s,
|
|
34
|
+
key: c,
|
|
35
|
+
ref: n !== void 0 ? n : null,
|
|
36
|
+
props: a
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return B.Fragment = t, B.jsx = o, B.jsxs = o, B;
|
|
40
|
+
}
|
|
41
|
+
var U = {};
|
|
42
|
+
/**
|
|
43
|
+
* @license React
|
|
44
|
+
* react-jsx-runtime.development.js
|
|
45
|
+
*
|
|
46
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the MIT license found in the
|
|
49
|
+
* LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/
|
|
51
|
+
var we;
|
|
52
|
+
function ut() {
|
|
53
|
+
return we || (we = 1, process.env.NODE_ENV !== "production" && function() {
|
|
54
|
+
function e(i) {
|
|
55
|
+
if (i == null) return null;
|
|
56
|
+
if (typeof i == "function")
|
|
57
|
+
return i.$$typeof === Be ? null : i.displayName || i.name || null;
|
|
58
|
+
if (typeof i == "string") return i;
|
|
59
|
+
switch (i) {
|
|
60
|
+
case u:
|
|
61
|
+
return "Fragment";
|
|
62
|
+
case v:
|
|
63
|
+
return "Profiler";
|
|
64
|
+
case y:
|
|
65
|
+
return "StrictMode";
|
|
66
|
+
case G:
|
|
67
|
+
return "Suspense";
|
|
68
|
+
case Le:
|
|
69
|
+
return "SuspenseList";
|
|
70
|
+
case He:
|
|
71
|
+
return "Activity";
|
|
72
|
+
}
|
|
73
|
+
if (typeof i == "object")
|
|
74
|
+
switch (typeof i.tag == "number" && console.error(
|
|
75
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
76
|
+
), i.$$typeof) {
|
|
77
|
+
case w:
|
|
78
|
+
return "Portal";
|
|
79
|
+
case C:
|
|
80
|
+
return (i.displayName || "Context") + ".Provider";
|
|
81
|
+
case x:
|
|
82
|
+
return (i._context.displayName || "Context") + ".Consumer";
|
|
83
|
+
case H:
|
|
84
|
+
var g = i.render;
|
|
85
|
+
return i = i.displayName, i || (i = g.displayName || g.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
|
|
86
|
+
case ze:
|
|
87
|
+
return g = i.displayName || null, g !== null ? g : e(i.type) || "Memo";
|
|
88
|
+
case me:
|
|
89
|
+
g = i._payload, i = i._init;
|
|
90
|
+
try {
|
|
91
|
+
return e(i(g));
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
function t(i) {
|
|
98
|
+
return "" + i;
|
|
99
|
+
}
|
|
100
|
+
function o(i) {
|
|
101
|
+
try {
|
|
102
|
+
t(i);
|
|
103
|
+
var g = !1;
|
|
104
|
+
} catch {
|
|
105
|
+
g = !0;
|
|
106
|
+
}
|
|
107
|
+
if (g) {
|
|
108
|
+
g = console;
|
|
109
|
+
var k = g.error, S = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
110
|
+
return k.call(
|
|
111
|
+
g,
|
|
112
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
113
|
+
S
|
|
114
|
+
), t(i);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function s(i) {
|
|
118
|
+
if (i === u) return "<>";
|
|
119
|
+
if (typeof i == "object" && i !== null && i.$$typeof === me)
|
|
120
|
+
return "<...>";
|
|
121
|
+
try {
|
|
122
|
+
var g = e(i);
|
|
123
|
+
return g ? "<" + g + ">" : "<...>";
|
|
124
|
+
} catch {
|
|
125
|
+
return "<...>";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function n() {
|
|
129
|
+
var i = Y.A;
|
|
130
|
+
return i === null ? null : i.getOwner();
|
|
131
|
+
}
|
|
132
|
+
function a() {
|
|
133
|
+
return Error("react-stack-top-frame");
|
|
134
|
+
}
|
|
135
|
+
function c(i) {
|
|
136
|
+
if (he.call(i, "key")) {
|
|
137
|
+
var g = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
138
|
+
if (g && g.isReactWarning) return !1;
|
|
139
|
+
}
|
|
140
|
+
return i.key !== void 0;
|
|
141
|
+
}
|
|
142
|
+
function d(i, g) {
|
|
143
|
+
function k() {
|
|
144
|
+
pe || (pe = !0, console.error(
|
|
145
|
+
"%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)",
|
|
146
|
+
g
|
|
147
|
+
));
|
|
148
|
+
}
|
|
149
|
+
k.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
150
|
+
get: k,
|
|
151
|
+
configurable: !0
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function h() {
|
|
155
|
+
var i = e(this.type);
|
|
156
|
+
return ge[i] || (ge[i] = !0, console.error(
|
|
157
|
+
"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."
|
|
158
|
+
)), i = this.props.ref, i !== void 0 ? i : null;
|
|
159
|
+
}
|
|
160
|
+
function p(i, g, k, S, I, P, X, Z) {
|
|
161
|
+
return k = P.ref, i = {
|
|
162
|
+
$$typeof: b,
|
|
163
|
+
type: i,
|
|
164
|
+
key: g,
|
|
165
|
+
props: P,
|
|
166
|
+
_owner: I
|
|
167
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(i, "ref", {
|
|
168
|
+
enumerable: !1,
|
|
169
|
+
get: h
|
|
170
|
+
}) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
171
|
+
configurable: !1,
|
|
172
|
+
enumerable: !1,
|
|
173
|
+
writable: !0,
|
|
174
|
+
value: 0
|
|
175
|
+
}), Object.defineProperty(i, "_debugInfo", {
|
|
176
|
+
configurable: !1,
|
|
177
|
+
enumerable: !1,
|
|
178
|
+
writable: !0,
|
|
179
|
+
value: null
|
|
180
|
+
}), Object.defineProperty(i, "_debugStack", {
|
|
181
|
+
configurable: !1,
|
|
182
|
+
enumerable: !1,
|
|
183
|
+
writable: !0,
|
|
184
|
+
value: X
|
|
185
|
+
}), Object.defineProperty(i, "_debugTask", {
|
|
186
|
+
configurable: !1,
|
|
187
|
+
enumerable: !1,
|
|
188
|
+
writable: !0,
|
|
189
|
+
value: Z
|
|
190
|
+
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
191
|
+
}
|
|
192
|
+
function l(i, g, k, S, I, P, X, Z) {
|
|
193
|
+
var E = g.children;
|
|
194
|
+
if (E !== void 0)
|
|
195
|
+
if (S)
|
|
196
|
+
if (Ue(E)) {
|
|
197
|
+
for (S = 0; S < E.length; S++)
|
|
198
|
+
f(E[S]);
|
|
199
|
+
Object.freeze && Object.freeze(E);
|
|
200
|
+
} else
|
|
201
|
+
console.error(
|
|
202
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
203
|
+
);
|
|
204
|
+
else f(E);
|
|
205
|
+
if (he.call(g, "key")) {
|
|
206
|
+
E = e(i);
|
|
207
|
+
var A = Object.keys(g).filter(function(Ve) {
|
|
208
|
+
return Ve !== "key";
|
|
209
|
+
});
|
|
210
|
+
S = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", ve[E + S] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
211
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
212
|
+
let props = %s;
|
|
213
|
+
<%s {...props} />
|
|
214
|
+
React keys must be passed directly to JSX without using spread:
|
|
215
|
+
let props = %s;
|
|
216
|
+
<%s key={someKey} {...props} />`,
|
|
217
|
+
S,
|
|
218
|
+
E,
|
|
219
|
+
A,
|
|
220
|
+
E
|
|
221
|
+
), ve[E + S] = !0);
|
|
222
|
+
}
|
|
223
|
+
if (E = null, k !== void 0 && (o(k), E = "" + k), c(g) && (o(g.key), E = "" + g.key), "key" in g) {
|
|
224
|
+
k = {};
|
|
225
|
+
for (var K in g)
|
|
226
|
+
K !== "key" && (k[K] = g[K]);
|
|
227
|
+
} else k = g;
|
|
228
|
+
return E && d(
|
|
229
|
+
k,
|
|
230
|
+
typeof i == "function" ? i.displayName || i.name || "Unknown" : i
|
|
231
|
+
), p(
|
|
232
|
+
i,
|
|
233
|
+
E,
|
|
234
|
+
P,
|
|
235
|
+
I,
|
|
236
|
+
n(),
|
|
237
|
+
k,
|
|
238
|
+
X,
|
|
239
|
+
Z
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
function f(i) {
|
|
243
|
+
typeof i == "object" && i !== null && i.$$typeof === b && i._store && (i._store.validated = 1);
|
|
244
|
+
}
|
|
245
|
+
var m = Te, b = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), C = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), Le = Symbol.for("react.suspense_list"), ze = Symbol.for("react.memo"), me = Symbol.for("react.lazy"), He = Symbol.for("react.activity"), Be = Symbol.for("react.client.reference"), Y = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, he = Object.prototype.hasOwnProperty, Ue = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
246
|
+
return null;
|
|
247
|
+
};
|
|
248
|
+
m = {
|
|
249
|
+
react_stack_bottom_frame: function(i) {
|
|
250
|
+
return i();
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
var pe, ge = {}, fe = m.react_stack_bottom_frame.bind(
|
|
254
|
+
m,
|
|
255
|
+
a
|
|
256
|
+
)(), be = Q(s(a)), ve = {};
|
|
257
|
+
U.Fragment = u, U.jsx = function(i, g, k, S, I) {
|
|
258
|
+
var P = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
259
|
+
return l(
|
|
260
|
+
i,
|
|
261
|
+
g,
|
|
262
|
+
k,
|
|
263
|
+
!1,
|
|
264
|
+
S,
|
|
265
|
+
I,
|
|
266
|
+
P ? Error("react-stack-top-frame") : fe,
|
|
267
|
+
P ? Q(s(i)) : be
|
|
268
|
+
);
|
|
269
|
+
}, U.jsxs = function(i, g, k, S, I) {
|
|
270
|
+
var P = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
271
|
+
return l(
|
|
272
|
+
i,
|
|
273
|
+
g,
|
|
274
|
+
k,
|
|
275
|
+
!0,
|
|
276
|
+
S,
|
|
277
|
+
I,
|
|
278
|
+
P ? Error("react-stack-top-frame") : fe,
|
|
279
|
+
P ? Q(s(i)) : be
|
|
280
|
+
);
|
|
281
|
+
};
|
|
282
|
+
}()), U;
|
|
283
|
+
}
|
|
284
|
+
var ye;
|
|
285
|
+
function mt() {
|
|
286
|
+
return ye || (ye = 1, process.env.NODE_ENV === "production" ? q.exports = dt() : q.exports = ut()), q.exports;
|
|
287
|
+
}
|
|
288
|
+
var r = mt();
|
|
289
|
+
const ht = ({ value: e, onChange: t, onClear: o }) => /* @__PURE__ */ r.jsx("div", { className: "p-2 border-b gap-4", "data-testid": "endpoints-search-container", children: /* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
|
|
290
|
+
/* @__PURE__ */ r.jsx(Ge, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
|
|
291
|
+
/* @__PURE__ */ r.jsx(
|
|
292
|
+
te,
|
|
293
|
+
{
|
|
294
|
+
variant: "shade",
|
|
295
|
+
value: e,
|
|
296
|
+
onChange: (s) => t(s.target.value),
|
|
297
|
+
className: "px-9 font-medium",
|
|
298
|
+
placeholder: "Search by Method or Path"
|
|
299
|
+
}
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ r.jsx(
|
|
302
|
+
W,
|
|
303
|
+
{
|
|
304
|
+
className: N(
|
|
305
|
+
"cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",
|
|
306
|
+
{
|
|
307
|
+
visible: e !== "",
|
|
308
|
+
invisible: e === ""
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
onClick: o
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
] }) }), pt = (e) => {
|
|
315
|
+
switch (e.toUpperCase()) {
|
|
316
|
+
case "POST":
|
|
317
|
+
return "bg-[#258DC3]/15 text-[#258DC3]";
|
|
318
|
+
case "GET":
|
|
319
|
+
return "bg-[#709A2D]/15 text-[#709A2D]";
|
|
320
|
+
case "DELETE":
|
|
321
|
+
return "bg-[#DE2134]/15 text-[#DE2134]";
|
|
322
|
+
case "PUT":
|
|
323
|
+
return "bg-[#B9922D]/15 text-[#B9922D]";
|
|
324
|
+
case "PATCH":
|
|
325
|
+
return "bg-[#B9922D]/15 text-[#B9922D]";
|
|
326
|
+
case "HEAD":
|
|
327
|
+
return "bg-[#E221DF]/15 text-[#E221DF]";
|
|
328
|
+
case "OPTIONS":
|
|
329
|
+
return "bg-[#B9922D]/15 text-[#B9922D]";
|
|
330
|
+
default:
|
|
331
|
+
return "bg-[#258DC3]/15 text-[#258DC3]";
|
|
332
|
+
}
|
|
333
|
+
}, gt = z(({ className: e, variant: t, ...o }) => {
|
|
334
|
+
const s = "rounded-lg px-2 py-0.5 text-xs font-mono font-bold transition-colors", n = pt(t);
|
|
335
|
+
return /* @__PURE__ */ r.jsx("div", { className: N(s, n, e), ...o });
|
|
336
|
+
}), je = () => /* @__PURE__ */ r.jsx("div", { className: "text-muted-foreground", children: "/" }), ce = ({ method: e, path: t }) => {
|
|
337
|
+
const o = F(() => {
|
|
338
|
+
const s = t.split("/").filter(Boolean), n = s.length - 1;
|
|
339
|
+
return s.flatMap((a, c) => {
|
|
340
|
+
const d = c === n, h = `part-${a}-${c}`, p = d ? void 0 : /* @__PURE__ */ r.jsx(je, {}, `separator-${h}`);
|
|
341
|
+
return a.startsWith(":") ? [
|
|
342
|
+
/* @__PURE__ */ r.jsx(
|
|
343
|
+
"div",
|
|
344
|
+
{
|
|
345
|
+
className: "bg-[#2862FE]/20 text-[#2862FE] rounded-sm px-1 py-0.5 text-sm font-mono font-bold font-medium",
|
|
346
|
+
children: a
|
|
347
|
+
},
|
|
348
|
+
h
|
|
349
|
+
),
|
|
350
|
+
p
|
|
351
|
+
] : [/* @__PURE__ */ r.jsx("div", { children: a }, h), p];
|
|
352
|
+
});
|
|
353
|
+
}, [t]);
|
|
354
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-[auto_1fr] gap-2 items-center", children: [
|
|
355
|
+
/* @__PURE__ */ r.jsx(gt, { variant: e, children: e }),
|
|
356
|
+
/* @__PURE__ */ r.jsxs("span", { className: "font-mono font-bold whitespace-nowrap flex flex-row gap-2 items-center truncate", children: [
|
|
357
|
+
/* @__PURE__ */ r.jsx(je, {}),
|
|
358
|
+
o
|
|
359
|
+
] })
|
|
360
|
+
] });
|
|
361
|
+
}, ft = ({ endpoint: e, isSelected: t, isLast: o, onSelect: s }) => /* @__PURE__ */ r.jsxs(
|
|
362
|
+
"div",
|
|
363
|
+
{
|
|
364
|
+
"data-testid": `endpoint-${e.method}-${e.path}`,
|
|
365
|
+
onClick: () => s(e.id),
|
|
366
|
+
className: N(
|
|
367
|
+
"grid grid-cols-[auto_1fr] items-center justify-center px-[17px] select-none hover:bg-muted-foreground/10 cursor-pointer",
|
|
368
|
+
t && "bg-muted-foreground/10"
|
|
369
|
+
),
|
|
370
|
+
children: [
|
|
371
|
+
o ? /* @__PURE__ */ r.jsx("svg", { width: "14", height: "34", viewBox: "0 0 12 34", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ r.jsx(
|
|
372
|
+
"path",
|
|
373
|
+
{
|
|
374
|
+
d: "M6.5 16.5C6.50006 19.2614 8.7386 21.4999 11.5 21.5C11.7759 21.5003 12 21.724 12 22C12 22.276 11.7759 22.4997 11.5 22.5C8.18632 22.4999 5.50006 19.8137 5.5 16.5V0H6.5V16.5Z",
|
|
375
|
+
className: "fill-[#555]"
|
|
376
|
+
}
|
|
377
|
+
) }) : /* @__PURE__ */ r.jsx("svg", { width: "14", height: "34", viewBox: "0 0 12 34", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ r.jsx(
|
|
378
|
+
"path",
|
|
379
|
+
{
|
|
380
|
+
d: "M6.5 0V11.5C6.50007 14.2614 8.73861 16.4999 11.5 16.5C11.7759 16.5003 12 16.724 12 17C12 17.276 11.7759 17.4997 11.5 17.5C9.41273 17.5 7.57486 16.4335 6.5 14.8164V34H5.5V0H6.5Z",
|
|
381
|
+
className: "fill-[#555]"
|
|
382
|
+
}
|
|
383
|
+
) }),
|
|
384
|
+
/* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-[auto_1fr] items-center gap-3 px-2", children: [
|
|
385
|
+
/* @__PURE__ */ r.jsx(ce, { method: e.method, path: e.path }),
|
|
386
|
+
/* @__PURE__ */ r.jsx("span", { className: "text-sm text-muted-foreground truncate", children: e.description })
|
|
387
|
+
] }) })
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
), bt = ({
|
|
391
|
+
flow: e,
|
|
392
|
+
endpoints: t,
|
|
393
|
+
isOpen: o,
|
|
394
|
+
isSelected: s,
|
|
395
|
+
onToggle: n,
|
|
396
|
+
onClearSelection: a,
|
|
397
|
+
selectedEndpointId: c,
|
|
398
|
+
onSelectEndpoint: d
|
|
399
|
+
}) => /* @__PURE__ */ r.jsxs("div", { className: "pt-2", children: [
|
|
400
|
+
/* @__PURE__ */ r.jsxs(
|
|
401
|
+
"button",
|
|
402
|
+
{
|
|
403
|
+
"data-testid": `flow-group-${e}`,
|
|
404
|
+
className: "w-full grid grid-cols-[auto_1fr] items-center gap-3 hover:bg-muted/40 cursor-pointer min-h-8.5 select-none hover:bg-muted-foreground/10 px-4",
|
|
405
|
+
onClick: () => {
|
|
406
|
+
s && a(), n(e);
|
|
407
|
+
},
|
|
408
|
+
children: [
|
|
409
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-1", children: [
|
|
410
|
+
/* @__PURE__ */ r.jsx(
|
|
411
|
+
Ye,
|
|
412
|
+
{
|
|
413
|
+
className: N("w-4 h-4 transition-transform duration-300 text-[#555]", { "rotate-180 mt-2.5": o }),
|
|
414
|
+
strokeWidth: 1.5
|
|
415
|
+
}
|
|
416
|
+
),
|
|
417
|
+
/* @__PURE__ */ r.jsx(
|
|
418
|
+
"svg",
|
|
419
|
+
{
|
|
420
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
421
|
+
width: "2",
|
|
422
|
+
height: "10",
|
|
423
|
+
viewBox: "0 0 2 10",
|
|
424
|
+
fill: "none",
|
|
425
|
+
className: N("ml-[7px]", { hidden: !o }),
|
|
426
|
+
children: /* @__PURE__ */ r.jsx(
|
|
427
|
+
"path",
|
|
428
|
+
{
|
|
429
|
+
d: "M1.5 1C1.5 0.723858 1.27614 0.5 1 0.5C0.723858 0.5 0.5 0.723858 0.5 1H1H1.5ZM1 1H0.5V10H1H1.5V1H1Z",
|
|
430
|
+
className: "fill-[#555]"
|
|
431
|
+
}
|
|
432
|
+
)
|
|
433
|
+
}
|
|
434
|
+
)
|
|
435
|
+
] }),
|
|
436
|
+
/* @__PURE__ */ r.jsx("h3", { className: "text-sm font-medium text-left", children: e })
|
|
437
|
+
]
|
|
438
|
+
}
|
|
439
|
+
),
|
|
440
|
+
/* @__PURE__ */ r.jsx("div", { className: N("grid grid-cols-1 items-center justify-center", { hidden: !o }), children: t.map((h, p) => /* @__PURE__ */ r.jsx(
|
|
441
|
+
ft,
|
|
442
|
+
{
|
|
443
|
+
endpoint: h,
|
|
444
|
+
isSelected: c === h.id,
|
|
445
|
+
isLast: p === t.length - 1,
|
|
446
|
+
onSelect: d
|
|
447
|
+
},
|
|
448
|
+
h.id
|
|
449
|
+
)) })
|
|
450
|
+
] }), Se = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, V = /* @__PURE__ */ new Map(), J = (e) => {
|
|
451
|
+
const t = V.get(e);
|
|
452
|
+
return t ? Object.fromEntries(
|
|
453
|
+
Object.entries(t.stores).map(([o, s]) => [o, s.getState()])
|
|
454
|
+
) : {};
|
|
455
|
+
}, vt = (e, t, o) => {
|
|
456
|
+
if (e === void 0)
|
|
457
|
+
return {
|
|
458
|
+
type: "untracked",
|
|
459
|
+
connection: t.connect(o)
|
|
460
|
+
};
|
|
461
|
+
const s = V.get(o.name);
|
|
462
|
+
if (s)
|
|
463
|
+
return { type: "tracked", store: e, ...s };
|
|
464
|
+
const n = {
|
|
465
|
+
connection: t.connect(o),
|
|
466
|
+
stores: {}
|
|
467
|
+
};
|
|
468
|
+
return V.set(o.name, n), { type: "tracked", store: e, ...n };
|
|
469
|
+
}, xt = (e, t) => {
|
|
470
|
+
if (t === void 0) return;
|
|
471
|
+
const o = V.get(e);
|
|
472
|
+
o && (delete o.stores[t], Object.keys(o.stores).length === 0 && V.delete(e));
|
|
473
|
+
}, kt = (e) => {
|
|
474
|
+
var t, o;
|
|
475
|
+
if (!e) return;
|
|
476
|
+
const s = e.split(`
|
|
477
|
+
`), n = s.findIndex(
|
|
478
|
+
(c) => c.includes("api.setState")
|
|
479
|
+
);
|
|
480
|
+
if (n < 0) return;
|
|
481
|
+
const a = ((t = s[n + 1]) == null ? void 0 : t.trim()) || "";
|
|
482
|
+
return (o = /.+ (.+) .+/.exec(a)) == null ? void 0 : o[1];
|
|
483
|
+
}, wt = (e, t = {}) => (o, s, n) => {
|
|
484
|
+
const { enabled: a, anonymousActionType: c, store: d, ...h } = t;
|
|
485
|
+
let p;
|
|
486
|
+
try {
|
|
487
|
+
p = (a ?? (Se ? "production" : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
488
|
+
} catch {
|
|
489
|
+
}
|
|
490
|
+
if (!p)
|
|
491
|
+
return e(o, s, n);
|
|
492
|
+
const { connection: l, ...f } = vt(d, p, h);
|
|
493
|
+
let m = !0;
|
|
494
|
+
n.setState = (u, y, v) => {
|
|
495
|
+
const x = o(u, y);
|
|
496
|
+
if (!m) return x;
|
|
497
|
+
const C = v === void 0 ? {
|
|
498
|
+
type: c || kt(new Error().stack) || "anonymous"
|
|
499
|
+
} : typeof v == "string" ? { type: v } : v;
|
|
500
|
+
return d === void 0 ? (l?.send(C, s()), x) : (l?.send(
|
|
501
|
+
{
|
|
502
|
+
...C,
|
|
503
|
+
type: `${d}/${C.type}`
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
...J(h.name),
|
|
507
|
+
[d]: n.getState()
|
|
508
|
+
}
|
|
509
|
+
), x);
|
|
510
|
+
}, n.devtools = {
|
|
511
|
+
cleanup: () => {
|
|
512
|
+
l && typeof l.unsubscribe == "function" && l.unsubscribe(), xt(h.name, d);
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
const b = (...u) => {
|
|
516
|
+
const y = m;
|
|
517
|
+
m = !1, o(...u), m = y;
|
|
518
|
+
}, w = e(n.setState, s, n);
|
|
519
|
+
if (f.type === "untracked" ? l?.init(w) : (f.stores[f.store] = n, l?.init(
|
|
520
|
+
Object.fromEntries(
|
|
521
|
+
Object.entries(f.stores).map(([u, y]) => [
|
|
522
|
+
u,
|
|
523
|
+
u === f.store ? w : y.getState()
|
|
524
|
+
])
|
|
525
|
+
)
|
|
526
|
+
)), n.dispatchFromDevtools && typeof n.dispatch == "function") {
|
|
527
|
+
let u = !1;
|
|
528
|
+
const y = n.dispatch;
|
|
529
|
+
n.dispatch = (...v) => {
|
|
530
|
+
(Se ? "production" : void 0) !== "production" && v[0].type === "__setState" && !u && (console.warn(
|
|
531
|
+
'[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'
|
|
532
|
+
), u = !0), y(...v);
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
return l.subscribe((u) => {
|
|
536
|
+
var y;
|
|
537
|
+
switch (u.type) {
|
|
538
|
+
case "ACTION":
|
|
539
|
+
if (typeof u.payload != "string") {
|
|
540
|
+
console.error(
|
|
541
|
+
"[zustand devtools middleware] Unsupported action format"
|
|
542
|
+
);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
return ee(
|
|
546
|
+
u.payload,
|
|
547
|
+
(v) => {
|
|
548
|
+
if (v.type === "__setState") {
|
|
549
|
+
if (d === void 0) {
|
|
550
|
+
b(v.state);
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
Object.keys(v.state).length !== 1 && console.error(
|
|
554
|
+
`
|
|
555
|
+
[zustand devtools middleware] Unsupported __setState action format.
|
|
556
|
+
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
557
|
+
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
558
|
+
`
|
|
559
|
+
);
|
|
560
|
+
const x = v.state[d];
|
|
561
|
+
if (x == null)
|
|
562
|
+
return;
|
|
563
|
+
JSON.stringify(n.getState()) !== JSON.stringify(x) && b(x);
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
n.dispatchFromDevtools && typeof n.dispatch == "function" && n.dispatch(v);
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
case "DISPATCH":
|
|
570
|
+
switch (u.payload.type) {
|
|
571
|
+
case "RESET":
|
|
572
|
+
return b(w), d === void 0 ? l?.init(n.getState()) : l?.init(J(h.name));
|
|
573
|
+
case "COMMIT":
|
|
574
|
+
if (d === void 0) {
|
|
575
|
+
l?.init(n.getState());
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
return l?.init(J(h.name));
|
|
579
|
+
case "ROLLBACK":
|
|
580
|
+
return ee(u.state, (v) => {
|
|
581
|
+
if (d === void 0) {
|
|
582
|
+
b(v), l?.init(n.getState());
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
b(v[d]), l?.init(J(h.name));
|
|
586
|
+
});
|
|
587
|
+
case "JUMP_TO_STATE":
|
|
588
|
+
case "JUMP_TO_ACTION":
|
|
589
|
+
return ee(u.state, (v) => {
|
|
590
|
+
if (d === void 0) {
|
|
591
|
+
b(v);
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
JSON.stringify(n.getState()) !== JSON.stringify(v[d]) && b(v[d]);
|
|
595
|
+
});
|
|
596
|
+
case "IMPORT_STATE": {
|
|
597
|
+
const { nextLiftedState: v } = u.payload, x = (y = v.computedStates.slice(-1)[0]) == null ? void 0 : y.state;
|
|
598
|
+
if (!x) return;
|
|
599
|
+
b(d === void 0 ? x : x[d]), l?.send(
|
|
600
|
+
null,
|
|
601
|
+
// FIXME no-any
|
|
602
|
+
v
|
|
603
|
+
);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
case "PAUSE_RECORDING":
|
|
607
|
+
return m = !m;
|
|
608
|
+
}
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
}), w;
|
|
612
|
+
}, yt = wt, ee = (e, t) => {
|
|
613
|
+
let o;
|
|
614
|
+
try {
|
|
615
|
+
o = JSON.parse(e);
|
|
616
|
+
} catch (s) {
|
|
617
|
+
console.error(
|
|
618
|
+
"[zustand devtools middleware] Could not parse the received json",
|
|
619
|
+
s
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
o !== void 0 && t(o);
|
|
623
|
+
};
|
|
624
|
+
function Ie(e, t) {
|
|
625
|
+
let o;
|
|
626
|
+
try {
|
|
627
|
+
o = e();
|
|
628
|
+
} catch {
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
return {
|
|
632
|
+
getItem: (n) => {
|
|
633
|
+
var a;
|
|
634
|
+
const c = (h) => h === null ? null : JSON.parse(h, void 0), d = (a = o.getItem(n)) != null ? a : null;
|
|
635
|
+
return d instanceof Promise ? d.then(c) : c(d);
|
|
636
|
+
},
|
|
637
|
+
setItem: (n, a) => o.setItem(n, JSON.stringify(a, void 0)),
|
|
638
|
+
removeItem: (n) => o.removeItem(n)
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
const re = (e) => (t) => {
|
|
642
|
+
try {
|
|
643
|
+
const o = e(t);
|
|
644
|
+
return o instanceof Promise ? o : {
|
|
645
|
+
then(s) {
|
|
646
|
+
return re(s)(o);
|
|
647
|
+
},
|
|
648
|
+
catch(s) {
|
|
649
|
+
return this;
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
} catch (o) {
|
|
653
|
+
return {
|
|
654
|
+
then(s) {
|
|
655
|
+
return this;
|
|
656
|
+
},
|
|
657
|
+
catch(s) {
|
|
658
|
+
return re(s)(o);
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
}, jt = (e, t) => (o, s, n) => {
|
|
663
|
+
let a = {
|
|
664
|
+
storage: Ie(() => localStorage),
|
|
665
|
+
partialize: (u) => u,
|
|
666
|
+
version: 0,
|
|
667
|
+
merge: (u, y) => ({
|
|
668
|
+
...y,
|
|
669
|
+
...u
|
|
670
|
+
}),
|
|
671
|
+
...t
|
|
672
|
+
}, c = !1;
|
|
673
|
+
const d = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
|
|
674
|
+
let p = a.storage;
|
|
675
|
+
if (!p)
|
|
676
|
+
return e(
|
|
677
|
+
(...u) => {
|
|
678
|
+
console.warn(
|
|
679
|
+
`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`
|
|
680
|
+
), o(...u);
|
|
681
|
+
},
|
|
682
|
+
s,
|
|
683
|
+
n
|
|
684
|
+
);
|
|
685
|
+
const l = () => {
|
|
686
|
+
const u = a.partialize({ ...s() });
|
|
687
|
+
return p.setItem(a.name, {
|
|
688
|
+
state: u,
|
|
689
|
+
version: a.version
|
|
690
|
+
});
|
|
691
|
+
}, f = n.setState;
|
|
692
|
+
n.setState = (u, y) => (f(u, y), l());
|
|
693
|
+
const m = e(
|
|
694
|
+
(...u) => (o(...u), l()),
|
|
695
|
+
s,
|
|
696
|
+
n
|
|
697
|
+
);
|
|
698
|
+
n.getInitialState = () => m;
|
|
699
|
+
let b;
|
|
700
|
+
const w = () => {
|
|
701
|
+
var u, y;
|
|
702
|
+
if (!p) return;
|
|
703
|
+
c = !1, d.forEach((x) => {
|
|
704
|
+
var C;
|
|
705
|
+
return x((C = s()) != null ? C : m);
|
|
706
|
+
});
|
|
707
|
+
const v = ((y = a.onRehydrateStorage) == null ? void 0 : y.call(a, (u = s()) != null ? u : m)) || void 0;
|
|
708
|
+
return re(p.getItem.bind(p))(a.name).then((x) => {
|
|
709
|
+
if (x)
|
|
710
|
+
if (typeof x.version == "number" && x.version !== a.version) {
|
|
711
|
+
if (a.migrate) {
|
|
712
|
+
const C = a.migrate(
|
|
713
|
+
x.state,
|
|
714
|
+
x.version
|
|
715
|
+
);
|
|
716
|
+
return C instanceof Promise ? C.then((H) => [!0, H]) : [!0, C];
|
|
717
|
+
}
|
|
718
|
+
console.error(
|
|
719
|
+
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
720
|
+
);
|
|
721
|
+
} else
|
|
722
|
+
return [!1, x.state];
|
|
723
|
+
return [!1, void 0];
|
|
724
|
+
}).then((x) => {
|
|
725
|
+
var C;
|
|
726
|
+
const [H, G] = x;
|
|
727
|
+
if (b = a.merge(
|
|
728
|
+
G,
|
|
729
|
+
(C = s()) != null ? C : m
|
|
730
|
+
), o(b, !0), H)
|
|
731
|
+
return l();
|
|
732
|
+
}).then(() => {
|
|
733
|
+
v?.(b, void 0), b = s(), c = !0, h.forEach((x) => x(b));
|
|
734
|
+
}).catch((x) => {
|
|
735
|
+
v?.(void 0, x);
|
|
736
|
+
});
|
|
737
|
+
};
|
|
738
|
+
return n.persist = {
|
|
739
|
+
setOptions: (u) => {
|
|
740
|
+
a = {
|
|
741
|
+
...a,
|
|
742
|
+
...u
|
|
743
|
+
}, u.storage && (p = u.storage);
|
|
744
|
+
},
|
|
745
|
+
clearStorage: () => {
|
|
746
|
+
p?.removeItem(a.name);
|
|
747
|
+
},
|
|
748
|
+
getOptions: () => a,
|
|
749
|
+
rehydrate: () => w(),
|
|
750
|
+
hasHydrated: () => c,
|
|
751
|
+
onHydrate: (u) => (d.add(u), () => {
|
|
752
|
+
d.delete(u);
|
|
753
|
+
}),
|
|
754
|
+
onFinishHydration: (u) => (h.add(u), () => {
|
|
755
|
+
h.delete(u);
|
|
756
|
+
})
|
|
757
|
+
}, a.skipHydration || w(), b || m;
|
|
758
|
+
}, St = jt, oe = {
|
|
759
|
+
CONTENT_TYPE: { name: "Content-Type", value: "application/json", active: !0 },
|
|
760
|
+
USER_AGENT: { name: "User-Agent", value: "Motia/1.0", active: !0 },
|
|
761
|
+
ACCEPT: { name: "Accept", value: "application/json", active: !0 }
|
|
762
|
+
}, de = (e) => {
|
|
763
|
+
const t = e.selectedEndpointId;
|
|
764
|
+
return t && e.headers[t] || oe;
|
|
765
|
+
}, Et = (e) => {
|
|
766
|
+
const t = e.selectedEndpointId;
|
|
767
|
+
return t ? e.bodyIsValid[t] : !0;
|
|
768
|
+
}, Fe = (e) => {
|
|
769
|
+
const t = e.selectedEndpointId;
|
|
770
|
+
return t && e.body[t] || "";
|
|
771
|
+
}, Ae = (e) => {
|
|
772
|
+
const t = e.selectedEndpointId;
|
|
773
|
+
if (t)
|
|
774
|
+
return e.response[t] || void 0;
|
|
775
|
+
}, ue = (e) => {
|
|
776
|
+
const t = e.selectedEndpointId;
|
|
777
|
+
return t ? e.queryParams[t] || {} : {};
|
|
778
|
+
}, De = (e) => {
|
|
779
|
+
const t = e.selectedEndpointId;
|
|
780
|
+
return t ? e.pathParams[t] || {} : {};
|
|
781
|
+
}, j = nt()(
|
|
782
|
+
St(
|
|
783
|
+
yt((e) => ({
|
|
784
|
+
selectedEndpointId: "",
|
|
785
|
+
headers: {},
|
|
786
|
+
body: {},
|
|
787
|
+
bodyIsValid: {},
|
|
788
|
+
response: {},
|
|
789
|
+
queryParams: {},
|
|
790
|
+
pathParams: {},
|
|
791
|
+
flowGroupStatus: {},
|
|
792
|
+
toggleFlowGroupStatus: (t) => e((o) => ({ flowGroupStatus: { ...o.flowGroupStatus, [t]: !o.flowGroupStatus[t] } })),
|
|
793
|
+
setSelectedEndpointId: (t) => e({ selectedEndpointId: t }),
|
|
794
|
+
setQueryParams: (t) => e((o) => ({ queryParams: { ...o.queryParams, [o.selectedEndpointId]: t } })),
|
|
795
|
+
removeQueryParams: (t) => e((o) => {
|
|
796
|
+
const s = { ...o.queryParams[o.selectedEndpointId] };
|
|
797
|
+
return delete s[t], {
|
|
798
|
+
queryParams: {
|
|
799
|
+
...o.queryParams,
|
|
800
|
+
[o.selectedEndpointId]: s
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
}),
|
|
804
|
+
setPathParams: (t) => e((o) => ({ pathParams: { ...o.pathParams, [o.selectedEndpointId]: t } })),
|
|
805
|
+
removePathParams: (t) => e((o) => {
|
|
806
|
+
const s = { ...o.pathParams[o.selectedEndpointId] };
|
|
807
|
+
return delete s[t], {
|
|
808
|
+
pathParams: {
|
|
809
|
+
...o.pathParams,
|
|
810
|
+
[o.selectedEndpointId]: s
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
}),
|
|
814
|
+
setHeaders: (t) => e((o) => ({ headers: { ...o.headers, [o.selectedEndpointId]: t } })),
|
|
815
|
+
setResponse: async (t, o) => {
|
|
816
|
+
if (!t) {
|
|
817
|
+
e((n) => ({
|
|
818
|
+
response: {
|
|
819
|
+
...n.response,
|
|
820
|
+
[n.selectedEndpointId]: void 0
|
|
821
|
+
}
|
|
822
|
+
}));
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
let s;
|
|
826
|
+
try {
|
|
827
|
+
const n = t?.headers.get("content-type") ?? "";
|
|
828
|
+
n.includes("text/") ? s = t ? await t.text() : void 0 : n.includes("application/json") ? s = t ? await t.json() : void 0 : (s = t ? await t.blob() : void 0, s.toJSON = () => "Preview not available");
|
|
829
|
+
} catch (n) {
|
|
830
|
+
console.error("Error setting response:", n);
|
|
831
|
+
}
|
|
832
|
+
e((n) => ({
|
|
833
|
+
response: {
|
|
834
|
+
...n.response,
|
|
835
|
+
[n.selectedEndpointId]: {
|
|
836
|
+
executionTime: Date.now() - o,
|
|
837
|
+
statusCode: t?.status,
|
|
838
|
+
headers: t?.headers ? Object.fromEntries(t.headers.entries()) : {},
|
|
839
|
+
body: s
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}));
|
|
843
|
+
},
|
|
844
|
+
setBody: (t) => e((o) => ({ body: { ...o.body, [o.selectedEndpointId]: t } })),
|
|
845
|
+
removeHeaders: (t) => e((o) => {
|
|
846
|
+
const n = { ...o.headers[o.selectedEndpointId] || oe };
|
|
847
|
+
return delete n[t], {
|
|
848
|
+
headers: {
|
|
849
|
+
...o.headers,
|
|
850
|
+
[o.selectedEndpointId]: n
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
}),
|
|
854
|
+
setBodyIsValid: (t) => e((o) => ({ bodyIsValid: { ...o.bodyIsValid, [o.selectedEndpointId]: t } }))
|
|
855
|
+
})),
|
|
856
|
+
{
|
|
857
|
+
name: "motia-endpoint-configuration",
|
|
858
|
+
storage: Ie(() => localStorage)
|
|
859
|
+
}
|
|
860
|
+
)
|
|
861
|
+
), Ct = () => {
|
|
862
|
+
const { data: e } = st({
|
|
863
|
+
streamName: "__motia.api-endpoints",
|
|
864
|
+
groupId: "default"
|
|
865
|
+
}), t = F(() => e.reduce(
|
|
866
|
+
(o, s) => (s.flows?.forEach((n) => {
|
|
867
|
+
o[n] = o[n] || [], o[n].push(s);
|
|
868
|
+
}), s.flows?.length == 0 && (o["no-flow"] = o["no-flow"] || [], o["no-flow"].push(s)), o),
|
|
869
|
+
{}
|
|
870
|
+
), [e]);
|
|
871
|
+
return { endpoints: e, groupedEndpoints: t };
|
|
872
|
+
}, Ee = (e) => Symbol.iterator in e, Ce = (e) => (
|
|
873
|
+
// HACK: avoid checking entries type
|
|
874
|
+
"entries" in e
|
|
875
|
+
), Ne = (e, t) => {
|
|
876
|
+
const o = e instanceof Map ? e : new Map(e.entries()), s = t instanceof Map ? t : new Map(t.entries());
|
|
877
|
+
if (o.size !== s.size)
|
|
878
|
+
return !1;
|
|
879
|
+
for (const [n, a] of o)
|
|
880
|
+
if (!s.has(n) || !Object.is(a, s.get(n)))
|
|
881
|
+
return !1;
|
|
882
|
+
return !0;
|
|
883
|
+
}, Nt = (e, t) => {
|
|
884
|
+
const o = e[Symbol.iterator](), s = t[Symbol.iterator]();
|
|
885
|
+
let n = o.next(), a = s.next();
|
|
886
|
+
for (; !n.done && !a.done; ) {
|
|
887
|
+
if (!Object.is(n.value, a.value))
|
|
888
|
+
return !1;
|
|
889
|
+
n = o.next(), a = s.next();
|
|
890
|
+
}
|
|
891
|
+
return !!n.done && !!a.done;
|
|
892
|
+
};
|
|
893
|
+
function Tt(e, t) {
|
|
894
|
+
return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null || Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) ? !1 : Ee(e) && Ee(t) ? Ce(e) && Ce(t) ? Ne(e, t) : Nt(e, t) : Ne(
|
|
895
|
+
{ entries: () => Object.entries(e) },
|
|
896
|
+
{ entries: () => Object.entries(t) }
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
function T(e) {
|
|
900
|
+
const t = Te.useRef(void 0);
|
|
901
|
+
return (o) => {
|
|
902
|
+
const s = e(o);
|
|
903
|
+
return Tt(t.current, s) ? t.current : t.current = s;
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
const $ = (e) => {
|
|
907
|
+
if (!e) return {};
|
|
908
|
+
if (e.type === "object") {
|
|
909
|
+
const t = {};
|
|
910
|
+
return e.properties && Object.entries(e.properties).forEach(([o, s]) => {
|
|
911
|
+
t[o] = $(s);
|
|
912
|
+
}), t;
|
|
913
|
+
}
|
|
914
|
+
switch (e.type) {
|
|
915
|
+
case "array":
|
|
916
|
+
return [$(e.items)];
|
|
917
|
+
case "string":
|
|
918
|
+
return e.enum?.[0] ?? e.description ?? "string";
|
|
919
|
+
case "number":
|
|
920
|
+
return e.description ?? 0;
|
|
921
|
+
case "integer":
|
|
922
|
+
return 0;
|
|
923
|
+
case "boolean":
|
|
924
|
+
return e.description ?? !1;
|
|
925
|
+
case "null":
|
|
926
|
+
return e.description ?? null;
|
|
927
|
+
default:
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
}, Pt = (e) => {
|
|
931
|
+
const [t, o] = _("");
|
|
932
|
+
return D(() => {
|
|
933
|
+
e && o(JSON.stringify($(e), null, 2));
|
|
934
|
+
}, [e]), { body: t, setBody: o };
|
|
935
|
+
}, Rt = ({ endpoint: e, panelName: t, value: o }) => ["post", "put", "patch"].includes(e.method.toLowerCase()) ? /* @__PURE__ */ r.jsx(se, { title: "Body", size: "sm", contentClassName: "p-0", "data-testid": `endpoint-body-panel__${t}`, children: /* @__PURE__ */ r.jsx(
|
|
936
|
+
Oe,
|
|
937
|
+
{
|
|
938
|
+
src: o ? JSON.parse(o) : {},
|
|
939
|
+
theme: "default",
|
|
940
|
+
enableClipboard: !1,
|
|
941
|
+
style: { backgroundColor: "transparent" }
|
|
942
|
+
}
|
|
943
|
+
) }) : null, _t = (e) => e.match(/:(\w+)/g)?.map((o) => o.slice(1)) ?? [], Ot = ({ endpoint: e }) => {
|
|
944
|
+
const t = _t(e.path);
|
|
945
|
+
return t.length ? /* @__PURE__ */ r.jsx(se, { title: "Path params", size: "sm", variant: "default", children: /* @__PURE__ */ r.jsx("div", { className: "grid gap-3", style: { gridTemplateColumns: "1fr 2fr" }, children: t.map((o) => /* @__PURE__ */ r.jsx("div", { className: "font-bold leading-[36px] flex text-xs", children: o }, o)) }) }) : null;
|
|
946
|
+
}, It = ({ endpoint: e }) => e.queryParams?.length ? /* @__PURE__ */ r.jsx(se, { title: "Query params", size: "sm", variant: "outlined", children: /* @__PURE__ */ r.jsx("div", { className: "grid gap-3", style: { gridTemplateColumns: "1fr 2fr", gridTemplateRows: "1fr 1fr" }, children: e.queryParams.map((t) => /* @__PURE__ */ r.jsxs($e, { children: [
|
|
947
|
+
/* @__PURE__ */ r.jsx("div", { className: "font-bold leading-[36px] flex text-xs", children: t.name }),
|
|
948
|
+
/* @__PURE__ */ r.jsx("div", { className: "flex items-center text-xs ", children: /* @__PURE__ */ r.jsx("span", { children: t.description }) })
|
|
949
|
+
] }, t.name)) }) }) : null, Ft = ({ responseCode: e, bodySchema: t }) => {
|
|
950
|
+
const o = le((a) => a.theme), s = F(() => $(t), [t]), n = typeof t.description == "string" ? t.description : "";
|
|
951
|
+
return /* @__PURE__ */ r.jsx(L, { value: e, className: "border-t", children: /* @__PURE__ */ r.jsx("div", { className: "text-xs font-mono rounded-lg whitespace-pre-wrap", children: s ? /* @__PURE__ */ r.jsx(
|
|
952
|
+
Oe,
|
|
953
|
+
{
|
|
954
|
+
src: s,
|
|
955
|
+
dark: o === "dark",
|
|
956
|
+
enableClipboard: !1,
|
|
957
|
+
style: { backgroundColor: "transparent" }
|
|
958
|
+
}
|
|
959
|
+
) : /* @__PURE__ */ r.jsx("div", { className: "text-xs font-mono rounded-lg whitespace-pre-wrap p-4", children: n }) }) }, e);
|
|
960
|
+
}, At = ({ items: e }) => e.length === 0 ? null : /* @__PURE__ */ r.jsx("div", { className: "flex flex-col rounded-lg border", children: /* @__PURE__ */ r.jsxs(ae, { defaultValue: e[0].responseCode, children: [
|
|
961
|
+
/* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-between bg-card", children: /* @__PURE__ */ r.jsx(ie, { className: "bg-transparent p-0", children: e.map((t) => /* @__PURE__ */ r.jsx(
|
|
962
|
+
M,
|
|
963
|
+
{
|
|
964
|
+
value: t.responseCode,
|
|
965
|
+
className: "text-xs font-bold cursor-pointer",
|
|
966
|
+
children: t.responseCode
|
|
967
|
+
},
|
|
968
|
+
t.responseCode
|
|
969
|
+
)) }) }),
|
|
970
|
+
e.map((t) => /* @__PURE__ */ r.jsx(Ft, { ...t }, t.responseCode))
|
|
971
|
+
] }) }), Dt = ({ endpoint: e, onClose: t }) => {
|
|
972
|
+
const { body: o } = Pt(e.bodySchema);
|
|
973
|
+
return /* @__PURE__ */ r.jsxs(
|
|
974
|
+
qe,
|
|
975
|
+
{
|
|
976
|
+
initialWidth: 600,
|
|
977
|
+
subtitle: e.description,
|
|
978
|
+
title: /* @__PURE__ */ r.jsx(ce, { method: e.method, path: e.path }),
|
|
979
|
+
onClose: t,
|
|
980
|
+
actions: [
|
|
981
|
+
{
|
|
982
|
+
icon: /* @__PURE__ */ r.jsx(W, { className: "cursor-pointer w-4 h-4", onClick: t }),
|
|
983
|
+
onClick: t
|
|
984
|
+
}
|
|
985
|
+
],
|
|
986
|
+
children: [
|
|
987
|
+
/* @__PURE__ */ r.jsx(Ot, { endpoint: e }),
|
|
988
|
+
/* @__PURE__ */ r.jsx(It, { endpoint: e }),
|
|
989
|
+
/* @__PURE__ */ r.jsx(Rt, { endpoint: e, panelName: "details", value: o }),
|
|
990
|
+
/* @__PURE__ */ r.jsx(
|
|
991
|
+
At,
|
|
992
|
+
{
|
|
993
|
+
items: Object.entries(e?.responseSchema ?? {}).map(([s, n]) => ({
|
|
994
|
+
responseCode: s,
|
|
995
|
+
bodySchema: n
|
|
996
|
+
}))
|
|
997
|
+
}
|
|
998
|
+
)
|
|
999
|
+
]
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
}, Mt = ({
|
|
1003
|
+
value: e,
|
|
1004
|
+
schema: t,
|
|
1005
|
+
onChange: o,
|
|
1006
|
+
onValidate: s,
|
|
1007
|
+
language: n = "json",
|
|
1008
|
+
readOnly: a = !1
|
|
1009
|
+
}) => {
|
|
1010
|
+
const c = it(), d = le((m) => m.theme), h = F(() => d === "dark" ? "transparent-dark" : "transparent-light", [d]), [p, l] = _(null), f = Pe(null);
|
|
1011
|
+
return D(() => {
|
|
1012
|
+
c && (c.editor.defineTheme("transparent-light", {
|
|
1013
|
+
base: "vs",
|
|
1014
|
+
inherit: !0,
|
|
1015
|
+
rules: [],
|
|
1016
|
+
colors: {
|
|
1017
|
+
"editor.background": "#00000000",
|
|
1018
|
+
"editor.lineHighlightBackground": "#00000000",
|
|
1019
|
+
"editorLineNumber.foreground": "#999999",
|
|
1020
|
+
"editorLineNumber.activeForeground": "#000000",
|
|
1021
|
+
focusBorder: "#00000000",
|
|
1022
|
+
"widget.border": "#00000000",
|
|
1023
|
+
"editor.border": "#00000000",
|
|
1024
|
+
"editorWidget.border": "#00000000"
|
|
1025
|
+
}
|
|
1026
|
+
}), c.editor.defineTheme("transparent-dark", {
|
|
1027
|
+
base: "vs-dark",
|
|
1028
|
+
inherit: !0,
|
|
1029
|
+
rules: [],
|
|
1030
|
+
colors: {
|
|
1031
|
+
"editor.background": "#00000000",
|
|
1032
|
+
"editor.lineHighlightBackground": "#00000000",
|
|
1033
|
+
"editorLineNumber.foreground": "#666666",
|
|
1034
|
+
"editorLineNumber.activeForeground": "#ffffff",
|
|
1035
|
+
focusBorder: "#00000000",
|
|
1036
|
+
"widget.border": "#00000000",
|
|
1037
|
+
"editor.border": "#00000000",
|
|
1038
|
+
"editorWidget.border": "#00000000"
|
|
1039
|
+
}
|
|
1040
|
+
}));
|
|
1041
|
+
}, [c]), D(() => {
|
|
1042
|
+
c && (c.languages.typescript.javascriptDefaults.setCompilerOptions({ isolatedModules: !0 }), c.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1043
|
+
schemas: t ? [
|
|
1044
|
+
{
|
|
1045
|
+
uri: window.location.href,
|
|
1046
|
+
fileMatch: ["*"],
|
|
1047
|
+
schema: t
|
|
1048
|
+
}
|
|
1049
|
+
] : []
|
|
1050
|
+
}));
|
|
1051
|
+
}, [c, t]), D(() => {
|
|
1052
|
+
c && c.editor.setTheme(h);
|
|
1053
|
+
}, [c, h]), D(() => {
|
|
1054
|
+
if (!p) return;
|
|
1055
|
+
const m = p.getContainerDomNode().parentElement?.parentElement;
|
|
1056
|
+
if (!m) return;
|
|
1057
|
+
const b = () => {
|
|
1058
|
+
f.current !== null && cancelAnimationFrame(f.current), f.current = requestAnimationFrame(() => {
|
|
1059
|
+
const { width: u, height: y } = m.getBoundingClientRect();
|
|
1060
|
+
p.layout({ width: u, height: y }), f.current = null;
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
b();
|
|
1064
|
+
const w = new ResizeObserver(b);
|
|
1065
|
+
return w.observe(m), () => {
|
|
1066
|
+
w.disconnect(), f.current !== null && cancelAnimationFrame(f.current);
|
|
1067
|
+
};
|
|
1068
|
+
}, [p]), /* @__PURE__ */ r.jsx(
|
|
1069
|
+
lt,
|
|
1070
|
+
{
|
|
1071
|
+
"data-testid": "json-editor",
|
|
1072
|
+
language: n,
|
|
1073
|
+
value: e,
|
|
1074
|
+
theme: h,
|
|
1075
|
+
onMount: l,
|
|
1076
|
+
onChange: (m) => {
|
|
1077
|
+
m || s?.(!1), o?.(m ?? "");
|
|
1078
|
+
},
|
|
1079
|
+
onValidate: (m) => s?.(m.length === 0),
|
|
1080
|
+
options: {
|
|
1081
|
+
automaticLayout: !1,
|
|
1082
|
+
readOnly: a,
|
|
1083
|
+
scrollBeyondLastLine: !1,
|
|
1084
|
+
minimap: { enabled: !1 },
|
|
1085
|
+
overviewRulerLanes: 0
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
);
|
|
1089
|
+
}, Lt = z(({ schema: e }) => {
|
|
1090
|
+
const { setBody: t, setBodyIsValid: o } = j(), s = j(T(Et)), n = j(Fe);
|
|
1091
|
+
D(() => {
|
|
1092
|
+
e && (t(n || JSON.stringify($(e), null, 2)), o(!0));
|
|
1093
|
+
}, [e]);
|
|
1094
|
+
const a = R(
|
|
1095
|
+
(c) => {
|
|
1096
|
+
t(c);
|
|
1097
|
+
},
|
|
1098
|
+
[t, o]
|
|
1099
|
+
);
|
|
1100
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "max-h-full h-full relative", children: [
|
|
1101
|
+
/* @__PURE__ */ r.jsx(Mt, { value: n, schema: e, onChange: a, onValidate: o }),
|
|
1102
|
+
!s && /* @__PURE__ */ r.jsxs(
|
|
1103
|
+
"div",
|
|
1104
|
+
{
|
|
1105
|
+
className: "absolute bottom-0 left-0 right-0 border-t border-border p-3 text-sm dark:text-yellow-500 text-yellow-700 flex items-center gap-1 font-medium",
|
|
1106
|
+
"data-testid": "endpoint-body-tab-invalid",
|
|
1107
|
+
children: [
|
|
1108
|
+
/* @__PURE__ */ r.jsx(Qe, { className: "w-4 h-4" }),
|
|
1109
|
+
"The body payload is invalid"
|
|
1110
|
+
]
|
|
1111
|
+
}
|
|
1112
|
+
)
|
|
1113
|
+
] });
|
|
1114
|
+
}), ne = z(
|
|
1115
|
+
({ value: e, id: t, onUpdate: o, onRemove: s, required: n = !1 }) => {
|
|
1116
|
+
const [a, c] = _(null), [d, h] = _(null), p = Pe(void 0), l = a === t, f = R(
|
|
1117
|
+
(w) => {
|
|
1118
|
+
clearTimeout(p.current), h(w), p.current = setTimeout(() => {
|
|
1119
|
+
h(null);
|
|
1120
|
+
}, 5e3);
|
|
1121
|
+
},
|
|
1122
|
+
[h]
|
|
1123
|
+
), m = R(() => {
|
|
1124
|
+
n || c(t);
|
|
1125
|
+
}, [t, n]), b = R(() => {
|
|
1126
|
+
n || c(null);
|
|
1127
|
+
}, [n]);
|
|
1128
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1129
|
+
"div",
|
|
1130
|
+
{
|
|
1131
|
+
className: N(
|
|
1132
|
+
"grid grid-cols-[auto_1fr_auto] items-center py-2 px-4 bg-muted/30 rounded-lg gap-2",
|
|
1133
|
+
l && "bg-card"
|
|
1134
|
+
),
|
|
1135
|
+
onMouseOver: m,
|
|
1136
|
+
onMouseLeave: b,
|
|
1137
|
+
children: [
|
|
1138
|
+
/* @__PURE__ */ r.jsx(
|
|
1139
|
+
Je,
|
|
1140
|
+
{
|
|
1141
|
+
checked: e.active,
|
|
1142
|
+
onCheckedChange: (w) => o(t, "active", w),
|
|
1143
|
+
disabled: n,
|
|
1144
|
+
children: /* @__PURE__ */ r.jsx(Re, { className: "h-3 w-3" })
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
1148
|
+
/* @__PURE__ */ r.jsx(
|
|
1149
|
+
te,
|
|
1150
|
+
{
|
|
1151
|
+
readOnly: n,
|
|
1152
|
+
disabled: !e.active,
|
|
1153
|
+
variant: n ? "outlineReadonly" : "outline",
|
|
1154
|
+
id: `name-${t}`,
|
|
1155
|
+
defaultValue: e.name,
|
|
1156
|
+
onBlur: (w) => o(t, "name", w.target.value),
|
|
1157
|
+
placeholder: "Name",
|
|
1158
|
+
className: "h-8"
|
|
1159
|
+
}
|
|
1160
|
+
),
|
|
1161
|
+
/* @__PURE__ */ r.jsx(
|
|
1162
|
+
te,
|
|
1163
|
+
{
|
|
1164
|
+
disabled: !e.active,
|
|
1165
|
+
variant: "outline",
|
|
1166
|
+
id: `value-${t}`,
|
|
1167
|
+
defaultValue: e.value,
|
|
1168
|
+
onBlur: (w) => o(t, "value", w.target.value),
|
|
1169
|
+
placeholder: "Value",
|
|
1170
|
+
className: "h-8"
|
|
1171
|
+
}
|
|
1172
|
+
)
|
|
1173
|
+
] }),
|
|
1174
|
+
/* @__PURE__ */ r.jsx(
|
|
1175
|
+
O,
|
|
1176
|
+
{
|
|
1177
|
+
variant: "ghost",
|
|
1178
|
+
size: "icon",
|
|
1179
|
+
onClick: () => {
|
|
1180
|
+
d === t ? s?.(t) : f(t);
|
|
1181
|
+
},
|
|
1182
|
+
className: N("h-6 w-6 opacity-0 transition-opacity duration-200", l && "opacity-100"),
|
|
1183
|
+
title: d === t && l ? "Click again to remove" : "Remove",
|
|
1184
|
+
children: d === t ? /* @__PURE__ */ r.jsx(Xe, { className: "h-3 w-3 text-destructive" }) : /* @__PURE__ */ r.jsx(Ze, { className: "h-3 w-3" })
|
|
1185
|
+
}
|
|
1186
|
+
)
|
|
1187
|
+
]
|
|
1188
|
+
}
|
|
1189
|
+
);
|
|
1190
|
+
}
|
|
1191
|
+
), zt = () => {
|
|
1192
|
+
const { setHeaders: e, removeHeaders: t } = j(), o = j(T(de)), s = R(() => {
|
|
1193
|
+
const a = {
|
|
1194
|
+
name: "",
|
|
1195
|
+
value: "",
|
|
1196
|
+
active: !0
|
|
1197
|
+
};
|
|
1198
|
+
e({ ...o, [(/* @__PURE__ */ new Date()).getTime().toString()]: a });
|
|
1199
|
+
}, [o, e]), n = R(
|
|
1200
|
+
(a, c, d) => {
|
|
1201
|
+
a && e({ ...o, [a]: { ...o[a], [c]: d } });
|
|
1202
|
+
},
|
|
1203
|
+
[o, e]
|
|
1204
|
+
);
|
|
1205
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "h-full max-h-full grid grid-rows-[auto_1fr]", children: [
|
|
1206
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid px-4 border-b h-10 items-center grid-cols-[auto_1fr]", children: /* @__PURE__ */ r.jsxs(O, { size: "sm", onClick: s, children: [
|
|
1207
|
+
/* @__PURE__ */ r.jsx(_e, { className: "h-3 w-3" }),
|
|
1208
|
+
"Add"
|
|
1209
|
+
] }) }),
|
|
1210
|
+
/* @__PURE__ */ r.jsxs("div", { className: "p-2", children: [
|
|
1211
|
+
Object.entries(o).map(([a, c]) => /* @__PURE__ */ r.jsx(ne, { value: c, id: a, onUpdate: n, onRemove: t }, a)),
|
|
1212
|
+
Object.entries(o).length === 0 && /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-1 items-center h-full", children: /* @__PURE__ */ r.jsx("div", { className: "text-sm text-muted-foreground text-center", children: "There are no headers in this endpoint" }) })
|
|
1213
|
+
] })
|
|
1214
|
+
] });
|
|
1215
|
+
}, Ht = (e) => Object.values(ue(e)).filter(
|
|
1216
|
+
(t) => t.active && t.value !== "" && t.name !== ""
|
|
1217
|
+
), Me = (e) => {
|
|
1218
|
+
const t = j(T(De)), o = j(T(Ht));
|
|
1219
|
+
return F(() => e.replace(/:(\w+)/g, (n, a) => t[a]?.value || n) + (o.length > 0 ? `?${o.map((n) => `${n.name}=${n.value}`).join("&")}` : ""), [e, t, o]);
|
|
1220
|
+
}, Bt = ({ path: e, baseUrl: t = window.location.origin }) => {
|
|
1221
|
+
const o = Me(e), s = `${t}${o}`, [n, a] = _(!1), c = async () => {
|
|
1222
|
+
try {
|
|
1223
|
+
await navigator.clipboard.writeText(s), a(!0), setTimeout(() => a(!1), 2e3);
|
|
1224
|
+
} catch (d) {
|
|
1225
|
+
console.error("Failed to copy URL:", d);
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-[auto_1fr] items-center gap-5 px-5 relative border-b border-border", children: [
|
|
1229
|
+
/* @__PURE__ */ r.jsx("div", { className: "text-sm font-medium py-2", children: "URL Preview" }),
|
|
1230
|
+
/* @__PURE__ */ r.jsxs("div", { className: "bg-muted-foreground/10 box-border grid grid-cols-[1fr_auto] gap-1 h-6 items-center px-2 py-1 rounded border border-border", children: [
|
|
1231
|
+
/* @__PURE__ */ r.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ r.jsx("div", { className: "font-medium text-xs text-muted-foreground truncate", title: s, children: s }) }),
|
|
1232
|
+
/* @__PURE__ */ r.jsx(
|
|
1233
|
+
O,
|
|
1234
|
+
{
|
|
1235
|
+
onClick: c,
|
|
1236
|
+
className: N(
|
|
1237
|
+
"w-3 h-3 grid place-items-center transition-colors cursor-pointer",
|
|
1238
|
+
n ? "text-green-400" : "text-muted-foreground"
|
|
1239
|
+
),
|
|
1240
|
+
variant: "icon",
|
|
1241
|
+
size: "sm",
|
|
1242
|
+
"aria-label": "Copy URL",
|
|
1243
|
+
children: n ? /* @__PURE__ */ r.jsx(Re, { className: "w-2.5 h-2.5" }) : /* @__PURE__ */ r.jsx(Ke, { className: "w-2.5 h-2.5" })
|
|
1244
|
+
}
|
|
1245
|
+
)
|
|
1246
|
+
] })
|
|
1247
|
+
] });
|
|
1248
|
+
}, Ut = ({ path: e }) => {
|
|
1249
|
+
const { setQueryParams: t, removeQueryParams: o, setPathParams: s } = j(), n = j(T(ue)), a = j(T(De)), c = F(() => e.match(/:(\w+)/g)?.map((f) => ({ name: f.slice(1), value: a[f.slice(1)]?.value ?? "", active: !0 })) ?? [], [e]), d = R(() => {
|
|
1250
|
+
const l = {
|
|
1251
|
+
name: "",
|
|
1252
|
+
value: "",
|
|
1253
|
+
active: !0
|
|
1254
|
+
};
|
|
1255
|
+
t({ ...n, [(/* @__PURE__ */ new Date()).getTime().toString()]: l });
|
|
1256
|
+
}, [n, t]), h = R(
|
|
1257
|
+
(l, f, m) => {
|
|
1258
|
+
l && t({ ...n, [l]: { ...n[l], [f]: m } });
|
|
1259
|
+
},
|
|
1260
|
+
[n, t]
|
|
1261
|
+
), p = R(
|
|
1262
|
+
(l, f, m) => {
|
|
1263
|
+
l && s({ ...a, [l]: { ...a[l], [f]: m } });
|
|
1264
|
+
},
|
|
1265
|
+
[a, s]
|
|
1266
|
+
);
|
|
1267
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "h-full grid grid-rows-[auto_auto_1fr]", children: [
|
|
1268
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid px-4 border-b h-10 items-center grid-cols-[auto_1fr]", children: /* @__PURE__ */ r.jsxs(O, { size: "sm", onClick: d, children: [
|
|
1269
|
+
/* @__PURE__ */ r.jsx(_e, { className: "h-3 w-3" }),
|
|
1270
|
+
"Add"
|
|
1271
|
+
] }) }),
|
|
1272
|
+
/* @__PURE__ */ r.jsx(Bt, { path: e }),
|
|
1273
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-rows-[1fr_1fr]", children: [
|
|
1274
|
+
c.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: "p-2", children: [
|
|
1275
|
+
/* @__PURE__ */ r.jsx("div", { className: "text-sm font-medium pl-3", children: "Path variables" }),
|
|
1276
|
+
c.map((l) => /* @__PURE__ */ r.jsx(
|
|
1277
|
+
ne,
|
|
1278
|
+
{
|
|
1279
|
+
value: { name: l.name, value: l.value, active: l.active },
|
|
1280
|
+
id: l.name,
|
|
1281
|
+
required: !0,
|
|
1282
|
+
onUpdate: p
|
|
1283
|
+
},
|
|
1284
|
+
l.name
|
|
1285
|
+
))
|
|
1286
|
+
] }),
|
|
1287
|
+
/* @__PURE__ */ r.jsxs("div", { className: "p-2 border-b border-border", children: [
|
|
1288
|
+
/* @__PURE__ */ r.jsx("div", { className: "text-sm font-medium pl-3", children: "Query parameters" }),
|
|
1289
|
+
Object.entries(n).map(([l, f]) => /* @__PURE__ */ r.jsx(
|
|
1290
|
+
ne,
|
|
1291
|
+
{
|
|
1292
|
+
value: f,
|
|
1293
|
+
id: l,
|
|
1294
|
+
onUpdate: h,
|
|
1295
|
+
onRemove: o
|
|
1296
|
+
},
|
|
1297
|
+
l
|
|
1298
|
+
)),
|
|
1299
|
+
Object.entries(n).length === 0 && /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-1 items-center h-full", children: /* @__PURE__ */ r.jsx("div", { className: "text-sm text-muted-foreground text-center", children: "There are no query params in this endpoint" }) })
|
|
1300
|
+
] })
|
|
1301
|
+
] })
|
|
1302
|
+
] });
|
|
1303
|
+
}, Vt = (e) => {
|
|
1304
|
+
const { __motia: t, ...o } = typeof e == "string" ? {} : e || {}, { data: s } = at(t), n = Array.isArray(e) ? e : o || e;
|
|
1305
|
+
return typeof e == "string" ? {
|
|
1306
|
+
data: e,
|
|
1307
|
+
originalData: e,
|
|
1308
|
+
isStreamed: !1
|
|
1309
|
+
} : {
|
|
1310
|
+
data: JSON.stringify(s || n, null, 2),
|
|
1311
|
+
originalData: n,
|
|
1312
|
+
isStreamed: !!t
|
|
1313
|
+
};
|
|
1314
|
+
}, $t = {
|
|
1315
|
+
// 1xx Informational
|
|
1316
|
+
100: "Continue",
|
|
1317
|
+
101: "Switching Protocols",
|
|
1318
|
+
102: "Processing",
|
|
1319
|
+
103: "Early Hints",
|
|
1320
|
+
// 2xx Success
|
|
1321
|
+
200: "OK",
|
|
1322
|
+
201: "Created",
|
|
1323
|
+
202: "Accepted",
|
|
1324
|
+
203: "Non-Authoritative Information",
|
|
1325
|
+
204: "No Content",
|
|
1326
|
+
205: "Reset Content",
|
|
1327
|
+
206: "Partial Content",
|
|
1328
|
+
207: "Multi-Status",
|
|
1329
|
+
208: "Already Reported",
|
|
1330
|
+
226: "IM Used",
|
|
1331
|
+
// 3xx Redirection
|
|
1332
|
+
300: "Multiple Choices",
|
|
1333
|
+
301: "Moved Permanently",
|
|
1334
|
+
302: "Found",
|
|
1335
|
+
303: "See Other",
|
|
1336
|
+
304: "Not Modified",
|
|
1337
|
+
305: "Use Proxy",
|
|
1338
|
+
307: "Temporary Redirect",
|
|
1339
|
+
308: "Permanent Redirect",
|
|
1340
|
+
// 4xx Client Error
|
|
1341
|
+
400: "Bad Request",
|
|
1342
|
+
401: "Unauthorized",
|
|
1343
|
+
402: "Payment Required",
|
|
1344
|
+
403: "Forbidden",
|
|
1345
|
+
404: "Not Found",
|
|
1346
|
+
405: "Method Not Allowed",
|
|
1347
|
+
406: "Not Acceptable",
|
|
1348
|
+
407: "Proxy Authentication Required",
|
|
1349
|
+
408: "Request Timeout",
|
|
1350
|
+
409: "Conflict",
|
|
1351
|
+
410: "Gone",
|
|
1352
|
+
411: "Length Required",
|
|
1353
|
+
412: "Precondition Failed",
|
|
1354
|
+
413: "Payload Too Large",
|
|
1355
|
+
414: "URI Too Long",
|
|
1356
|
+
415: "Unsupported Media Type",
|
|
1357
|
+
416: "Range Not Satisfiable",
|
|
1358
|
+
417: "Expectation Failed",
|
|
1359
|
+
418: "I'm a teapot",
|
|
1360
|
+
421: "Misdirected Request",
|
|
1361
|
+
422: "Unprocessable Entity",
|
|
1362
|
+
423: "Locked",
|
|
1363
|
+
424: "Failed Dependency",
|
|
1364
|
+
425: "Too Early",
|
|
1365
|
+
426: "Upgrade Required",
|
|
1366
|
+
428: "Precondition Required",
|
|
1367
|
+
429: "Too Many Requests",
|
|
1368
|
+
431: "Request Header Fields Too Large",
|
|
1369
|
+
451: "Unavailable For Legal Reasons",
|
|
1370
|
+
// 5xx Server Error
|
|
1371
|
+
500: "Internal Server Error",
|
|
1372
|
+
501: "Not Implemented",
|
|
1373
|
+
502: "Bad Gateway",
|
|
1374
|
+
503: "Service Unavailable",
|
|
1375
|
+
504: "Gateway Timeout",
|
|
1376
|
+
505: "HTTP Version Not Supported",
|
|
1377
|
+
506: "Variant Also Negotiates",
|
|
1378
|
+
507: "Insufficient Storage",
|
|
1379
|
+
508: "Loop Detected",
|
|
1380
|
+
510: "Not Extended",
|
|
1381
|
+
511: "Network Authentication Required"
|
|
1382
|
+
}, qt = (e) => $t[e] || "Unknown", Jt = ({ statusCode: e }) => {
|
|
1383
|
+
const t = qt(e), o = e > 0 && e < 400, s = e >= 400 && e < 500, n = e >= 500;
|
|
1384
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1385
|
+
"div",
|
|
1386
|
+
{
|
|
1387
|
+
className: N(
|
|
1388
|
+
"px-2 py-1 rounded-sm flex items-center gap-1",
|
|
1389
|
+
s && "dark:bg-[#EAB71F]/20 dark:text-[#EAB71F] bg-[#EAB71F] text-white",
|
|
1390
|
+
n && "dark:bg-[#F8367D]/20 dark:text-[#F8367D] bg-[#F8367D] text-white",
|
|
1391
|
+
o && "dark:bg-accent-200 dark:text-primary bg-accent text-white"
|
|
1392
|
+
),
|
|
1393
|
+
children: [
|
|
1394
|
+
/* @__PURE__ */ r.jsx("span", { className: "font-bold font-mono", children: e }),
|
|
1395
|
+
" ",
|
|
1396
|
+
t
|
|
1397
|
+
]
|
|
1398
|
+
}
|
|
1399
|
+
);
|
|
1400
|
+
}, Wt = {
|
|
1401
|
+
'code[class*="language-"]': {
|
|
1402
|
+
color: "#c5c8c6",
|
|
1403
|
+
textShadow: "0 1px rgba(0, 0, 0, 0.3)",
|
|
1404
|
+
fontFamily: "Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",
|
|
1405
|
+
direction: "ltr",
|
|
1406
|
+
textAlign: "left",
|
|
1407
|
+
whiteSpace: "pre",
|
|
1408
|
+
wordSpacing: "normal",
|
|
1409
|
+
wordBreak: "normal",
|
|
1410
|
+
lineHeight: "1.5",
|
|
1411
|
+
MozTabSize: "4",
|
|
1412
|
+
OTabSize: "4",
|
|
1413
|
+
tabSize: "4",
|
|
1414
|
+
WebkitHyphens: "none",
|
|
1415
|
+
MozHyphens: "none",
|
|
1416
|
+
msHyphens: "none",
|
|
1417
|
+
hyphens: "none"
|
|
1418
|
+
},
|
|
1419
|
+
'pre[class*="language-"]': {
|
|
1420
|
+
color: "#c5c8c6",
|
|
1421
|
+
textShadow: "0 1px rgba(0, 0, 0, 0.3)",
|
|
1422
|
+
fontFamily: "Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",
|
|
1423
|
+
direction: "ltr",
|
|
1424
|
+
textAlign: "left",
|
|
1425
|
+
whiteSpace: "pre",
|
|
1426
|
+
wordSpacing: "normal",
|
|
1427
|
+
wordBreak: "normal",
|
|
1428
|
+
lineHeight: "1.5",
|
|
1429
|
+
MozTabSize: "4",
|
|
1430
|
+
OTabSize: "4",
|
|
1431
|
+
tabSize: "4",
|
|
1432
|
+
WebkitHyphens: "none",
|
|
1433
|
+
MozHyphens: "none",
|
|
1434
|
+
msHyphens: "none",
|
|
1435
|
+
hyphens: "none",
|
|
1436
|
+
padding: "1em",
|
|
1437
|
+
margin: ".5em 0",
|
|
1438
|
+
overflow: "auto",
|
|
1439
|
+
borderRadius: "0.3em",
|
|
1440
|
+
background: "#1d1f21"
|
|
1441
|
+
},
|
|
1442
|
+
':not(pre) > code[class*="language-"]': {
|
|
1443
|
+
background: "#1d1f21",
|
|
1444
|
+
padding: ".1em",
|
|
1445
|
+
borderRadius: ".3em"
|
|
1446
|
+
},
|
|
1447
|
+
comment: {
|
|
1448
|
+
color: "#7C7C7C"
|
|
1449
|
+
},
|
|
1450
|
+
prolog: {
|
|
1451
|
+
color: "#7C7C7C"
|
|
1452
|
+
},
|
|
1453
|
+
doctype: {
|
|
1454
|
+
color: "#7C7C7C"
|
|
1455
|
+
},
|
|
1456
|
+
cdata: {
|
|
1457
|
+
color: "#7C7C7C"
|
|
1458
|
+
},
|
|
1459
|
+
punctuation: {
|
|
1460
|
+
color: "#c5c8c6"
|
|
1461
|
+
},
|
|
1462
|
+
".namespace": {
|
|
1463
|
+
Opacity: ".7"
|
|
1464
|
+
},
|
|
1465
|
+
property: {
|
|
1466
|
+
color: "#96CBFE"
|
|
1467
|
+
},
|
|
1468
|
+
keyword: {
|
|
1469
|
+
color: "#96CBFE"
|
|
1470
|
+
},
|
|
1471
|
+
tag: {
|
|
1472
|
+
color: "#96CBFE"
|
|
1473
|
+
},
|
|
1474
|
+
"class-name": {
|
|
1475
|
+
color: "#FFFFB6",
|
|
1476
|
+
textDecoration: "underline"
|
|
1477
|
+
},
|
|
1478
|
+
boolean: {
|
|
1479
|
+
color: "#99CC99"
|
|
1480
|
+
},
|
|
1481
|
+
constant: {
|
|
1482
|
+
color: "#99CC99"
|
|
1483
|
+
},
|
|
1484
|
+
symbol: {
|
|
1485
|
+
color: "#f92672"
|
|
1486
|
+
},
|
|
1487
|
+
deleted: {
|
|
1488
|
+
color: "#f92672"
|
|
1489
|
+
},
|
|
1490
|
+
number: {
|
|
1491
|
+
color: "#FF73FD"
|
|
1492
|
+
},
|
|
1493
|
+
selector: {
|
|
1494
|
+
color: "#A8FF60"
|
|
1495
|
+
},
|
|
1496
|
+
"attr-name": {
|
|
1497
|
+
color: "#A8FF60"
|
|
1498
|
+
},
|
|
1499
|
+
string: {
|
|
1500
|
+
color: "#A8FF60"
|
|
1501
|
+
},
|
|
1502
|
+
char: {
|
|
1503
|
+
color: "#A8FF60"
|
|
1504
|
+
},
|
|
1505
|
+
builtin: {
|
|
1506
|
+
color: "#A8FF60"
|
|
1507
|
+
},
|
|
1508
|
+
inserted: {
|
|
1509
|
+
color: "#A8FF60"
|
|
1510
|
+
},
|
|
1511
|
+
variable: {
|
|
1512
|
+
color: "#C6C5FE"
|
|
1513
|
+
},
|
|
1514
|
+
operator: {
|
|
1515
|
+
color: "#EDEDED"
|
|
1516
|
+
},
|
|
1517
|
+
entity: {
|
|
1518
|
+
color: "#FFFFB6",
|
|
1519
|
+
cursor: "help"
|
|
1520
|
+
},
|
|
1521
|
+
url: {
|
|
1522
|
+
color: "#96CBFE"
|
|
1523
|
+
},
|
|
1524
|
+
".language-css .token.string": {
|
|
1525
|
+
color: "#87C38A"
|
|
1526
|
+
},
|
|
1527
|
+
".style .token.string": {
|
|
1528
|
+
color: "#87C38A"
|
|
1529
|
+
},
|
|
1530
|
+
atrule: {
|
|
1531
|
+
color: "#F9EE98"
|
|
1532
|
+
},
|
|
1533
|
+
"attr-value": {
|
|
1534
|
+
color: "#F9EE98"
|
|
1535
|
+
},
|
|
1536
|
+
function: {
|
|
1537
|
+
color: "#DAD085"
|
|
1538
|
+
},
|
|
1539
|
+
regex: {
|
|
1540
|
+
color: "#E9C062"
|
|
1541
|
+
},
|
|
1542
|
+
important: {
|
|
1543
|
+
color: "#fd971f",
|
|
1544
|
+
fontWeight: "bold"
|
|
1545
|
+
},
|
|
1546
|
+
bold: {
|
|
1547
|
+
fontWeight: "bold"
|
|
1548
|
+
},
|
|
1549
|
+
italic: {
|
|
1550
|
+
fontStyle: "italic"
|
|
1551
|
+
}
|
|
1552
|
+
}, Gt = {
|
|
1553
|
+
'code[class*="language-"]': {
|
|
1554
|
+
background: "hsl(230, 1%, 98%)",
|
|
1555
|
+
color: "hsl(230, 8%, 24%)",
|
|
1556
|
+
fontFamily: '"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',
|
|
1557
|
+
direction: "ltr",
|
|
1558
|
+
textAlign: "left",
|
|
1559
|
+
whiteSpace: "pre",
|
|
1560
|
+
wordSpacing: "normal",
|
|
1561
|
+
wordBreak: "normal",
|
|
1562
|
+
lineHeight: "1.5",
|
|
1563
|
+
MozTabSize: "2",
|
|
1564
|
+
OTabSize: "2",
|
|
1565
|
+
tabSize: "2",
|
|
1566
|
+
WebkitHyphens: "none",
|
|
1567
|
+
MozHyphens: "none",
|
|
1568
|
+
msHyphens: "none",
|
|
1569
|
+
hyphens: "none"
|
|
1570
|
+
},
|
|
1571
|
+
'pre[class*="language-"]': {
|
|
1572
|
+
background: "hsl(230, 1%, 98%)",
|
|
1573
|
+
color: "hsl(230, 8%, 24%)",
|
|
1574
|
+
fontFamily: '"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',
|
|
1575
|
+
direction: "ltr",
|
|
1576
|
+
textAlign: "left",
|
|
1577
|
+
whiteSpace: "pre",
|
|
1578
|
+
wordSpacing: "normal",
|
|
1579
|
+
wordBreak: "normal",
|
|
1580
|
+
lineHeight: "1.5",
|
|
1581
|
+
MozTabSize: "2",
|
|
1582
|
+
OTabSize: "2",
|
|
1583
|
+
tabSize: "2",
|
|
1584
|
+
WebkitHyphens: "none",
|
|
1585
|
+
MozHyphens: "none",
|
|
1586
|
+
msHyphens: "none",
|
|
1587
|
+
hyphens: "none",
|
|
1588
|
+
padding: "1em",
|
|
1589
|
+
margin: "0.5em 0",
|
|
1590
|
+
overflow: "auto",
|
|
1591
|
+
borderRadius: "0.3em"
|
|
1592
|
+
},
|
|
1593
|
+
'code[class*="language-"]::-moz-selection': {
|
|
1594
|
+
background: "hsl(230, 1%, 90%)",
|
|
1595
|
+
color: "inherit"
|
|
1596
|
+
},
|
|
1597
|
+
'code[class*="language-"] *::-moz-selection': {
|
|
1598
|
+
background: "hsl(230, 1%, 90%)",
|
|
1599
|
+
color: "inherit"
|
|
1600
|
+
},
|
|
1601
|
+
'pre[class*="language-"] *::-moz-selection': {
|
|
1602
|
+
background: "hsl(230, 1%, 90%)",
|
|
1603
|
+
color: "inherit"
|
|
1604
|
+
},
|
|
1605
|
+
'code[class*="language-"]::selection': {
|
|
1606
|
+
background: "hsl(230, 1%, 90%)",
|
|
1607
|
+
color: "inherit"
|
|
1608
|
+
},
|
|
1609
|
+
'code[class*="language-"] *::selection': {
|
|
1610
|
+
background: "hsl(230, 1%, 90%)",
|
|
1611
|
+
color: "inherit"
|
|
1612
|
+
},
|
|
1613
|
+
'pre[class*="language-"] *::selection': {
|
|
1614
|
+
background: "hsl(230, 1%, 90%)",
|
|
1615
|
+
color: "inherit"
|
|
1616
|
+
},
|
|
1617
|
+
':not(pre) > code[class*="language-"]': {
|
|
1618
|
+
padding: "0.2em 0.3em",
|
|
1619
|
+
borderRadius: "0.3em",
|
|
1620
|
+
whiteSpace: "normal"
|
|
1621
|
+
},
|
|
1622
|
+
comment: {
|
|
1623
|
+
color: "hsl(230, 4%, 64%)",
|
|
1624
|
+
fontStyle: "italic"
|
|
1625
|
+
},
|
|
1626
|
+
prolog: {
|
|
1627
|
+
color: "hsl(230, 4%, 64%)"
|
|
1628
|
+
},
|
|
1629
|
+
cdata: {
|
|
1630
|
+
color: "hsl(230, 4%, 64%)"
|
|
1631
|
+
},
|
|
1632
|
+
doctype: {
|
|
1633
|
+
color: "hsl(230, 8%, 24%)"
|
|
1634
|
+
},
|
|
1635
|
+
punctuation: {
|
|
1636
|
+
color: "hsl(230, 8%, 24%)"
|
|
1637
|
+
},
|
|
1638
|
+
entity: {
|
|
1639
|
+
color: "hsl(230, 8%, 24%)",
|
|
1640
|
+
cursor: "help"
|
|
1641
|
+
},
|
|
1642
|
+
"attr-name": {
|
|
1643
|
+
color: "hsl(35, 99%, 36%)"
|
|
1644
|
+
},
|
|
1645
|
+
"class-name": {
|
|
1646
|
+
color: "hsl(35, 99%, 36%)"
|
|
1647
|
+
},
|
|
1648
|
+
boolean: {
|
|
1649
|
+
color: "hsl(35, 99%, 36%)"
|
|
1650
|
+
},
|
|
1651
|
+
constant: {
|
|
1652
|
+
color: "hsl(35, 99%, 36%)"
|
|
1653
|
+
},
|
|
1654
|
+
number: {
|
|
1655
|
+
color: "hsl(35, 99%, 36%)"
|
|
1656
|
+
},
|
|
1657
|
+
atrule: {
|
|
1658
|
+
color: "hsl(35, 99%, 36%)"
|
|
1659
|
+
},
|
|
1660
|
+
keyword: {
|
|
1661
|
+
color: "hsl(301, 63%, 40%)"
|
|
1662
|
+
},
|
|
1663
|
+
property: {
|
|
1664
|
+
color: "hsl(5, 74%, 59%)"
|
|
1665
|
+
},
|
|
1666
|
+
tag: {
|
|
1667
|
+
color: "hsl(5, 74%, 59%)"
|
|
1668
|
+
},
|
|
1669
|
+
symbol: {
|
|
1670
|
+
color: "hsl(5, 74%, 59%)"
|
|
1671
|
+
},
|
|
1672
|
+
deleted: {
|
|
1673
|
+
color: "hsl(5, 74%, 59%)"
|
|
1674
|
+
},
|
|
1675
|
+
important: {
|
|
1676
|
+
color: "hsl(5, 74%, 59%)"
|
|
1677
|
+
},
|
|
1678
|
+
selector: {
|
|
1679
|
+
color: "hsl(119, 34%, 47%)"
|
|
1680
|
+
},
|
|
1681
|
+
string: {
|
|
1682
|
+
color: "hsl(119, 34%, 47%)"
|
|
1683
|
+
},
|
|
1684
|
+
char: {
|
|
1685
|
+
color: "hsl(119, 34%, 47%)"
|
|
1686
|
+
},
|
|
1687
|
+
builtin: {
|
|
1688
|
+
color: "hsl(119, 34%, 47%)"
|
|
1689
|
+
},
|
|
1690
|
+
inserted: {
|
|
1691
|
+
color: "hsl(119, 34%, 47%)"
|
|
1692
|
+
},
|
|
1693
|
+
regex: {
|
|
1694
|
+
color: "hsl(119, 34%, 47%)"
|
|
1695
|
+
},
|
|
1696
|
+
"attr-value": {
|
|
1697
|
+
color: "hsl(119, 34%, 47%)"
|
|
1698
|
+
},
|
|
1699
|
+
"attr-value > .token.punctuation": {
|
|
1700
|
+
color: "hsl(119, 34%, 47%)"
|
|
1701
|
+
},
|
|
1702
|
+
variable: {
|
|
1703
|
+
color: "hsl(221, 87%, 60%)"
|
|
1704
|
+
},
|
|
1705
|
+
operator: {
|
|
1706
|
+
color: "hsl(221, 87%, 60%)"
|
|
1707
|
+
},
|
|
1708
|
+
function: {
|
|
1709
|
+
color: "hsl(221, 87%, 60%)"
|
|
1710
|
+
},
|
|
1711
|
+
url: {
|
|
1712
|
+
color: "hsl(198, 99%, 37%)"
|
|
1713
|
+
},
|
|
1714
|
+
"attr-value > .token.punctuation.attr-equals": {
|
|
1715
|
+
color: "hsl(230, 8%, 24%)"
|
|
1716
|
+
},
|
|
1717
|
+
"special-attr > .token.attr-value > .token.value.css": {
|
|
1718
|
+
color: "hsl(230, 8%, 24%)"
|
|
1719
|
+
},
|
|
1720
|
+
".language-css .token.selector": {
|
|
1721
|
+
color: "hsl(5, 74%, 59%)"
|
|
1722
|
+
},
|
|
1723
|
+
".language-css .token.property": {
|
|
1724
|
+
color: "hsl(230, 8%, 24%)"
|
|
1725
|
+
},
|
|
1726
|
+
".language-css .token.function": {
|
|
1727
|
+
color: "hsl(198, 99%, 37%)"
|
|
1728
|
+
},
|
|
1729
|
+
".language-css .token.url > .token.function": {
|
|
1730
|
+
color: "hsl(198, 99%, 37%)"
|
|
1731
|
+
},
|
|
1732
|
+
".language-css .token.url > .token.string.url": {
|
|
1733
|
+
color: "hsl(119, 34%, 47%)"
|
|
1734
|
+
},
|
|
1735
|
+
".language-css .token.important": {
|
|
1736
|
+
color: "hsl(301, 63%, 40%)"
|
|
1737
|
+
},
|
|
1738
|
+
".language-css .token.atrule .token.rule": {
|
|
1739
|
+
color: "hsl(301, 63%, 40%)"
|
|
1740
|
+
},
|
|
1741
|
+
".language-javascript .token.operator": {
|
|
1742
|
+
color: "hsl(301, 63%, 40%)"
|
|
1743
|
+
},
|
|
1744
|
+
".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation": {
|
|
1745
|
+
color: "hsl(344, 84%, 43%)"
|
|
1746
|
+
},
|
|
1747
|
+
".language-json .token.operator": {
|
|
1748
|
+
color: "hsl(230, 8%, 24%)"
|
|
1749
|
+
},
|
|
1750
|
+
".language-json .token.null.keyword": {
|
|
1751
|
+
color: "hsl(35, 99%, 36%)"
|
|
1752
|
+
},
|
|
1753
|
+
".language-markdown .token.url": {
|
|
1754
|
+
color: "hsl(230, 8%, 24%)"
|
|
1755
|
+
},
|
|
1756
|
+
".language-markdown .token.url > .token.operator": {
|
|
1757
|
+
color: "hsl(230, 8%, 24%)"
|
|
1758
|
+
},
|
|
1759
|
+
".language-markdown .token.url-reference.url > .token.string": {
|
|
1760
|
+
color: "hsl(230, 8%, 24%)"
|
|
1761
|
+
},
|
|
1762
|
+
".language-markdown .token.url > .token.content": {
|
|
1763
|
+
color: "hsl(221, 87%, 60%)"
|
|
1764
|
+
},
|
|
1765
|
+
".language-markdown .token.url > .token.url": {
|
|
1766
|
+
color: "hsl(198, 99%, 37%)"
|
|
1767
|
+
},
|
|
1768
|
+
".language-markdown .token.url-reference.url": {
|
|
1769
|
+
color: "hsl(198, 99%, 37%)"
|
|
1770
|
+
},
|
|
1771
|
+
".language-markdown .token.blockquote.punctuation": {
|
|
1772
|
+
color: "hsl(230, 4%, 64%)",
|
|
1773
|
+
fontStyle: "italic"
|
|
1774
|
+
},
|
|
1775
|
+
".language-markdown .token.hr.punctuation": {
|
|
1776
|
+
color: "hsl(230, 4%, 64%)",
|
|
1777
|
+
fontStyle: "italic"
|
|
1778
|
+
},
|
|
1779
|
+
".language-markdown .token.code-snippet": {
|
|
1780
|
+
color: "hsl(119, 34%, 47%)"
|
|
1781
|
+
},
|
|
1782
|
+
".language-markdown .token.bold .token.content": {
|
|
1783
|
+
color: "hsl(35, 99%, 36%)"
|
|
1784
|
+
},
|
|
1785
|
+
".language-markdown .token.italic .token.content": {
|
|
1786
|
+
color: "hsl(301, 63%, 40%)"
|
|
1787
|
+
},
|
|
1788
|
+
".language-markdown .token.strike .token.content": {
|
|
1789
|
+
color: "hsl(5, 74%, 59%)"
|
|
1790
|
+
},
|
|
1791
|
+
".language-markdown .token.strike .token.punctuation": {
|
|
1792
|
+
color: "hsl(5, 74%, 59%)"
|
|
1793
|
+
},
|
|
1794
|
+
".language-markdown .token.list.punctuation": {
|
|
1795
|
+
color: "hsl(5, 74%, 59%)"
|
|
1796
|
+
},
|
|
1797
|
+
".language-markdown .token.title.important > .token.punctuation": {
|
|
1798
|
+
color: "hsl(5, 74%, 59%)"
|
|
1799
|
+
},
|
|
1800
|
+
bold: {
|
|
1801
|
+
fontWeight: "bold"
|
|
1802
|
+
},
|
|
1803
|
+
italic: {
|
|
1804
|
+
fontStyle: "italic"
|
|
1805
|
+
},
|
|
1806
|
+
namespace: {
|
|
1807
|
+
Opacity: "0.8"
|
|
1808
|
+
},
|
|
1809
|
+
"token.tab:not(:empty):before": {
|
|
1810
|
+
color: "hsla(230, 8%, 24%, 0.2)"
|
|
1811
|
+
},
|
|
1812
|
+
"token.cr:before": {
|
|
1813
|
+
color: "hsla(230, 8%, 24%, 0.2)"
|
|
1814
|
+
},
|
|
1815
|
+
"token.lf:before": {
|
|
1816
|
+
color: "hsla(230, 8%, 24%, 0.2)"
|
|
1817
|
+
},
|
|
1818
|
+
"token.space:before": {
|
|
1819
|
+
color: "hsla(230, 8%, 24%, 0.2)"
|
|
1820
|
+
},
|
|
1821
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item": {
|
|
1822
|
+
marginRight: "0.4em"
|
|
1823
|
+
},
|
|
1824
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button": {
|
|
1825
|
+
background: "hsl(230, 1%, 90%)",
|
|
1826
|
+
color: "hsl(230, 6%, 44%)",
|
|
1827
|
+
padding: "0.1em 0.4em",
|
|
1828
|
+
borderRadius: "0.3em"
|
|
1829
|
+
},
|
|
1830
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a": {
|
|
1831
|
+
background: "hsl(230, 1%, 90%)",
|
|
1832
|
+
color: "hsl(230, 6%, 44%)",
|
|
1833
|
+
padding: "0.1em 0.4em",
|
|
1834
|
+
borderRadius: "0.3em"
|
|
1835
|
+
},
|
|
1836
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span": {
|
|
1837
|
+
background: "hsl(230, 1%, 90%)",
|
|
1838
|
+
color: "hsl(230, 6%, 44%)",
|
|
1839
|
+
padding: "0.1em 0.4em",
|
|
1840
|
+
borderRadius: "0.3em"
|
|
1841
|
+
},
|
|
1842
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover": {
|
|
1843
|
+
background: "hsl(230, 1%, 78%)",
|
|
1844
|
+
color: "hsl(230, 8%, 24%)"
|
|
1845
|
+
},
|
|
1846
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus": {
|
|
1847
|
+
background: "hsl(230, 1%, 78%)",
|
|
1848
|
+
color: "hsl(230, 8%, 24%)"
|
|
1849
|
+
},
|
|
1850
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover": {
|
|
1851
|
+
background: "hsl(230, 1%, 78%)",
|
|
1852
|
+
color: "hsl(230, 8%, 24%)"
|
|
1853
|
+
},
|
|
1854
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus": {
|
|
1855
|
+
background: "hsl(230, 1%, 78%)",
|
|
1856
|
+
color: "hsl(230, 8%, 24%)"
|
|
1857
|
+
},
|
|
1858
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover": {
|
|
1859
|
+
background: "hsl(230, 1%, 78%)",
|
|
1860
|
+
color: "hsl(230, 8%, 24%)"
|
|
1861
|
+
},
|
|
1862
|
+
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus": {
|
|
1863
|
+
background: "hsl(230, 1%, 78%)",
|
|
1864
|
+
color: "hsl(230, 8%, 24%)"
|
|
1865
|
+
},
|
|
1866
|
+
".line-highlight.line-highlight": {
|
|
1867
|
+
background: "hsla(230, 8%, 24%, 0.05)"
|
|
1868
|
+
},
|
|
1869
|
+
".line-highlight.line-highlight:before": {
|
|
1870
|
+
background: "hsl(230, 1%, 90%)",
|
|
1871
|
+
color: "hsl(230, 8%, 24%)",
|
|
1872
|
+
padding: "0.1em 0.6em",
|
|
1873
|
+
borderRadius: "0.3em",
|
|
1874
|
+
boxShadow: "0 2px 0 0 rgba(0, 0, 0, 0.2)"
|
|
1875
|
+
},
|
|
1876
|
+
".line-highlight.line-highlight[data-end]:after": {
|
|
1877
|
+
background: "hsl(230, 1%, 90%)",
|
|
1878
|
+
color: "hsl(230, 8%, 24%)",
|
|
1879
|
+
padding: "0.1em 0.6em",
|
|
1880
|
+
borderRadius: "0.3em",
|
|
1881
|
+
boxShadow: "0 2px 0 0 rgba(0, 0, 0, 0.2)"
|
|
1882
|
+
},
|
|
1883
|
+
"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before": {
|
|
1884
|
+
backgroundColor: "hsla(230, 8%, 24%, 0.05)"
|
|
1885
|
+
},
|
|
1886
|
+
".line-numbers.line-numbers .line-numbers-rows": {
|
|
1887
|
+
borderRightColor: "hsla(230, 8%, 24%, 0.2)"
|
|
1888
|
+
},
|
|
1889
|
+
".command-line .command-line-prompt": {
|
|
1890
|
+
borderRightColor: "hsla(230, 8%, 24%, 0.2)"
|
|
1891
|
+
},
|
|
1892
|
+
".line-numbers .line-numbers-rows > span:before": {
|
|
1893
|
+
color: "hsl(230, 1%, 62%)"
|
|
1894
|
+
},
|
|
1895
|
+
".command-line .command-line-prompt > span:before": {
|
|
1896
|
+
color: "hsl(230, 1%, 62%)"
|
|
1897
|
+
},
|
|
1898
|
+
".rainbow-braces .token.token.punctuation.brace-level-1": {
|
|
1899
|
+
color: "hsl(5, 74%, 59%)"
|
|
1900
|
+
},
|
|
1901
|
+
".rainbow-braces .token.token.punctuation.brace-level-5": {
|
|
1902
|
+
color: "hsl(5, 74%, 59%)"
|
|
1903
|
+
},
|
|
1904
|
+
".rainbow-braces .token.token.punctuation.brace-level-9": {
|
|
1905
|
+
color: "hsl(5, 74%, 59%)"
|
|
1906
|
+
},
|
|
1907
|
+
".rainbow-braces .token.token.punctuation.brace-level-2": {
|
|
1908
|
+
color: "hsl(119, 34%, 47%)"
|
|
1909
|
+
},
|
|
1910
|
+
".rainbow-braces .token.token.punctuation.brace-level-6": {
|
|
1911
|
+
color: "hsl(119, 34%, 47%)"
|
|
1912
|
+
},
|
|
1913
|
+
".rainbow-braces .token.token.punctuation.brace-level-10": {
|
|
1914
|
+
color: "hsl(119, 34%, 47%)"
|
|
1915
|
+
},
|
|
1916
|
+
".rainbow-braces .token.token.punctuation.brace-level-3": {
|
|
1917
|
+
color: "hsl(221, 87%, 60%)"
|
|
1918
|
+
},
|
|
1919
|
+
".rainbow-braces .token.token.punctuation.brace-level-7": {
|
|
1920
|
+
color: "hsl(221, 87%, 60%)"
|
|
1921
|
+
},
|
|
1922
|
+
".rainbow-braces .token.token.punctuation.brace-level-11": {
|
|
1923
|
+
color: "hsl(221, 87%, 60%)"
|
|
1924
|
+
},
|
|
1925
|
+
".rainbow-braces .token.token.punctuation.brace-level-4": {
|
|
1926
|
+
color: "hsl(301, 63%, 40%)"
|
|
1927
|
+
},
|
|
1928
|
+
".rainbow-braces .token.token.punctuation.brace-level-8": {
|
|
1929
|
+
color: "hsl(301, 63%, 40%)"
|
|
1930
|
+
},
|
|
1931
|
+
".rainbow-braces .token.token.punctuation.brace-level-12": {
|
|
1932
|
+
color: "hsl(301, 63%, 40%)"
|
|
1933
|
+
},
|
|
1934
|
+
"pre.diff-highlight > code .token.token.deleted:not(.prefix)": {
|
|
1935
|
+
backgroundColor: "hsla(353, 100%, 66%, 0.15)"
|
|
1936
|
+
},
|
|
1937
|
+
"pre > code.diff-highlight .token.token.deleted:not(.prefix)": {
|
|
1938
|
+
backgroundColor: "hsla(353, 100%, 66%, 0.15)"
|
|
1939
|
+
},
|
|
1940
|
+
"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection": {
|
|
1941
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1942
|
+
},
|
|
1943
|
+
"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection": {
|
|
1944
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1945
|
+
},
|
|
1946
|
+
"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection": {
|
|
1947
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1948
|
+
},
|
|
1949
|
+
"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection": {
|
|
1950
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1951
|
+
},
|
|
1952
|
+
"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection": {
|
|
1953
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1954
|
+
},
|
|
1955
|
+
"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection": {
|
|
1956
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1957
|
+
},
|
|
1958
|
+
"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection": {
|
|
1959
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1960
|
+
},
|
|
1961
|
+
"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection": {
|
|
1962
|
+
backgroundColor: "hsla(353, 95%, 66%, 0.25)"
|
|
1963
|
+
},
|
|
1964
|
+
"pre.diff-highlight > code .token.token.inserted:not(.prefix)": {
|
|
1965
|
+
backgroundColor: "hsla(137, 100%, 55%, 0.15)"
|
|
1966
|
+
},
|
|
1967
|
+
"pre > code.diff-highlight .token.token.inserted:not(.prefix)": {
|
|
1968
|
+
backgroundColor: "hsla(137, 100%, 55%, 0.15)"
|
|
1969
|
+
},
|
|
1970
|
+
"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection": {
|
|
1971
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1972
|
+
},
|
|
1973
|
+
"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection": {
|
|
1974
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1975
|
+
},
|
|
1976
|
+
"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection": {
|
|
1977
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1978
|
+
},
|
|
1979
|
+
"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection": {
|
|
1980
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1981
|
+
},
|
|
1982
|
+
"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection": {
|
|
1983
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1984
|
+
},
|
|
1985
|
+
"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection": {
|
|
1986
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1987
|
+
},
|
|
1988
|
+
"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection": {
|
|
1989
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1990
|
+
},
|
|
1991
|
+
"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection": {
|
|
1992
|
+
backgroundColor: "hsla(135, 73%, 55%, 0.25)"
|
|
1993
|
+
},
|
|
1994
|
+
".prism-previewer.prism-previewer:before": {
|
|
1995
|
+
borderColor: "hsl(0, 0, 95%)"
|
|
1996
|
+
},
|
|
1997
|
+
".prism-previewer-gradient.prism-previewer-gradient div": {
|
|
1998
|
+
borderColor: "hsl(0, 0, 95%)",
|
|
1999
|
+
borderRadius: "0.3em"
|
|
2000
|
+
},
|
|
2001
|
+
".prism-previewer-color.prism-previewer-color:before": {
|
|
2002
|
+
borderRadius: "0.3em"
|
|
2003
|
+
},
|
|
2004
|
+
".prism-previewer-easing.prism-previewer-easing:before": {
|
|
2005
|
+
borderRadius: "0.3em"
|
|
2006
|
+
},
|
|
2007
|
+
".prism-previewer.prism-previewer:after": {
|
|
2008
|
+
borderTopColor: "hsl(0, 0, 95%)"
|
|
2009
|
+
},
|
|
2010
|
+
".prism-previewer-flipped.prism-previewer-flipped.after": {
|
|
2011
|
+
borderBottomColor: "hsl(0, 0, 95%)"
|
|
2012
|
+
},
|
|
2013
|
+
".prism-previewer-angle.prism-previewer-angle:before": {
|
|
2014
|
+
background: "hsl(0, 0%, 100%)"
|
|
2015
|
+
},
|
|
2016
|
+
".prism-previewer-time.prism-previewer-time:before": {
|
|
2017
|
+
background: "hsl(0, 0%, 100%)"
|
|
2018
|
+
},
|
|
2019
|
+
".prism-previewer-easing.prism-previewer-easing": {
|
|
2020
|
+
background: "hsl(0, 0%, 100%)"
|
|
2021
|
+
},
|
|
2022
|
+
".prism-previewer-angle.prism-previewer-angle circle": {
|
|
2023
|
+
stroke: "hsl(230, 8%, 24%)",
|
|
2024
|
+
strokeOpacity: "1"
|
|
2025
|
+
},
|
|
2026
|
+
".prism-previewer-time.prism-previewer-time circle": {
|
|
2027
|
+
stroke: "hsl(230, 8%, 24%)",
|
|
2028
|
+
strokeOpacity: "1"
|
|
2029
|
+
},
|
|
2030
|
+
".prism-previewer-easing.prism-previewer-easing circle": {
|
|
2031
|
+
stroke: "hsl(230, 8%, 24%)",
|
|
2032
|
+
fill: "transparent"
|
|
2033
|
+
},
|
|
2034
|
+
".prism-previewer-easing.prism-previewer-easing path": {
|
|
2035
|
+
stroke: "hsl(230, 8%, 24%)"
|
|
2036
|
+
},
|
|
2037
|
+
".prism-previewer-easing.prism-previewer-easing line": {
|
|
2038
|
+
stroke: "hsl(230, 8%, 24%)"
|
|
2039
|
+
}
|
|
2040
|
+
}, Yt = {
|
|
2041
|
+
style: {
|
|
2042
|
+
fontFamily: "DM Mono, monospace",
|
|
2043
|
+
fontSize: "16px"
|
|
2044
|
+
}
|
|
2045
|
+
}, Qt = {
|
|
2046
|
+
margin: 0,
|
|
2047
|
+
borderRadius: 0,
|
|
2048
|
+
padding: 0
|
|
2049
|
+
}, Xt = (e) => e?.includes("json") ? "json" : e?.includes("html") ? "html" : "text", Zt = ({ code: e, blob: t, contentType: o }) => {
|
|
2050
|
+
const n = le((d) => d.theme) === "dark" ? Wt : Gt, a = Xt(o), c = () => {
|
|
2051
|
+
if (t) {
|
|
2052
|
+
const d = URL.createObjectURL(t);
|
|
2053
|
+
window.open(d, "_blank");
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col h-full overflow-y-auto", children: [
|
|
2057
|
+
t && /* @__PURE__ */ r.jsx("div", { className: "flex p-8 justify-center", children: /* @__PURE__ */ r.jsxs(O, { variant: "default", onClick: c, children: [
|
|
2058
|
+
/* @__PURE__ */ r.jsx(et, { className: "h-4 w-4" }),
|
|
2059
|
+
" Download"
|
|
2060
|
+
] }) }),
|
|
2061
|
+
!t && e && /* @__PURE__ */ r.jsx(
|
|
2062
|
+
ct,
|
|
2063
|
+
{
|
|
2064
|
+
showLineNumbers: !0,
|
|
2065
|
+
language: a,
|
|
2066
|
+
style: n,
|
|
2067
|
+
codeTagProps: Yt,
|
|
2068
|
+
customStyle: Qt,
|
|
2069
|
+
wrapLines: !0,
|
|
2070
|
+
children: e
|
|
2071
|
+
}
|
|
2072
|
+
)
|
|
2073
|
+
] });
|
|
2074
|
+
}, Kt = z(() => {
|
|
2075
|
+
const { setResponse: e } = j(), t = j(Ae), { data: o } = Vt(t?.body instanceof Blob ? void 0 : t?.body), [s, n] = _("preview"), a = () => e(void 0);
|
|
2076
|
+
return t ? /* @__PURE__ */ r.jsxs(
|
|
2077
|
+
ae,
|
|
2078
|
+
{
|
|
2079
|
+
value: s,
|
|
2080
|
+
onValueChange: (c) => n(c),
|
|
2081
|
+
className: "border-l border-border",
|
|
2082
|
+
"data-testid": "endpoint-response-container",
|
|
2083
|
+
children: [
|
|
2084
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-[1fr_auto] items-center h-10 border-b px-5 bg-card", children: [
|
|
2085
|
+
/* @__PURE__ */ r.jsxs(ie, { children: [
|
|
2086
|
+
/* @__PURE__ */ r.jsx(M, { value: "preview", className: "cursor-pointer", children: "Preview" }),
|
|
2087
|
+
/* @__PURE__ */ r.jsx(M, { value: "headers", className: "grid grid-cols-[auto_auto] gap-2 items-center cursor-pointer", children: "Headers" })
|
|
2088
|
+
] }),
|
|
2089
|
+
/* @__PURE__ */ r.jsx(O, { variant: "ghost", size: "icon", onClick: a, children: /* @__PURE__ */ r.jsx(W, { className: "h-4 w-4" }) })
|
|
2090
|
+
] }),
|
|
2091
|
+
/* @__PURE__ */ r.jsx("div", { className: "sticky bottom-0 border-b border-border p-3 text-sm flex items-center gap-1 font-medium", children: /* @__PURE__ */ r.jsxs("div", { className: "flex flex-row items-center flex-1 gap-3", children: [
|
|
2092
|
+
/* @__PURE__ */ r.jsx(Jt, { statusCode: t.statusCode }),
|
|
2093
|
+
!!t.executionTime && /* @__PURE__ */ r.jsxs("div", { className: "text-muted-foreground bg-muted-foreground/10 px-2 py-1 rounded-sm", children: [
|
|
2094
|
+
t.executionTime,
|
|
2095
|
+
"ms"
|
|
2096
|
+
] })
|
|
2097
|
+
] }) }),
|
|
2098
|
+
/* @__PURE__ */ r.jsx(L, { value: "preview", children: /* @__PURE__ */ r.jsx(
|
|
2099
|
+
Zt,
|
|
2100
|
+
{
|
|
2101
|
+
code: o,
|
|
2102
|
+
blob: t?.body instanceof Blob ? t.body : void 0,
|
|
2103
|
+
contentType: t.headers["content-type"]
|
|
2104
|
+
}
|
|
2105
|
+
) }),
|
|
2106
|
+
/* @__PURE__ */ r.jsx(L, { value: "headers", children: /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-[auto_minmax(0,1fr)] gap-4 p-4 overflow-auto auto-rows-max h-full", children: t.headers && Object.entries(t.headers).map(([c, d]) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
2107
|
+
/* @__PURE__ */ r.jsx("span", { className: "font-bold text-sm h-8 items-center grid whitespace-nowrap", children: c }),
|
|
2108
|
+
/* @__PURE__ */ r.jsx("span", { className: "text-sm text-muted-foreground h-8 items-center grid whitespace-nowrap", children: d })
|
|
2109
|
+
] })) }) })
|
|
2110
|
+
]
|
|
2111
|
+
}
|
|
2112
|
+
) : null;
|
|
2113
|
+
}), er = z(({ method: e, path: t }) => {
|
|
2114
|
+
const { setResponse: o } = j(), s = j(T(de)), n = j(T(Fe)), a = Me(t), [c, d] = _(!1), h = async () => {
|
|
2115
|
+
try {
|
|
2116
|
+
d(!0);
|
|
2117
|
+
const p = Object.values(s).filter((m) => m.active && m.name !== "" && m.value !== "").reduce(
|
|
2118
|
+
(m, b) => (m[b.name.toLowerCase()] = b.value, m),
|
|
2119
|
+
{}
|
|
2120
|
+
), l = Date.now(), f = await fetch(a, {
|
|
2121
|
+
method: e,
|
|
2122
|
+
headers: p,
|
|
2123
|
+
body: ["GET", "DELETE", "HEAD", "OPTIONS"].includes(e) ? null : n
|
|
2124
|
+
});
|
|
2125
|
+
o(f, l);
|
|
2126
|
+
} catch (p) {
|
|
2127
|
+
console.error("Error triggering endpoint:", p);
|
|
2128
|
+
} finally {
|
|
2129
|
+
d(!1);
|
|
2130
|
+
}
|
|
2131
|
+
};
|
|
2132
|
+
return /* @__PURE__ */ r.jsx(O, { variant: "ghost", size: "icon", onClick: h, disabled: c, "data-testid": "endpoint-play-button", children: c ? /* @__PURE__ */ r.jsx(tt, { className: "animate-spin" }) : /* @__PURE__ */ r.jsx(rt, { className: "h-4 w-4" }) });
|
|
2133
|
+
}), tr = (e) => Object.keys(de(e)).length, rr = (e) => Ae(e) !== void 0, or = (e) => Object.keys(ue(e)).length, nr = z(({ endpoint: e, onClose: t }) => {
|
|
2134
|
+
const o = e.method === "GET" || e.method === "DELETE", [s, n] = _(o ? "params" : "body"), [a, c] = _(!1), d = j(T(tr)), h = j(T(rr)), p = j(T(or));
|
|
2135
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2136
|
+
"div",
|
|
2137
|
+
{
|
|
2138
|
+
className: "isolate grid grid-cols-1 overflow-y-auto min-w-0 grid-rows-[auto_1fr] border-l border-border",
|
|
2139
|
+
"data-testid": "endpoint-details-panel",
|
|
2140
|
+
children: [
|
|
2141
|
+
/* @__PURE__ */ r.jsx(We, {}),
|
|
2142
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-[1fr_1fr_auto] items-start gap-4 px-5 py-4 border-b bg-card w-full", children: [
|
|
2143
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-rows-2 gap-2", children: [
|
|
2144
|
+
/* @__PURE__ */ r.jsx(ce, { method: e.method, path: e.path }),
|
|
2145
|
+
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground", children: e.description })
|
|
2146
|
+
] }),
|
|
2147
|
+
/* @__PURE__ */ r.jsx("div", { className: "flex items-end justify-end", children: /* @__PURE__ */ r.jsx(
|
|
2148
|
+
O,
|
|
2149
|
+
{
|
|
2150
|
+
variant: "icon",
|
|
2151
|
+
size: "icon",
|
|
2152
|
+
onClick: () => c(!a),
|
|
2153
|
+
"data-testid": "endpoint-spec-button",
|
|
2154
|
+
children: /* @__PURE__ */ r.jsx(ot, {})
|
|
2155
|
+
}
|
|
2156
|
+
) }),
|
|
2157
|
+
/* @__PURE__ */ r.jsx(O, { variant: "icon", size: "icon", onClick: t, children: /* @__PURE__ */ r.jsx(W, {}) })
|
|
2158
|
+
] }),
|
|
2159
|
+
/* @__PURE__ */ r.jsxs("div", { className: N("grid grid-cols-[minmax(350px,1fr)_minmax(auto,1fr)]", !h && "grid-cols-1"), children: [
|
|
2160
|
+
/* @__PURE__ */ r.jsxs(ae, { value: s, onValueChange: (l) => n(l), children: [
|
|
2161
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-[1fr_auto] items-center h-10 border-b px-5 bg-card", children: [
|
|
2162
|
+
/* @__PURE__ */ r.jsxs(ie, { children: [
|
|
2163
|
+
/* @__PURE__ */ r.jsxs(
|
|
2164
|
+
M,
|
|
2165
|
+
{
|
|
2166
|
+
value: "params",
|
|
2167
|
+
className: "grid grid-cols-[auto_auto] gap-2 items-center cursor-pointer",
|
|
2168
|
+
"data-testid": "endpoint-params-tab",
|
|
2169
|
+
children: [
|
|
2170
|
+
"Params",
|
|
2171
|
+
/* @__PURE__ */ r.jsx(xe, { variant: "outline", className: "h-4 px-1.5 text-xs", children: p })
|
|
2172
|
+
]
|
|
2173
|
+
}
|
|
2174
|
+
),
|
|
2175
|
+
/* @__PURE__ */ r.jsx(M, { value: "body", className: "cursor-pointer", "data-testid": "endpoint-body-tab", children: "Body" }),
|
|
2176
|
+
/* @__PURE__ */ r.jsxs(
|
|
2177
|
+
M,
|
|
2178
|
+
{
|
|
2179
|
+
value: "headers",
|
|
2180
|
+
className: "grid grid-cols-[auto_auto] gap-2 items-center cursor-pointer",
|
|
2181
|
+
"data-testid": "endpoint-headers-tab",
|
|
2182
|
+
children: [
|
|
2183
|
+
"Headers",
|
|
2184
|
+
/* @__PURE__ */ r.jsx(xe, { variant: "outline", className: "h-4 px-1.5 text-xs", children: d })
|
|
2185
|
+
]
|
|
2186
|
+
}
|
|
2187
|
+
)
|
|
2188
|
+
] }),
|
|
2189
|
+
/* @__PURE__ */ r.jsx(er, { method: e.method, path: e.path.toString() })
|
|
2190
|
+
] }),
|
|
2191
|
+
/* @__PURE__ */ r.jsx(L, { value: "params", children: /* @__PURE__ */ r.jsx(Ut, { path: e.path }) }),
|
|
2192
|
+
/* @__PURE__ */ r.jsx(L, { value: "body", children: /* @__PURE__ */ r.jsx(Lt, { schema: e.bodySchema }) }),
|
|
2193
|
+
/* @__PURE__ */ r.jsx(L, { value: "headers", children: /* @__PURE__ */ r.jsx(zt, {}) })
|
|
2194
|
+
] }),
|
|
2195
|
+
/* @__PURE__ */ r.jsx(Kt, {})
|
|
2196
|
+
] }),
|
|
2197
|
+
a && /* @__PURE__ */ r.jsx(Dt, { endpoint: e, onClose: () => c(!1) })
|
|
2198
|
+
]
|
|
2199
|
+
}
|
|
2200
|
+
);
|
|
2201
|
+
}), hr = () => {
|
|
2202
|
+
const { endpoints: e, groupedEndpoints: t } = Ct(), { selectedEndpointId: o, setSelectedEndpointId: s, toggleFlowGroupStatus: n, flowGroupStatus: a } = j(), c = F(
|
|
2203
|
+
() => e.find((f) => f.id === o),
|
|
2204
|
+
[e, o]
|
|
2205
|
+
), d = R(() => {
|
|
2206
|
+
s("");
|
|
2207
|
+
}, [s]), [h, p] = _(""), l = F(() => Object.entries(t).filter(([f, m]) => m.some(
|
|
2208
|
+
(b) => b.method?.toLowerCase().includes(h.toLowerCase()) || b.path?.toLowerCase().includes(h.toLowerCase())
|
|
2209
|
+
)), [t, h]);
|
|
2210
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2211
|
+
"div",
|
|
2212
|
+
{
|
|
2213
|
+
className: N("grid h-full max-h-full", c ? "grid-cols-[300px_1fr] " : "grid-cols-1"),
|
|
2214
|
+
"data-testid": "endpoints-list",
|
|
2215
|
+
children: [
|
|
2216
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full overflow-auto min-w-0", children: [
|
|
2217
|
+
/* @__PURE__ */ r.jsx(ht, { value: h, onChange: p, onClear: () => p("") }),
|
|
2218
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-1 auto-rows-max overflow-auto min-w-0", children: l.map(([f, m]) => {
|
|
2219
|
+
const b = m.some((u) => u.id === o), w = !a[f] || b || h !== "";
|
|
2220
|
+
return /* @__PURE__ */ r.jsx(
|
|
2221
|
+
bt,
|
|
2222
|
+
{
|
|
2223
|
+
flow: f,
|
|
2224
|
+
endpoints: m,
|
|
2225
|
+
isOpen: w,
|
|
2226
|
+
isSelected: b,
|
|
2227
|
+
onToggle: n,
|
|
2228
|
+
onClearSelection: () => s(""),
|
|
2229
|
+
selectedEndpointId: o,
|
|
2230
|
+
onSelectEndpoint: s
|
|
2231
|
+
},
|
|
2232
|
+
f
|
|
2233
|
+
);
|
|
2234
|
+
}) })
|
|
2235
|
+
] }),
|
|
2236
|
+
c && /* @__PURE__ */ r.jsx(nr, { endpoint: c, onClose: d })
|
|
2237
|
+
]
|
|
2238
|
+
}
|
|
2239
|
+
);
|
|
2240
|
+
};
|
|
2241
|
+
export {
|
|
2242
|
+
hr as EndpointsPage
|
|
2243
|
+
};
|