@devtable/settings-form 10.5.2 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/settings-form.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import K, { useEffect as bt, forwardRef as Qe, useState as Gt, Component as Ar } from "react";
|
|
2
|
-
import { Box as
|
|
3
|
-
import { showNotification as
|
|
2
|
+
import { Box as se, TextInput as ue, Divider as Je, Group as J, NumberInput as kr, PasswordInput as et, Button as V, Modal as Ae, Stack as Be, Alert as Tr, SegmentedControl as Rr, Tooltip as We, Text as Re, ActionIcon as yt, LoadingOverlay as tt, Table as rt, Select as Or, Switch as xr, createStyles as qt, rem as ze, useComponentDefaultProps as Cr, useMantineTheme as Ir, ScrollArea as Ht, Tabs as nt, HoverCard as pt } from "@mantine/core";
|
|
3
|
+
import { showNotification as be, updateNotification as ee } from "@mantine/notifications";
|
|
4
4
|
import { Recycle as Dr, AlertCircle as Lr, PlaylistAdd as at, Trash as it, Edit as Fr } from "tabler-icons-react";
|
|
5
5
|
import Nr from "axios";
|
|
6
6
|
import $r from "crypto-js";
|
|
7
7
|
import Pr from "lodash";
|
|
8
|
-
import { useForm as Ee, Controller as
|
|
8
|
+
import { useForm as Ee, Controller as H } from "react-hook-form";
|
|
9
9
|
import { useBoolean as zr, useRequest as Oe } from "ahooks";
|
|
10
10
|
import Yt, { loader as gt } from "@monaco-editor/react";
|
|
11
11
|
import { useModals as je, closeAllModals as Mr } from "@mantine/modals";
|
|
@@ -71,10 +71,10 @@ function Wr() {
|
|
|
71
71
|
{
|
|
72
72
|
for (var v = arguments.length, T = new Array(v > 1 ? v - 1 : 0), D = 1; D < v; D++)
|
|
73
73
|
T[D - 1] = arguments[D];
|
|
74
|
-
|
|
74
|
+
$("error", i, T);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function $(i, v, T) {
|
|
78
78
|
{
|
|
79
79
|
var D = A.ReactDebugCurrentFrame, G = D.getStackAddendum();
|
|
80
80
|
G !== "" && (v += "%s", T = T.concat([G]));
|
|
@@ -84,10 +84,10 @@ function Wr() {
|
|
|
84
84
|
W.unshift("Warning: " + v), Function.prototype.apply.call(console[i], console, W);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
var M = !1,
|
|
87
|
+
var M = !1, re = !1, Q = !1, Y = !1, Z = !1, F;
|
|
88
88
|
F = Symbol.for("react.module.reference");
|
|
89
89
|
function L(i) {
|
|
90
|
-
return !!(typeof i == "string" || typeof i == "function" || i === n || i === o || Z || i === s || i === f || i === b ||
|
|
90
|
+
return !!(typeof i == "string" || typeof i == "function" || i === n || i === o || Z || i === s || i === f || i === b || Y || i === g || M || re || Q || typeof i == "object" && i !== null && (i.$$typeof === c || i.$$typeof === u || i.$$typeof === l || i.$$typeof === p || i.$$typeof === d || // This needs to include all possible module reference object
|
|
91
91
|
// types supported by any Flight configuration anywhere since
|
|
92
92
|
// we don't know which Flight build this will end up being used
|
|
93
93
|
// with.
|
|
@@ -103,7 +103,7 @@ function Wr() {
|
|
|
103
103
|
function te(i) {
|
|
104
104
|
return i.displayName || "Context";
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function R(i) {
|
|
107
107
|
if (i == null)
|
|
108
108
|
return null;
|
|
109
109
|
if (typeof i.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
|
@@ -136,11 +136,11 @@ function Wr() {
|
|
|
136
136
|
return B(i, i.render, "ForwardRef");
|
|
137
137
|
case u:
|
|
138
138
|
var D = i.displayName || null;
|
|
139
|
-
return D !== null ? D :
|
|
139
|
+
return D !== null ? D : R(i.type) || "Memo";
|
|
140
140
|
case c: {
|
|
141
141
|
var G = i, W = G._payload, z = G._init;
|
|
142
142
|
try {
|
|
143
|
-
return
|
|
143
|
+
return R(z(W));
|
|
144
144
|
} catch {
|
|
145
145
|
return null;
|
|
146
146
|
}
|
|
@@ -148,14 +148,14 @@ function Wr() {
|
|
|
148
148
|
}
|
|
149
149
|
return null;
|
|
150
150
|
}
|
|
151
|
-
var E = Object.assign, S = 0,
|
|
151
|
+
var E = Object.assign, S = 0, O, w, x, I, N, q, j;
|
|
152
152
|
function U() {
|
|
153
153
|
}
|
|
154
154
|
U.__reactDisabledLog = !0;
|
|
155
|
-
function
|
|
155
|
+
function le() {
|
|
156
156
|
{
|
|
157
157
|
if (S === 0) {
|
|
158
|
-
|
|
158
|
+
O = console.log, w = console.info, x = console.warn, I = console.error, N = console.group, q = console.groupCollapsed, j = console.groupEnd;
|
|
159
159
|
var i = {
|
|
160
160
|
configurable: !0,
|
|
161
161
|
enumerable: !0,
|
|
@@ -175,7 +175,7 @@ function Wr() {
|
|
|
175
175
|
S++;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ce() {
|
|
179
179
|
{
|
|
180
180
|
if (S--, S === 0) {
|
|
181
181
|
var i = {
|
|
@@ -185,7 +185,7 @@ function Wr() {
|
|
|
185
185
|
};
|
|
186
186
|
Object.defineProperties(console, {
|
|
187
187
|
log: E({}, i, {
|
|
188
|
-
value:
|
|
188
|
+
value: O
|
|
189
189
|
}),
|
|
190
190
|
info: E({}, i, {
|
|
191
191
|
value: w
|
|
@@ -197,40 +197,40 @@ function Wr() {
|
|
|
197
197
|
value: I
|
|
198
198
|
}),
|
|
199
199
|
group: E({}, i, {
|
|
200
|
-
value:
|
|
200
|
+
value: N
|
|
201
201
|
}),
|
|
202
202
|
groupCollapsed: E({}, i, {
|
|
203
|
-
value:
|
|
203
|
+
value: q
|
|
204
204
|
}),
|
|
205
205
|
groupEnd: E({}, i, {
|
|
206
|
-
value:
|
|
206
|
+
value: j
|
|
207
207
|
})
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
S < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
var
|
|
213
|
+
var pe = A.ReactCurrentDispatcher, ye;
|
|
214
214
|
function fe(i, v, T) {
|
|
215
215
|
{
|
|
216
|
-
if (
|
|
216
|
+
if (ye === void 0)
|
|
217
217
|
try {
|
|
218
218
|
throw Error();
|
|
219
219
|
} catch (G) {
|
|
220
220
|
var D = G.stack.trim().match(/\n( *(at )?)/);
|
|
221
|
-
|
|
221
|
+
ye = D && D[1] || "";
|
|
222
222
|
}
|
|
223
223
|
return `
|
|
224
|
-
` +
|
|
224
|
+
` + ye + i;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
var
|
|
227
|
+
var ne = !1, de;
|
|
228
228
|
{
|
|
229
|
-
var
|
|
230
|
-
de = new
|
|
229
|
+
var ve = typeof WeakMap == "function" ? WeakMap : Map;
|
|
230
|
+
de = new ve();
|
|
231
231
|
}
|
|
232
232
|
function Te(i, v) {
|
|
233
|
-
if (!i ||
|
|
233
|
+
if (!i || ne)
|
|
234
234
|
return "";
|
|
235
235
|
{
|
|
236
236
|
var T = de.get(i);
|
|
@@ -238,11 +238,11 @@ function Wr() {
|
|
|
238
238
|
return T;
|
|
239
239
|
}
|
|
240
240
|
var D;
|
|
241
|
-
|
|
241
|
+
ne = !0;
|
|
242
242
|
var G = Error.prepareStackTrace;
|
|
243
243
|
Error.prepareStackTrace = void 0;
|
|
244
244
|
var W;
|
|
245
|
-
W =
|
|
245
|
+
W = pe.current, pe.current = null, le();
|
|
246
246
|
try {
|
|
247
247
|
if (v) {
|
|
248
248
|
var z = function() {
|
|
@@ -278,24 +278,24 @@ function Wr() {
|
|
|
278
278
|
} catch (we) {
|
|
279
279
|
if (we && D && typeof we.stack == "string") {
|
|
280
280
|
for (var P = we.stack.split(`
|
|
281
|
-
`),
|
|
282
|
-
`),
|
|
283
|
-
|
|
284
|
-
for (;
|
|
285
|
-
if (P[
|
|
286
|
-
if (
|
|
281
|
+
`), ge = D.stack.split(`
|
|
282
|
+
`), ae = P.length - 1, ie = ge.length - 1; ae >= 1 && ie >= 0 && P[ae] !== ge[ie]; )
|
|
283
|
+
ie--;
|
|
284
|
+
for (; ae >= 1 && ie >= 0; ae--, ie--)
|
|
285
|
+
if (P[ae] !== ge[ie]) {
|
|
286
|
+
if (ae !== 1 || ie !== 1)
|
|
287
287
|
do
|
|
288
|
-
if (
|
|
289
|
-
var
|
|
290
|
-
` + P[
|
|
291
|
-
return i.displayName &&
|
|
288
|
+
if (ae--, ie--, ie < 0 || P[ae] !== ge[ie]) {
|
|
289
|
+
var me = `
|
|
290
|
+
` + P[ae].replace(" at new ", " at ");
|
|
291
|
+
return i.displayName && me.includes("<anonymous>") && (me = me.replace("<anonymous>", i.displayName)), typeof i == "function" && de.set(i, me), me;
|
|
292
292
|
}
|
|
293
|
-
while (
|
|
293
|
+
while (ae >= 1 && ie >= 0);
|
|
294
294
|
break;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
} finally {
|
|
298
|
-
|
|
298
|
+
ne = !1, pe.current = W, ce(), Error.prepareStackTrace = G;
|
|
299
299
|
}
|
|
300
300
|
var Ce = i ? i.displayName || i.name : "", Lt = Ce ? fe(Ce) : "";
|
|
301
301
|
return typeof i == "function" && de.set(i, Lt), Lt;
|
|
@@ -352,12 +352,12 @@ function Wr() {
|
|
|
352
352
|
var P = void 0;
|
|
353
353
|
try {
|
|
354
354
|
if (typeof i[z] != "function") {
|
|
355
|
-
var
|
|
356
|
-
throw
|
|
355
|
+
var ge = Error((D || "React class") + ": " + T + " type `" + z + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[z] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
356
|
+
throw ge.name = "Invariant Violation", ge;
|
|
357
357
|
}
|
|
358
358
|
P = i[z](v, z, D, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
359
|
-
} catch (
|
|
360
|
-
P =
|
|
359
|
+
} catch (ae) {
|
|
360
|
+
P = ae;
|
|
361
361
|
}
|
|
362
362
|
P && !(P instanceof Error) && (Ye(G), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", D || "React class", T, z, typeof P), Ye(null)), P instanceof Error && !(P.message in wt) && (wt[P.message] = !0, Ye(G), k("Failed %s type: %s", T, P.message), Ye(null));
|
|
363
363
|
}
|
|
@@ -412,8 +412,8 @@ function Wr() {
|
|
|
412
412
|
}
|
|
413
413
|
function dr(i, v) {
|
|
414
414
|
if (typeof i.ref == "string" && Le.current && v && Le.current.stateNode !== v) {
|
|
415
|
-
var T =
|
|
416
|
-
lt[T] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',
|
|
415
|
+
var T = R(Le.current.type);
|
|
416
|
+
lt[T] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', R(Le.current.type), i.ref), lt[T] = !0);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
function pr(i, v) {
|
|
@@ -469,20 +469,20 @@ function Wr() {
|
|
|
469
469
|
};
|
|
470
470
|
function hr(i, v, T, D, G) {
|
|
471
471
|
{
|
|
472
|
-
var W, z = {}, P = null,
|
|
473
|
-
T !== void 0 && (At(T), P = "" + T), cr(v) && (At(v.key), P = "" + v.key), ur(v) && (
|
|
472
|
+
var W, z = {}, P = null, ge = null;
|
|
473
|
+
T !== void 0 && (At(T), P = "" + T), cr(v) && (At(v.key), P = "" + v.key), ur(v) && (ge = v.ref, dr(v, G));
|
|
474
474
|
for (W in v)
|
|
475
475
|
He.call(v, W) && !lr.hasOwnProperty(W) && (z[W] = v[W]);
|
|
476
476
|
if (i && i.defaultProps) {
|
|
477
|
-
var
|
|
478
|
-
for (W in
|
|
479
|
-
z[W] === void 0 && (z[W] =
|
|
477
|
+
var ae = i.defaultProps;
|
|
478
|
+
for (W in ae)
|
|
479
|
+
z[W] === void 0 && (z[W] = ae[W]);
|
|
480
480
|
}
|
|
481
|
-
if (P ||
|
|
482
|
-
var
|
|
483
|
-
P && pr(z,
|
|
481
|
+
if (P || ge) {
|
|
482
|
+
var ie = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
483
|
+
P && pr(z, ie), ge && gr(z, ie);
|
|
484
484
|
}
|
|
485
|
-
return fr(i, P,
|
|
485
|
+
return fr(i, P, ge, G, D, Le.current, z);
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
var ut = A.ReactCurrentOwner, Rt = A.ReactDebugCurrentFrame;
|
|
@@ -501,7 +501,7 @@ function Wr() {
|
|
|
501
501
|
function Ot() {
|
|
502
502
|
{
|
|
503
503
|
if (ut.current) {
|
|
504
|
-
var i =
|
|
504
|
+
var i = R(ut.current.type);
|
|
505
505
|
if (i)
|
|
506
506
|
return `
|
|
507
507
|
|
|
@@ -544,7 +544,7 @@ Check the top-level render call using <` + T + ">.");
|
|
|
544
544
|
return;
|
|
545
545
|
xt[T] = !0;
|
|
546
546
|
var D = "";
|
|
547
|
-
i && i._owner && i._owner !== ut.current && (D = " It was passed a child from " +
|
|
547
|
+
i && i._owner && i._owner !== ut.current && (D = " It was passed a child from " + R(i._owner.type) + "."), xe(i), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, D), xe(null);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
function It(i, v) {
|
|
@@ -581,11 +581,11 @@ Check the top-level render call using <` + T + ">.");
|
|
|
581
581
|
else
|
|
582
582
|
return;
|
|
583
583
|
if (T) {
|
|
584
|
-
var D =
|
|
584
|
+
var D = R(v);
|
|
585
585
|
ar(T, i.props, "prop", D, i);
|
|
586
586
|
} else if (v.PropTypes !== void 0 && !ct) {
|
|
587
587
|
ct = !0;
|
|
588
|
-
var G =
|
|
588
|
+
var G = R(v);
|
|
589
589
|
k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", G || "Unknown");
|
|
590
590
|
}
|
|
591
591
|
typeof v.getDefaultProps == "function" && !v.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -609,28 +609,28 @@ Check the top-level render call using <` + T + ">.");
|
|
|
609
609
|
if (!z) {
|
|
610
610
|
var P = "";
|
|
611
611
|
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (P += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
612
|
-
var
|
|
613
|
-
|
|
614
|
-
var
|
|
615
|
-
i === null ?
|
|
612
|
+
var ge = mr(G);
|
|
613
|
+
ge ? P += ge : P += Ot();
|
|
614
|
+
var ae;
|
|
615
|
+
i === null ? ae = "null" : st(i) ? ae = "array" : i !== void 0 && i.$$typeof === t ? (ae = "<" + (R(i.type) || "Unknown") + " />", P = " Did you accidentally export a JSX literal instead of a component?") : ae = typeof i, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ae, P);
|
|
616
616
|
}
|
|
617
|
-
var
|
|
618
|
-
if (
|
|
619
|
-
return
|
|
617
|
+
var ie = hr(i, v, T, G, W);
|
|
618
|
+
if (ie == null)
|
|
619
|
+
return ie;
|
|
620
620
|
if (z) {
|
|
621
|
-
var
|
|
622
|
-
if (
|
|
621
|
+
var me = v.children;
|
|
622
|
+
if (me !== void 0)
|
|
623
623
|
if (D)
|
|
624
|
-
if (st(
|
|
625
|
-
for (var Ce = 0; Ce <
|
|
626
|
-
It(
|
|
627
|
-
Object.freeze && Object.freeze(
|
|
624
|
+
if (st(me)) {
|
|
625
|
+
for (var Ce = 0; Ce < me.length; Ce++)
|
|
626
|
+
It(me[Ce], i);
|
|
627
|
+
Object.freeze && Object.freeze(me);
|
|
628
628
|
} else
|
|
629
629
|
k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
630
630
|
else
|
|
631
|
-
It(
|
|
631
|
+
It(me, i);
|
|
632
632
|
}
|
|
633
|
-
return i === n ? vr(
|
|
633
|
+
return i === n ? vr(ie) : yr(ie), ie;
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
function Sr(i, v, T) {
|
|
@@ -829,62 +829,62 @@ var ht = {}, tn = {
|
|
|
829
829
|
(function(r, n) {
|
|
830
830
|
e.exports = n();
|
|
831
831
|
})(Hr, function() {
|
|
832
|
-
var r = 1e3, n = 6e4, s = 36e5, o = "millisecond", l = "second", p = "minute", d = "hour", f = "day", b = "week", u = "month", c = "quarter", g = "year", y = "date", h = "Invalid Date", _ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, A = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, k = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(
|
|
833
|
-
var E = ["th", "st", "nd", "rd"], S =
|
|
834
|
-
return "[" +
|
|
835
|
-
} },
|
|
836
|
-
var
|
|
837
|
-
return !
|
|
838
|
-
}, M = { s:
|
|
839
|
-
var E = -
|
|
840
|
-
return (E <= 0 ? "+" : "-") +
|
|
841
|
-
}, m: function
|
|
832
|
+
var r = 1e3, n = 6e4, s = 36e5, o = "millisecond", l = "second", p = "minute", d = "hour", f = "day", b = "week", u = "month", c = "quarter", g = "year", y = "date", h = "Invalid Date", _ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, A = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, k = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(R) {
|
|
833
|
+
var E = ["th", "st", "nd", "rd"], S = R % 100;
|
|
834
|
+
return "[" + R + (E[(S - 20) % 10] || E[S] || E[0]) + "]";
|
|
835
|
+
} }, $ = function(R, E, S) {
|
|
836
|
+
var O = String(R);
|
|
837
|
+
return !O || O.length >= E ? R : "" + Array(E + 1 - O.length).join(S) + R;
|
|
838
|
+
}, M = { s: $, z: function(R) {
|
|
839
|
+
var E = -R.utcOffset(), S = Math.abs(E), O = Math.floor(S / 60), w = S % 60;
|
|
840
|
+
return (E <= 0 ? "+" : "-") + $(O, 2, "0") + ":" + $(w, 2, "0");
|
|
841
|
+
}, m: function R(E, S) {
|
|
842
842
|
if (E.date() < S.date())
|
|
843
|
-
return -
|
|
844
|
-
var
|
|
845
|
-
return +(-(
|
|
846
|
-
}, a: function(
|
|
847
|
-
return
|
|
848
|
-
}, p: function(
|
|
849
|
-
return { M: u, y: g, w: b, d: f, D: y, h: d, m: p, s: l, ms: o, Q: c }[
|
|
850
|
-
}, u: function(
|
|
851
|
-
return
|
|
852
|
-
} },
|
|
853
|
-
Q[
|
|
854
|
-
var
|
|
855
|
-
return
|
|
856
|
-
}, Z = function
|
|
843
|
+
return -R(S, E);
|
|
844
|
+
var O = 12 * (S.year() - E.year()) + (S.month() - E.month()), w = E.clone().add(O, u), x = S - w < 0, I = E.clone().add(O + (x ? -1 : 1), u);
|
|
845
|
+
return +(-(O + (S - w) / (x ? w - I : I - w)) || 0);
|
|
846
|
+
}, a: function(R) {
|
|
847
|
+
return R < 0 ? Math.ceil(R) || 0 : Math.floor(R);
|
|
848
|
+
}, p: function(R) {
|
|
849
|
+
return { M: u, y: g, w: b, d: f, D: y, h: d, m: p, s: l, ms: o, Q: c }[R] || String(R || "").toLowerCase().replace(/s$/, "");
|
|
850
|
+
}, u: function(R) {
|
|
851
|
+
return R === void 0;
|
|
852
|
+
} }, re = "en", Q = {};
|
|
853
|
+
Q[re] = k;
|
|
854
|
+
var Y = function(R) {
|
|
855
|
+
return R instanceof B;
|
|
856
|
+
}, Z = function R(E, S, O) {
|
|
857
857
|
var w;
|
|
858
858
|
if (!E)
|
|
859
|
-
return
|
|
859
|
+
return re;
|
|
860
860
|
if (typeof E == "string") {
|
|
861
861
|
var x = E.toLowerCase();
|
|
862
862
|
Q[x] && (w = x), S && (Q[x] = S, w = x);
|
|
863
863
|
var I = E.split("-");
|
|
864
864
|
if (!w && I.length > 1)
|
|
865
|
-
return
|
|
865
|
+
return R(I[0]);
|
|
866
866
|
} else {
|
|
867
|
-
var
|
|
868
|
-
Q[
|
|
867
|
+
var N = E.name;
|
|
868
|
+
Q[N] = E, w = N;
|
|
869
869
|
}
|
|
870
|
-
return !
|
|
871
|
-
}, F = function(
|
|
872
|
-
if (
|
|
873
|
-
return
|
|
870
|
+
return !O && w && (re = w), w || !O && re;
|
|
871
|
+
}, F = function(R, E) {
|
|
872
|
+
if (Y(R))
|
|
873
|
+
return R.clone();
|
|
874
874
|
var S = typeof E == "object" ? E : {};
|
|
875
|
-
return S.date =
|
|
875
|
+
return S.date = R, S.args = arguments, new B(S);
|
|
876
876
|
}, L = M;
|
|
877
|
-
L.l = Z, L.i =
|
|
878
|
-
return F(
|
|
877
|
+
L.l = Z, L.i = Y, L.w = function(R, E) {
|
|
878
|
+
return F(R, { locale: E.$L, utc: E.$u, x: E.$x, $offset: E.$offset });
|
|
879
879
|
};
|
|
880
880
|
var B = function() {
|
|
881
|
-
function
|
|
881
|
+
function R(S) {
|
|
882
882
|
this.$L = Z(S.locale, null, !0), this.parse(S);
|
|
883
883
|
}
|
|
884
|
-
var E =
|
|
884
|
+
var E = R.prototype;
|
|
885
885
|
return E.parse = function(S) {
|
|
886
|
-
this.$d = function(
|
|
887
|
-
var w =
|
|
886
|
+
this.$d = function(O) {
|
|
887
|
+
var w = O.date, x = O.utc;
|
|
888
888
|
if (w === null)
|
|
889
889
|
return /* @__PURE__ */ new Date(NaN);
|
|
890
890
|
if (L.u(w))
|
|
@@ -894,8 +894,8 @@ var ht = {}, tn = {
|
|
|
894
894
|
if (typeof w == "string" && !/Z$/i.test(w)) {
|
|
895
895
|
var I = w.match(_);
|
|
896
896
|
if (I) {
|
|
897
|
-
var
|
|
898
|
-
return x ? new Date(Date.UTC(I[1],
|
|
897
|
+
var N = I[2] - 1 || 0, q = (I[7] || "0").substring(0, 3);
|
|
898
|
+
return x ? new Date(Date.UTC(I[1], N, I[3] || 1, I[4] || 0, I[5] || 0, I[6] || 0, q)) : new Date(I[1], N, I[3] || 1, I[4] || 0, I[5] || 0, I[6] || 0, q);
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
901
|
return new Date(w);
|
|
@@ -907,189 +907,107 @@ var ht = {}, tn = {
|
|
|
907
907
|
return L;
|
|
908
908
|
}, E.isValid = function() {
|
|
909
909
|
return this.$d.toString() !== h;
|
|
910
|
-
}, E.isSame = function(S,
|
|
910
|
+
}, E.isSame = function(S, O) {
|
|
911
911
|
var w = F(S);
|
|
912
|
-
return this.startOf(
|
|
913
|
-
}, E.isAfter = function(S,
|
|
914
|
-
return F(S) < this.startOf(
|
|
915
|
-
}, E.isBefore = function(S,
|
|
916
|
-
return this.endOf(
|
|
917
|
-
}, E.$g = function(S,
|
|
918
|
-
return L.u(S) ? this[
|
|
912
|
+
return this.startOf(O) <= w && w <= this.endOf(O);
|
|
913
|
+
}, E.isAfter = function(S, O) {
|
|
914
|
+
return F(S) < this.startOf(O);
|
|
915
|
+
}, E.isBefore = function(S, O) {
|
|
916
|
+
return this.endOf(O) < F(S);
|
|
917
|
+
}, E.$g = function(S, O, w) {
|
|
918
|
+
return L.u(S) ? this[O] : this.set(w, S);
|
|
919
919
|
}, E.unix = function() {
|
|
920
920
|
return Math.floor(this.valueOf() / 1e3);
|
|
921
921
|
}, E.valueOf = function() {
|
|
922
922
|
return this.$d.getTime();
|
|
923
|
-
}, E.startOf = function(S,
|
|
924
|
-
var w = this, x = !!L.u(
|
|
925
|
-
var de = L.w(w.$u ? Date.UTC(w.$y,
|
|
923
|
+
}, E.startOf = function(S, O) {
|
|
924
|
+
var w = this, x = !!L.u(O) || O, I = L.p(S), N = function(fe, ne) {
|
|
925
|
+
var de = L.w(w.$u ? Date.UTC(w.$y, ne, fe) : new Date(w.$y, ne, fe), w);
|
|
926
926
|
return x ? de : de.endOf(f);
|
|
927
|
-
},
|
|
928
|
-
return L.w(w.toDate()[fe].apply(w.toDate("s"), (x ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(
|
|
929
|
-
},
|
|
927
|
+
}, q = function(fe, ne) {
|
|
928
|
+
return L.w(w.toDate()[fe].apply(w.toDate("s"), (x ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ne)), w);
|
|
929
|
+
}, j = this.$W, U = this.$M, le = this.$D, ce = "set" + (this.$u ? "UTC" : "");
|
|
930
930
|
switch (I) {
|
|
931
931
|
case g:
|
|
932
|
-
return x ?
|
|
932
|
+
return x ? N(1, 0) : N(31, 11);
|
|
933
933
|
case u:
|
|
934
|
-
return x ?
|
|
934
|
+
return x ? N(1, U) : N(0, U + 1);
|
|
935
935
|
case b:
|
|
936
|
-
var
|
|
937
|
-
return
|
|
936
|
+
var pe = this.$locale().weekStart || 0, ye = (j < pe ? j + 7 : j) - pe;
|
|
937
|
+
return N(x ? le - ye : le + (6 - ye), U);
|
|
938
938
|
case f:
|
|
939
939
|
case y:
|
|
940
|
-
return
|
|
940
|
+
return q(ce + "Hours", 0);
|
|
941
941
|
case d:
|
|
942
|
-
return
|
|
942
|
+
return q(ce + "Minutes", 1);
|
|
943
943
|
case p:
|
|
944
|
-
return
|
|
944
|
+
return q(ce + "Seconds", 2);
|
|
945
945
|
case l:
|
|
946
|
-
return
|
|
946
|
+
return q(ce + "Milliseconds", 3);
|
|
947
947
|
default:
|
|
948
948
|
return this.clone();
|
|
949
949
|
}
|
|
950
950
|
}, E.endOf = function(S) {
|
|
951
951
|
return this.startOf(S, !1);
|
|
952
|
-
}, E.$set = function(S,
|
|
953
|
-
var w, x = L.p(S), I = "set" + (this.$u ? "UTC" : ""),
|
|
952
|
+
}, E.$set = function(S, O) {
|
|
953
|
+
var w, x = L.p(S), I = "set" + (this.$u ? "UTC" : ""), N = (w = {}, w[f] = I + "Date", w[y] = I + "Date", w[u] = I + "Month", w[g] = I + "FullYear", w[d] = I + "Hours", w[p] = I + "Minutes", w[l] = I + "Seconds", w[o] = I + "Milliseconds", w)[x], q = x === f ? this.$D + (O - this.$W) : O;
|
|
954
954
|
if (x === u || x === g) {
|
|
955
|
-
var
|
|
956
|
-
|
|
955
|
+
var j = this.clone().set(y, 1);
|
|
956
|
+
j.$d[N](q), j.init(), this.$d = j.set(y, Math.min(this.$D, j.daysInMonth())).$d;
|
|
957
957
|
} else
|
|
958
|
-
|
|
958
|
+
N && this.$d[N](q);
|
|
959
959
|
return this.init(), this;
|
|
960
|
-
}, E.set = function(S,
|
|
961
|
-
return this.clone().$set(S,
|
|
960
|
+
}, E.set = function(S, O) {
|
|
961
|
+
return this.clone().$set(S, O);
|
|
962
962
|
}, E.get = function(S) {
|
|
963
963
|
return this[L.p(S)]();
|
|
964
|
-
}, E.add = function(S,
|
|
964
|
+
}, E.add = function(S, O) {
|
|
965
965
|
var w, x = this;
|
|
966
966
|
S = Number(S);
|
|
967
|
-
var I = L.p(
|
|
968
|
-
var
|
|
969
|
-
return L.w(
|
|
967
|
+
var I = L.p(O), N = function(U) {
|
|
968
|
+
var le = F(x);
|
|
969
|
+
return L.w(le.date(le.date() + Math.round(U * S)), x);
|
|
970
970
|
};
|
|
971
971
|
if (I === u)
|
|
972
972
|
return this.set(u, this.$M + S);
|
|
973
973
|
if (I === g)
|
|
974
974
|
return this.set(g, this.$y + S);
|
|
975
975
|
if (I === f)
|
|
976
|
-
return
|
|
976
|
+
return N(1);
|
|
977
977
|
if (I === b)
|
|
978
|
-
return
|
|
979
|
-
var
|
|
980
|
-
return L.w(
|
|
981
|
-
}, E.subtract = function(S,
|
|
982
|
-
return this.add(-1 * S,
|
|
978
|
+
return N(7);
|
|
979
|
+
var q = (w = {}, w[p] = n, w[d] = s, w[l] = r, w)[I] || 1, j = this.$d.getTime() + S * q;
|
|
980
|
+
return L.w(j, this);
|
|
981
|
+
}, E.subtract = function(S, O) {
|
|
982
|
+
return this.add(-1 * S, O);
|
|
983
983
|
}, E.format = function(S) {
|
|
984
|
-
var
|
|
984
|
+
var O = this, w = this.$locale();
|
|
985
985
|
if (!this.isValid())
|
|
986
986
|
return w.invalidDate || h;
|
|
987
|
-
var x = S || "YYYY-MM-DDTHH:mm:ssZ", I = L.z(this),
|
|
988
|
-
return
|
|
989
|
-
},
|
|
990
|
-
return L.s(
|
|
991
|
-
},
|
|
992
|
-
var Te =
|
|
993
|
-
return
|
|
994
|
-
};
|
|
995
|
-
return x.replace(A, function(
|
|
996
|
-
return de ||
|
|
997
|
-
switch (me) {
|
|
998
|
-
case "YY":
|
|
999
|
-
return String(R.$y).slice(-2);
|
|
1000
|
-
case "YYYY":
|
|
1001
|
-
return L.s(R.$y, 4, "0");
|
|
1002
|
-
case "M":
|
|
1003
|
-
return V + 1;
|
|
1004
|
-
case "MM":
|
|
1005
|
-
return L.s(V + 1, 2, "0");
|
|
1006
|
-
case "MMM":
|
|
1007
|
-
return ce(w.monthsShort, V, re, 3);
|
|
1008
|
-
case "MMMM":
|
|
1009
|
-
return ce(re, V);
|
|
1010
|
-
case "D":
|
|
1011
|
-
return R.$D;
|
|
1012
|
-
case "DD":
|
|
1013
|
-
return L.s(R.$D, 2, "0");
|
|
1014
|
-
case "d":
|
|
1015
|
-
return String(R.$W);
|
|
1016
|
-
case "dd":
|
|
1017
|
-
return ce(w.weekdaysMin, R.$W, U, 2);
|
|
1018
|
-
case "ddd":
|
|
1019
|
-
return ce(w.weekdaysShort, R.$W, U, 3);
|
|
1020
|
-
case "dddd":
|
|
1021
|
-
return U[R.$W];
|
|
1022
|
-
case "H":
|
|
1023
|
-
return String($);
|
|
1024
|
-
case "HH":
|
|
1025
|
-
return L.s($, 2, "0");
|
|
1026
|
-
case "h":
|
|
1027
|
-
return ve(1);
|
|
1028
|
-
case "hh":
|
|
1029
|
-
return ve(2);
|
|
1030
|
-
case "a":
|
|
1031
|
-
return fe($, j, !0);
|
|
1032
|
-
case "A":
|
|
1033
|
-
return fe($, j, !1);
|
|
1034
|
-
case "m":
|
|
1035
|
-
return String(j);
|
|
1036
|
-
case "mm":
|
|
1037
|
-
return L.s(j, 2, "0");
|
|
1038
|
-
case "s":
|
|
1039
|
-
return String(R.$s);
|
|
1040
|
-
case "ss":
|
|
1041
|
-
return L.s(R.$s, 2, "0");
|
|
1042
|
-
case "SSS":
|
|
1043
|
-
return L.s(R.$ms, 3, "0");
|
|
1044
|
-
case "Z":
|
|
1045
|
-
return I;
|
|
1046
|
-
}
|
|
1047
|
-
return null;
|
|
1048
|
-
}(ae) || I.replace(":", "");
|
|
987
|
+
var x = S || "YYYY-MM-DDTHH:mm:ssZ", I = L.z(this), N = this.$H, q = this.$m, j = this.$M, U = w.weekdays, le = w.months, ce = function(ne, de, ve, Te) {
|
|
988
|
+
return ne && (ne[de] || ne(O, x)) || ve[de].slice(0, Te);
|
|
989
|
+
}, pe = function(ne) {
|
|
990
|
+
return L.s(N % 12 || 12, ne, "0");
|
|
991
|
+
}, ye = w.meridiem || function(ne, de, ve) {
|
|
992
|
+
var Te = ne < 12 ? "AM" : "PM";
|
|
993
|
+
return ve ? Te.toLowerCase() : Te;
|
|
994
|
+
}, fe = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: j + 1, MM: L.s(j + 1, 2, "0"), MMM: ce(w.monthsShort, j, le, 3), MMMM: ce(le, j), D: this.$D, DD: L.s(this.$D, 2, "0"), d: String(this.$W), dd: ce(w.weekdaysMin, this.$W, U, 2), ddd: ce(w.weekdaysShort, this.$W, U, 3), dddd: U[this.$W], H: String(N), HH: L.s(N, 2, "0"), h: pe(1), hh: pe(2), a: ye(N, q, !0), A: ye(N, q, !1), m: String(q), mm: L.s(q, 2, "0"), s: String(this.$s), ss: L.s(this.$s, 2, "0"), SSS: L.s(this.$ms, 3, "0"), Z: I };
|
|
995
|
+
return x.replace(A, function(ne, de) {
|
|
996
|
+
return de || fe[ne] || I.replace(":", "");
|
|
1049
997
|
});
|
|
1050
998
|
}, E.utcOffset = function() {
|
|
1051
999
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1052
|
-
}, E.diff = function(S,
|
|
1053
|
-
var x, I =
|
|
1054
|
-
|
|
1055
|
-
};
|
|
1056
|
-
switch ($) {
|
|
1057
|
-
case g:
|
|
1058
|
-
x = re() / 12;
|
|
1059
|
-
break;
|
|
1060
|
-
case u:
|
|
1061
|
-
x = re();
|
|
1062
|
-
break;
|
|
1063
|
-
case c:
|
|
1064
|
-
x = re() / 3;
|
|
1065
|
-
break;
|
|
1066
|
-
case b:
|
|
1067
|
-
x = (U - V) / 6048e5;
|
|
1068
|
-
break;
|
|
1069
|
-
case f:
|
|
1070
|
-
x = (U - V) / 864e5;
|
|
1071
|
-
break;
|
|
1072
|
-
case d:
|
|
1073
|
-
x = U / s;
|
|
1074
|
-
break;
|
|
1075
|
-
case p:
|
|
1076
|
-
x = U / n;
|
|
1077
|
-
break;
|
|
1078
|
-
case l:
|
|
1079
|
-
x = U / r;
|
|
1080
|
-
break;
|
|
1081
|
-
default:
|
|
1082
|
-
x = U;
|
|
1083
|
-
}
|
|
1084
|
-
return w ? x : L.a(x);
|
|
1000
|
+
}, E.diff = function(S, O, w) {
|
|
1001
|
+
var x, I = L.p(O), N = F(S), q = (N.utcOffset() - this.utcOffset()) * n, j = this - N, U = L.m(this, N);
|
|
1002
|
+
return U = (x = {}, x[g] = U / 12, x[u] = U, x[c] = U / 3, x[b] = (j - q) / 6048e5, x[f] = (j - q) / 864e5, x[d] = j / s, x[p] = j / n, x[l] = j / r, x)[I] || j, w ? U : L.a(U);
|
|
1085
1003
|
}, E.daysInMonth = function() {
|
|
1086
1004
|
return this.endOf(u).$D;
|
|
1087
1005
|
}, E.$locale = function() {
|
|
1088
1006
|
return Q[this.$L];
|
|
1089
|
-
}, E.locale = function(S,
|
|
1007
|
+
}, E.locale = function(S, O) {
|
|
1090
1008
|
if (!S)
|
|
1091
1009
|
return this.$L;
|
|
1092
|
-
var w = this.clone(), x = Z(S,
|
|
1010
|
+
var w = this.clone(), x = Z(S, O, !0);
|
|
1093
1011
|
return x && (w.$L = x), w;
|
|
1094
1012
|
}, E.clone = function() {
|
|
1095
1013
|
return L.w(this.$d, this);
|
|
@@ -1101,17 +1019,17 @@ var ht = {}, tn = {
|
|
|
1101
1019
|
return this.$d.toISOString();
|
|
1102
1020
|
}, E.toString = function() {
|
|
1103
1021
|
return this.$d.toUTCString();
|
|
1104
|
-
},
|
|
1022
|
+
}, R;
|
|
1105
1023
|
}(), te = B.prototype;
|
|
1106
|
-
return F.prototype = te, [["$ms", o], ["$s", l], ["$m", p], ["$H", d], ["$W", f], ["$M", u], ["$y", g], ["$D", y]].forEach(function(
|
|
1107
|
-
te[
|
|
1108
|
-
return this.$g(E,
|
|
1024
|
+
return F.prototype = te, [["$ms", o], ["$s", l], ["$m", p], ["$H", d], ["$W", f], ["$M", u], ["$y", g], ["$D", y]].forEach(function(R) {
|
|
1025
|
+
te[R[1]] = function(E) {
|
|
1026
|
+
return this.$g(E, R[0], R[1]);
|
|
1109
1027
|
};
|
|
1110
|
-
}), F.extend = function(
|
|
1111
|
-
return
|
|
1112
|
-
}, F.locale = Z, F.isDayjs =
|
|
1113
|
-
return F(1e3 *
|
|
1114
|
-
}, F.en = Q[
|
|
1028
|
+
}), F.extend = function(R, E) {
|
|
1029
|
+
return R.$i || (R(E, B, F), R.$i = !0), F;
|
|
1030
|
+
}, F.locale = Z, F.isDayjs = Y, F.unix = function(R) {
|
|
1031
|
+
return F(1e3 * R);
|
|
1032
|
+
}, F.en = Q[re], F.Ls = Q, F.p = {}, F;
|
|
1115
1033
|
});
|
|
1116
1034
|
})(tn);
|
|
1117
1035
|
const $t = ht, rn = {
|
|
@@ -1137,7 +1055,7 @@ const $t = ht, rn = {
|
|
|
1137
1055
|
delete: async (e, t) => X.getRequest("POST", t)("/sql_snippet/delete", {
|
|
1138
1056
|
id: e
|
|
1139
1057
|
})
|
|
1140
|
-
},
|
|
1058
|
+
}, oe = {
|
|
1141
1059
|
datasource: Jr,
|
|
1142
1060
|
account: Xr,
|
|
1143
1061
|
role: en,
|
|
@@ -1174,18 +1092,18 @@ function nn({
|
|
|
1174
1092
|
});
|
|
1175
1093
|
return bt(() => {
|
|
1176
1094
|
s("type", r);
|
|
1177
|
-
}, [s, r]), /* @__PURE__ */ a(
|
|
1178
|
-
/* @__PURE__ */ a(
|
|
1095
|
+
}, [s, r]), /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: o(e), children: [
|
|
1096
|
+
/* @__PURE__ */ a(H, { name: "key", control: n, render: ({
|
|
1179
1097
|
field: l
|
|
1180
1098
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", placeholder: "A unique name", ...l }) }),
|
|
1181
1099
|
/* @__PURE__ */ a(Je, { label: "Connection Info", labelPosition: "center" }),
|
|
1182
1100
|
/* @__PURE__ */ C(J, { grow: !0, children: [
|
|
1183
|
-
/* @__PURE__ */ a(
|
|
1101
|
+
/* @__PURE__ */ a(H, { name: "config.host", control: n, render: ({
|
|
1184
1102
|
field: l
|
|
1185
1103
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Host", sx: {
|
|
1186
1104
|
flexGrow: 1
|
|
1187
1105
|
}, ...l }) }),
|
|
1188
|
-
/* @__PURE__ */ a(
|
|
1106
|
+
/* @__PURE__ */ a(H, { name: "config.port", control: n, render: ({
|
|
1189
1107
|
field: l
|
|
1190
1108
|
}) => (
|
|
1191
1109
|
// @ts-expect-error type of onChange
|
|
@@ -1194,22 +1112,22 @@ function nn({
|
|
|
1194
1112
|
}, ...l })
|
|
1195
1113
|
) })
|
|
1196
1114
|
] }),
|
|
1197
|
-
/* @__PURE__ */ a(
|
|
1115
|
+
/* @__PURE__ */ a(H, { name: "config.username", control: n, render: ({
|
|
1198
1116
|
field: l
|
|
1199
1117
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Username", ...l }) }),
|
|
1200
|
-
/* @__PURE__ */ a(
|
|
1118
|
+
/* @__PURE__ */ a(H, { name: "config.password", control: n, render: ({
|
|
1201
1119
|
field: l
|
|
1202
1120
|
}) => /* @__PURE__ */ a(et, { mb: t.spacing, size: t.size, required: !0, label: "Password", ...l }) }),
|
|
1203
|
-
/* @__PURE__ */ a(
|
|
1121
|
+
/* @__PURE__ */ a(H, { name: "config.database", control: n, render: ({
|
|
1204
1122
|
field: l
|
|
1205
1123
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Database", ...l }) }),
|
|
1206
|
-
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(
|
|
1124
|
+
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
1207
1125
|
] }) });
|
|
1208
1126
|
}
|
|
1209
1127
|
const an = ({
|
|
1210
1128
|
value: e,
|
|
1211
1129
|
onChange: t
|
|
1212
|
-
}) => /* @__PURE__ */ a(
|
|
1130
|
+
}) => /* @__PURE__ */ a(se, { sx: {
|
|
1213
1131
|
position: "relative"
|
|
1214
1132
|
}, children: /* @__PURE__ */ a(Yt, { height: "500px", defaultLanguage: "javascript", value: e, onChange: (n) => {
|
|
1215
1133
|
n && t(n);
|
|
@@ -1238,16 +1156,16 @@ const an = ({
|
|
|
1238
1156
|
return bt(() => {
|
|
1239
1157
|
u(e);
|
|
1240
1158
|
}, [e]), /* @__PURE__ */ C(he, { children: [
|
|
1241
|
-
/* @__PURE__ */ a(
|
|
1159
|
+
/* @__PURE__ */ a(V, { variant: "filled", size: o.button.size, onClick: d, sx: {
|
|
1242
1160
|
flexGrow: 1
|
|
1243
1161
|
}, children: r }),
|
|
1244
1162
|
/* @__PURE__ */ a(Ae, { size: 800, title: n, opened: p, onClose: f, closeOnClickOutside: !1, withCloseButton: !1, children: p && /* @__PURE__ */ C(Be, { children: [
|
|
1245
1163
|
/* @__PURE__ */ a(an, { value: b, onChange: u }),
|
|
1246
1164
|
/* @__PURE__ */ C(J, { position: "apart", children: [
|
|
1247
|
-
/* @__PURE__ */ a(
|
|
1165
|
+
/* @__PURE__ */ a(V, { onClick: y, color: "red", leftIcon: /* @__PURE__ */ a(Dr, { size: 20 }), children: "Rest" }),
|
|
1248
1166
|
/* @__PURE__ */ C(J, { position: "right", children: [
|
|
1249
|
-
/* @__PURE__ */ a(
|
|
1250
|
-
/* @__PURE__ */ a(
|
|
1167
|
+
/* @__PURE__ */ a(V, { onClick: g, variant: "subtle", children: "Cancel" }),
|
|
1168
|
+
/* @__PURE__ */ a(V, { onClick: c, children: "OK" })
|
|
1251
1169
|
] })
|
|
1252
1170
|
] })
|
|
1253
1171
|
] }) })
|
|
@@ -1279,31 +1197,31 @@ function on({
|
|
|
1279
1197
|
}
|
|
1280
1198
|
}
|
|
1281
1199
|
});
|
|
1282
|
-
return /* @__PURE__ */ a(
|
|
1283
|
-
/* @__PURE__ */ a(
|
|
1200
|
+
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: s(e), children: [
|
|
1201
|
+
/* @__PURE__ */ a(H, { name: "key", control: r, render: ({
|
|
1284
1202
|
field: o
|
|
1285
1203
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", placeholder: "A unique name", ...o }) }),
|
|
1286
1204
|
/* @__PURE__ */ a(Je, { label: "Connection Info", labelPosition: "center" }),
|
|
1287
|
-
/* @__PURE__ */ a(
|
|
1205
|
+
/* @__PURE__ */ a(H, { name: "config.host", control: r, render: ({
|
|
1288
1206
|
field: o
|
|
1289
1207
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Base URL", sx: {
|
|
1290
1208
|
flexGrow: 1
|
|
1291
1209
|
}, ...o }) }),
|
|
1292
1210
|
/* @__PURE__ */ C(J, { grow: !0, children: [
|
|
1293
|
-
/* @__PURE__ */ a(
|
|
1211
|
+
/* @__PURE__ */ a(H, { name: "config.processing.pre", control: r, render: ({
|
|
1294
1212
|
field: o
|
|
1295
1213
|
}) => /* @__PURE__ */ a(Ke, { label: "Pre Processing", modalTitle: "This function will run before sending the request (for scenarios like encryption)", defaultValue: Ve.pre, ...o, styles: t }) }),
|
|
1296
|
-
/* @__PURE__ */ a(
|
|
1214
|
+
/* @__PURE__ */ a(H, { name: "config.processing.post", control: r, render: ({
|
|
1297
1215
|
field: o
|
|
1298
1216
|
}) => /* @__PURE__ */ a(Ke, { label: "Post Processing", modalTitle: "This function will run after sending the request (for scenarios like decryption)", defaultValue: Ve.post, ...o, styles: t }) })
|
|
1299
1217
|
] }),
|
|
1300
|
-
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(
|
|
1218
|
+
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
1301
1219
|
] }) });
|
|
1302
1220
|
}
|
|
1303
1221
|
function sn({
|
|
1304
1222
|
styles: e = Se
|
|
1305
1223
|
}) {
|
|
1306
|
-
return /* @__PURE__ */ a(
|
|
1224
|
+
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C(Tr, { mt: e.spacing, icon: /* @__PURE__ */ a(Lr, { size: 16 }), children: [
|
|
1307
1225
|
"Only ",
|
|
1308
1226
|
/* @__PURE__ */ a("b", { children: "SELECT" }),
|
|
1309
1227
|
" privilege is needed."
|
|
@@ -1318,7 +1236,7 @@ function ln({
|
|
|
1318
1236
|
key: d,
|
|
1319
1237
|
config: f
|
|
1320
1238
|
}) => {
|
|
1321
|
-
|
|
1239
|
+
be({
|
|
1322
1240
|
id: "for-creating",
|
|
1323
1241
|
title: "Pending",
|
|
1324
1242
|
message: "Adding data source...",
|
|
@@ -1329,7 +1247,7 @@ function ln({
|
|
|
1329
1247
|
type: p,
|
|
1330
1248
|
key: d,
|
|
1331
1249
|
config: f
|
|
1332
|
-
}), await
|
|
1250
|
+
}), await oe.datasource.create(p, d, f), ee({
|
|
1333
1251
|
id: "for-creating",
|
|
1334
1252
|
title: "Successful",
|
|
1335
1253
|
message: "Data source is added",
|
|
@@ -1344,7 +1262,7 @@ function ln({
|
|
|
1344
1262
|
});
|
|
1345
1263
|
}
|
|
1346
1264
|
}, o = r === "postgresql" || r === "mysql", l = r === "http";
|
|
1347
|
-
return /* @__PURE__ */ C(
|
|
1265
|
+
return /* @__PURE__ */ C(se, { mx: "auto", children: [
|
|
1348
1266
|
/* @__PURE__ */ a(Rr, { fullWidth: !0, mb: t.spacing, size: t.size, data: [{
|
|
1349
1267
|
label: "PostgreSQL",
|
|
1350
1268
|
value: "postgresql"
|
|
@@ -1371,7 +1289,7 @@ function un({
|
|
|
1371
1289
|
}, children: /* @__PURE__ */ a(ln, { postSubmit: () => {
|
|
1372
1290
|
e(), o();
|
|
1373
1291
|
}, styles: t }) }),
|
|
1374
|
-
/* @__PURE__ */ a(
|
|
1292
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: s, leftIcon: /* @__PURE__ */ a(at, { size: 20 }), children: "Add a Data Source" })
|
|
1375
1293
|
] });
|
|
1376
1294
|
}
|
|
1377
1295
|
const cn = (e) => e.replace(/([^:])(\/\/+)/g, "$1/");
|
|
@@ -1396,12 +1314,12 @@ function pn({
|
|
|
1396
1314
|
styles: s = Se
|
|
1397
1315
|
}) {
|
|
1398
1316
|
const o = je(), l = async () => {
|
|
1399
|
-
e && (
|
|
1317
|
+
e && (be({
|
|
1400
1318
|
id: "for-deleting",
|
|
1401
1319
|
title: "Pending",
|
|
1402
1320
|
message: "Deleting data source...",
|
|
1403
1321
|
loading: !0
|
|
1404
|
-
}), await
|
|
1322
|
+
}), await oe.datasource.delete(e), ee({
|
|
1405
1323
|
id: "for-deleting",
|
|
1406
1324
|
title: "Successful",
|
|
1407
1325
|
message: `Data source [${t}] is deleted`,
|
|
@@ -1421,9 +1339,9 @@ function pn({
|
|
|
1421
1339
|
hover: !0,
|
|
1422
1340
|
touch: !1,
|
|
1423
1341
|
focus: !1
|
|
1424
|
-
}, label: "This is a preset datasource, it can not be deleted", children: /* @__PURE__ */ a(
|
|
1342
|
+
}, label: "This is a preset datasource, it can not be deleted", children: /* @__PURE__ */ a(V, { size: s.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(Vt, { size: 16 }), sx: {
|
|
1425
1343
|
transform: "none !important"
|
|
1426
|
-
}, children: "Delete" }) }) : /* @__PURE__ */ a(
|
|
1344
|
+
}, children: "Delete" }) }) : /* @__PURE__ */ a(V, { size: s.button.size, color: "red", onClick: p, leftIcon: /* @__PURE__ */ a(it, { size: 16 }), children: "Delete" });
|
|
1427
1345
|
}
|
|
1428
1346
|
const Pt = {
|
|
1429
1347
|
pre: ["function pre_process({ method, url, params, headers, data }, utils) {", " // your code goes here", " return { method, url, params, headers, data }", "}"].join(`
|
|
@@ -1445,23 +1363,23 @@ function gn({
|
|
|
1445
1363
|
config: t
|
|
1446
1364
|
}
|
|
1447
1365
|
});
|
|
1448
|
-
return /* @__PURE__ */ a(
|
|
1366
|
+
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: o(r), children: [
|
|
1449
1367
|
/* @__PURE__ */ a(ue, { mb: n.spacing, size: n.size, required: !0, label: "Name", value: e, readOnly: !0 }),
|
|
1450
1368
|
/* @__PURE__ */ a(Je, { label: "Connection Info", labelPosition: "center" }),
|
|
1451
|
-
/* @__PURE__ */ a(
|
|
1369
|
+
/* @__PURE__ */ a(H, { name: "config.host", control: s, render: ({
|
|
1452
1370
|
field: l
|
|
1453
1371
|
}) => /* @__PURE__ */ a(ue, { mb: n.spacing, size: n.size, label: "Base URL", sx: {
|
|
1454
1372
|
flexGrow: 1
|
|
1455
1373
|
}, ...l }) }),
|
|
1456
1374
|
/* @__PURE__ */ C(J, { grow: !0, children: [
|
|
1457
|
-
/* @__PURE__ */ a(
|
|
1375
|
+
/* @__PURE__ */ a(H, { name: "config.processing.pre", control: s, render: ({
|
|
1458
1376
|
field: l
|
|
1459
1377
|
}) => /* @__PURE__ */ a(Ke, { label: "Pre Processing", modalTitle: "This function will run before sending the request (for scenarios like encryption)", defaultValue: Pt.pre, ...l, styles: n }) }),
|
|
1460
|
-
/* @__PURE__ */ a(
|
|
1378
|
+
/* @__PURE__ */ a(H, { name: "config.processing.post", control: s, render: ({
|
|
1461
1379
|
field: l
|
|
1462
1380
|
}) => /* @__PURE__ */ a(Ke, { label: "Post Processing", modalTitle: "This function will run after sending the request (for scenarios like decryption)", defaultValue: Pt.post, ...l, styles: n }) })
|
|
1463
1381
|
] }),
|
|
1464
|
-
/* @__PURE__ */ a(J, { position: "right", mt: n.spacing, children: /* @__PURE__ */ a(
|
|
1382
|
+
/* @__PURE__ */ a(J, { position: "right", mt: n.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: n.button.size, children: "Save" }) })
|
|
1465
1383
|
] }) });
|
|
1466
1384
|
}
|
|
1467
1385
|
function fn({
|
|
@@ -1472,7 +1390,7 @@ function fn({
|
|
|
1472
1390
|
const n = async ({
|
|
1473
1391
|
config: s
|
|
1474
1392
|
}) => {
|
|
1475
|
-
|
|
1393
|
+
be({
|
|
1476
1394
|
id: "for-updating",
|
|
1477
1395
|
title: "Pending",
|
|
1478
1396
|
message: "Editing data source...",
|
|
@@ -1481,7 +1399,7 @@ function fn({
|
|
|
1481
1399
|
try {
|
|
1482
1400
|
console.log({
|
|
1483
1401
|
config: s
|
|
1484
|
-
}), await
|
|
1402
|
+
}), await oe.datasource.update(e.id, s), ee({
|
|
1485
1403
|
id: "for-updating",
|
|
1486
1404
|
title: "Successful",
|
|
1487
1405
|
message: "Data source is updated",
|
|
@@ -1496,7 +1414,7 @@ function fn({
|
|
|
1496
1414
|
});
|
|
1497
1415
|
}
|
|
1498
1416
|
};
|
|
1499
|
-
return e.config ? /* @__PURE__ */ a(
|
|
1417
|
+
return e.config ? /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ a(gn, { name: e.key, config: e.config, submit: n, styles: r }) }) : (console.error(new Error("unexpected empty config of a http datasource")), null);
|
|
1500
1418
|
}
|
|
1501
1419
|
function hn({
|
|
1502
1420
|
dataSource: e,
|
|
@@ -1510,19 +1428,19 @@ function hn({
|
|
|
1510
1428
|
hover: !0,
|
|
1511
1429
|
touch: !1,
|
|
1512
1430
|
focus: !1
|
|
1513
|
-
}, label: "This is a preset datasource, it can not be changed", children: /* @__PURE__ */ a(
|
|
1431
|
+
}, label: "This is a preset datasource, it can not be changed", children: /* @__PURE__ */ a(V, { size: r.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(Vt, { size: 16 }), sx: {
|
|
1514
1432
|
transform: "none !important"
|
|
1515
1433
|
}, children: "Edit" }) }) : e.type !== "http" ? /* @__PURE__ */ a(We, { withArrow: !0, events: {
|
|
1516
1434
|
hover: !0,
|
|
1517
1435
|
touch: !1,
|
|
1518
1436
|
focus: !1
|
|
1519
|
-
}, label: "Only HTTP datasources can be edited", children: /* @__PURE__ */ a(
|
|
1437
|
+
}, label: "Only HTTP datasources can be edited", children: /* @__PURE__ */ a(V, { size: r.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(ft, { size: 16 }), sx: {
|
|
1520
1438
|
transform: "none !important"
|
|
1521
1439
|
}, children: "Edit" }) }) : /* @__PURE__ */ C(he, { children: [
|
|
1522
1440
|
/* @__PURE__ */ a(Ae, { opened: n, onClose: () => s(!1), title: "Add a data source", trapFocus: !0, onDragStart: (d) => {
|
|
1523
1441
|
d.stopPropagation();
|
|
1524
1442
|
}, children: /* @__PURE__ */ a(fn, { dataSource: e, postSubmit: p, styles: r }) }),
|
|
1525
|
-
/* @__PURE__ */ a(
|
|
1443
|
+
/* @__PURE__ */ a(V, { size: r.button.size, color: "blue", onClick: o, leftIcon: /* @__PURE__ */ a(ft, { size: 16 }), children: "Edit" })
|
|
1526
1444
|
] });
|
|
1527
1445
|
}
|
|
1528
1446
|
const mn = {
|
|
@@ -1559,14 +1477,14 @@ function wa({
|
|
|
1559
1477
|
} = Oe(async () => {
|
|
1560
1478
|
const {
|
|
1561
1479
|
data: o
|
|
1562
|
-
} = await
|
|
1480
|
+
} = await oe.datasource.list();
|
|
1563
1481
|
return o;
|
|
1564
1482
|
}, {
|
|
1565
1483
|
refreshDeps: []
|
|
1566
1484
|
});
|
|
1567
1485
|
return /* @__PURE__ */ C(he, { children: [
|
|
1568
1486
|
/* @__PURE__ */ a(J, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(un, { onSuccess: s }) }),
|
|
1569
|
-
/* @__PURE__ */ C(
|
|
1487
|
+
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
1570
1488
|
position: "relative"
|
|
1571
1489
|
}, children: [
|
|
1572
1490
|
/* @__PURE__ */ a(tt, { visible: n }),
|
|
@@ -1612,7 +1530,7 @@ const vn = Qe(({
|
|
|
1612
1530
|
const {
|
|
1613
1531
|
data: s = [],
|
|
1614
1532
|
loading: o
|
|
1615
|
-
} = Oe(async () => (await
|
|
1533
|
+
} = Oe(async () => (await oe.role.list()).map((p) => ({
|
|
1616
1534
|
label: p.id,
|
|
1617
1535
|
value: p.id,
|
|
1618
1536
|
description: p.description,
|
|
@@ -1654,19 +1572,19 @@ function Sn({
|
|
|
1654
1572
|
password: ""
|
|
1655
1573
|
}
|
|
1656
1574
|
});
|
|
1657
|
-
return /* @__PURE__ */ a(
|
|
1575
|
+
return /* @__PURE__ */ a(se, { mx: "auto", mb: 10, children: /* @__PURE__ */ C("form", { onSubmit: s(async ({
|
|
1658
1576
|
name: l,
|
|
1659
1577
|
email: p,
|
|
1660
1578
|
password: d,
|
|
1661
1579
|
role_id: f
|
|
1662
1580
|
}) => {
|
|
1663
1581
|
try {
|
|
1664
|
-
|
|
1582
|
+
be({
|
|
1665
1583
|
id: "for-creating",
|
|
1666
1584
|
title: "Pending",
|
|
1667
1585
|
message: "Adding account...",
|
|
1668
1586
|
loading: !0
|
|
1669
|
-
}), await
|
|
1587
|
+
}), await oe.account.create(l, p, d, f), ee({
|
|
1670
1588
|
id: "for-creating",
|
|
1671
1589
|
title: "Successful",
|
|
1672
1590
|
message: "Account is added",
|
|
@@ -1681,19 +1599,19 @@ function Sn({
|
|
|
1681
1599
|
});
|
|
1682
1600
|
}
|
|
1683
1601
|
}), children: [
|
|
1684
|
-
/* @__PURE__ */ a(
|
|
1602
|
+
/* @__PURE__ */ a(H, { name: "name", control: n, render: ({
|
|
1685
1603
|
field: l
|
|
1686
1604
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Username", ...l }) }),
|
|
1687
|
-
/* @__PURE__ */ a(
|
|
1605
|
+
/* @__PURE__ */ a(H, { name: "email", control: n, render: ({
|
|
1688
1606
|
field: l
|
|
1689
1607
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Email", ...l }) }),
|
|
1690
|
-
/* @__PURE__ */ a(
|
|
1608
|
+
/* @__PURE__ */ a(H, { name: "password", control: n, render: ({
|
|
1691
1609
|
field: l
|
|
1692
1610
|
}) => /* @__PURE__ */ a(et, { mb: t.spacing, size: t.size, required: !0, label: "Password", description: "Password must be at least 8 characters long", ...l }) }),
|
|
1693
|
-
/* @__PURE__ */ a(
|
|
1611
|
+
/* @__PURE__ */ a(H, { name: "role_id", control: n, render: ({
|
|
1694
1612
|
field: l
|
|
1695
1613
|
}) => /* @__PURE__ */ a(vt, { styles: t, ...l }) }),
|
|
1696
|
-
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(
|
|
1614
|
+
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
1697
1615
|
] }) });
|
|
1698
1616
|
}
|
|
1699
1617
|
function wn({
|
|
@@ -1708,7 +1626,7 @@ function wn({
|
|
|
1708
1626
|
}, children: /* @__PURE__ */ a(Sn, { postSubmit: () => {
|
|
1709
1627
|
e(), l();
|
|
1710
1628
|
}, styles: t, initialRoleID: r }) }),
|
|
1711
|
-
/* @__PURE__ */ a(
|
|
1629
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(at, { size: 20 }), children: "Add an Account" })
|
|
1712
1630
|
] });
|
|
1713
1631
|
}
|
|
1714
1632
|
function En({
|
|
@@ -1719,14 +1637,14 @@ function En({
|
|
|
1719
1637
|
}) {
|
|
1720
1638
|
const s = je(), o = async () => {
|
|
1721
1639
|
if (e) {
|
|
1722
|
-
|
|
1640
|
+
be({
|
|
1723
1641
|
id: "for-deleting",
|
|
1724
1642
|
title: "Pending",
|
|
1725
1643
|
message: "Deleting account...",
|
|
1726
1644
|
loading: !0
|
|
1727
1645
|
});
|
|
1728
1646
|
try {
|
|
1729
|
-
await
|
|
1647
|
+
await oe.account.delete(e), ee({
|
|
1730
1648
|
id: "for-deleting",
|
|
1731
1649
|
title: "Successful",
|
|
1732
1650
|
message: `Account [${t}] is deleted`,
|
|
@@ -1750,7 +1668,7 @@ function En({
|
|
|
1750
1668
|
onCancel: () => console.log("Cancel"),
|
|
1751
1669
|
onConfirm: o
|
|
1752
1670
|
});
|
|
1753
|
-
return /* @__PURE__ */ a(
|
|
1671
|
+
return /* @__PURE__ */ a(V, { size: n.button.size, color: "red", onClick: l, leftIcon: /* @__PURE__ */ a(it, { size: 20 }), children: "Delete" });
|
|
1754
1672
|
}
|
|
1755
1673
|
function _n({
|
|
1756
1674
|
id: e,
|
|
@@ -1780,12 +1698,12 @@ function _n({
|
|
|
1780
1698
|
new_password: _
|
|
1781
1699
|
}) => {
|
|
1782
1700
|
try {
|
|
1783
|
-
|
|
1701
|
+
be({
|
|
1784
1702
|
id: "for-updating",
|
|
1785
1703
|
title: "Pending",
|
|
1786
1704
|
message: "Updating account...",
|
|
1787
1705
|
loading: !0
|
|
1788
|
-
}), await
|
|
1706
|
+
}), await oe.account.edit({
|
|
1789
1707
|
id: e,
|
|
1790
1708
|
name: c.trim(),
|
|
1791
1709
|
email: g.trim(),
|
|
@@ -1807,18 +1725,18 @@ function _n({
|
|
|
1807
1725
|
});
|
|
1808
1726
|
}
|
|
1809
1727
|
}, [b, u] = d(["reset_password", "new_password"]);
|
|
1810
|
-
return /* @__PURE__ */ a(
|
|
1811
|
-
/* @__PURE__ */ a(
|
|
1728
|
+
return /* @__PURE__ */ a(se, { mx: "auto", mb: 10, children: /* @__PURE__ */ C("form", { onSubmit: p(f), children: [
|
|
1729
|
+
/* @__PURE__ */ a(H, { name: "name", control: l, render: ({
|
|
1812
1730
|
field: c
|
|
1813
1731
|
}) => /* @__PURE__ */ a(ue, { mb: o.spacing, size: o.size, required: !0, label: "Username", ...c }) }),
|
|
1814
|
-
/* @__PURE__ */ a(
|
|
1732
|
+
/* @__PURE__ */ a(H, { name: "email", control: l, render: ({
|
|
1815
1733
|
field: c
|
|
1816
1734
|
}) => /* @__PURE__ */ a(ue, { mb: o.spacing, size: o.size, required: !0, label: "Email", ...c }) }),
|
|
1817
|
-
/* @__PURE__ */ a(
|
|
1735
|
+
/* @__PURE__ */ a(H, { name: "role_id", control: l, render: ({
|
|
1818
1736
|
field: c
|
|
1819
1737
|
}) => /* @__PURE__ */ a(vt, { styles: o, ...c }) }),
|
|
1820
1738
|
/* @__PURE__ */ a(Je, { my: 20, variant: "dashed", label: "", labelPosition: "center" }),
|
|
1821
|
-
/* @__PURE__ */ a(
|
|
1739
|
+
/* @__PURE__ */ a(H, { name: "reset_password", control: l, render: ({
|
|
1822
1740
|
field: c
|
|
1823
1741
|
}) => /* @__PURE__ */ a(xr, { mb: o.spacing, size: o.size, label: "Reset password", checked: c.value, onChange: (g) => c.onChange(g.currentTarget.checked), styles: {
|
|
1824
1742
|
label: {
|
|
@@ -1826,7 +1744,7 @@ function _n({
|
|
|
1826
1744
|
}
|
|
1827
1745
|
} }) }),
|
|
1828
1746
|
b && /* @__PURE__ */ a(
|
|
1829
|
-
|
|
1747
|
+
H,
|
|
1830
1748
|
{
|
|
1831
1749
|
name: "new_password",
|
|
1832
1750
|
control: l,
|
|
@@ -1835,7 +1753,7 @@ function _n({
|
|
|
1835
1753
|
}) => /* @__PURE__ */ a(et, { autoComplete: "off", mb: o.spacing, size: o.size, required: !0, description: "Password must be at least 8 characters long", label: "New Password", ...c })
|
|
1836
1754
|
}
|
|
1837
1755
|
),
|
|
1838
|
-
/* @__PURE__ */ a(J, { position: "right", mt: o.spacing, children: /* @__PURE__ */ a(
|
|
1756
|
+
/* @__PURE__ */ a(J, { position: "right", mt: o.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: o.button.size, children: "Submit" }) })
|
|
1839
1757
|
] }) });
|
|
1840
1758
|
}
|
|
1841
1759
|
function An({
|
|
@@ -1850,7 +1768,7 @@ function An({
|
|
|
1850
1768
|
/* @__PURE__ */ a(Ae, { opened: n, onClose: () => s(!1), title: `Editing ${e.name}`, trapFocus: !0, onDragStart: (d) => {
|
|
1851
1769
|
d.stopPropagation();
|
|
1852
1770
|
}, children: /* @__PURE__ */ a(_n, { ...e, postSubmit: p, styles: r }) }),
|
|
1853
|
-
/* @__PURE__ */ a(
|
|
1771
|
+
/* @__PURE__ */ a(V, { size: r.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(Fr, { size: 20 }), children: "Edit" })
|
|
1854
1772
|
] });
|
|
1855
1773
|
}
|
|
1856
1774
|
function Ea({
|
|
@@ -1866,14 +1784,14 @@ function Ea({
|
|
|
1866
1784
|
} = Oe(async () => {
|
|
1867
1785
|
const {
|
|
1868
1786
|
data: d
|
|
1869
|
-
} = await
|
|
1787
|
+
} = await oe.account.list();
|
|
1870
1788
|
return d;
|
|
1871
1789
|
}, {
|
|
1872
1790
|
refreshDeps: []
|
|
1873
1791
|
}), {
|
|
1874
1792
|
data: o = [],
|
|
1875
1793
|
loading: l
|
|
1876
|
-
} = Oe(async () => (await
|
|
1794
|
+
} = Oe(async () => (await oe.role.list()).map((f) => ({
|
|
1877
1795
|
label: f.id,
|
|
1878
1796
|
value: f.id,
|
|
1879
1797
|
description: f.description,
|
|
@@ -1883,7 +1801,7 @@ function Ea({
|
|
|
1883
1801
|
});
|
|
1884
1802
|
return /* @__PURE__ */ C(he, { children: [
|
|
1885
1803
|
/* @__PURE__ */ a(J, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(wn, { onSuccess: s, initialRoleID: ((p = o == null ? void 0 : o[0]) == null ? void 0 : p.value) ?? "INACTIVE" }) }),
|
|
1886
|
-
/* @__PURE__ */ C(
|
|
1804
|
+
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
1887
1805
|
position: "relative"
|
|
1888
1806
|
}, children: [
|
|
1889
1807
|
/* @__PURE__ */ a(tt, { visible: n || l }),
|
|
@@ -1928,18 +1846,18 @@ function kn({
|
|
|
1928
1846
|
password: ""
|
|
1929
1847
|
}
|
|
1930
1848
|
});
|
|
1931
|
-
return /* @__PURE__ */ a(
|
|
1849
|
+
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: n(async ({
|
|
1932
1850
|
name: o,
|
|
1933
1851
|
password: l
|
|
1934
1852
|
}) => {
|
|
1935
1853
|
try {
|
|
1936
|
-
|
|
1854
|
+
be({
|
|
1937
1855
|
id: "for-login",
|
|
1938
1856
|
title: "Pending",
|
|
1939
1857
|
message: "Loggin in...",
|
|
1940
1858
|
loading: !0
|
|
1941
1859
|
});
|
|
1942
|
-
const p = await
|
|
1860
|
+
const p = await oe.account.login(o.trim(), l.trim());
|
|
1943
1861
|
window.localStorage.setItem("token", p.token), ee({
|
|
1944
1862
|
id: "for-login",
|
|
1945
1863
|
title: "Successful",
|
|
@@ -1955,13 +1873,13 @@ function kn({
|
|
|
1955
1873
|
});
|
|
1956
1874
|
}
|
|
1957
1875
|
}), children: [
|
|
1958
|
-
/* @__PURE__ */ a(
|
|
1876
|
+
/* @__PURE__ */ a(H, { name: "name", control: r, render: ({
|
|
1959
1877
|
field: o
|
|
1960
1878
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Username", ...o }) }),
|
|
1961
|
-
/* @__PURE__ */ a(
|
|
1879
|
+
/* @__PURE__ */ a(H, { name: "password", control: r, render: ({
|
|
1962
1880
|
field: o
|
|
1963
1881
|
}) => /* @__PURE__ */ a(et, { mb: t.spacing, size: t.size, required: !0, label: "Password", ...o }) }),
|
|
1964
|
-
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(
|
|
1882
|
+
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Submit" }) })
|
|
1965
1883
|
] }) });
|
|
1966
1884
|
}
|
|
1967
1885
|
function _a({
|
|
@@ -1969,7 +1887,7 @@ function _a({
|
|
|
1969
1887
|
config: t,
|
|
1970
1888
|
onSuccess: r
|
|
1971
1889
|
}) {
|
|
1972
|
-
return Ue(t), /* @__PURE__ */ a(he, { children: /* @__PURE__ */ a(
|
|
1890
|
+
return Ue(t), /* @__PURE__ */ a(he, { children: /* @__PURE__ */ a(se, { mt: e.spacing, sx: {
|
|
1973
1891
|
position: "relative"
|
|
1974
1892
|
}, children: /* @__PURE__ */ a(kn, { styles: e, postSubmit: r }) }) });
|
|
1975
1893
|
}
|
|
@@ -1994,12 +1912,12 @@ function Tn({
|
|
|
1994
1912
|
role_id: r
|
|
1995
1913
|
}
|
|
1996
1914
|
});
|
|
1997
|
-
return /* @__PURE__ */ a(
|
|
1915
|
+
return /* @__PURE__ */ a(se, { mx: "auto", mb: 10, children: /* @__PURE__ */ C("form", { onSubmit: s(async ({
|
|
1998
1916
|
name: l,
|
|
1999
1917
|
role_id: p
|
|
2000
1918
|
}) => {
|
|
2001
1919
|
try {
|
|
2002
|
-
|
|
1920
|
+
be({
|
|
2003
1921
|
id: "for-creating",
|
|
2004
1922
|
title: "Pending",
|
|
2005
1923
|
message: "Adding API Key...",
|
|
@@ -2008,7 +1926,7 @@ function Tn({
|
|
|
2008
1926
|
const {
|
|
2009
1927
|
app_id: d,
|
|
2010
1928
|
app_secret: f
|
|
2011
|
-
} = await
|
|
1929
|
+
} = await oe.api_key.create(l, p);
|
|
2012
1930
|
ee({
|
|
2013
1931
|
id: "for-creating",
|
|
2014
1932
|
title: "Successful",
|
|
@@ -2024,13 +1942,13 @@ function Tn({
|
|
|
2024
1942
|
});
|
|
2025
1943
|
}
|
|
2026
1944
|
}), children: [
|
|
2027
|
-
/* @__PURE__ */ a(
|
|
1945
|
+
/* @__PURE__ */ a(H, { name: "name", control: n, render: ({
|
|
2028
1946
|
field: l
|
|
2029
1947
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", ...l }) }),
|
|
2030
|
-
/* @__PURE__ */ a(
|
|
1948
|
+
/* @__PURE__ */ a(H, { name: "role_id", control: n, render: ({
|
|
2031
1949
|
field: l
|
|
2032
1950
|
}) => /* @__PURE__ */ a(vt, { styles: t, ...l }) }),
|
|
2033
|
-
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(
|
|
1951
|
+
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
2034
1952
|
] }) });
|
|
2035
1953
|
}
|
|
2036
1954
|
function Rn({
|
|
@@ -2057,7 +1975,7 @@ function Rn({
|
|
|
2057
1975
|
cursor: "text !important"
|
|
2058
1976
|
}
|
|
2059
1977
|
} }),
|
|
2060
|
-
/* @__PURE__ */ a(
|
|
1978
|
+
/* @__PURE__ */ a(V, { size: "sm", onClick: () => {
|
|
2061
1979
|
Mr();
|
|
2062
1980
|
}, children: "I've saved this API Key" })
|
|
2063
1981
|
] }),
|
|
@@ -2066,7 +1984,7 @@ function Rn({
|
|
|
2066
1984
|
}
|
|
2067
1985
|
});
|
|
2068
1986
|
}, styles: t, initialRoleID: r }) }),
|
|
2069
|
-
/* @__PURE__ */ a(
|
|
1987
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: l, leftIcon: /* @__PURE__ */ a(at, { size: 20 }), children: "Add an API Key" })
|
|
2070
1988
|
] });
|
|
2071
1989
|
}
|
|
2072
1990
|
function On({
|
|
@@ -2077,14 +1995,14 @@ function On({
|
|
|
2077
1995
|
}) {
|
|
2078
1996
|
const s = je(), o = async () => {
|
|
2079
1997
|
if (e) {
|
|
2080
|
-
|
|
1998
|
+
be({
|
|
2081
1999
|
id: "for-deleting",
|
|
2082
2000
|
title: "Pending",
|
|
2083
2001
|
message: "Deleting API Key...",
|
|
2084
2002
|
loading: !0
|
|
2085
2003
|
});
|
|
2086
2004
|
try {
|
|
2087
|
-
await
|
|
2005
|
+
await oe.api_key.delete(e), ee({
|
|
2088
2006
|
id: "for-deleting",
|
|
2089
2007
|
title: "Successful",
|
|
2090
2008
|
message: `API Key [${t}] is deleted`,
|
|
@@ -2108,7 +2026,7 @@ function On({
|
|
|
2108
2026
|
onCancel: () => console.log("Cancel"),
|
|
2109
2027
|
onConfirm: o
|
|
2110
2028
|
});
|
|
2111
|
-
return /* @__PURE__ */ a(
|
|
2029
|
+
return /* @__PURE__ */ a(V, { size: n.button.size, color: "red", onClick: l, leftIcon: /* @__PURE__ */ a(it, { size: 20 }), children: "Delete" });
|
|
2112
2030
|
}
|
|
2113
2031
|
function Aa({
|
|
2114
2032
|
styles: e = ot,
|
|
@@ -2123,14 +2041,14 @@ function Aa({
|
|
|
2123
2041
|
} = Oe(async () => {
|
|
2124
2042
|
const {
|
|
2125
2043
|
data: d
|
|
2126
|
-
} = await
|
|
2044
|
+
} = await oe.api_key.list();
|
|
2127
2045
|
return d;
|
|
2128
2046
|
}, {
|
|
2129
2047
|
refreshDeps: []
|
|
2130
2048
|
}), {
|
|
2131
2049
|
data: o = [],
|
|
2132
2050
|
loading: l
|
|
2133
|
-
} = Oe(async () => (await
|
|
2051
|
+
} = Oe(async () => (await oe.role.list()).map((f) => ({
|
|
2134
2052
|
label: f.id,
|
|
2135
2053
|
value: f.id,
|
|
2136
2054
|
description: f.description,
|
|
@@ -2140,7 +2058,7 @@ function Aa({
|
|
|
2140
2058
|
});
|
|
2141
2059
|
return /* @__PURE__ */ C(he, { children: [
|
|
2142
2060
|
/* @__PURE__ */ a(J, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(Rn, { onSuccess: s, initialRoleID: ((p = o == null ? void 0 : o[0]) == null ? void 0 : p.value) ?? "INACTIVE" }) }),
|
|
2143
|
-
/* @__PURE__ */ C(
|
|
2061
|
+
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
2144
2062
|
position: "relative"
|
|
2145
2063
|
}, children: [
|
|
2146
2064
|
/* @__PURE__ */ a(tt, { visible: n || l }),
|
|
@@ -2209,14 +2127,14 @@ function xn({
|
|
|
2209
2127
|
content: ""
|
|
2210
2128
|
}
|
|
2211
2129
|
});
|
|
2212
|
-
return /* @__PURE__ */ a(
|
|
2130
|
+
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: n(async (o) => {
|
|
2213
2131
|
try {
|
|
2214
|
-
|
|
2132
|
+
be({
|
|
2215
2133
|
id: "for-creating",
|
|
2216
2134
|
title: "Pending",
|
|
2217
2135
|
message: "Adding SQL Snippet...",
|
|
2218
2136
|
loading: !0
|
|
2219
|
-
}), await
|
|
2137
|
+
}), await oe.sql_snippet.create(o), ee({
|
|
2220
2138
|
id: "for-creating",
|
|
2221
2139
|
title: "Successful",
|
|
2222
2140
|
message: "SQL Snippet is added",
|
|
@@ -2231,10 +2149,10 @@ function xn({
|
|
|
2231
2149
|
});
|
|
2232
2150
|
}
|
|
2233
2151
|
}), children: [
|
|
2234
|
-
/* @__PURE__ */ a(
|
|
2152
|
+
/* @__PURE__ */ a(H, { name: "id", control: r, render: ({
|
|
2235
2153
|
field: o
|
|
2236
2154
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", ...o }) }),
|
|
2237
|
-
/* @__PURE__ */ a(
|
|
2155
|
+
/* @__PURE__ */ a(H, { name: "content", control: r, render: ({
|
|
2238
2156
|
field: o
|
|
2239
2157
|
}) => /* @__PURE__ */ C(Be, { spacing: 4, children: [
|
|
2240
2158
|
/* @__PURE__ */ a(Re, { size: 14, fw: 500, color: "#212529", sx: {
|
|
@@ -2242,7 +2160,7 @@ function xn({
|
|
|
2242
2160
|
}, children: "Content" }),
|
|
2243
2161
|
/* @__PURE__ */ a(Wt, { height: "600px", ...o })
|
|
2244
2162
|
] }) }),
|
|
2245
|
-
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(
|
|
2163
|
+
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
2246
2164
|
] }) });
|
|
2247
2165
|
}
|
|
2248
2166
|
function Cn({
|
|
@@ -2256,7 +2174,7 @@ function Cn({
|
|
|
2256
2174
|
}, size: "80vw", children: /* @__PURE__ */ a(xn, { postSubmit: () => {
|
|
2257
2175
|
o(), e();
|
|
2258
2176
|
}, styles: t }) }),
|
|
2259
|
-
/* @__PURE__ */ a(
|
|
2177
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: s, leftIcon: /* @__PURE__ */ a(at, { size: 18 }), children: "Add a SQL Snippet" })
|
|
2260
2178
|
] });
|
|
2261
2179
|
}
|
|
2262
2180
|
function In({
|
|
@@ -2274,14 +2192,14 @@ function In({
|
|
|
2274
2192
|
content: n
|
|
2275
2193
|
}
|
|
2276
2194
|
});
|
|
2277
|
-
return /* @__PURE__ */ a(
|
|
2195
|
+
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: o(async (p) => {
|
|
2278
2196
|
try {
|
|
2279
|
-
|
|
2197
|
+
be({
|
|
2280
2198
|
id: "for-updating",
|
|
2281
2199
|
title: "Pending",
|
|
2282
2200
|
message: "Updating SQL Snippet...",
|
|
2283
2201
|
loading: !0
|
|
2284
|
-
}), await
|
|
2202
|
+
}), await oe.sql_snippet.update(p), ee({
|
|
2285
2203
|
id: "for-updating",
|
|
2286
2204
|
title: "Successful",
|
|
2287
2205
|
message: "SQL Snippet is updated",
|
|
@@ -2296,10 +2214,10 @@ function In({
|
|
|
2296
2214
|
});
|
|
2297
2215
|
}
|
|
2298
2216
|
}), children: [
|
|
2299
|
-
/* @__PURE__ */ a(
|
|
2217
|
+
/* @__PURE__ */ a(H, { name: "id", control: s, render: ({
|
|
2300
2218
|
field: p
|
|
2301
2219
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", ...p }) }),
|
|
2302
|
-
/* @__PURE__ */ a(
|
|
2220
|
+
/* @__PURE__ */ a(H, { name: "content", control: s, render: ({
|
|
2303
2221
|
field: p
|
|
2304
2222
|
}) => /* @__PURE__ */ C(Be, { spacing: 4, children: [
|
|
2305
2223
|
/* @__PURE__ */ a(Re, { size: 14, fw: 500, color: "#212529", sx: {
|
|
@@ -2307,7 +2225,7 @@ function In({
|
|
|
2307
2225
|
}, children: "Content" }),
|
|
2308
2226
|
/* @__PURE__ */ a(Wt, { height: "600px", ...p })
|
|
2309
2227
|
] }) }),
|
|
2310
|
-
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(
|
|
2228
|
+
/* @__PURE__ */ a(J, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
2311
2229
|
] }) });
|
|
2312
2230
|
}
|
|
2313
2231
|
function Dn({
|
|
@@ -2322,7 +2240,7 @@ function Dn({
|
|
|
2322
2240
|
}, size: "80vw", children: /* @__PURE__ */ a(In, { postSubmit: () => {
|
|
2323
2241
|
l(), e();
|
|
2324
2242
|
}, styles: t, ...r }) }),
|
|
2325
|
-
/* @__PURE__ */ a(
|
|
2243
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(ft, { size: 18 }), children: "Edit" })
|
|
2326
2244
|
] });
|
|
2327
2245
|
}
|
|
2328
2246
|
/**
|
|
@@ -2605,9 +2523,9 @@ var mt = function() {
|
|
|
2605
2523
|
g.hasOwnProperty(k) && (_[k] = g[k]);
|
|
2606
2524
|
g.hasOwnProperty(A) || (_[A] = h[A]);
|
|
2607
2525
|
}
|
|
2608
|
-
var
|
|
2609
|
-
return y[u] = _, n.languages.DFS(n.languages, function(M,
|
|
2610
|
-
|
|
2526
|
+
var $ = y[u];
|
|
2527
|
+
return y[u] = _, n.languages.DFS(n.languages, function(M, re) {
|
|
2528
|
+
re === $ && M != u && (this[M] = _);
|
|
2611
2529
|
}), _;
|
|
2612
2530
|
},
|
|
2613
2531
|
// Traverse a language definition with Depth First Search
|
|
@@ -2617,8 +2535,8 @@ var mt = function() {
|
|
|
2617
2535
|
for (var A in c)
|
|
2618
2536
|
if (c.hasOwnProperty(A)) {
|
|
2619
2537
|
g.call(c, A, c[A], y || A);
|
|
2620
|
-
var k = c[A],
|
|
2621
|
-
|
|
2538
|
+
var k = c[A], $ = n.util.type(k);
|
|
2539
|
+
$ === "Object" && !h[_(k)] ? (h[_(k)] = !0, u(k, g, null, h)) : $ === "Array" && !h[_(k)] && (h[_(k)] = !0, u(k, g, A, h));
|
|
2622
2540
|
}
|
|
2623
2541
|
}
|
|
2624
2542
|
},
|
|
@@ -2734,8 +2652,8 @@ var mt = function() {
|
|
|
2734
2652
|
return c;
|
|
2735
2653
|
if (Array.isArray(c)) {
|
|
2736
2654
|
var y = "";
|
|
2737
|
-
return c.forEach(function(
|
|
2738
|
-
y += u(
|
|
2655
|
+
return c.forEach(function($) {
|
|
2656
|
+
y += u($, g);
|
|
2739
2657
|
}), y;
|
|
2740
2658
|
}
|
|
2741
2659
|
var h = {
|
|
@@ -2766,44 +2684,44 @@ var mt = function() {
|
|
|
2766
2684
|
if (!(!g.hasOwnProperty(A) || !g[A])) {
|
|
2767
2685
|
var k = g[A];
|
|
2768
2686
|
k = Array.isArray(k) ? k : [k];
|
|
2769
|
-
for (var
|
|
2770
|
-
if (_ && _.cause == A + "," +
|
|
2687
|
+
for (var $ = 0; $ < k.length; ++$) {
|
|
2688
|
+
if (_ && _.cause == A + "," + $)
|
|
2771
2689
|
return;
|
|
2772
|
-
var M = k[
|
|
2773
|
-
if (
|
|
2690
|
+
var M = k[$], re = M.inside, Q = !!M.lookbehind, Y = !!M.greedy, Z = M.alias;
|
|
2691
|
+
if (Y && !M.pattern.global) {
|
|
2774
2692
|
var F = M.pattern.toString().match(/[imsuy]*$/)[0];
|
|
2775
2693
|
M.pattern = RegExp(M.pattern.source, F + "g");
|
|
2776
2694
|
}
|
|
2777
2695
|
for (var L = M.pattern || M, B = y.next, te = h; B !== c.tail && !(_ && te >= _.reach); te += B.value.length, B = B.next) {
|
|
2778
|
-
var
|
|
2696
|
+
var R = B.value;
|
|
2779
2697
|
if (c.length > u.length)
|
|
2780
2698
|
return;
|
|
2781
|
-
if (!(
|
|
2699
|
+
if (!(R instanceof s)) {
|
|
2782
2700
|
var E = 1, S;
|
|
2783
|
-
if (
|
|
2701
|
+
if (Y) {
|
|
2784
2702
|
if (S = o(L, te, u, Q), !S || S.index >= u.length)
|
|
2785
2703
|
break;
|
|
2786
|
-
var I = S.index,
|
|
2704
|
+
var I = S.index, O = S.index + S[0].length, w = te;
|
|
2787
2705
|
for (w += B.value.length; I >= w; )
|
|
2788
2706
|
B = B.next, w += B.value.length;
|
|
2789
2707
|
if (w -= B.value.length, te = w, B.value instanceof s)
|
|
2790
2708
|
continue;
|
|
2791
|
-
for (var x = B; x !== c.tail && (w <
|
|
2709
|
+
for (var x = B; x !== c.tail && (w < O || typeof x.value == "string"); x = x.next)
|
|
2792
2710
|
E++, w += x.value.length;
|
|
2793
|
-
E--,
|
|
2794
|
-
} else if (S = o(L, 0,
|
|
2711
|
+
E--, R = u.slice(te, w), S.index -= te;
|
|
2712
|
+
} else if (S = o(L, 0, R, Q), !S)
|
|
2795
2713
|
continue;
|
|
2796
|
-
var I = S.index,
|
|
2714
|
+
var I = S.index, N = S[0], q = R.slice(0, I), j = R.slice(I + N.length), U = te + R.length;
|
|
2797
2715
|
_ && U > _.reach && (_.reach = U);
|
|
2798
|
-
var
|
|
2799
|
-
|
|
2800
|
-
var
|
|
2801
|
-
if (B = d(c,
|
|
2802
|
-
var
|
|
2803
|
-
cause: A + "," +
|
|
2716
|
+
var le = B.prev;
|
|
2717
|
+
q && (le = d(c, le, q), te += q.length), f(c, le, E);
|
|
2718
|
+
var ce = new s(A, re ? n.tokenize(N, re) : N, Z, N);
|
|
2719
|
+
if (B = d(c, le, ce), j && d(c, B, j), E > 1) {
|
|
2720
|
+
var pe = {
|
|
2721
|
+
cause: A + "," + $,
|
|
2804
2722
|
reach: U
|
|
2805
2723
|
};
|
|
2806
|
-
l(u, c, g, B.prev, te,
|
|
2724
|
+
l(u, c, g, B.prev, te, pe), _ && pe.reach > _.reach && (_.reach = pe.reach);
|
|
2807
2725
|
}
|
|
2808
2726
|
}
|
|
2809
2727
|
}
|
|
@@ -4015,8 +3933,8 @@ m.languages.js = m.languages.javascript;
|
|
|
4015
3933
|
if (_ && A && _.type === "code-language" && A.type === "code-block" && typeof _.content == "string") {
|
|
4016
3934
|
var k = _.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
|
|
4017
3935
|
k = (/[a-z][\w-]*/i.exec(k) || [""])[0].toLowerCase();
|
|
4018
|
-
var
|
|
4019
|
-
A.alias ? typeof A.alias == "string" ? A.alias = [A.alias,
|
|
3936
|
+
var $ = "language-" + k;
|
|
3937
|
+
A.alias ? typeof A.alias == "string" ? A.alias = [A.alias, $] : A.alias.push($) : A.alias = [$];
|
|
4020
3938
|
}
|
|
4021
3939
|
}
|
|
4022
3940
|
}
|
|
@@ -4143,8 +4061,8 @@ m.hooks.add("after-tokenize", function(t) {
|
|
|
4143
4061
|
}
|
|
4144
4062
|
function l(h, _) {
|
|
4145
4063
|
for (var A = 1, k = n; k < r.length; k++) {
|
|
4146
|
-
var
|
|
4147
|
-
if (
|
|
4064
|
+
var $ = r[k], M = $.content;
|
|
4065
|
+
if ($.type === "punctuation" && typeof M == "string") {
|
|
4148
4066
|
if (h.test(M))
|
|
4149
4067
|
A++;
|
|
4150
4068
|
else if (_.test(M) && (A--, A === 0))
|
|
@@ -4281,32 +4199,32 @@ m.languages.sql = {
|
|
|
4281
4199
|
pattern: RegExp(o),
|
|
4282
4200
|
lookbehind: !0
|
|
4283
4201
|
}
|
|
4284
|
-
}), A = 0, k = {},
|
|
4285
|
-
if (typeof
|
|
4286
|
-
return
|
|
4287
|
-
for (var Z =
|
|
4202
|
+
}), A = 0, k = {}, $ = _.map(function(Y) {
|
|
4203
|
+
if (typeof Y == "string")
|
|
4204
|
+
return Y;
|
|
4205
|
+
for (var Z = Y.content, F; g.indexOf(F = p(A++, h)) !== -1; )
|
|
4288
4206
|
;
|
|
4289
4207
|
return k[F] = Z, F;
|
|
4290
|
-
}).join(""), M = d(
|
|
4208
|
+
}).join(""), M = d($, y, h), re = Object.keys(k);
|
|
4291
4209
|
A = 0;
|
|
4292
|
-
function Q(
|
|
4293
|
-
for (var Z = 0; Z <
|
|
4294
|
-
if (A >=
|
|
4210
|
+
function Q(Y) {
|
|
4211
|
+
for (var Z = 0; Z < Y.length; Z++) {
|
|
4212
|
+
if (A >= re.length)
|
|
4295
4213
|
return;
|
|
4296
|
-
var F =
|
|
4214
|
+
var F = Y[Z];
|
|
4297
4215
|
if (typeof F == "string" || typeof F.content == "string") {
|
|
4298
|
-
var L =
|
|
4216
|
+
var L = re[A], B = typeof F == "string" ? F : (
|
|
4299
4217
|
/** @type {string} */
|
|
4300
4218
|
F.content
|
|
4301
4219
|
), te = B.indexOf(L);
|
|
4302
4220
|
if (te !== -1) {
|
|
4303
4221
|
++A;
|
|
4304
|
-
var
|
|
4305
|
-
if (
|
|
4222
|
+
var R = B.substring(0, te), E = f(k[L]), S = B.substring(te + L.length), O = [];
|
|
4223
|
+
if (R && O.push(R), O.push(E), S) {
|
|
4306
4224
|
var w = [S];
|
|
4307
|
-
Q(w),
|
|
4225
|
+
Q(w), O.push.apply(O, w);
|
|
4308
4226
|
}
|
|
4309
|
-
typeof F == "string" ? (
|
|
4227
|
+
typeof F == "string" ? (Y.splice.apply(Y, [Z, 1].concat(O)), Z += O.length - 1) : F.content = O;
|
|
4310
4228
|
}
|
|
4311
4229
|
} else {
|
|
4312
4230
|
var x = F.content;
|
|
@@ -4331,21 +4249,21 @@ m.languages.sql = {
|
|
|
4331
4249
|
for (var _ = 0, A = h.length; _ < A; _++) {
|
|
4332
4250
|
var k = h[_];
|
|
4333
4251
|
if (typeof k != "string") {
|
|
4334
|
-
var
|
|
4335
|
-
if (!Array.isArray(
|
|
4336
|
-
typeof
|
|
4252
|
+
var $ = k.content;
|
|
4253
|
+
if (!Array.isArray($)) {
|
|
4254
|
+
typeof $ != "string" && y([$]);
|
|
4337
4255
|
continue;
|
|
4338
4256
|
}
|
|
4339
4257
|
if (k.type === "template-string") {
|
|
4340
|
-
var M =
|
|
4341
|
-
if (
|
|
4342
|
-
var
|
|
4258
|
+
var M = $[1];
|
|
4259
|
+
if ($.length === 3 && typeof M != "string" && M.type === "embedded-code") {
|
|
4260
|
+
var re = c(M), Q = M.alias, Y = Array.isArray(Q) ? Q[0] : Q, Z = e.languages[Y];
|
|
4343
4261
|
if (!Z)
|
|
4344
4262
|
continue;
|
|
4345
|
-
|
|
4263
|
+
$[1] = b(re, Z, Y);
|
|
4346
4264
|
}
|
|
4347
4265
|
} else
|
|
4348
|
-
y(
|
|
4266
|
+
y($);
|
|
4349
4267
|
}
|
|
4350
4268
|
}
|
|
4351
4269
|
}
|
|
@@ -5794,7 +5712,7 @@ const Xn = {
|
|
|
5794
5712
|
unstyled: _,
|
|
5795
5713
|
radius: A,
|
|
5796
5714
|
getPrismTheme: k,
|
|
5797
|
-
variant:
|
|
5715
|
+
variant: $
|
|
5798
5716
|
} = r, M = Zn(r, [
|
|
5799
5717
|
"className",
|
|
5800
5718
|
"children",
|
|
@@ -5813,14 +5731,14 @@ const Xn = {
|
|
|
5813
5731
|
"radius",
|
|
5814
5732
|
"getPrismTheme",
|
|
5815
5733
|
"variant"
|
|
5816
|
-
]),
|
|
5817
|
-
`).length.toString().length,
|
|
5734
|
+
]), re = h && typeof s == "string" ? s.trim() : s, Q = re.split(`
|
|
5735
|
+
`).length.toString().length, Y = Ir(), Z = qr(), F = y || Y.colorScheme, { classes: L, cx: B } = Yn({
|
|
5818
5736
|
colorScheme: F,
|
|
5819
5737
|
native: g !== Ht,
|
|
5820
5738
|
maxLineSize: Q,
|
|
5821
5739
|
radius: A
|
|
5822
|
-
}, { name: "Prism", classNames: p, styles: d, unstyled: _, variant:
|
|
5823
|
-
return /* @__PURE__ */ K.createElement(
|
|
5740
|
+
}, { name: "Prism", classNames: p, styles: d, unstyled: _, variant: $ });
|
|
5741
|
+
return /* @__PURE__ */ K.createElement(se, Pe(Ie({
|
|
5824
5742
|
className: B(L.root, n),
|
|
5825
5743
|
ref: t
|
|
5826
5744
|
}, M), {
|
|
@@ -5836,49 +5754,49 @@ const Xn = {
|
|
|
5836
5754
|
}, /* @__PURE__ */ K.createElement(yt, {
|
|
5837
5755
|
className: L.copy,
|
|
5838
5756
|
"aria-label": Z.copied ? b : f,
|
|
5839
|
-
onClick: () => Z.copy(
|
|
5757
|
+
onClick: () => Z.copy(re),
|
|
5840
5758
|
unstyled: _
|
|
5841
5759
|
}, /* @__PURE__ */ K.createElement(Kt, {
|
|
5842
5760
|
copied: Z.copied
|
|
5843
5761
|
}))), /* @__PURE__ */ K.createElement(jn, Pe(Ie({}, $n), {
|
|
5844
|
-
theme: k(
|
|
5845
|
-
code:
|
|
5762
|
+
theme: k(Y, F),
|
|
5763
|
+
code: re,
|
|
5846
5764
|
language: o
|
|
5847
5765
|
}), ({
|
|
5848
5766
|
className: te,
|
|
5849
|
-
style:
|
|
5767
|
+
style: R,
|
|
5850
5768
|
tokens: E,
|
|
5851
5769
|
getLineProps: S,
|
|
5852
|
-
getTokenProps:
|
|
5770
|
+
getTokenProps: O
|
|
5853
5771
|
}) => /* @__PURE__ */ K.createElement(g, {
|
|
5854
5772
|
className: L.scrollArea,
|
|
5855
5773
|
dir: "ltr"
|
|
5856
5774
|
}, /* @__PURE__ */ K.createElement("pre", {
|
|
5857
5775
|
className: B(L.code, te),
|
|
5858
|
-
style:
|
|
5776
|
+
style: R,
|
|
5859
5777
|
dir: "ltr"
|
|
5860
5778
|
}, E.map((w, x) => {
|
|
5861
|
-
var I,
|
|
5779
|
+
var I, N, q, j;
|
|
5862
5780
|
if (x === E.length - 1 && w.length === 1 && w[0].content === `
|
|
5863
5781
|
`)
|
|
5864
5782
|
return null;
|
|
5865
|
-
const U = x + 1,
|
|
5866
|
-
return /* @__PURE__ */ K.createElement("div", Pe(Ie({},
|
|
5867
|
-
className: B(L.line,
|
|
5868
|
-
style: Ie({},
|
|
5783
|
+
const U = x + 1, le = S({ line: w, key: x }), ce = U in c, pe = F === "dark" ? Y.fn.rgba(Y.fn.themeColor((I = c[U]) == null ? void 0 : I.color, 9), 0.25) : Y.fn.themeColor((N = c[U]) == null ? void 0 : N.color, 0);
|
|
5784
|
+
return /* @__PURE__ */ K.createElement("div", Pe(Ie({}, le), {
|
|
5785
|
+
className: B(L.line, le.className),
|
|
5786
|
+
style: Ie({}, ce ? { backgroundColor: pe } : null)
|
|
5869
5787
|
}), u && /* @__PURE__ */ K.createElement("div", {
|
|
5870
5788
|
className: L.lineNumber,
|
|
5871
5789
|
style: {
|
|
5872
|
-
color:
|
|
5790
|
+
color: ce ? Y.fn.themeColor((q = c[U]) == null ? void 0 : q.color, F === "dark" ? 5 : 8) : void 0
|
|
5873
5791
|
}
|
|
5874
|
-
}, ((
|
|
5792
|
+
}, ((j = c[U]) == null ? void 0 : j.label) || U), /* @__PURE__ */ K.createElement("div", {
|
|
5875
5793
|
className: L.lineContent
|
|
5876
|
-
}, w.map((
|
|
5877
|
-
var
|
|
5878
|
-
const
|
|
5879
|
-
return /* @__PURE__ */ K.createElement("span", Pe(Ie({},
|
|
5880
|
-
style: Pe(Ie({},
|
|
5881
|
-
color:
|
|
5794
|
+
}, w.map((ye, fe) => {
|
|
5795
|
+
var ne, de;
|
|
5796
|
+
const ve = O({ token: ye, key: fe });
|
|
5797
|
+
return /* @__PURE__ */ K.createElement("span", Pe(Ie({}, ve), {
|
|
5798
|
+
style: Pe(Ie({}, ve.style), {
|
|
5799
|
+
color: ce ? Y.fn.themeColor((ne = c[U]) == null ? void 0 : ne.color, F === "dark" ? 5 : 8) : (de = ve == null ? void 0 : ve.style) == null ? void 0 : de.color
|
|
5882
5800
|
})
|
|
5883
5801
|
}));
|
|
5884
5802
|
})));
|
|
@@ -6014,14 +5932,14 @@ function oa({
|
|
|
6014
5932
|
}) {
|
|
6015
5933
|
const n = je(), s = async () => {
|
|
6016
5934
|
if (e) {
|
|
6017
|
-
|
|
5935
|
+
be({
|
|
6018
5936
|
id: "for-deleting",
|
|
6019
5937
|
title: "Pending",
|
|
6020
5938
|
message: "Deleting SQL Snippet...",
|
|
6021
5939
|
loading: !0
|
|
6022
5940
|
});
|
|
6023
5941
|
try {
|
|
6024
|
-
await
|
|
5942
|
+
await oe.sql_snippet.delete(e), ee({
|
|
6025
5943
|
id: "for-deleting",
|
|
6026
5944
|
title: "Successful",
|
|
6027
5945
|
message: `SQL Snippet [${e}] is deleted`,
|
|
@@ -6048,7 +5966,7 @@ function oa({
|
|
|
6048
5966
|
color: "red"
|
|
6049
5967
|
}
|
|
6050
5968
|
});
|
|
6051
|
-
return /* @__PURE__ */ a(
|
|
5969
|
+
return /* @__PURE__ */ a(V, { size: r.button.size, color: "red", onClick: o, leftIcon: /* @__PURE__ */ a(it, { size: 20 }), children: "Delete" });
|
|
6052
5970
|
}
|
|
6053
5971
|
function sa({
|
|
6054
5972
|
content: e
|
|
@@ -6070,7 +5988,7 @@ function ka({
|
|
|
6070
5988
|
} = Oe(async () => {
|
|
6071
5989
|
const {
|
|
6072
5990
|
data: o
|
|
6073
|
-
} = await
|
|
5991
|
+
} = await oe.sql_snippet.list({
|
|
6074
5992
|
pagination: {
|
|
6075
5993
|
page: 1,
|
|
6076
5994
|
pagesize: 10
|
|
@@ -6082,7 +6000,7 @@ function ka({
|
|
|
6082
6000
|
});
|
|
6083
6001
|
return /* @__PURE__ */ C(he, { children: [
|
|
6084
6002
|
/* @__PURE__ */ a(J, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(Cn, { onSuccess: s }) }),
|
|
6085
|
-
/* @__PURE__ */ C(
|
|
6003
|
+
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
6086
6004
|
position: "relative"
|
|
6087
6005
|
}, children: [
|
|
6088
6006
|
/* @__PURE__ */ a(tt, { visible: n }),
|
|
@@ -6116,7 +6034,7 @@ function ka({
|
|
|
6116
6034
|
] })
|
|
6117
6035
|
] });
|
|
6118
6036
|
}
|
|
6119
|
-
const Ta = () => import("./package-
|
|
6037
|
+
const Ta = () => import("./package-3f084be8.mjs").then(({
|
|
6120
6038
|
version: e
|
|
6121
6039
|
}) => (console.log(`[@devtable/dashboard] version: ${e}`), e));
|
|
6122
6040
|
export {
|