@declarion/react 0.38.1 → 0.39.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-lib/{DraggableChildrenTable-CI5a0Emm.js → DraggableChildrenTable-DziCVhq6.js} +1 -1
- package/dist-lib/{Grid-BZEMUmjI.js → Grid-BTX2tkCT.js} +2 -2
- package/dist-lib/{LayoutRenderer-CnKUYh8M.js → LayoutRenderer-CwMERoPJ.js} +387 -285
- package/dist-lib/{MarkdownRenderer-DNmOqp_M.js → MarkdownRenderer-dHOTEhUa.js} +1 -1
- package/dist-lib/{RefreshControl-DsEXi6WF.js → RefreshControl--UAgflh7.js} +257 -175
- package/dist-lib/{SmartDetailPage.impl-DhSpZTLw.js → SmartDetailPage.impl-Bj7MtHxi.js} +474 -414
- package/dist-lib/{SmartRecordListPage.impl-Bi_FPbGy.js → SmartRecordListPage.impl-CZXzVhPC.js} +164 -164
- package/dist-lib/api/params.d.ts +12 -11
- package/dist-lib/components/columns/ColumnPicker.d.ts +11 -1
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +6 -0
- package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +25 -0
- package/dist-lib/components/list/QuickPeek.d.ts +11 -2
- package/dist-lib/components/pages/list/{ListBulkBar.d.ts → ListFloatbar.d.ts} +3 -3
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +8 -10
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +29 -0
- package/dist-lib/components/pages/list/SaveViewDialog.d.ts +5 -1
- package/dist-lib/components/pages/list/cardProjection.d.ts +1 -1
- package/dist-lib/components/pages/list/column-sizing.d.ts +15 -0
- package/dist-lib/components/pages/list/columns.d.ts +3 -0
- package/dist-lib/components/pages/list/useHeaderReorder.d.ts +26 -0
- package/dist-lib/components/pages/list/useRowMenu.d.ts +47 -0
- package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +2 -0
- package/dist-lib/components/params/ParamsBlock.d.ts +25 -0
- package/dist-lib/components/params/param-editors.d.ts +28 -0
- package/dist-lib/components/primitives/Dropdown.d.ts +10 -1
- package/dist-lib/components/shared/ActionDialog.d.ts +2 -2
- package/dist-lib/components/shared/ActionRunner.d.ts +15 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +45 -23
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useParams.d.ts +45 -1
- package/dist-lib/index.d.ts +0 -2
- package/dist-lib/index.js +3074 -2189
- package/dist-lib/lib/actions.d.ts +17 -3
- package/dist-lib/lib/evidence-verdict.d.ts +11 -0
- package/dist-lib/lib/rowClickGesture.d.ts +14 -0
- package/dist-lib/{registry-B_AmhRdj.js → registry-DXNFRlbB.js} +780 -559
- package/dist-lib/stores/list-layout.d.ts +86 -0
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/api.d.ts +29 -1
- package/dist-lib/types/schema.d.ts +15 -0
- package/dist-lib/{useCurrentScreen-CcsD2NAk.js → useCurrentScreen-BA2lb-d7.js} +860 -835
- package/dist-lib/{useProperties-CPtQIWXp.js → useProperties-Br2DeOQh.js} +81 -81
- package/dist-lib/{value-BCjHI_Ai.js → value-C91loRXp.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/components/list/RowMenu.d.ts +0 -23
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c as e, s as t, t as n } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
2
|
import { Suspense as r, createContext as i, forwardRef as a, lazy as o, useCallback as s, useContext as c, useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
3
3
|
import { useLocation as m, useNavigate as h } from "react-router-dom";
|
|
4
|
-
import { useQuery as g } from "@tanstack/react-query";
|
|
5
|
-
import { toast as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { create as
|
|
9
|
-
import { formatDistanceStrict as
|
|
4
|
+
import { useQuery as g, useQueryClient as _ } from "@tanstack/react-query";
|
|
5
|
+
import { toast as v } from "sonner";
|
|
6
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as S } from "react-dom";
|
|
8
|
+
import { create as C } from "zustand";
|
|
9
|
+
import { formatDistanceStrict as w, formatDistanceToNowStrict as T, formatISO as E } from "date-fns";
|
|
10
10
|
//#region src/components/primitives/Btn.tsx
|
|
11
|
-
var
|
|
11
|
+
var D = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r, children: i, onClick: a, active: o, danger: s, style: c, disabled: l, type: u = "button", title: d, ...f }, p) {
|
|
12
12
|
let m = {
|
|
13
13
|
display: "inline-flex",
|
|
14
14
|
alignItems: "center",
|
|
@@ -49,7 +49,7 @@ var E = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r,
|
|
|
49
49
|
})), l && Object.assign(m, {
|
|
50
50
|
opacity: .5,
|
|
51
51
|
pointerEvents: "none"
|
|
52
|
-
}), Object.assign(m, c || {}), /* @__PURE__ */
|
|
52
|
+
}), Object.assign(m, c || {}), /* @__PURE__ */ x("button", {
|
|
53
53
|
ref: p,
|
|
54
54
|
type: u,
|
|
55
55
|
onClick: a,
|
|
@@ -69,8 +69,8 @@ var E = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r,
|
|
|
69
69
|
r
|
|
70
70
|
]
|
|
71
71
|
});
|
|
72
|
-
}),
|
|
73
|
-
return /* @__PURE__ */
|
|
72
|
+
}), O = a(function({ icon: e, onClick: t, title: n, size: r = 28, active: i, disabled: a, style: o }, s) {
|
|
73
|
+
return /* @__PURE__ */ b("button", {
|
|
74
74
|
type: "button",
|
|
75
75
|
ref: s,
|
|
76
76
|
onClick: t,
|
|
@@ -103,9 +103,9 @@ var E = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r,
|
|
|
103
103
|
});
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/components/primitives/Pill.tsx
|
|
106
|
-
function
|
|
106
|
+
function k({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style: i }) {
|
|
107
107
|
let a = `var(--pill-${e}-bg)`, o = `var(--pill-${e})`;
|
|
108
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ x("span", {
|
|
109
109
|
className: "num",
|
|
110
110
|
style: {
|
|
111
111
|
display: "inline-flex",
|
|
@@ -122,12 +122,12 @@ function O({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style:
|
|
|
122
122
|
maxWidth: "100%",
|
|
123
123
|
...i
|
|
124
124
|
},
|
|
125
|
-
children: [r && /* @__PURE__ */
|
|
125
|
+
children: [r && /* @__PURE__ */ b("span", { style: {
|
|
126
126
|
width: 6,
|
|
127
127
|
height: 6,
|
|
128
128
|
borderRadius: 999,
|
|
129
129
|
background: o
|
|
130
|
-
} }), /* @__PURE__ */
|
|
130
|
+
} }), /* @__PURE__ */ b("span", {
|
|
131
131
|
style: {
|
|
132
132
|
minWidth: 0,
|
|
133
133
|
overflow: "hidden",
|
|
@@ -140,8 +140,8 @@ function O({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style:
|
|
|
140
140
|
}
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region src/components/primitives/Kbd.tsx
|
|
143
|
-
function
|
|
144
|
-
return /* @__PURE__ */
|
|
143
|
+
function A({ children: e }) {
|
|
144
|
+
return /* @__PURE__ */ b("span", {
|
|
145
145
|
className: "mono",
|
|
146
146
|
style: {
|
|
147
147
|
display: "inline-flex",
|
|
@@ -161,57 +161,68 @@ function k({ children: e }) {
|
|
|
161
161
|
}
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/components/primitives/Dropdown.tsx
|
|
164
|
-
function
|
|
165
|
-
let
|
|
164
|
+
function j({ open: e, onClose: t, anchor: n, anchorPoint: r, children: i, align: a = "start", width: o, style: s }) {
|
|
165
|
+
let c = f(null), [d, m] = p(null), h = r?.x, g = r?.y;
|
|
166
166
|
if (u(() => {
|
|
167
|
-
if (!e || !n) return;
|
|
168
|
-
let t = n
|
|
169
|
-
|
|
167
|
+
if (!e || !n && h === void 0) return;
|
|
168
|
+
let t = n ? n.getBoundingClientRect() : {
|
|
169
|
+
top: g,
|
|
170
|
+
bottom: g,
|
|
171
|
+
left: h,
|
|
172
|
+
right: h
|
|
173
|
+
}, r = M(), i = c.current?.offsetHeight || 260, s = r - t.bottom < i + 12 && t.top > i + 12 ? "above" : "below", l = s === "below" ? t.bottom + 4 : t.top - 4 - i, u = typeof window < "u" ? window.innerWidth : 0, d = a === "end" ? t.right - (o || 200) : t.left;
|
|
174
|
+
u && (d = Math.max(8, Math.min(d, u - (o || 200) - 8))), m((e) => e && e.top === l && e.left === d && e.placement === s ? e : {
|
|
170
175
|
top: l,
|
|
171
|
-
left:
|
|
172
|
-
placement:
|
|
176
|
+
left: d,
|
|
177
|
+
placement: s
|
|
173
178
|
});
|
|
174
179
|
}, [
|
|
175
180
|
e,
|
|
176
181
|
n,
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
h,
|
|
183
|
+
g,
|
|
184
|
+
a,
|
|
185
|
+
o
|
|
179
186
|
]), l(() => {
|
|
180
187
|
if (!e) return;
|
|
181
188
|
let r = (e) => {
|
|
182
189
|
let r = e.target;
|
|
183
|
-
|
|
190
|
+
c.current && r && !c.current.contains(r) && (!n || !n.contains(r)) && t?.();
|
|
191
|
+
}, i = (e) => {
|
|
192
|
+
e.key === "Escape" && t?.();
|
|
193
|
+
};
|
|
194
|
+
return document.addEventListener("mousedown", r), document.addEventListener("keydown", i), () => {
|
|
195
|
+
document.removeEventListener("mousedown", r), document.removeEventListener("keydown", i);
|
|
184
196
|
};
|
|
185
|
-
return document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
|
|
186
197
|
}, [
|
|
187
198
|
e,
|
|
188
199
|
n,
|
|
189
200
|
t
|
|
190
|
-
]), !e || !
|
|
191
|
-
let
|
|
192
|
-
return
|
|
193
|
-
ref:
|
|
201
|
+
]), !e || !d) return null;
|
|
202
|
+
let _ = d.placement === "below" ? `calc(var(--app-height) - ${d.top}px - 8px)` : `${Math.max(120, d.top - 8)}px`, v = ee(s?.maxHeight), y = v ? `min(${_}, ${v})` : _;
|
|
203
|
+
return S(/* @__PURE__ */ b("div", {
|
|
204
|
+
ref: c,
|
|
194
205
|
style: {
|
|
195
206
|
position: "fixed",
|
|
196
|
-
top:
|
|
197
|
-
left:
|
|
207
|
+
top: d.top,
|
|
208
|
+
left: d.left,
|
|
198
209
|
zIndex: 200,
|
|
199
|
-
minWidth:
|
|
200
|
-
maxWidth: `calc(100vw - ${
|
|
210
|
+
minWidth: o || 200,
|
|
211
|
+
maxWidth: `calc(100vw - ${d.left}px - 8px)`,
|
|
201
212
|
background: "var(--surface)",
|
|
202
213
|
border: "1px solid var(--border)",
|
|
203
214
|
borderRadius: 8,
|
|
204
215
|
boxShadow: "var(--shadow-lg)",
|
|
205
216
|
padding: 4,
|
|
206
|
-
...
|
|
207
|
-
maxHeight:
|
|
208
|
-
overflowY:
|
|
217
|
+
...s,
|
|
218
|
+
maxHeight: y,
|
|
219
|
+
overflowY: s?.overflowY ?? "auto",
|
|
209
220
|
overscrollBehavior: "contain"
|
|
210
221
|
},
|
|
211
|
-
children:
|
|
222
|
+
children: i
|
|
212
223
|
}), document.body);
|
|
213
224
|
}
|
|
214
|
-
function
|
|
225
|
+
function M() {
|
|
215
226
|
if (typeof window > "u" || typeof document > "u") return 0;
|
|
216
227
|
let e = getComputedStyle(document.documentElement).getPropertyValue("--app-height").trim();
|
|
217
228
|
if (e.endsWith("px")) {
|
|
@@ -221,14 +232,14 @@ function ee() {
|
|
|
221
232
|
let t = window.visualViewport?.height;
|
|
222
233
|
return Number.isFinite(t) && t && t > 0 ? t : window.innerHeight;
|
|
223
234
|
}
|
|
224
|
-
function
|
|
235
|
+
function ee(e) {
|
|
225
236
|
if (e != null) return typeof e == "number" ? `${e}px` : String(e);
|
|
226
237
|
}
|
|
227
238
|
//#endregion
|
|
228
239
|
//#region src/components/primitives/HoverCard.tsx
|
|
229
240
|
var te = 400, ne = 150, re = 320, ie = 240, ae = 4, oe = 4;
|
|
230
241
|
function se({ content: e, children: t, width: n = re, align: r = "center", style: i }) {
|
|
231
|
-
let a = f(null), o = f(null), c = f(null), u = f(null), [d, m] = p(!1), [h, g] = p(null), [_,
|
|
242
|
+
let a = f(null), o = f(null), c = f(null), u = f(null), [d, m] = p(!1), [h, g] = p(null), [_, v] = p(!1), C = s(() => {
|
|
232
243
|
let e = a.current;
|
|
233
244
|
if (!e) return;
|
|
234
245
|
let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.visualViewport : void 0, s = i?.width ?? (typeof window < "u" ? window.innerWidth : 0), c = i?.height ?? (typeof window < "u" ? window.innerHeight : 0), l = i?.offsetLeft ?? 0, u = i?.offsetTop ?? 0, d = Math.min(n, Math.max(160, s - ae * 2)), f = o.current?.offsetHeight ?? ie, p = u + c - t.bottom < f + oe * 2 && t.top > f + oe * 2 ? "above" : "below", m = p === "below" ? t.bottom + oe : t.top - oe - f, h;
|
|
@@ -243,10 +254,10 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
|
|
|
243
254
|
}, [r, n]), w = f(null), T = s((e) => {
|
|
244
255
|
if (o.current = e, w.current &&= (w.current.disconnect(), null), e) if (typeof ResizeObserver < "u") {
|
|
245
256
|
let t = new ResizeObserver(() => {
|
|
246
|
-
C(),
|
|
257
|
+
C(), v(!0);
|
|
247
258
|
});
|
|
248
259
|
t.observe(e), w.current = t;
|
|
249
|
-
} else
|
|
260
|
+
} else v(!0);
|
|
250
261
|
}, [C]), E = s(() => {
|
|
251
262
|
c.current !== null && (window.clearTimeout(c.current), c.current = null), u.current !== null && (window.clearTimeout(u.current), u.current = null);
|
|
252
263
|
}, []), D = () => {
|
|
@@ -266,7 +277,7 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
|
|
|
266
277
|
E(), w.current &&= (w.current.disconnect(), null);
|
|
267
278
|
}, [E]), l(() => {
|
|
268
279
|
if (!d) {
|
|
269
|
-
|
|
280
|
+
v(!1);
|
|
270
281
|
return;
|
|
271
282
|
}
|
|
272
283
|
return C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C), () => {
|
|
@@ -280,7 +291,7 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
|
|
|
280
291
|
};
|
|
281
292
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
282
293
|
}, [k, d]);
|
|
283
|
-
let
|
|
294
|
+
let j = d && h ? S(/* @__PURE__ */ b("div", {
|
|
284
295
|
ref: T,
|
|
285
296
|
role: "tooltip",
|
|
286
297
|
onMouseEnter: () => {
|
|
@@ -308,7 +319,7 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
|
|
|
308
319
|
},
|
|
309
320
|
children: e
|
|
310
321
|
}), document.body) : null;
|
|
311
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
312
323
|
ref: a,
|
|
313
324
|
tabIndex: 0,
|
|
314
325
|
"aria-haspopup": "dialog",
|
|
@@ -334,12 +345,12 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
|
|
|
334
345
|
outline: "none"
|
|
335
346
|
},
|
|
336
347
|
children: t
|
|
337
|
-
}),
|
|
348
|
+
}), j] });
|
|
338
349
|
}
|
|
339
350
|
//#endregion
|
|
340
351
|
//#region src/components/primitives/Chip.tsx
|
|
341
|
-
function
|
|
342
|
-
return /* @__PURE__ */
|
|
352
|
+
function N({ icon: e, children: n, onRemove: r, onClick: i }) {
|
|
353
|
+
return /* @__PURE__ */ x("span", {
|
|
343
354
|
onClick: i,
|
|
344
355
|
style: {
|
|
345
356
|
display: "inline-flex",
|
|
@@ -357,7 +368,7 @@ function M({ icon: e, children: n, onRemove: r, onClick: i }) {
|
|
|
357
368
|
children: [
|
|
358
369
|
e,
|
|
359
370
|
n,
|
|
360
|
-
r && /* @__PURE__ */
|
|
371
|
+
r && /* @__PURE__ */ b("button", {
|
|
361
372
|
type: "button",
|
|
362
373
|
onClick: (e) => {
|
|
363
374
|
e.stopPropagation(), r();
|
|
@@ -371,7 +382,7 @@ function M({ icon: e, children: n, onRemove: r, onClick: i }) {
|
|
|
371
382
|
cursor: "pointer",
|
|
372
383
|
display: "flex"
|
|
373
384
|
},
|
|
374
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ b(t.x, { size: 12 })
|
|
375
386
|
})
|
|
376
387
|
]
|
|
377
388
|
});
|
|
@@ -457,7 +468,7 @@ function ve({ children: e, breakpoints: t = ue, viewportOverride: n, viewport: r
|
|
|
457
468
|
isDesktop: o === "desktop",
|
|
458
469
|
touch: i.touch ?? !1
|
|
459
470
|
}), [o, i]);
|
|
460
|
-
return /* @__PURE__ */
|
|
471
|
+
return /* @__PURE__ */ b(fe.Provider, {
|
|
461
472
|
value: s,
|
|
462
473
|
children: e
|
|
463
474
|
});
|
|
@@ -468,7 +479,7 @@ function ye() {
|
|
|
468
479
|
//#endregion
|
|
469
480
|
//#region src/components/primitives/BoolToggle.tsx
|
|
470
481
|
function be({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
|
|
471
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ b("button", {
|
|
472
483
|
type: "button",
|
|
473
484
|
id: n,
|
|
474
485
|
"aria-labelledby": r,
|
|
@@ -486,7 +497,7 @@ function be({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
|
|
|
486
497
|
cursor: "pointer",
|
|
487
498
|
transition: "background .15s"
|
|
488
499
|
},
|
|
489
|
-
children: /* @__PURE__ */
|
|
500
|
+
children: /* @__PURE__ */ b("span", { style: {
|
|
490
501
|
display: "block",
|
|
491
502
|
width: 14,
|
|
492
503
|
height: 14,
|
|
@@ -501,14 +512,14 @@ function be({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
|
|
|
501
512
|
//#endregion
|
|
502
513
|
//#region src/components/primitives/MenuItem.tsx
|
|
503
514
|
function xe({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, divider: o, disabled: s, title: c, "data-testid": l }) {
|
|
504
|
-
return o ? /* @__PURE__ */
|
|
515
|
+
return o ? /* @__PURE__ */ b("div", {
|
|
505
516
|
role: "separator",
|
|
506
517
|
style: {
|
|
507
518
|
height: 1,
|
|
508
519
|
background: "var(--divider)",
|
|
509
520
|
margin: "4px 0"
|
|
510
521
|
}
|
|
511
|
-
}) : /* @__PURE__ */
|
|
522
|
+
}) : /* @__PURE__ */ x("div", {
|
|
512
523
|
role: "menuitem",
|
|
513
524
|
tabIndex: s ? -1 : 0,
|
|
514
525
|
onClick: s ? void 0 : n,
|
|
@@ -537,32 +548,32 @@ function xe({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, di
|
|
|
537
548
|
e.currentTarget.style.background = a ? "var(--surface-3)" : "transparent";
|
|
538
549
|
},
|
|
539
550
|
children: [
|
|
540
|
-
e && /* @__PURE__ */
|
|
551
|
+
e && /* @__PURE__ */ b("span", {
|
|
541
552
|
style: {
|
|
542
553
|
color: r ? "var(--danger)" : "var(--text-3)",
|
|
543
554
|
display: "flex"
|
|
544
555
|
},
|
|
545
556
|
children: e
|
|
546
557
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ b("span", {
|
|
548
559
|
style: { flex: 1 },
|
|
549
560
|
children: t
|
|
550
561
|
}),
|
|
551
|
-
i && /* @__PURE__ */
|
|
562
|
+
i && /* @__PURE__ */ b(A, { children: i })
|
|
552
563
|
]
|
|
553
564
|
});
|
|
554
565
|
}
|
|
555
566
|
//#endregion
|
|
556
567
|
//#region src/components/primitives/Spinner.tsx
|
|
557
568
|
function Se({ size: e = 14 }) {
|
|
558
|
-
return /* @__PURE__ */
|
|
569
|
+
return /* @__PURE__ */ x("svg", {
|
|
559
570
|
width: e,
|
|
560
571
|
height: e,
|
|
561
572
|
viewBox: "0 0 24 24",
|
|
562
573
|
style: { animation: "spin 0.8s linear infinite" },
|
|
563
574
|
children: [
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ b("style", { children: "@keyframes spin{to{transform:rotate(360deg);}}" }),
|
|
576
|
+
/* @__PURE__ */ b("circle", {
|
|
566
577
|
cx: "12",
|
|
567
578
|
cy: "12",
|
|
568
579
|
r: "9",
|
|
@@ -570,7 +581,7 @@ function Se({ size: e = 14 }) {
|
|
|
570
581
|
strokeWidth: "2.5",
|
|
571
582
|
fill: "none"
|
|
572
583
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ b("path", {
|
|
574
585
|
d: "M12 3a9 9 0 0 1 9 9",
|
|
575
586
|
stroke: "var(--accent)",
|
|
576
587
|
strokeWidth: "2.5",
|
|
@@ -582,7 +593,7 @@ function Se({ size: e = 14 }) {
|
|
|
582
593
|
}
|
|
583
594
|
//#endregion
|
|
584
595
|
//#region src/components/primitives/Fields.tsx
|
|
585
|
-
var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */
|
|
596
|
+
var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ x("div", {
|
|
586
597
|
style: {
|
|
587
598
|
display: "flex",
|
|
588
599
|
alignItems: "center",
|
|
@@ -594,20 +605,20 @@ var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ b("div", {
|
|
|
594
605
|
letterSpacing: "0.01em"
|
|
595
606
|
},
|
|
596
607
|
children: [
|
|
597
|
-
/* @__PURE__ */
|
|
598
|
-
n && /* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ b("span", { children: e }),
|
|
609
|
+
n && /* @__PURE__ */ b("span", {
|
|
599
610
|
"aria-hidden": "true",
|
|
600
611
|
style: { color: "var(--danger)" },
|
|
601
612
|
children: "*"
|
|
602
613
|
}),
|
|
603
|
-
r && /* @__PURE__ */
|
|
614
|
+
r && /* @__PURE__ */ b("span", {
|
|
604
615
|
title: r,
|
|
605
616
|
style: {
|
|
606
617
|
cursor: "help",
|
|
607
618
|
color: "var(--text-4)",
|
|
608
619
|
display: "flex"
|
|
609
620
|
},
|
|
610
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ b(t.info, { size: 11 })
|
|
611
622
|
})
|
|
612
623
|
]
|
|
613
624
|
}), we = {
|
|
@@ -623,9 +634,9 @@ var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ b("div", {
|
|
|
623
634
|
outline: "none",
|
|
624
635
|
transition: "border-color .12s, box-shadow .12s"
|
|
625
636
|
};
|
|
626
|
-
function
|
|
637
|
+
function P({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style: a, ...o }) {
|
|
627
638
|
let [s, c] = p(!1);
|
|
628
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ x("div", {
|
|
629
640
|
style: {
|
|
630
641
|
display: "flex",
|
|
631
642
|
alignItems: "center",
|
|
@@ -637,14 +648,14 @@ function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
637
648
|
...a
|
|
638
649
|
},
|
|
639
650
|
children: [
|
|
640
|
-
r && /* @__PURE__ */
|
|
651
|
+
r && /* @__PURE__ */ b("span", {
|
|
641
652
|
style: {
|
|
642
653
|
color: "var(--text-3)",
|
|
643
654
|
display: "flex"
|
|
644
655
|
},
|
|
645
656
|
children: r
|
|
646
657
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ b("input", {
|
|
648
659
|
value: e ?? "",
|
|
649
660
|
onChange: (e) => t?.(e.target.value),
|
|
650
661
|
placeholder: n,
|
|
@@ -662,7 +673,7 @@ function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
662
673
|
},
|
|
663
674
|
...o
|
|
664
675
|
}),
|
|
665
|
-
i && /* @__PURE__ */
|
|
676
|
+
i && /* @__PURE__ */ b("span", {
|
|
666
677
|
style: {
|
|
667
678
|
color: "var(--text-3)",
|
|
668
679
|
display: "flex"
|
|
@@ -682,7 +693,7 @@ function Te({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
|
|
|
682
693
|
height: "auto",
|
|
683
694
|
resize: "vertical"
|
|
684
695
|
};
|
|
685
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ b("textarea", {
|
|
686
697
|
id: a,
|
|
687
698
|
name: o,
|
|
688
699
|
"aria-required": s || void 0,
|
|
@@ -707,8 +718,8 @@ var Ee = 20, De = 100;
|
|
|
707
718
|
function Oe(e) {
|
|
708
719
|
return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
|
|
709
720
|
}
|
|
710
|
-
function
|
|
711
|
-
let [s, c] = p(!1), [l, u] = p(""), m = f(null), h = n.find((t) => !t.heading && !t.divider && t.value === e), g = n.filter((e) => !e.heading && !e.divider).length, _ = !!a,
|
|
721
|
+
function F({ value: e, options: n, onChange: r, placeholder: i = "Select...", onSearchChange: a, ...o }) {
|
|
722
|
+
let [s, c] = p(!1), [l, u] = p(""), m = f(null), h = n.find((t) => !t.heading && !t.divider && t.value === e), g = n.filter((e) => !e.heading && !e.divider).length, _ = !!a, v = _ || g > Ee, S = (e) => {
|
|
712
723
|
u(e), a?.(e);
|
|
713
724
|
}, C = d(() => {
|
|
714
725
|
if (_) return n.slice(0, De);
|
|
@@ -719,7 +730,7 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
719
730
|
l,
|
|
720
731
|
_
|
|
721
732
|
]);
|
|
722
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("button", {
|
|
723
734
|
...o,
|
|
724
735
|
type: "button",
|
|
725
736
|
ref: m,
|
|
@@ -741,7 +752,7 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
741
752
|
...o.style,
|
|
742
753
|
color: h ? "var(--text)" : "var(--text-placeholder)"
|
|
743
754
|
},
|
|
744
|
-
children: [/* @__PURE__ */
|
|
755
|
+
children: [/* @__PURE__ */ b("span", {
|
|
745
756
|
style: {
|
|
746
757
|
display: "flex",
|
|
747
758
|
alignItems: "center",
|
|
@@ -750,12 +761,12 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
750
761
|
textOverflow: "ellipsis"
|
|
751
762
|
},
|
|
752
763
|
children: h ? h.label : i
|
|
753
|
-
}), /* @__PURE__ */
|
|
764
|
+
}), /* @__PURE__ */ b(t.down, {
|
|
754
765
|
size: 12,
|
|
755
766
|
cls: "",
|
|
756
767
|
style: { color: "var(--text-3)" }
|
|
757
768
|
})]
|
|
758
|
-
}), /* @__PURE__ */
|
|
769
|
+
}), /* @__PURE__ */ x(j, {
|
|
759
770
|
open: s,
|
|
760
771
|
anchor: m.current,
|
|
761
772
|
onClose: () => c(!1),
|
|
@@ -765,7 +776,7 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
765
776
|
overflowY: "auto"
|
|
766
777
|
},
|
|
767
778
|
children: [
|
|
768
|
-
|
|
779
|
+
v && /* @__PURE__ */ b("div", {
|
|
769
780
|
style: {
|
|
770
781
|
padding: 6,
|
|
771
782
|
position: "sticky",
|
|
@@ -773,18 +784,18 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
773
784
|
background: "var(--surface)",
|
|
774
785
|
zIndex: 1
|
|
775
786
|
},
|
|
776
|
-
children: /* @__PURE__ */
|
|
787
|
+
children: /* @__PURE__ */ b(P, {
|
|
777
788
|
value: l,
|
|
778
789
|
onChange: S,
|
|
779
790
|
placeholder: "Search…",
|
|
780
|
-
prefix: /* @__PURE__ */
|
|
791
|
+
prefix: /* @__PURE__ */ b(t.search, { size: 12 }),
|
|
781
792
|
autoFocus: !0
|
|
782
793
|
})
|
|
783
794
|
}),
|
|
784
|
-
C.map((t, n) => t.divider ? /* @__PURE__ */
|
|
795
|
+
C.map((t, n) => t.divider ? /* @__PURE__ */ b("div", { style: {
|
|
785
796
|
borderTop: "1px solid var(--divider)",
|
|
786
797
|
margin: "4px 0"
|
|
787
|
-
} }, `divider-${n}`) : t.heading ? /* @__PURE__ */
|
|
798
|
+
} }, `divider-${n}`) : t.heading ? /* @__PURE__ */ b("div", {
|
|
788
799
|
style: {
|
|
789
800
|
padding: "6px 10px 2px",
|
|
790
801
|
fontSize: 10.5,
|
|
@@ -794,14 +805,14 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
794
805
|
letterSpacing: "0.06em"
|
|
795
806
|
},
|
|
796
807
|
children: t.label
|
|
797
|
-
}, `heading-${n}`) : /* @__PURE__ */
|
|
808
|
+
}, `heading-${n}`) : /* @__PURE__ */ b(xe, {
|
|
798
809
|
onClick: () => {
|
|
799
810
|
r(t.value), c(!1);
|
|
800
811
|
},
|
|
801
812
|
active: t.value === e,
|
|
802
813
|
children: t.label
|
|
803
814
|
}, t.value)),
|
|
804
|
-
C.length === 0 && /* @__PURE__ */
|
|
815
|
+
C.length === 0 && /* @__PURE__ */ b("div", {
|
|
805
816
|
style: {
|
|
806
817
|
padding: "8px 10px",
|
|
807
818
|
fontSize: 12.5,
|
|
@@ -813,11 +824,11 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
813
824
|
})] });
|
|
814
825
|
}
|
|
815
826
|
function ke({ value: e, onChange: n }) {
|
|
816
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ b(P, {
|
|
817
828
|
value: e || "",
|
|
818
829
|
onChange: n,
|
|
819
830
|
placeholder: "YYYY-MM-DD HH:mm",
|
|
820
|
-
prefix: /* @__PURE__ */
|
|
831
|
+
prefix: /* @__PURE__ */ b(t.calendar, { size: 13 })
|
|
821
832
|
});
|
|
822
833
|
}
|
|
823
834
|
function Ae(e) {
|
|
@@ -840,7 +851,7 @@ var je = [
|
|
|
840
851
|
];
|
|
841
852
|
function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStrength: i, id: a, name: o, ariaRequired: s }) {
|
|
842
853
|
let [c, l] = p(!1), u = e || "", d = Ae(u);
|
|
843
|
-
return /* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(P, {
|
|
844
855
|
id: a,
|
|
845
856
|
name: o,
|
|
846
857
|
"aria-required": s || void 0,
|
|
@@ -848,7 +859,7 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
848
859
|
value: u,
|
|
849
860
|
onChange: n,
|
|
850
861
|
placeholder: r,
|
|
851
|
-
suffix: /* @__PURE__ */
|
|
862
|
+
suffix: /* @__PURE__ */ b("button", {
|
|
852
863
|
type: "button",
|
|
853
864
|
"aria-label": c ? "Hide password" : "Show password",
|
|
854
865
|
style: {
|
|
@@ -860,16 +871,16 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
860
871
|
display: "flex"
|
|
861
872
|
},
|
|
862
873
|
onClick: () => l((e) => !e),
|
|
863
|
-
children:
|
|
874
|
+
children: b(c ? t.eyeOff : t.eye, { size: 14 })
|
|
864
875
|
})
|
|
865
|
-
}), i && /* @__PURE__ */
|
|
876
|
+
}), i && /* @__PURE__ */ x("div", {
|
|
866
877
|
style: {
|
|
867
878
|
marginTop: 6,
|
|
868
879
|
display: "flex",
|
|
869
880
|
alignItems: "center",
|
|
870
881
|
gap: 8
|
|
871
882
|
},
|
|
872
|
-
children: [/* @__PURE__ */
|
|
883
|
+
children: [/* @__PURE__ */ b("div", {
|
|
873
884
|
style: {
|
|
874
885
|
display: "flex",
|
|
875
886
|
gap: 3,
|
|
@@ -880,14 +891,14 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
880
891
|
1,
|
|
881
892
|
2,
|
|
882
893
|
3
|
|
883
|
-
].map((e) => /* @__PURE__ */
|
|
894
|
+
].map((e) => /* @__PURE__ */ b("span", { style: {
|
|
884
895
|
flex: 1,
|
|
885
896
|
height: 3,
|
|
886
897
|
borderRadius: 999,
|
|
887
898
|
background: e < d ? Me[d] : "var(--surface-3)",
|
|
888
899
|
transition: "background .15s"
|
|
889
900
|
} }, e))
|
|
890
|
-
}), /* @__PURE__ */
|
|
901
|
+
}), /* @__PURE__ */ b("span", {
|
|
891
902
|
style: {
|
|
892
903
|
fontSize: 10.5,
|
|
893
904
|
color: "var(--text-3)",
|
|
@@ -900,7 +911,7 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
900
911
|
}
|
|
901
912
|
function Pe({ value: e = [], onChange: t }) {
|
|
902
913
|
let [n, r] = p("");
|
|
903
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ x("div", {
|
|
904
915
|
style: {
|
|
905
916
|
...we,
|
|
906
917
|
height: "auto",
|
|
@@ -911,11 +922,11 @@ function Pe({ value: e = [], onChange: t }) {
|
|
|
911
922
|
padding: "4px 6px",
|
|
912
923
|
alignItems: "center"
|
|
913
924
|
},
|
|
914
|
-
children: [e.map((n, r) => /* @__PURE__ */
|
|
925
|
+
children: [e.map((n, r) => /* @__PURE__ */ b(N, {
|
|
915
926
|
tone: "slate",
|
|
916
927
|
onRemove: () => t(e.filter((e, t) => t !== r)),
|
|
917
928
|
children: n
|
|
918
|
-
}, r)), /* @__PURE__ */
|
|
929
|
+
}, r)), /* @__PURE__ */ b("input", {
|
|
919
930
|
value: n,
|
|
920
931
|
onChange: (e) => r(e.target.value),
|
|
921
932
|
onKeyDown: (i) => {
|
|
@@ -935,14 +946,14 @@ function Pe({ value: e = [], onChange: t }) {
|
|
|
935
946
|
});
|
|
936
947
|
}
|
|
937
948
|
function Fe({ value: e, onChange: t }) {
|
|
938
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ x("div", {
|
|
939
950
|
style: {
|
|
940
951
|
border: "1px solid var(--border)",
|
|
941
952
|
borderRadius: 6,
|
|
942
953
|
background: "var(--surface-2)",
|
|
943
954
|
overflow: "hidden"
|
|
944
955
|
},
|
|
945
|
-
children: [/* @__PURE__ */
|
|
956
|
+
children: [/* @__PURE__ */ x("div", {
|
|
946
957
|
style: {
|
|
947
958
|
padding: "6px 10px",
|
|
948
959
|
background: "var(--surface-3)",
|
|
@@ -952,7 +963,7 @@ function Fe({ value: e, onChange: t }) {
|
|
|
952
963
|
gap: 8
|
|
953
964
|
},
|
|
954
965
|
children: [
|
|
955
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ b("span", {
|
|
956
967
|
className: "mono",
|
|
957
968
|
style: {
|
|
958
969
|
fontSize: 10.5,
|
|
@@ -962,19 +973,19 @@ function Fe({ value: e, onChange: t }) {
|
|
|
962
973
|
},
|
|
963
974
|
children: "JSON"
|
|
964
975
|
}),
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ b("span", { style: { flex: 1 } }),
|
|
977
|
+
/* @__PURE__ */ b(D, {
|
|
967
978
|
size: "xs",
|
|
968
979
|
kind: "ghost",
|
|
969
980
|
children: "Format"
|
|
970
981
|
}),
|
|
971
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ b(D, {
|
|
972
983
|
size: "xs",
|
|
973
984
|
kind: "ghost",
|
|
974
985
|
children: "Validate"
|
|
975
986
|
})
|
|
976
987
|
]
|
|
977
|
-
}), /* @__PURE__ */
|
|
988
|
+
}), /* @__PURE__ */ b("textarea", {
|
|
978
989
|
className: "mono",
|
|
979
990
|
value: e || "",
|
|
980
991
|
onChange: (e) => t?.(e.target.value),
|
|
@@ -995,7 +1006,7 @@ function Fe({ value: e, onChange: t }) {
|
|
|
995
1006
|
}
|
|
996
1007
|
function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a, ariaLabelledby: o, ariaRequired: s }) {
|
|
997
1008
|
let [c, l] = p(!1), u = f(null);
|
|
998
|
-
return /* @__PURE__ */
|
|
1009
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("button", {
|
|
999
1010
|
type: "button",
|
|
1000
1011
|
id: a,
|
|
1001
1012
|
"aria-labelledby": o,
|
|
@@ -1010,14 +1021,14 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
1010
1021
|
textAlign: "left",
|
|
1011
1022
|
cursor: "pointer"
|
|
1012
1023
|
},
|
|
1013
|
-
children: [/* @__PURE__ */
|
|
1024
|
+
children: [/* @__PURE__ */ x("span", {
|
|
1014
1025
|
style: {
|
|
1015
1026
|
display: "flex",
|
|
1016
1027
|
alignItems: "center",
|
|
1017
1028
|
gap: 8,
|
|
1018
1029
|
overflow: "hidden"
|
|
1019
1030
|
},
|
|
1020
|
-
children: [/* @__PURE__ */
|
|
1031
|
+
children: [/* @__PURE__ */ b("span", {
|
|
1021
1032
|
style: {
|
|
1022
1033
|
width: 18,
|
|
1023
1034
|
height: 18,
|
|
@@ -1028,30 +1039,30 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
1028
1039
|
alignItems: "center",
|
|
1029
1040
|
justifyContent: "center"
|
|
1030
1041
|
},
|
|
1031
|
-
children: /* @__PURE__ */
|
|
1032
|
-
}), /* @__PURE__ */
|
|
1042
|
+
children: /* @__PURE__ */ b(t.link, { size: 11 })
|
|
1043
|
+
}), /* @__PURE__ */ b("span", {
|
|
1033
1044
|
style: { color: e ? "var(--accent)" : "var(--text-placeholder)" },
|
|
1034
1045
|
children: e || `Link to ${n}…`
|
|
1035
1046
|
})]
|
|
1036
|
-
}), /* @__PURE__ */
|
|
1047
|
+
}), /* @__PURE__ */ b(t.search, {
|
|
1037
1048
|
size: 12,
|
|
1038
1049
|
cls: "",
|
|
1039
1050
|
style: { color: "var(--text-3)" }
|
|
1040
1051
|
})]
|
|
1041
|
-
}), /* @__PURE__ */
|
|
1052
|
+
}), /* @__PURE__ */ x(j, {
|
|
1042
1053
|
open: c,
|
|
1043
1054
|
anchor: u.current,
|
|
1044
1055
|
onClose: () => l(!1),
|
|
1045
1056
|
width: u.current?.offsetWidth,
|
|
1046
|
-
children: [/* @__PURE__ */
|
|
1057
|
+
children: [/* @__PURE__ */ b("div", {
|
|
1047
1058
|
style: { padding: 4 },
|
|
1048
|
-
children: /* @__PURE__ */
|
|
1059
|
+
children: /* @__PURE__ */ b(P, {
|
|
1049
1060
|
placeholder: `Search ${n}…`,
|
|
1050
|
-
prefix: /* @__PURE__ */
|
|
1061
|
+
prefix: /* @__PURE__ */ b(t.search, { size: 12 }),
|
|
1051
1062
|
style: { marginBottom: 4 }
|
|
1052
1063
|
})
|
|
1053
|
-
}), i.slice(0, 6).map((e) => /* @__PURE__ */
|
|
1054
|
-
icon: /* @__PURE__ */
|
|
1064
|
+
}), i.slice(0, 6).map((e) => /* @__PURE__ */ b(xe, {
|
|
1065
|
+
icon: /* @__PURE__ */ b(t.building, { size: 13 }),
|
|
1055
1066
|
onClick: () => {
|
|
1056
1067
|
r?.(e.name), l(!1);
|
|
1057
1068
|
},
|
|
@@ -1060,7 +1071,7 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
1060
1071
|
})] });
|
|
1061
1072
|
}
|
|
1062
1073
|
function Le({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
1063
|
-
return /* @__PURE__ */
|
|
1074
|
+
return /* @__PURE__ */ x("div", {
|
|
1064
1075
|
style: {
|
|
1065
1076
|
display: "flex",
|
|
1066
1077
|
flexDirection: r ? "column" : "row",
|
|
@@ -1068,7 +1079,7 @@ function Le({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
|
1068
1079
|
minHeight: 24,
|
|
1069
1080
|
alignItems: "baseline"
|
|
1070
1081
|
},
|
|
1071
|
-
children: [/* @__PURE__ */
|
|
1082
|
+
children: [/* @__PURE__ */ b("div", {
|
|
1072
1083
|
style: {
|
|
1073
1084
|
width: r ? "auto" : 140,
|
|
1074
1085
|
flexShrink: 0,
|
|
@@ -1078,7 +1089,7 @@ function Le({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
|
1078
1089
|
letterSpacing: "0.01em"
|
|
1079
1090
|
},
|
|
1080
1091
|
children: e
|
|
1081
|
-
}), /* @__PURE__ */
|
|
1092
|
+
}), /* @__PURE__ */ b("div", {
|
|
1082
1093
|
className: n ? "mono num" : "num",
|
|
1083
1094
|
style: {
|
|
1084
1095
|
flex: 1,
|
|
@@ -1098,7 +1109,7 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
|
|
|
1098
1109
|
}, u = () => {
|
|
1099
1110
|
c(e), o(!1);
|
|
1100
1111
|
};
|
|
1101
|
-
return a ? /* @__PURE__ */
|
|
1112
|
+
return a ? /* @__PURE__ */ x("div", {
|
|
1102
1113
|
style: {
|
|
1103
1114
|
display: "flex",
|
|
1104
1115
|
alignItems: "center",
|
|
@@ -1107,34 +1118,34 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
|
|
|
1107
1118
|
onKeyDown: (e) => {
|
|
1108
1119
|
e.key === "Enter" && l(), e.key === "Escape" && u();
|
|
1109
1120
|
},
|
|
1110
|
-
children: [r === "select" ? /* @__PURE__ */
|
|
1121
|
+
children: [r === "select" ? /* @__PURE__ */ b(F, {
|
|
1111
1122
|
value: s,
|
|
1112
1123
|
options: i || [],
|
|
1113
1124
|
onChange: (e) => {
|
|
1114
1125
|
c(e), n?.(e), o(!1);
|
|
1115
1126
|
}
|
|
1116
|
-
}) : r === "bool" ? /* @__PURE__ */
|
|
1127
|
+
}) : r === "bool" ? /* @__PURE__ */ b(be, {
|
|
1117
1128
|
value: s === "true",
|
|
1118
1129
|
onChange: (e) => {
|
|
1119
1130
|
let t = String(e);
|
|
1120
1131
|
c(t), n?.(t), o(!1);
|
|
1121
1132
|
}
|
|
1122
|
-
}) : /* @__PURE__ */
|
|
1133
|
+
}) : /* @__PURE__ */ b(P, {
|
|
1123
1134
|
value: s ?? "",
|
|
1124
1135
|
onChange: c,
|
|
1125
1136
|
autoFocus: !0
|
|
1126
|
-
}), r !== "select" && r !== "bool" && /* @__PURE__ */
|
|
1137
|
+
}), r !== "select" && r !== "bool" && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(O, {
|
|
1127
1138
|
size: 24,
|
|
1128
|
-
icon: /* @__PURE__ */
|
|
1139
|
+
icon: /* @__PURE__ */ b(t.check, { size: 13 }),
|
|
1129
1140
|
onClick: l,
|
|
1130
1141
|
title: "Save"
|
|
1131
|
-
}), /* @__PURE__ */
|
|
1142
|
+
}), /* @__PURE__ */ b(O, {
|
|
1132
1143
|
size: 24,
|
|
1133
|
-
icon: /* @__PURE__ */
|
|
1144
|
+
icon: /* @__PURE__ */ b(t.x, { size: 13 }),
|
|
1134
1145
|
onClick: u,
|
|
1135
1146
|
title: "Cancel"
|
|
1136
1147
|
})] })]
|
|
1137
|
-
}) : /* @__PURE__ */
|
|
1148
|
+
}) : /* @__PURE__ */ b("div", {
|
|
1138
1149
|
onClick: () => o(!0),
|
|
1139
1150
|
style: {
|
|
1140
1151
|
padding: "4px 6px",
|
|
@@ -1153,7 +1164,7 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
|
|
|
1153
1164
|
onMouseLeave: (e) => {
|
|
1154
1165
|
e.currentTarget.style.borderColor = "transparent";
|
|
1155
1166
|
},
|
|
1156
|
-
children: e || /* @__PURE__ */
|
|
1167
|
+
children: e || /* @__PURE__ */ b("span", {
|
|
1157
1168
|
style: { color: "var(--text-4)" },
|
|
1158
1169
|
children: "Click to edit"
|
|
1159
1170
|
})
|
|
@@ -1204,7 +1215,7 @@ var ze = class e {
|
|
|
1204
1215
|
};
|
|
1205
1216
|
//#endregion
|
|
1206
1217
|
//#region src/lib/display-value.ts
|
|
1207
|
-
function
|
|
1218
|
+
function I(e) {
|
|
1208
1219
|
if (e == null) return "";
|
|
1209
1220
|
switch (typeof e) {
|
|
1210
1221
|
case "string": return e;
|
|
@@ -1220,7 +1231,7 @@ function F(e) {
|
|
|
1220
1231
|
default: return "";
|
|
1221
1232
|
}
|
|
1222
1233
|
}
|
|
1223
|
-
function
|
|
1234
|
+
function L(e, t = "en") {
|
|
1224
1235
|
return e ? e[t] ?? Object.values(e)[0] ?? "" : "";
|
|
1225
1236
|
}
|
|
1226
1237
|
var Be = "$display";
|
|
@@ -1231,12 +1242,21 @@ function Ve(e, t) {
|
|
|
1231
1242
|
let r = t?.display?.display_field;
|
|
1232
1243
|
if (!r) return;
|
|
1233
1244
|
let i = e[r];
|
|
1234
|
-
if (i
|
|
1245
|
+
if (i == null) return;
|
|
1246
|
+
let a = t?.fields?.get(r)?.values;
|
|
1247
|
+
if (a && (typeof i == "string" || typeof i == "number")) {
|
|
1248
|
+
let e = a.find((e) => e.code === String(i));
|
|
1249
|
+
if (e) {
|
|
1250
|
+
let t = L(e.name);
|
|
1251
|
+
if (t) return t;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
return typeof i == "object" && !Array.isArray(i) ? L(i) || void 0 : I(i);
|
|
1235
1255
|
}
|
|
1236
|
-
function
|
|
1256
|
+
function R(e, t, n) {
|
|
1237
1257
|
if (!t) return n;
|
|
1238
1258
|
let r = e[t];
|
|
1239
|
-
return r == null ? n : typeof r == "object" && !Array.isArray(r) ?
|
|
1259
|
+
return r == null ? n : typeof r == "object" && !Array.isArray(r) ? L(r) || n : I(r);
|
|
1240
1260
|
}
|
|
1241
1261
|
function He(e) {
|
|
1242
1262
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
@@ -1257,9 +1277,9 @@ function We(e, t, n) {
|
|
|
1257
1277
|
let r = e.replace(/\/+$/, "") || "/", i;
|
|
1258
1278
|
for (let e of Object.values(t)) {
|
|
1259
1279
|
if (!e.route || !He(e.route).test(r)) continue;
|
|
1260
|
-
let t = e.route.includes("/:"), a =
|
|
1280
|
+
let t = e.route.includes("/:"), a = L(e.display?.name);
|
|
1261
1281
|
if (!a && t && n && e.entity) {
|
|
1262
|
-
let t =
|
|
1282
|
+
let t = L(n[e.entity]?.display?.name);
|
|
1263
1283
|
if (t) {
|
|
1264
1284
|
let e = r.slice(r.lastIndexOf("/") + 1);
|
|
1265
1285
|
a = e ? `${t} ${Ue(e)}` : t;
|
|
@@ -1276,12 +1296,12 @@ function We(e, t, n) {
|
|
|
1276
1296
|
return i;
|
|
1277
1297
|
}
|
|
1278
1298
|
function Ge(e, t, n) {
|
|
1279
|
-
let r =
|
|
1299
|
+
let r = L(e.display?.name);
|
|
1280
1300
|
if (r) return r;
|
|
1281
1301
|
if (e.type === "ref" && e.ref?.entity && n) {
|
|
1282
1302
|
let t = n[e.ref.entity];
|
|
1283
1303
|
if (t) {
|
|
1284
|
-
let e =
|
|
1304
|
+
let e = L(t.display?.name);
|
|
1285
1305
|
if (e) return e;
|
|
1286
1306
|
}
|
|
1287
1307
|
}
|
|
@@ -1315,14 +1335,14 @@ function Je(e) {
|
|
|
1315
1335
|
function Ye(e, t) {
|
|
1316
1336
|
return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
|
|
1317
1337
|
}
|
|
1318
|
-
function
|
|
1338
|
+
function z(e) {
|
|
1319
1339
|
if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
|
|
1320
1340
|
for (let [t, n] of e.fields) if (n.primary) return [t];
|
|
1321
1341
|
return ["id"];
|
|
1322
1342
|
}
|
|
1323
1343
|
function Xe(e, t) {
|
|
1324
|
-
let n =
|
|
1325
|
-
for (let e of n) r[e] =
|
|
1344
|
+
let n = z(e), r = {};
|
|
1345
|
+
for (let e of n) r[e] = I(t[e]);
|
|
1326
1346
|
return r;
|
|
1327
1347
|
}
|
|
1328
1348
|
function Ze(e) {
|
|
@@ -1332,10 +1352,10 @@ function Qe(e) {
|
|
|
1332
1352
|
return Ze(Object.values(e));
|
|
1333
1353
|
}
|
|
1334
1354
|
function $e(e, t) {
|
|
1335
|
-
return Ze(
|
|
1355
|
+
return Ze(z(e).map((e) => t[e] ?? ""));
|
|
1336
1356
|
}
|
|
1337
1357
|
function et(e, t) {
|
|
1338
|
-
let n =
|
|
1358
|
+
let n = z(e);
|
|
1339
1359
|
if (n.length === 1) return { [n[0]]: t };
|
|
1340
1360
|
}
|
|
1341
1361
|
function tt(e, t) {
|
|
@@ -1359,17 +1379,17 @@ function rt(e, t, n, r) {
|
|
|
1359
1379
|
return i ? i.replace(":id", encodeURIComponent(t)) : null;
|
|
1360
1380
|
}
|
|
1361
1381
|
function it(e, t, n, r) {
|
|
1362
|
-
return !t ||
|
|
1382
|
+
return !t || z(t).some((e) => !r[e]) ? null : rt(e, $e(t, r), t, n);
|
|
1363
1383
|
}
|
|
1364
1384
|
function at(e, t, n, r) {
|
|
1365
1385
|
return t ? it(e, t, n, Xe(t, r)) : null;
|
|
1366
1386
|
}
|
|
1367
1387
|
function ot(e) {
|
|
1368
|
-
return
|
|
1388
|
+
return z(e).length > 1;
|
|
1369
1389
|
}
|
|
1370
1390
|
//#endregion
|
|
1371
1391
|
//#region src/types/api.ts
|
|
1372
|
-
var
|
|
1392
|
+
var B = class extends Error {
|
|
1373
1393
|
status;
|
|
1374
1394
|
code;
|
|
1375
1395
|
index;
|
|
@@ -1379,31 +1399,31 @@ var z = class extends Error {
|
|
|
1379
1399
|
}
|
|
1380
1400
|
}, st = "cursor_semantics_mismatch", ct = "cursor_locale_changed";
|
|
1381
1401
|
function lt(e) {
|
|
1382
|
-
return e instanceof
|
|
1402
|
+
return e instanceof B && (e.code === "cursor_semantics_mismatch" || e.code === "cursor_locale_changed" || e.code === "archive_cursor_invalid");
|
|
1383
1403
|
}
|
|
1384
1404
|
//#endregion
|
|
1385
1405
|
//#region src/api/auth-redirect.ts
|
|
1386
|
-
var
|
|
1406
|
+
var V = "/", ut = "/login", dt = "/signup", ft = "https://declarion.local";
|
|
1387
1407
|
function pt(e) {
|
|
1388
1408
|
let t = e.split(/[?#]/, 1)[0];
|
|
1389
1409
|
return t === ut || t.startsWith(`${ut}/`) || t === dt || t.startsWith(`${dt}/`);
|
|
1390
1410
|
}
|
|
1391
1411
|
function mt(e) {
|
|
1392
|
-
if (!e) return
|
|
1412
|
+
if (!e) return V;
|
|
1393
1413
|
let t = e.toLowerCase();
|
|
1394
|
-
if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return
|
|
1414
|
+
if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return V;
|
|
1395
1415
|
try {
|
|
1396
1416
|
let t = new URL(e, ft);
|
|
1397
|
-
if (t.origin !== ft) return
|
|
1417
|
+
if (t.origin !== ft) return V;
|
|
1398
1418
|
let n = `${t.pathname}${t.search}${t.hash}`;
|
|
1399
|
-
return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ?
|
|
1419
|
+
return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ? V : n || V;
|
|
1400
1420
|
} catch {
|
|
1401
|
-
return
|
|
1421
|
+
return V;
|
|
1402
1422
|
}
|
|
1403
1423
|
}
|
|
1404
1424
|
function ht(e) {
|
|
1405
1425
|
let t = mt(e);
|
|
1406
|
-
return t ===
|
|
1426
|
+
return t === V || pt(t) ? ut : `${ut}?next=${encodeURIComponent(t)}`;
|
|
1407
1427
|
}
|
|
1408
1428
|
function gt() {
|
|
1409
1429
|
if (typeof window > "u") return ut;
|
|
@@ -1437,55 +1457,55 @@ function yt(e, t, n) {
|
|
|
1437
1457
|
}
|
|
1438
1458
|
//#endregion
|
|
1439
1459
|
//#region src/embed/token.ts
|
|
1440
|
-
var bt = 15e3, xt = 5e3,
|
|
1460
|
+
var bt = 15e3, xt = 5e3, H = {
|
|
1441
1461
|
active: !1,
|
|
1442
1462
|
parentOrigin: null,
|
|
1443
1463
|
current: null,
|
|
1444
1464
|
pending: null
|
|
1445
1465
|
};
|
|
1446
1466
|
function St(e) {
|
|
1447
|
-
|
|
1467
|
+
H.active = !0, H.parentOrigin = e;
|
|
1448
1468
|
}
|
|
1449
1469
|
function Ct() {
|
|
1450
|
-
return
|
|
1470
|
+
return H.active;
|
|
1451
1471
|
}
|
|
1452
1472
|
function wt() {
|
|
1453
|
-
return
|
|
1473
|
+
return H.current?.token ?? null;
|
|
1454
1474
|
}
|
|
1455
1475
|
function Tt() {
|
|
1456
|
-
return
|
|
1476
|
+
return H.parentOrigin;
|
|
1457
1477
|
}
|
|
1458
1478
|
function Et() {
|
|
1459
|
-
return !
|
|
1479
|
+
return !H.current || Date.now() >= H.current.expiresAt - xt;
|
|
1460
1480
|
}
|
|
1461
1481
|
function Dt(e) {
|
|
1462
1482
|
if (!e.token || typeof e.token != "string") return;
|
|
1463
1483
|
let t = Date.parse(e.expires_at);
|
|
1464
|
-
if (!Number.isNaN(t) && (
|
|
1484
|
+
if (!Number.isNaN(t) && (H.current = {
|
|
1465
1485
|
token: e.token,
|
|
1466
1486
|
expiresAt: t
|
|
1467
|
-
},
|
|
1468
|
-
let t =
|
|
1469
|
-
|
|
1487
|
+
}, H.pending)) {
|
|
1488
|
+
let t = H.pending;
|
|
1489
|
+
H.pending = null, clearTimeout(t.timer), t.resolve(e.token);
|
|
1470
1490
|
}
|
|
1471
1491
|
}
|
|
1472
1492
|
function Ot() {
|
|
1473
|
-
|
|
1493
|
+
H.current = null;
|
|
1474
1494
|
}
|
|
1475
1495
|
function kt() {
|
|
1476
|
-
if (!Et() &&
|
|
1477
|
-
if (
|
|
1496
|
+
if (!Et() && H.current) return Promise.resolve(H.current.token);
|
|
1497
|
+
if (H.pending) return H.pending.promise;
|
|
1478
1498
|
let e, t, n = new Promise((n, r) => {
|
|
1479
1499
|
e = n, t = r;
|
|
1480
1500
|
}), r = setTimeout(() => {
|
|
1481
|
-
|
|
1501
|
+
H.pending && H.pending.promise === n && (H.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${bt}ms`));
|
|
1482
1502
|
}, bt);
|
|
1483
|
-
return
|
|
1503
|
+
return H.pending = {
|
|
1484
1504
|
promise: n,
|
|
1485
1505
|
resolve: e,
|
|
1486
1506
|
reject: t,
|
|
1487
1507
|
timer: r
|
|
1488
|
-
}, yt(
|
|
1508
|
+
}, yt(H.parentOrigin, vt.tokenExpired, {}), n;
|
|
1489
1509
|
}
|
|
1490
1510
|
//#endregion
|
|
1491
1511
|
//#region src/lib/versionTracker.ts
|
|
@@ -1498,7 +1518,7 @@ function Mt() {
|
|
|
1498
1518
|
return null;
|
|
1499
1519
|
}
|
|
1500
1520
|
}
|
|
1501
|
-
var
|
|
1521
|
+
var U = {
|
|
1502
1522
|
firstSeen: null,
|
|
1503
1523
|
firstComponents: null,
|
|
1504
1524
|
hasReportedDrift: !1,
|
|
@@ -1507,11 +1527,11 @@ var H = {
|
|
|
1507
1527
|
channel: null
|
|
1508
1528
|
};
|
|
1509
1529
|
function Nt() {
|
|
1510
|
-
|
|
1530
|
+
U.channel || typeof BroadcastChannel > "u" || (U.channel = Mt(), U.channel && U.channel.addEventListener("message", (e) => {
|
|
1511
1531
|
let t = e.data;
|
|
1512
|
-
if (!(!t || t.type !== "drift" || !t.delta) && !
|
|
1513
|
-
|
|
1514
|
-
for (let e of
|
|
1532
|
+
if (!(!t || t.type !== "drift" || !t.delta) && !U.hasReportedDrift) {
|
|
1533
|
+
U.hasReportedDrift = !0;
|
|
1534
|
+
for (let e of U.listeners) e(t.delta);
|
|
1515
1535
|
}
|
|
1516
1536
|
}));
|
|
1517
1537
|
}
|
|
@@ -1519,11 +1539,11 @@ function Pt(e) {
|
|
|
1519
1539
|
if (Nt(), !e) return;
|
|
1520
1540
|
let t = e.get(At);
|
|
1521
1541
|
if (t) {
|
|
1522
|
-
if (!
|
|
1523
|
-
|
|
1542
|
+
if (!U.firstSeen) {
|
|
1543
|
+
U.firstSeen = t;
|
|
1524
1544
|
return;
|
|
1525
1545
|
}
|
|
1526
|
-
t !==
|
|
1546
|
+
t !== U.firstSeen && (U.hasReportedDrift || Ft().catch(() => {
|
|
1527
1547
|
Lt({
|
|
1528
1548
|
kind: "unknown",
|
|
1529
1549
|
observed: t
|
|
@@ -1536,7 +1556,7 @@ async function Ft() {
|
|
|
1536
1556
|
let e;
|
|
1537
1557
|
try {
|
|
1538
1558
|
let t = {};
|
|
1539
|
-
|
|
1559
|
+
U.firstSeen && (t["If-None-Match"] = `"${U.firstSeen}"`), e = await fetch("/api/version", {
|
|
1540
1560
|
method: "GET",
|
|
1541
1561
|
credentials: Ct() ? "omit" : "include",
|
|
1542
1562
|
headers: t
|
|
@@ -1559,8 +1579,8 @@ async function Ft() {
|
|
|
1559
1579
|
asset: t.asset_fingerprint,
|
|
1560
1580
|
binary: t.binary_fingerprint
|
|
1561
1581
|
} : void 0;
|
|
1562
|
-
|
|
1563
|
-
kind: It(
|
|
1582
|
+
U.firstSeen ||= n, !U.firstComponents && r && n === U.firstSeen && (U.firstComponents = r), n !== U.firstSeen && Lt({
|
|
1583
|
+
kind: It(U.firstComponents, r),
|
|
1564
1584
|
observed: n,
|
|
1565
1585
|
components: r
|
|
1566
1586
|
});
|
|
@@ -1571,11 +1591,11 @@ function It(e, t) {
|
|
|
1571
1591
|
return n && !r && !i ? "schema-only" : r || i ? "asset-or-binary" : "unknown";
|
|
1572
1592
|
}
|
|
1573
1593
|
function Lt(e) {
|
|
1574
|
-
if (!
|
|
1575
|
-
|
|
1576
|
-
for (let t of
|
|
1577
|
-
if (
|
|
1578
|
-
|
|
1594
|
+
if (!U.hasReportedDrift) {
|
|
1595
|
+
U.hasReportedDrift = !0, e.kind !== "schema-only" && (U.pendingReload = e);
|
|
1596
|
+
for (let t of U.listeners) t(e);
|
|
1597
|
+
if (U.channel) try {
|
|
1598
|
+
U.channel.postMessage({
|
|
1579
1599
|
type: "drift",
|
|
1580
1600
|
delta: e
|
|
1581
1601
|
});
|
|
@@ -1584,20 +1604,20 @@ function Lt(e) {
|
|
|
1584
1604
|
}
|
|
1585
1605
|
}
|
|
1586
1606
|
function Rt() {
|
|
1587
|
-
return
|
|
1607
|
+
return U.pendingReload;
|
|
1588
1608
|
}
|
|
1589
1609
|
function zt(e) {
|
|
1590
|
-
return
|
|
1591
|
-
|
|
1610
|
+
return U.listeners.add(e), () => {
|
|
1611
|
+
U.listeners.delete(e);
|
|
1592
1612
|
};
|
|
1593
1613
|
}
|
|
1594
1614
|
//#endregion
|
|
1595
1615
|
//#region src/api/client.ts
|
|
1596
|
-
var Bt = (e) => JSON.stringify(e ?? {}), Vt = null,
|
|
1616
|
+
var Bt = (e) => JSON.stringify(e ?? {}), Vt = null, W = "declarion.auth.refresh.lock", Ht = "declarion.auth.refresh.result", Ut = "declarion.auth.refresh", Wt = 3e4, Gt = 100, Kt = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1597
1617
|
function qt() {
|
|
1598
1618
|
if (typeof window > "u") return !1;
|
|
1599
1619
|
try {
|
|
1600
|
-
let e = window.localStorage, t = `${
|
|
1620
|
+
let e = window.localStorage, t = `${W}.probe`;
|
|
1601
1621
|
return e.setItem(t, "1"), e.removeItem(t), !0;
|
|
1602
1622
|
} catch {
|
|
1603
1623
|
return !1;
|
|
@@ -1638,19 +1658,19 @@ function Zt(e) {
|
|
|
1638
1658
|
return !t || t.updated_at < e ? null : t;
|
|
1639
1659
|
}
|
|
1640
1660
|
function Qt(e) {
|
|
1641
|
-
if (!e.ok) throw new
|
|
1661
|
+
if (!e.ok) throw new G(e.status ?? 401);
|
|
1642
1662
|
}
|
|
1643
1663
|
function $t(e = Date.now()) {
|
|
1644
|
-
let t = Yt(window.localStorage.getItem(
|
|
1664
|
+
let t = Yt(window.localStorage.getItem(W));
|
|
1645
1665
|
if (t && t.expires_at > e && t.owner !== Kt) return !1;
|
|
1646
1666
|
let n = {
|
|
1647
1667
|
owner: Kt,
|
|
1648
1668
|
expires_at: e + Wt
|
|
1649
1669
|
};
|
|
1650
|
-
return window.localStorage.setItem(
|
|
1670
|
+
return window.localStorage.setItem(W, JSON.stringify(n)), Yt(window.localStorage.getItem(W))?.owner === Kt;
|
|
1651
1671
|
}
|
|
1652
1672
|
function en() {
|
|
1653
|
-
Yt(window.localStorage.getItem(
|
|
1673
|
+
Yt(window.localStorage.getItem(W))?.owner === Kt && window.localStorage.removeItem(W);
|
|
1654
1674
|
}
|
|
1655
1675
|
function tn(e) {
|
|
1656
1676
|
let t = {
|
|
@@ -1665,14 +1685,14 @@ async function nn(e) {
|
|
|
1665
1685
|
let r = !1, i = null, a = (e) => {
|
|
1666
1686
|
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), t(e));
|
|
1667
1687
|
}, o = (e) => {
|
|
1668
|
-
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new
|
|
1688
|
+
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new G(e)));
|
|
1669
1689
|
}, s = () => {
|
|
1670
1690
|
let t = Xt(window.localStorage.getItem(Ht));
|
|
1671
1691
|
if (t && t.updated_at >= e) {
|
|
1672
1692
|
t.ok ? a("complete") : o(t.status ?? 401);
|
|
1673
1693
|
return;
|
|
1674
1694
|
}
|
|
1675
|
-
let n = Yt(window.localStorage.getItem(
|
|
1695
|
+
let n = Yt(window.localStorage.getItem(W));
|
|
1676
1696
|
if (!n) {
|
|
1677
1697
|
a("complete");
|
|
1678
1698
|
return;
|
|
@@ -1683,7 +1703,7 @@ async function nn(e) {
|
|
|
1683
1703
|
}
|
|
1684
1704
|
i = setTimeout(s, Gt);
|
|
1685
1705
|
}, c = (e) => {
|
|
1686
|
-
(e.key ===
|
|
1706
|
+
(e.key === W || e.key === Ht) && (i && clearTimeout(i), s());
|
|
1687
1707
|
};
|
|
1688
1708
|
window.addEventListener("storage", c), s();
|
|
1689
1709
|
});
|
|
@@ -1699,7 +1719,7 @@ async function rn(e) {
|
|
|
1699
1719
|
try {
|
|
1700
1720
|
await mn(), qt() && tn({ ok: !0 });
|
|
1701
1721
|
} catch (e) {
|
|
1702
|
-
throw e instanceof
|
|
1722
|
+
throw e instanceof G && qt() && tn({
|
|
1703
1723
|
ok: !1,
|
|
1704
1724
|
status: e.status
|
|
1705
1725
|
}), e;
|
|
@@ -1717,7 +1737,7 @@ async function an() {
|
|
|
1717
1737
|
await mn(), tn({ ok: !0 });
|
|
1718
1738
|
return;
|
|
1719
1739
|
} catch (e) {
|
|
1720
|
-
throw e instanceof
|
|
1740
|
+
throw e instanceof G && tn({
|
|
1721
1741
|
ok: !1,
|
|
1722
1742
|
status: e.status
|
|
1723
1743
|
}), e;
|
|
@@ -1727,7 +1747,7 @@ async function an() {
|
|
|
1727
1747
|
await nn(e) === "expired" && await an();
|
|
1728
1748
|
}
|
|
1729
1749
|
}
|
|
1730
|
-
var
|
|
1750
|
+
var G = class extends Error {
|
|
1731
1751
|
status;
|
|
1732
1752
|
constructor(e) {
|
|
1733
1753
|
super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
|
|
@@ -1735,7 +1755,7 @@ var W = class extends Error {
|
|
|
1735
1755
|
}, on = null, sn = null, cn = 3e4, ln = 5e3;
|
|
1736
1756
|
function un() {
|
|
1737
1757
|
hn().catch((e) => {
|
|
1738
|
-
e instanceof
|
|
1758
|
+
e instanceof G && K();
|
|
1739
1759
|
});
|
|
1740
1760
|
}
|
|
1741
1761
|
function dn(e) {
|
|
@@ -1771,11 +1791,11 @@ async function mn() {
|
|
|
1771
1791
|
let n = parseInt(t.headers.get("Retry-After") || "1", 10);
|
|
1772
1792
|
await new Promise((e) => setTimeout(e, n * 1e3));
|
|
1773
1793
|
let r = await fetch("/api/actions/auth.refresh", e);
|
|
1774
|
-
if (!r.ok) throw new
|
|
1794
|
+
if (!r.ok) throw new G(r.status);
|
|
1775
1795
|
await pn(r);
|
|
1776
1796
|
return;
|
|
1777
1797
|
}
|
|
1778
|
-
if (!t.ok) throw new
|
|
1798
|
+
if (!t.ok) throw new G(t.status);
|
|
1779
1799
|
await pn(t);
|
|
1780
1800
|
}
|
|
1781
1801
|
async function hn() {
|
|
@@ -1783,17 +1803,17 @@ async function hn() {
|
|
|
1783
1803
|
Vt = null;
|
|
1784
1804
|
}), Vt);
|
|
1785
1805
|
}
|
|
1786
|
-
var
|
|
1806
|
+
var K = () => {
|
|
1787
1807
|
if (typeof window > "u") return;
|
|
1788
1808
|
let { pathname: e } = window.location;
|
|
1789
1809
|
e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = gt());
|
|
1790
1810
|
};
|
|
1791
1811
|
function gn(e) {
|
|
1792
|
-
let t =
|
|
1793
|
-
return
|
|
1812
|
+
let t = K;
|
|
1813
|
+
return K = e, t;
|
|
1794
1814
|
}
|
|
1795
1815
|
function _n() {
|
|
1796
|
-
return
|
|
1816
|
+
return K;
|
|
1797
1817
|
}
|
|
1798
1818
|
var vn = ({ status: e, code: t, message: n }) => {
|
|
1799
1819
|
console.error(`[API ${e}] ${t}: ${n}`);
|
|
@@ -1824,29 +1844,29 @@ async function bn(e, t, n, r) {
|
|
|
1824
1844
|
credentials: a
|
|
1825
1845
|
});
|
|
1826
1846
|
if (!c.ok) {
|
|
1827
|
-
|
|
1847
|
+
K();
|
|
1828
1848
|
let e = await c.json().catch(() => ({ error: {
|
|
1829
1849
|
message: "Request failed",
|
|
1830
1850
|
code: "UNKNOWN"
|
|
1831
1851
|
} }));
|
|
1832
|
-
throw new
|
|
1852
|
+
throw new B(c.status, e.error.message, e.error.code, e.index);
|
|
1833
1853
|
}
|
|
1834
1854
|
return r(c);
|
|
1835
1855
|
} catch (e) {
|
|
1836
|
-
throw e instanceof
|
|
1856
|
+
throw e instanceof B ? e : (K(), new B(401, o, c, l));
|
|
1837
1857
|
}
|
|
1838
|
-
throw s.status === 401 &&
|
|
1858
|
+
throw s.status === 401 && K(), vn({
|
|
1839
1859
|
status: s.status,
|
|
1840
1860
|
code: c,
|
|
1841
1861
|
message: o
|
|
1842
|
-
}), new
|
|
1862
|
+
}), new B(s.status, o, c, l, u);
|
|
1843
1863
|
}
|
|
1844
1864
|
return r(s);
|
|
1845
1865
|
}
|
|
1846
1866
|
function xn(e) {
|
|
1847
1867
|
return e.status === 204 ? Promise.resolve(void 0) : e.json();
|
|
1848
1868
|
}
|
|
1849
|
-
async function
|
|
1869
|
+
async function q(e, t = {}) {
|
|
1850
1870
|
return bn(e, t, { setAccept: !1 }, xn);
|
|
1851
1871
|
}
|
|
1852
1872
|
async function Sn(e) {
|
|
@@ -1869,8 +1889,8 @@ function wn(e) {
|
|
|
1869
1889
|
let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
|
|
1870
1890
|
return r ? (r[2] ?? r[3] ?? "").trim() : "";
|
|
1871
1891
|
}
|
|
1872
|
-
async function
|
|
1873
|
-
return (await
|
|
1892
|
+
async function J(e, t = {}) {
|
|
1893
|
+
return (await q(`/api/actions/${encodeURIComponent(e)}`, {
|
|
1874
1894
|
method: "POST",
|
|
1875
1895
|
body: Bt(t)
|
|
1876
1896
|
})).result;
|
|
@@ -1923,15 +1943,15 @@ function On(e) {
|
|
|
1923
1943
|
};
|
|
1924
1944
|
}
|
|
1925
1945
|
async function kn() {
|
|
1926
|
-
return On(await
|
|
1946
|
+
return On(await q("/api/schema"));
|
|
1927
1947
|
}
|
|
1928
1948
|
//#endregion
|
|
1929
1949
|
//#region src/api/auth.ts
|
|
1930
1950
|
async function An() {
|
|
1931
|
-
return
|
|
1951
|
+
return J("auth.check_setup");
|
|
1932
1952
|
}
|
|
1933
1953
|
async function jn(e, t, n = !0) {
|
|
1934
|
-
let r = await
|
|
1954
|
+
let r = await J("auth.login", {
|
|
1935
1955
|
email: e,
|
|
1936
1956
|
password: t,
|
|
1937
1957
|
remember: n
|
|
@@ -1939,7 +1959,7 @@ async function jn(e, t, n = !0) {
|
|
|
1939
1959
|
return dn(r.expires_at), r;
|
|
1940
1960
|
}
|
|
1941
1961
|
async function Mn(e, t, n) {
|
|
1942
|
-
let r = await
|
|
1962
|
+
let r = await J("auth.signup", {
|
|
1943
1963
|
email: e,
|
|
1944
1964
|
password: t,
|
|
1945
1965
|
display_name: n
|
|
@@ -1947,20 +1967,20 @@ async function Mn(e, t, n) {
|
|
|
1947
1967
|
return dn(r.expires_at), r;
|
|
1948
1968
|
}
|
|
1949
1969
|
async function Nn() {
|
|
1950
|
-
return
|
|
1970
|
+
return J("auth.me");
|
|
1951
1971
|
}
|
|
1952
1972
|
async function Pn() {
|
|
1953
|
-
return (await
|
|
1973
|
+
return (await J("auth.list_tenants")).tenants;
|
|
1954
1974
|
}
|
|
1955
1975
|
async function Fn(e) {
|
|
1956
|
-
let t = await
|
|
1976
|
+
let t = await J("auth.switch_tenant", { tenant_id: e });
|
|
1957
1977
|
return dn(t.expires_at), t;
|
|
1958
1978
|
}
|
|
1959
1979
|
async function In() {
|
|
1960
|
-
await
|
|
1980
|
+
await J("auth.logout");
|
|
1961
1981
|
}
|
|
1962
1982
|
async function Ln(e) {
|
|
1963
|
-
return (await
|
|
1983
|
+
return (await J("sso_provider.list", e ? { tenant_code: e } : {})).providers;
|
|
1964
1984
|
}
|
|
1965
1985
|
function Rn(e, t, n) {
|
|
1966
1986
|
let r = new URLSearchParams();
|
|
@@ -1973,23 +1993,23 @@ async function zn(e, t, n) {
|
|
|
1973
1993
|
target_user_id: e,
|
|
1974
1994
|
reason: t
|
|
1975
1995
|
};
|
|
1976
|
-
return n != null && (r.duration_minutes = n),
|
|
1996
|
+
return n != null && (r.duration_minutes = n), J("impersonation.start", r);
|
|
1977
1997
|
}
|
|
1978
1998
|
async function Bn() {
|
|
1979
|
-
return
|
|
1999
|
+
return J("impersonation.stop");
|
|
1980
2000
|
}
|
|
1981
2001
|
async function Vn(e) {
|
|
1982
|
-
await
|
|
2002
|
+
await J("impersonation.revoke", { session_id: e });
|
|
1983
2003
|
}
|
|
1984
2004
|
async function Hn(e, t) {
|
|
1985
|
-
await
|
|
2005
|
+
await J("auth.change_password", {
|
|
1986
2006
|
current_password: e,
|
|
1987
2007
|
new_password: t
|
|
1988
2008
|
});
|
|
1989
2009
|
}
|
|
1990
2010
|
//#endregion
|
|
1991
2011
|
//#region src/stores/auth.ts
|
|
1992
|
-
var Un =
|
|
2012
|
+
var Un = C((e) => ({
|
|
1993
2013
|
user: null,
|
|
1994
2014
|
isAuthenticated: !1,
|
|
1995
2015
|
isLoading: !0,
|
|
@@ -2054,7 +2074,7 @@ var Un = S((e) => ({
|
|
|
2054
2074
|
}));
|
|
2055
2075
|
//#endregion
|
|
2056
2076
|
//#region src/hooks/useSchema.ts
|
|
2057
|
-
function
|
|
2077
|
+
function Y() {
|
|
2058
2078
|
let e = Un((e) => e.isAuthenticated);
|
|
2059
2079
|
return g({
|
|
2060
2080
|
queryKey: ["schema", e],
|
|
@@ -2075,7 +2095,7 @@ async function Gn(e, t = {}, n = {}) {
|
|
|
2075
2095
|
let n = ir(e, t);
|
|
2076
2096
|
if (n !== void 0) return n;
|
|
2077
2097
|
}
|
|
2078
|
-
return
|
|
2098
|
+
return q(Wn(e, t), { signal: n.signal });
|
|
2079
2099
|
}
|
|
2080
2100
|
async function Kn(e, t) {
|
|
2081
2101
|
if (ar) {
|
|
@@ -2085,7 +2105,7 @@ async function Kn(e, t) {
|
|
|
2085
2105
|
let n = new URLSearchParams();
|
|
2086
2106
|
if (typeof t == "string") n.set("id", t);
|
|
2087
2107
|
else for (let [e, r] of Object.entries(t)) n.set(e, r);
|
|
2088
|
-
return
|
|
2108
|
+
return q(`/api/data/${e}?${n.toString()}`);
|
|
2089
2109
|
}
|
|
2090
2110
|
async function qn(e, t) {
|
|
2091
2111
|
return { data: ((await cr(`${e}.__create`, {
|
|
@@ -2165,17 +2185,17 @@ function sr(e) {
|
|
|
2165
2185
|
async function cr(e, t) {
|
|
2166
2186
|
if (nr) return nr(e, t);
|
|
2167
2187
|
try {
|
|
2168
|
-
return await
|
|
2188
|
+
return await q(`/api/actions/${e}`, {
|
|
2169
2189
|
method: "POST",
|
|
2170
2190
|
body: JSON.stringify(t)
|
|
2171
2191
|
});
|
|
2172
2192
|
} catch (e) {
|
|
2173
|
-
throw e instanceof
|
|
2193
|
+
throw e instanceof B && er(e.raw) ? new $n(e.status, e.raw) : e;
|
|
2174
2194
|
}
|
|
2175
2195
|
}
|
|
2176
2196
|
async function lr(e, t) {
|
|
2177
2197
|
let n = new URLSearchParams();
|
|
2178
|
-
return n.set("ids", t.join(",")),
|
|
2198
|
+
return n.set("ids", t.join(",")), q(`/api/associations/${e}?${n.toString()}`);
|
|
2179
2199
|
}
|
|
2180
2200
|
//#endregion
|
|
2181
2201
|
//#region src/embed/params.ts
|
|
@@ -2243,7 +2263,7 @@ function Sr({ children: e, query: t }) {
|
|
|
2243
2263
|
let n = d(() => xr(vr(t ?? (typeof window < "u" ? window.location.search : ""))), [t]);
|
|
2244
2264
|
return l(() => {
|
|
2245
2265
|
le(n.enabled);
|
|
2246
|
-
}, [n.enabled]), /* @__PURE__ */
|
|
2266
|
+
}, [n.enabled]), /* @__PURE__ */ b(br.Provider, {
|
|
2247
2267
|
value: n,
|
|
2248
2268
|
children: e
|
|
2249
2269
|
});
|
|
@@ -2253,7 +2273,7 @@ function Cr() {
|
|
|
2253
2273
|
}
|
|
2254
2274
|
//#endregion
|
|
2255
2275
|
//#region src/embed/embed-dirty.ts
|
|
2256
|
-
var wr =
|
|
2276
|
+
var wr = C((e) => ({
|
|
2257
2277
|
isDirty: !1,
|
|
2258
2278
|
setDirty: (t) => e((e) => e.isDirty === t ? e : { isDirty: t })
|
|
2259
2279
|
}));
|
|
@@ -2271,7 +2291,7 @@ function Tr(e, t) {
|
|
|
2271
2291
|
}
|
|
2272
2292
|
//#endregion
|
|
2273
2293
|
//#region src/embed/embed-nav-guard.ts
|
|
2274
|
-
var Er =
|
|
2294
|
+
var Er = C((e, t) => ({
|
|
2275
2295
|
pendingNavigation: null,
|
|
2276
2296
|
requestNavigation: (t) => e({ pendingNavigation: t }),
|
|
2277
2297
|
confirmNavigation: () => {
|
|
@@ -2328,7 +2348,7 @@ function Ar(e) {
|
|
|
2328
2348
|
return t === -1 ? e : e.slice(0, t);
|
|
2329
2349
|
}
|
|
2330
2350
|
function jr() {
|
|
2331
|
-
let e = h(), t = m(), n = Cr(), { data: r } =
|
|
2351
|
+
let e = h(), t = m(), n = Cr(), { data: r } = Y();
|
|
2332
2352
|
return s((i, a) => {
|
|
2333
2353
|
if (!n.enabled) return e(i, a), !0;
|
|
2334
2354
|
let o = r?.screens, s = Or(Ar(i), o), c = wr.getState().isDirty && Ar(i) !== t.pathname;
|
|
@@ -2407,31 +2427,31 @@ var Fr = {
|
|
|
2407
2427
|
}, Ir = 200;
|
|
2408
2428
|
function Lr({ type: e }) {
|
|
2409
2429
|
let n = { display: "flex" };
|
|
2410
|
-
return e === "loading" ? /* @__PURE__ */
|
|
2430
|
+
return e === "loading" ? /* @__PURE__ */ b("span", {
|
|
2411
2431
|
style: {
|
|
2412
2432
|
...n,
|
|
2413
2433
|
animation: "dz-toast-spin 0.9s linear infinite"
|
|
2414
2434
|
},
|
|
2415
|
-
children: /* @__PURE__ */
|
|
2416
|
-
}) : /* @__PURE__ */
|
|
2435
|
+
children: /* @__PURE__ */ b(t.loader, { size: 11 })
|
|
2436
|
+
}) : /* @__PURE__ */ b("span", {
|
|
2417
2437
|
style: n,
|
|
2418
|
-
children: /* @__PURE__ */
|
|
2438
|
+
children: /* @__PURE__ */ b(e === "success" ? t.check : e === "error" ? t.x : e === "warning" ? t.warning : t.info, { size: 11 })
|
|
2419
2439
|
});
|
|
2420
2440
|
}
|
|
2421
2441
|
function Rr({ model: e, onClose: n }) {
|
|
2422
|
-
let r = Fr[e.type] ?? Fr.info, i = r.tone, [a, o] = p(!1), [c, u] = p(!1), [d, m] = p(!1), [h, g] = p(!1), [_, v] = p(1),
|
|
2442
|
+
let r = Fr[e.type] ?? Fr.info, i = r.tone, [a, o] = p(!1), [c, u] = p(!1), [d, m] = p(!1), [h, g] = p(!1), [_, v] = p(1), y = f(e.duration), S = f(!1), C = !e.sticky && e.duration > 0, w = s(() => {
|
|
2423
2443
|
S.current || (S.current = !0, g(!0), window.setTimeout(n, Ir));
|
|
2424
2444
|
}, [n]);
|
|
2425
2445
|
l(() => {
|
|
2426
|
-
|
|
2446
|
+
y.current = e.duration, v(1);
|
|
2427
2447
|
}, [e.createdAt, e.duration]), l(() => {
|
|
2428
2448
|
if (!C || a || h) return;
|
|
2429
|
-
let t = Date.now(), n = window.setTimeout(w,
|
|
2430
|
-
let n =
|
|
2449
|
+
let t = Date.now(), n = window.setTimeout(w, y.current), r = 0, i = () => {
|
|
2450
|
+
let n = y.current - (Date.now() - t);
|
|
2431
2451
|
v(Math.max(0, n) / e.duration), n > 0 && (r = requestAnimationFrame(i));
|
|
2432
2452
|
};
|
|
2433
2453
|
return r = requestAnimationFrame(i), () => {
|
|
2434
|
-
window.clearTimeout(n), cancelAnimationFrame(r),
|
|
2454
|
+
window.clearTimeout(n), cancelAnimationFrame(r), y.current = Math.max(0, y.current - (Date.now() - t));
|
|
2435
2455
|
};
|
|
2436
2456
|
}, [
|
|
2437
2457
|
C,
|
|
@@ -2455,7 +2475,7 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2455
2475
|
e.requestId,
|
|
2456
2476
|
e.details
|
|
2457
2477
|
]), E = (e) => `var(--${i}${e})`, D = e.type === "error";
|
|
2458
|
-
return /* @__PURE__ */
|
|
2478
|
+
return /* @__PURE__ */ x("div", {
|
|
2459
2479
|
role: e.type === "error" ? "alert" : "status",
|
|
2460
2480
|
"aria-live": e.type === "error" ? "assertive" : "polite",
|
|
2461
2481
|
onMouseEnter: () => o(!0),
|
|
@@ -2471,14 +2491,14 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2471
2491
|
position: "relative",
|
|
2472
2492
|
animation: h ? `dz-toast-out ${Ir}ms ease-in forwards` : "dz-toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2473
2493
|
},
|
|
2474
|
-
children: [/* @__PURE__ */
|
|
2494
|
+
children: [/* @__PURE__ */ x("div", {
|
|
2475
2495
|
style: {
|
|
2476
2496
|
display: "flex",
|
|
2477
2497
|
padding: "10px 12px 11px 12px",
|
|
2478
2498
|
gap: 10
|
|
2479
2499
|
},
|
|
2480
2500
|
children: [
|
|
2481
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ b("div", {
|
|
2482
2502
|
style: {
|
|
2483
2503
|
width: 18,
|
|
2484
2504
|
height: 18,
|
|
@@ -2491,22 +2511,22 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2491
2511
|
justifyContent: "center",
|
|
2492
2512
|
color: E("")
|
|
2493
2513
|
},
|
|
2494
|
-
children: /* @__PURE__ */
|
|
2514
|
+
children: /* @__PURE__ */ b(Lr, { type: e.type })
|
|
2495
2515
|
}),
|
|
2496
|
-
/* @__PURE__ */
|
|
2516
|
+
/* @__PURE__ */ x("div", {
|
|
2497
2517
|
style: {
|
|
2498
2518
|
flex: 1,
|
|
2499
2519
|
minWidth: 0
|
|
2500
2520
|
},
|
|
2501
2521
|
children: [
|
|
2502
|
-
/* @__PURE__ */
|
|
2522
|
+
/* @__PURE__ */ x("div", {
|
|
2503
2523
|
style: {
|
|
2504
2524
|
display: "flex",
|
|
2505
2525
|
alignItems: "baseline",
|
|
2506
2526
|
gap: 6
|
|
2507
2527
|
},
|
|
2508
2528
|
children: [
|
|
2509
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ b("div", {
|
|
2510
2530
|
style: {
|
|
2511
2531
|
fontSize: 12.5,
|
|
2512
2532
|
fontWeight: 600,
|
|
@@ -2516,7 +2536,7 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2516
2536
|
},
|
|
2517
2537
|
children: e.title || r.defaultTitle
|
|
2518
2538
|
}),
|
|
2519
|
-
(e.count ?? 0) > 1 && /* @__PURE__ */
|
|
2539
|
+
(e.count ?? 0) > 1 && /* @__PURE__ */ x("span", {
|
|
2520
2540
|
style: {
|
|
2521
2541
|
background: E("-soft"),
|
|
2522
2542
|
color: E(""),
|
|
@@ -2528,7 +2548,7 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2528
2548
|
},
|
|
2529
2549
|
children: ["×", e.count]
|
|
2530
2550
|
}),
|
|
2531
|
-
e.requestId && /* @__PURE__ */
|
|
2551
|
+
e.requestId && /* @__PURE__ */ b("span", {
|
|
2532
2552
|
className: "mono",
|
|
2533
2553
|
style: {
|
|
2534
2554
|
fontSize: 10,
|
|
@@ -2540,7 +2560,7 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2540
2560
|
})
|
|
2541
2561
|
]
|
|
2542
2562
|
}),
|
|
2543
|
-
e.message && /* @__PURE__ */
|
|
2563
|
+
e.message && /* @__PURE__ */ b("div", {
|
|
2544
2564
|
style: {
|
|
2545
2565
|
fontSize: 12,
|
|
2546
2566
|
color: "var(--text-2)",
|
|
@@ -2552,9 +2572,9 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2552
2572
|
},
|
|
2553
2573
|
children: e.message
|
|
2554
2574
|
}),
|
|
2555
|
-
e.details && /* @__PURE__ */
|
|
2575
|
+
e.details && /* @__PURE__ */ x("div", {
|
|
2556
2576
|
style: { marginTop: 6 },
|
|
2557
|
-
children: [/* @__PURE__ */
|
|
2577
|
+
children: [/* @__PURE__ */ x("button", {
|
|
2558
2578
|
type: "button",
|
|
2559
2579
|
onClick: () => m((e) => !e),
|
|
2560
2580
|
style: {
|
|
@@ -2569,14 +2589,14 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2569
2589
|
alignItems: "center",
|
|
2570
2590
|
gap: 4
|
|
2571
2591
|
},
|
|
2572
|
-
children: [/* @__PURE__ */
|
|
2592
|
+
children: [/* @__PURE__ */ b(t.down, {
|
|
2573
2593
|
size: 10,
|
|
2574
2594
|
style: {
|
|
2575
2595
|
transform: d ? "rotate(180deg)" : "none",
|
|
2576
2596
|
transition: "transform .15s"
|
|
2577
2597
|
}
|
|
2578
2598
|
}), d ? "Hide details" : "Show details"]
|
|
2579
|
-
}), d && /* @__PURE__ */
|
|
2599
|
+
}), d && /* @__PURE__ */ b("pre", {
|
|
2580
2600
|
className: "mono",
|
|
2581
2601
|
style: {
|
|
2582
2602
|
margin: "6px 0 0 0",
|
|
@@ -2596,14 +2616,14 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2596
2616
|
children: e.details
|
|
2597
2617
|
})]
|
|
2598
2618
|
}),
|
|
2599
|
-
(e.action || D) && /* @__PURE__ */
|
|
2619
|
+
(e.action || D) && /* @__PURE__ */ x("div", {
|
|
2600
2620
|
style: {
|
|
2601
2621
|
display: "flex",
|
|
2602
2622
|
alignItems: "center",
|
|
2603
2623
|
gap: 6,
|
|
2604
2624
|
marginTop: 8
|
|
2605
2625
|
},
|
|
2606
|
-
children: [e.action && /* @__PURE__ */
|
|
2626
|
+
children: [e.action && /* @__PURE__ */ b("button", {
|
|
2607
2627
|
type: "button",
|
|
2608
2628
|
onClick: () => {
|
|
2609
2629
|
e.action?.onClick(), w();
|
|
@@ -2619,7 +2639,7 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2619
2639
|
cursor: "pointer"
|
|
2620
2640
|
},
|
|
2621
2641
|
children: e.action.label
|
|
2622
|
-
}), D && /* @__PURE__ */
|
|
2642
|
+
}), D && /* @__PURE__ */ x("button", {
|
|
2623
2643
|
type: "button",
|
|
2624
2644
|
onClick: T,
|
|
2625
2645
|
title: "Copy error message",
|
|
@@ -2637,12 +2657,12 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2637
2657
|
cursor: "pointer",
|
|
2638
2658
|
fontWeight: 500
|
|
2639
2659
|
},
|
|
2640
|
-
children: [
|
|
2660
|
+
children: [b(c ? t.check : t.copy, { size: 11 }), c ? "Copied" : "Copy"]
|
|
2641
2661
|
})]
|
|
2642
2662
|
})
|
|
2643
2663
|
]
|
|
2644
2664
|
}),
|
|
2645
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ b("button", {
|
|
2646
2666
|
type: "button",
|
|
2647
2667
|
onClick: w,
|
|
2648
2668
|
"aria-label": "Dismiss",
|
|
@@ -2661,10 +2681,10 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2661
2681
|
alignItems: "center",
|
|
2662
2682
|
justifyContent: "center"
|
|
2663
2683
|
},
|
|
2664
|
-
children: /* @__PURE__ */
|
|
2684
|
+
children: /* @__PURE__ */ b(t.x, { size: 12 })
|
|
2665
2685
|
})
|
|
2666
2686
|
]
|
|
2667
|
-
}), C && /* @__PURE__ */
|
|
2687
|
+
}), C && /* @__PURE__ */ b("div", {
|
|
2668
2688
|
style: {
|
|
2669
2689
|
position: "absolute",
|
|
2670
2690
|
left: 0,
|
|
@@ -2672,7 +2692,7 @@ function Rr({ model: e, onClose: n }) {
|
|
|
2672
2692
|
bottom: 0,
|
|
2673
2693
|
height: 2
|
|
2674
2694
|
},
|
|
2675
|
-
children: /* @__PURE__ */
|
|
2695
|
+
children: /* @__PURE__ */ b("div", { style: {
|
|
2676
2696
|
height: "100%",
|
|
2677
2697
|
width: `${_ * 100}%`,
|
|
2678
2698
|
background: E(""),
|
|
@@ -2690,31 +2710,31 @@ var zr = {
|
|
|
2690
2710
|
warning: 8e3,
|
|
2691
2711
|
error: 0,
|
|
2692
2712
|
loading: 0
|
|
2693
|
-
},
|
|
2713
|
+
}, X = /* @__PURE__ */ new Map(), Br = /* @__PURE__ */ new Map(), Vr = 0, Hr = () => `dz-${++Vr}`;
|
|
2694
2714
|
function Ur(e) {
|
|
2695
|
-
|
|
2715
|
+
v.custom(() => /* @__PURE__ */ b(Rr, {
|
|
2696
2716
|
model: e,
|
|
2697
|
-
onClose: () =>
|
|
2717
|
+
onClose: () => v.dismiss(e.id)
|
|
2698
2718
|
}), {
|
|
2699
2719
|
id: e.id,
|
|
2700
2720
|
duration: Infinity,
|
|
2701
2721
|
onDismiss: () => {
|
|
2702
|
-
|
|
2722
|
+
X.delete(String(e.id)), e.group && Br.get(e.group) === e.id && Br.delete(e.group);
|
|
2703
2723
|
}
|
|
2704
2724
|
});
|
|
2705
2725
|
}
|
|
2706
2726
|
function Wr(e, t, n, r = {}) {
|
|
2707
2727
|
if (r.group) {
|
|
2708
2728
|
let e = Br.get(r.group);
|
|
2709
|
-
if (e &&
|
|
2710
|
-
let r =
|
|
2729
|
+
if (e && X.has(e)) {
|
|
2730
|
+
let r = X.get(e), i = {
|
|
2711
2731
|
...r,
|
|
2712
2732
|
title: t,
|
|
2713
2733
|
message: n,
|
|
2714
2734
|
count: (r.count ?? 1) + 1,
|
|
2715
2735
|
createdAt: Date.now()
|
|
2716
2736
|
};
|
|
2717
|
-
return
|
|
2737
|
+
return X.set(e, i), Ur(i), e;
|
|
2718
2738
|
}
|
|
2719
2739
|
}
|
|
2720
2740
|
let i = r.id ?? Hr(), a = r.duration ?? zr[e], o = {
|
|
@@ -2731,10 +2751,10 @@ function Wr(e, t, n, r = {}) {
|
|
|
2731
2751
|
createdAt: Date.now(),
|
|
2732
2752
|
group: r.group
|
|
2733
2753
|
};
|
|
2734
|
-
return
|
|
2754
|
+
return X.set(i, o), r.group && Br.set(r.group, i), Ur(o), i;
|
|
2735
2755
|
}
|
|
2736
2756
|
function Gr(e, t) {
|
|
2737
|
-
let n =
|
|
2757
|
+
let n = X.get(e);
|
|
2738
2758
|
if (!n) return;
|
|
2739
2759
|
let r = t.type ?? n.type, i = t.duration ?? (t.type ? zr[r] : n.duration), a = {
|
|
2740
2760
|
...n,
|
|
@@ -2744,25 +2764,25 @@ function Gr(e, t) {
|
|
|
2744
2764
|
sticky: t.sticky ?? i === 0,
|
|
2745
2765
|
createdAt: Date.now()
|
|
2746
2766
|
};
|
|
2747
|
-
|
|
2767
|
+
X.set(e, a), Ur(a);
|
|
2748
2768
|
}
|
|
2749
|
-
var
|
|
2769
|
+
var Z = {
|
|
2750
2770
|
success: (e, t, n) => Wr("success", e, t, n),
|
|
2751
2771
|
info: (e, t, n) => Wr("info", e, t, n),
|
|
2752
2772
|
warning: (e, t, n) => Wr("warning", e, t, n),
|
|
2753
2773
|
error: (e, t, n) => Wr("error", e, t, n),
|
|
2754
2774
|
loading: (e, t, n) => Wr("loading", e, t, n),
|
|
2755
2775
|
update: Gr,
|
|
2756
|
-
dismiss: (e) =>
|
|
2757
|
-
dismissAll: () =>
|
|
2758
|
-
}, Kr = o(() => import("./MarkdownRenderer-
|
|
2776
|
+
dismiss: (e) => v.dismiss(e),
|
|
2777
|
+
dismissAll: () => v.dismiss()
|
|
2778
|
+
}, Kr = o(() => import("./MarkdownRenderer-dHOTEhUa.js").then((e) => ({ default: e.MarkdownRenderer })));
|
|
2759
2779
|
function qr() {
|
|
2760
|
-
return /* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ b("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
|
|
2761
2781
|
}
|
|
2762
2782
|
function Jr(e) {
|
|
2763
|
-
return /* @__PURE__ */
|
|
2764
|
-
fallback: /* @__PURE__ */
|
|
2765
|
-
children: /* @__PURE__ */
|
|
2783
|
+
return /* @__PURE__ */ b(r, {
|
|
2784
|
+
fallback: /* @__PURE__ */ b(qr, {}),
|
|
2785
|
+
children: /* @__PURE__ */ b(Kr, { ...e })
|
|
2766
2786
|
});
|
|
2767
2787
|
}
|
|
2768
2788
|
//#endregion
|
|
@@ -2835,12 +2855,12 @@ function ri({ value: e, title: n, size: r = "icon" }) {
|
|
|
2835
2855
|
await navigator.clipboard.writeText(e), a(!0), setTimeout(() => a(!1), 2e3);
|
|
2836
2856
|
} catch {}
|
|
2837
2857
|
}, [e]), c = r === "sm" ? 12 : 14;
|
|
2838
|
-
return /* @__PURE__ */
|
|
2858
|
+
return /* @__PURE__ */ b(O, {
|
|
2839
2859
|
size: r === "sm" ? 22 : 28,
|
|
2840
|
-
icon: i ? /* @__PURE__ */
|
|
2860
|
+
icon: i ? /* @__PURE__ */ b(t.check, {
|
|
2841
2861
|
size: c,
|
|
2842
2862
|
style: { color: "var(--success)" }
|
|
2843
|
-
}) : /* @__PURE__ */
|
|
2863
|
+
}) : /* @__PURE__ */ b(t.copy, { size: c }),
|
|
2844
2864
|
onClick: o,
|
|
2845
2865
|
title: n ?? "Copy to clipboard"
|
|
2846
2866
|
});
|
|
@@ -2849,33 +2869,33 @@ function ri({ value: e, title: n, size: r = "icon" }) {
|
|
|
2849
2869
|
//#region src/components/fields/StringField.tsx
|
|
2850
2870
|
function ii({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
2851
2871
|
if (r === "display") {
|
|
2852
|
-
let t =
|
|
2853
|
-
return e.copyable && t ? /* @__PURE__ */
|
|
2872
|
+
let t = I(n);
|
|
2873
|
+
return e.copyable && t ? /* @__PURE__ */ x("span", {
|
|
2854
2874
|
style: {
|
|
2855
2875
|
display: "inline-flex",
|
|
2856
2876
|
alignItems: "center",
|
|
2857
2877
|
gap: 4
|
|
2858
2878
|
},
|
|
2859
|
-
children: [/* @__PURE__ */
|
|
2879
|
+
children: [/* @__PURE__ */ b("span", {
|
|
2860
2880
|
style: { fontSize: 12.5 },
|
|
2861
2881
|
children: t
|
|
2862
|
-
}), /* @__PURE__ */
|
|
2882
|
+
}), /* @__PURE__ */ b(ri, {
|
|
2863
2883
|
value: t,
|
|
2864
2884
|
size: "sm"
|
|
2865
2885
|
})]
|
|
2866
|
-
}) : /* @__PURE__ */
|
|
2886
|
+
}) : /* @__PURE__ */ b("span", {
|
|
2867
2887
|
style: { fontSize: 12.5 },
|
|
2868
|
-
children: t || /* @__PURE__ */
|
|
2888
|
+
children: t || /* @__PURE__ */ b("span", {
|
|
2869
2889
|
style: { color: "var(--text-4)" },
|
|
2870
2890
|
children: "—"
|
|
2871
2891
|
})
|
|
2872
2892
|
});
|
|
2873
2893
|
}
|
|
2874
|
-
return /* @__PURE__ */
|
|
2894
|
+
return /* @__PURE__ */ b(P, {
|
|
2875
2895
|
id: a,
|
|
2876
2896
|
name: t,
|
|
2877
2897
|
"aria-required": e.required || void 0,
|
|
2878
|
-
value:
|
|
2898
|
+
value: I(n),
|
|
2879
2899
|
onChange: (e) => i?.(e)
|
|
2880
2900
|
});
|
|
2881
2901
|
}
|
|
@@ -2884,15 +2904,15 @@ function ii({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
2884
2904
|
function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
|
|
2885
2905
|
let c = e.display?.widget;
|
|
2886
2906
|
if (r === "display") {
|
|
2887
|
-
let t =
|
|
2888
|
-
if (!t) return /* @__PURE__ */
|
|
2907
|
+
let t = I(n);
|
|
2908
|
+
if (!t) return /* @__PURE__ */ b("span", {
|
|
2889
2909
|
style: {
|
|
2890
2910
|
fontSize: 12.5,
|
|
2891
2911
|
color: "var(--text-4)"
|
|
2892
2912
|
},
|
|
2893
2913
|
children: "—"
|
|
2894
2914
|
});
|
|
2895
|
-
let r = c === "markdown" ? /* @__PURE__ */
|
|
2915
|
+
let r = c === "markdown" ? /* @__PURE__ */ b(Jr, { content: t }) : c === "code" ? /* @__PURE__ */ b("pre", {
|
|
2896
2916
|
className: "mono",
|
|
2897
2917
|
style: {
|
|
2898
2918
|
fontSize: 12,
|
|
@@ -2907,7 +2927,7 @@ function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2907
2927
|
whiteSpace: "pre"
|
|
2908
2928
|
},
|
|
2909
2929
|
children: t
|
|
2910
|
-
}) : /* @__PURE__ */
|
|
2930
|
+
}) : /* @__PURE__ */ b("p", {
|
|
2911
2931
|
style: {
|
|
2912
2932
|
fontSize: 12.5,
|
|
2913
2933
|
whiteSpace: "pre-wrap",
|
|
@@ -2916,34 +2936,34 @@ function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2916
2936
|
},
|
|
2917
2937
|
children: t
|
|
2918
2938
|
});
|
|
2919
|
-
return e.copyable ? /* @__PURE__ */
|
|
2939
|
+
return e.copyable ? /* @__PURE__ */ x("div", {
|
|
2920
2940
|
style: { position: "relative" },
|
|
2921
|
-
children: [r, /* @__PURE__ */
|
|
2941
|
+
children: [r, /* @__PURE__ */ b("div", {
|
|
2922
2942
|
style: {
|
|
2923
2943
|
position: "absolute",
|
|
2924
2944
|
top: 0,
|
|
2925
2945
|
right: 0
|
|
2926
2946
|
},
|
|
2927
|
-
children: /* @__PURE__ */
|
|
2947
|
+
children: /* @__PURE__ */ b(ri, {
|
|
2928
2948
|
value: t,
|
|
2929
2949
|
size: "sm"
|
|
2930
2950
|
})
|
|
2931
2951
|
})]
|
|
2932
2952
|
}) : r;
|
|
2933
2953
|
}
|
|
2934
|
-
if (o) return /* @__PURE__ */
|
|
2954
|
+
if (o) return /* @__PURE__ */ b(P, {
|
|
2935
2955
|
id: s,
|
|
2936
2956
|
name: t,
|
|
2937
2957
|
"aria-required": e.required || void 0,
|
|
2938
|
-
value:
|
|
2958
|
+
value: I(n),
|
|
2939
2959
|
onChange: (e) => i?.(e)
|
|
2940
2960
|
});
|
|
2941
2961
|
let l = c === "markdown" || c === "code" ? 10 : 4;
|
|
2942
|
-
return /* @__PURE__ */
|
|
2962
|
+
return /* @__PURE__ */ b(Te, {
|
|
2943
2963
|
id: s,
|
|
2944
2964
|
name: t,
|
|
2945
2965
|
ariaRequired: e.required,
|
|
2946
|
-
value:
|
|
2966
|
+
value: I(n),
|
|
2947
2967
|
onChange: (e) => i?.(e),
|
|
2948
2968
|
rows: l,
|
|
2949
2969
|
fill: a
|
|
@@ -2954,25 +2974,25 @@ function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2954
2974
|
var oi = "__declarion_enum_null__";
|
|
2955
2975
|
function si({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
|
|
2956
2976
|
let o = e.values ?? [], s = o.find((e) => e.code === t);
|
|
2957
|
-
if (n === "display") return s ? /* @__PURE__ */
|
|
2977
|
+
if (n === "display") return s ? /* @__PURE__ */ b(k, {
|
|
2958
2978
|
tone: s.color ?? "slate",
|
|
2959
2979
|
size: "xs",
|
|
2960
|
-
children:
|
|
2961
|
-
}) : /* @__PURE__ */
|
|
2980
|
+
children: L(s.name)
|
|
2981
|
+
}) : /* @__PURE__ */ b("span", {
|
|
2962
2982
|
style: {
|
|
2963
2983
|
fontSize: 12.5,
|
|
2964
2984
|
color: "var(--text-4)"
|
|
2965
2985
|
},
|
|
2966
2986
|
children: "—"
|
|
2967
2987
|
});
|
|
2968
|
-
let c = !e.required, l = t != null && t !== "" ?
|
|
2988
|
+
let c = !e.required, l = t != null && t !== "" ? I(t) : oi, u = [...c ? [{
|
|
2969
2989
|
value: oi,
|
|
2970
2990
|
label: "— None —"
|
|
2971
2991
|
}] : [], ...o.map((e) => ({
|
|
2972
2992
|
value: e.code,
|
|
2973
|
-
label:
|
|
2993
|
+
label: L(e.name) || e.code
|
|
2974
2994
|
}))];
|
|
2975
|
-
return /* @__PURE__ */
|
|
2995
|
+
return /* @__PURE__ */ b(F, {
|
|
2976
2996
|
id: i,
|
|
2977
2997
|
"aria-labelledby": a,
|
|
2978
2998
|
"aria-required": e.required || void 0,
|
|
@@ -2985,24 +3005,24 @@ function si({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
2985
3005
|
//#endregion
|
|
2986
3006
|
//#region src/components/fields/EmailField.tsx
|
|
2987
3007
|
function ci({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
2988
|
-
return /* @__PURE__ */
|
|
3008
|
+
return /* @__PURE__ */ b(P, {
|
|
2989
3009
|
id: i,
|
|
2990
3010
|
name: t,
|
|
2991
3011
|
"aria-required": e.required || void 0,
|
|
2992
3012
|
type: "email",
|
|
2993
|
-
value:
|
|
3013
|
+
value: I(n),
|
|
2994
3014
|
onChange: (e) => r?.(e)
|
|
2995
3015
|
});
|
|
2996
3016
|
}
|
|
2997
3017
|
//#endregion
|
|
2998
3018
|
//#region src/components/fields/UrlField.tsx
|
|
2999
3019
|
function li({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3000
|
-
return /* @__PURE__ */
|
|
3020
|
+
return /* @__PURE__ */ b(P, {
|
|
3001
3021
|
id: i,
|
|
3002
3022
|
name: t,
|
|
3003
3023
|
"aria-required": e.required || void 0,
|
|
3004
3024
|
type: "url",
|
|
3005
|
-
value:
|
|
3025
|
+
value: I(n),
|
|
3006
3026
|
onChange: (e) => r?.(e),
|
|
3007
3027
|
placeholder: "https://"
|
|
3008
3028
|
});
|
|
@@ -3010,12 +3030,12 @@ function li({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
3010
3030
|
//#endregion
|
|
3011
3031
|
//#region src/components/fields/PhoneField.tsx
|
|
3012
3032
|
function ui({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3013
|
-
return /* @__PURE__ */
|
|
3033
|
+
return /* @__PURE__ */ b(P, {
|
|
3014
3034
|
id: i,
|
|
3015
3035
|
name: t,
|
|
3016
3036
|
"aria-required": e.required || void 0,
|
|
3017
3037
|
type: "tel",
|
|
3018
|
-
value:
|
|
3038
|
+
value: I(n),
|
|
3019
3039
|
onChange: (e) => r?.(e),
|
|
3020
3040
|
placeholder: "+1 555 555 5555"
|
|
3021
3041
|
});
|
|
@@ -3023,7 +3043,7 @@ function ui({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
3023
3043
|
//#endregion
|
|
3024
3044
|
//#region src/lib/timestamp.ts
|
|
3025
3045
|
function di(e = /* @__PURE__ */ new Date()) {
|
|
3026
|
-
return
|
|
3046
|
+
return E(e);
|
|
3027
3047
|
}
|
|
3028
3048
|
function fi(e, t) {
|
|
3029
3049
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
@@ -3072,10 +3092,10 @@ function mi(e, t = /* @__PURE__ */ new Date()) {
|
|
|
3072
3092
|
}
|
|
3073
3093
|
let r = pi(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
|
|
3074
3094
|
return Math.abs(i) > 720 * 60 * 60 * 1e3 ? {
|
|
3075
|
-
text:
|
|
3095
|
+
text: E(n, { representation: "date" }),
|
|
3076
3096
|
absolute: r
|
|
3077
3097
|
} : {
|
|
3078
|
-
text:
|
|
3098
|
+
text: T(n, { addSuffix: !0 }),
|
|
3079
3099
|
absolute: r
|
|
3080
3100
|
};
|
|
3081
3101
|
}
|
|
@@ -3144,17 +3164,17 @@ function xi(e, t) {
|
|
|
3144
3164
|
function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3145
3165
|
let o = e.type === "date", s = !!e.timezone;
|
|
3146
3166
|
if (r === "display") {
|
|
3147
|
-
if (!n) return /* @__PURE__ */
|
|
3167
|
+
if (!n) return /* @__PURE__ */ b("span", {
|
|
3148
3168
|
style: {
|
|
3149
3169
|
fontSize: 12.5,
|
|
3150
3170
|
color: "var(--text-4)"
|
|
3151
3171
|
},
|
|
3152
3172
|
children: "—"
|
|
3153
3173
|
});
|
|
3154
|
-
let e =
|
|
3155
|
-
return /* @__PURE__ */
|
|
3174
|
+
let e = I(n), t = s ? _i(e, o) : vi(e, o), r = s && !o ? yi(e) : null;
|
|
3175
|
+
return /* @__PURE__ */ x("span", {
|
|
3156
3176
|
style: { fontSize: 12.5 },
|
|
3157
|
-
children: [t, r && /* @__PURE__ */
|
|
3177
|
+
children: [t, r && /* @__PURE__ */ b("span", {
|
|
3158
3178
|
style: {
|
|
3159
3179
|
marginLeft: 4,
|
|
3160
3180
|
color: "var(--text-3)"
|
|
@@ -3163,8 +3183,8 @@ function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3163
3183
|
})]
|
|
3164
3184
|
});
|
|
3165
3185
|
}
|
|
3166
|
-
let c = n ? s ? bi(
|
|
3167
|
-
return /* @__PURE__ */
|
|
3186
|
+
let c = n ? s ? bi(I(n), o) : xi(I(n), o) : "";
|
|
3187
|
+
return /* @__PURE__ */ b(P, {
|
|
3168
3188
|
id: a,
|
|
3169
3189
|
name: t,
|
|
3170
3190
|
"aria-required": e.required || void 0,
|
|
@@ -3192,21 +3212,21 @@ function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3192
3212
|
//#region src/components/fields/BoolField.tsx
|
|
3193
3213
|
function Ci({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
3194
3214
|
let a = !!e;
|
|
3195
|
-
return t === "display" ? /* @__PURE__ */
|
|
3215
|
+
return t === "display" ? /* @__PURE__ */ x("span", {
|
|
3196
3216
|
style: {
|
|
3197
3217
|
display: "inline-flex",
|
|
3198
3218
|
alignItems: "center",
|
|
3199
3219
|
gap: 6,
|
|
3200
3220
|
fontSize: 12.5
|
|
3201
3221
|
},
|
|
3202
|
-
children: [/* @__PURE__ */
|
|
3222
|
+
children: [/* @__PURE__ */ b("span", { style: {
|
|
3203
3223
|
display: "inline-block",
|
|
3204
3224
|
width: 6,
|
|
3205
3225
|
height: 6,
|
|
3206
3226
|
borderRadius: 999,
|
|
3207
3227
|
background: a ? "var(--success)" : "var(--text-4)"
|
|
3208
3228
|
} }), a ? "Yes" : "No"]
|
|
3209
|
-
}) : /* @__PURE__ */
|
|
3229
|
+
}) : /* @__PURE__ */ b(be, {
|
|
3210
3230
|
id: r,
|
|
3211
3231
|
ariaLabelledby: i,
|
|
3212
3232
|
value: a,
|
|
@@ -3231,7 +3251,7 @@ var Ti = new Intl.NumberFormat();
|
|
|
3231
3251
|
function Ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3232
3252
|
let s = e.display?.widget === "money", c = e.type === "decimal" || s, l = a?.$units?.[t], u = !l && e.unit ? e.unit.display || e.unit.storage : void 0, d = l || (u && !u.startsWith("$") ? u : void 0);
|
|
3233
3253
|
if (r === "display") {
|
|
3234
|
-
if (n == null) return /* @__PURE__ */
|
|
3254
|
+
if (n == null) return /* @__PURE__ */ b("span", {
|
|
3235
3255
|
style: {
|
|
3236
3256
|
fontSize: 12.5,
|
|
3237
3257
|
color: "var(--text-4)"
|
|
@@ -3244,16 +3264,16 @@ function Ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3244
3264
|
let t = Number(n);
|
|
3245
3265
|
e = isNaN(t) ? null : Ti.format(t);
|
|
3246
3266
|
}
|
|
3247
|
-
return e == null ? /* @__PURE__ */
|
|
3267
|
+
return e == null ? /* @__PURE__ */ b("span", {
|
|
3248
3268
|
style: { fontSize: 12.5 },
|
|
3249
3269
|
children: "—"
|
|
3250
|
-
}) : /* @__PURE__ */
|
|
3270
|
+
}) : /* @__PURE__ */ x("span", {
|
|
3251
3271
|
className: "num",
|
|
3252
3272
|
style: {
|
|
3253
3273
|
fontSize: 12.5,
|
|
3254
3274
|
fontVariantNumeric: "tabular-nums"
|
|
3255
3275
|
},
|
|
3256
|
-
children: [e, d && /* @__PURE__ */
|
|
3276
|
+
children: [e, d && /* @__PURE__ */ b("span", {
|
|
3257
3277
|
style: {
|
|
3258
3278
|
color: "var(--text-3)",
|
|
3259
3279
|
marginLeft: 4
|
|
@@ -3262,24 +3282,24 @@ function Ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3262
3282
|
})]
|
|
3263
3283
|
});
|
|
3264
3284
|
}
|
|
3265
|
-
return c ? /* @__PURE__ */
|
|
3285
|
+
return c ? /* @__PURE__ */ b(P, {
|
|
3266
3286
|
id: o,
|
|
3267
3287
|
name: t,
|
|
3268
3288
|
"aria-required": e.required || void 0,
|
|
3269
3289
|
type: "text",
|
|
3270
3290
|
inputMode: "decimal",
|
|
3271
3291
|
pattern: "-?\\d*\\.?\\d*",
|
|
3272
|
-
value: n == null ? "" :
|
|
3292
|
+
value: n == null ? "" : I(n),
|
|
3273
3293
|
onChange: (e) => {
|
|
3274
3294
|
e === "" ? i?.(null) : i?.(e);
|
|
3275
3295
|
}
|
|
3276
|
-
}) : /* @__PURE__ */
|
|
3296
|
+
}) : /* @__PURE__ */ b(P, {
|
|
3277
3297
|
id: o,
|
|
3278
3298
|
name: t,
|
|
3279
3299
|
"aria-required": e.required || void 0,
|
|
3280
3300
|
type: "number",
|
|
3281
3301
|
step: e.type === "float" ? "0.01" : "1",
|
|
3282
|
-
value: n == null ? "" :
|
|
3302
|
+
value: n == null ? "" : I(n),
|
|
3283
3303
|
onChange: (t) => {
|
|
3284
3304
|
t === "" ? i?.(null) : i?.(e.type === "int" ? parseInt(t, 10) : parseFloat(t));
|
|
3285
3305
|
}
|
|
@@ -3341,19 +3361,19 @@ function Ai(e, t) {
|
|
|
3341
3361
|
//#endregion
|
|
3342
3362
|
//#region src/hooks/useEntity.ts
|
|
3343
3363
|
function ji(e) {
|
|
3344
|
-
let { data: t } =
|
|
3364
|
+
let { data: t } = Y();
|
|
3345
3365
|
if (!(!t || !e)) return t.entities[e];
|
|
3346
3366
|
}
|
|
3347
3367
|
//#endregion
|
|
3348
3368
|
//#region src/components/fields/RefCombobox.tsx
|
|
3349
3369
|
var Mi = 200;
|
|
3350
3370
|
function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, id: a, labelId: o, ariaLabel: s, required: c, placeholder: l = "Select…", specialValues: u }) {
|
|
3351
|
-
let m = e?.entity, h = ji(m), g = i ?? e?.display?.field ?? h?.display?.display_field ?? "$display", _ = d(() => h ?
|
|
3371
|
+
let m = e?.entity, h = ji(m), g = i ?? e?.display?.field ?? h?.display?.display_field ?? "$display", _ = d(() => h ? z(h)[0] ?? "id" : "id", [h]), v = e?.field || _, [y, x] = p(""), S = Ai(y, 300), { data: C, isLoading: w } = Oi(m, {
|
|
3352
3372
|
per_page: Mi,
|
|
3353
3373
|
sort: g ? `${g}:asc` : void 0,
|
|
3354
3374
|
search: S || void 0,
|
|
3355
3375
|
filters: e?.options_filter
|
|
3356
|
-
}), T = d(() => C?.data ?? [], [C?.data]), E = t == null ? "" :
|
|
3376
|
+
}), T = d(() => C?.data ?? [], [C?.data]), E = t == null ? "" : I(t), D = d(() => T.some((e) => String(e[v]) === E), [
|
|
3357
3377
|
T,
|
|
3358
3378
|
v,
|
|
3359
3379
|
E
|
|
@@ -3364,19 +3384,19 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3364
3384
|
op: "eq",
|
|
3365
3385
|
value: E
|
|
3366
3386
|
}]
|
|
3367
|
-
}),
|
|
3387
|
+
}), j = f(null), M = d(() => {
|
|
3368
3388
|
if (!E) return "";
|
|
3369
3389
|
let e;
|
|
3370
|
-
if (O) e =
|
|
3390
|
+
if (O) e = R(O, g, E);
|
|
3371
3391
|
else {
|
|
3372
3392
|
let t = T.find((e) => String(e[v]) === E);
|
|
3373
|
-
if (t) e =
|
|
3393
|
+
if (t) e = R(t, g, E);
|
|
3374
3394
|
else {
|
|
3375
3395
|
let t = A?.data?.find((e) => String(e[v]) === E);
|
|
3376
|
-
t && (e =
|
|
3396
|
+
t && (e = R(t, g, E));
|
|
3377
3397
|
}
|
|
3378
3398
|
}
|
|
3379
|
-
return e === void 0 ?
|
|
3399
|
+
return e === void 0 ? j.current?.value === E ? j.current.label : E : (j.current = {
|
|
3380
3400
|
value: E,
|
|
3381
3401
|
label: e
|
|
3382
3402
|
}, e);
|
|
@@ -3387,19 +3407,19 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3387
3407
|
v,
|
|
3388
3408
|
g,
|
|
3389
3409
|
A
|
|
3390
|
-
]),
|
|
3410
|
+
]), ee = d(() => {
|
|
3391
3411
|
let e = (u ?? []).map((e) => ({
|
|
3392
3412
|
value: e.code,
|
|
3393
|
-
label:
|
|
3413
|
+
label: L(e.label) || e.code
|
|
3394
3414
|
})), t = T.map((e) => {
|
|
3395
|
-
let t =
|
|
3415
|
+
let t = I(e[v]);
|
|
3396
3416
|
return {
|
|
3397
3417
|
value: t,
|
|
3398
|
-
label:
|
|
3418
|
+
label: R(e, g, t)
|
|
3399
3419
|
};
|
|
3400
3420
|
}), n = E && !D && !k ? [{
|
|
3401
3421
|
value: E,
|
|
3402
|
-
label:
|
|
3422
|
+
label: M
|
|
3403
3423
|
}] : [], r = t.length > 0 || n.length > 0;
|
|
3404
3424
|
return [
|
|
3405
3425
|
{
|
|
@@ -3425,18 +3445,18 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3425
3445
|
E,
|
|
3426
3446
|
D,
|
|
3427
3447
|
k,
|
|
3428
|
-
|
|
3448
|
+
M,
|
|
3429
3449
|
T,
|
|
3430
3450
|
v,
|
|
3431
3451
|
g
|
|
3432
3452
|
]);
|
|
3433
|
-
return /* @__PURE__ */
|
|
3453
|
+
return /* @__PURE__ */ b(F, {
|
|
3434
3454
|
id: a,
|
|
3435
3455
|
"aria-label": s,
|
|
3436
3456
|
"aria-labelledby": o,
|
|
3437
3457
|
"aria-required": c || void 0,
|
|
3438
3458
|
value: E,
|
|
3439
|
-
options:
|
|
3459
|
+
options: ee,
|
|
3440
3460
|
onChange: (e) => n(e || null),
|
|
3441
3461
|
onSearchChange: x,
|
|
3442
3462
|
placeholder: l
|
|
@@ -3447,10 +3467,10 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3447
3467
|
function Pi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
|
|
3448
3468
|
let s = e.ref?.entity, c = e.display?.ref_display_field || "$display", l = d(() => {
|
|
3449
3469
|
if (t == null) return "—";
|
|
3450
|
-
let e =
|
|
3470
|
+
let e = I(t);
|
|
3451
3471
|
if (i && s) {
|
|
3452
3472
|
let t = i[s]?.[e];
|
|
3453
|
-
if (t) return
|
|
3473
|
+
if (t) return R(t, c, e);
|
|
3454
3474
|
}
|
|
3455
3475
|
return e;
|
|
3456
3476
|
}, [
|
|
@@ -3459,10 +3479,10 @@ function Pi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3459
3479
|
s,
|
|
3460
3480
|
c
|
|
3461
3481
|
]);
|
|
3462
|
-
return n === "display" ? /* @__PURE__ */
|
|
3482
|
+
return n === "display" ? /* @__PURE__ */ b("span", {
|
|
3463
3483
|
style: { fontSize: 12.5 },
|
|
3464
3484
|
children: l
|
|
3465
|
-
}) : /* @__PURE__ */
|
|
3485
|
+
}) : /* @__PURE__ */ b(Ni, {
|
|
3466
3486
|
ref: e.ref,
|
|
3467
3487
|
value: t,
|
|
3468
3488
|
onChange: (e) => r?.(e),
|
|
@@ -3477,27 +3497,27 @@ function Pi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3477
3497
|
//#region src/components/fields/JsonField.tsx
|
|
3478
3498
|
var Fi = o(() => import("./JsonEditor-DoNmyrYd.js").then((e) => ({ default: e.JsonEditor })));
|
|
3479
3499
|
function Ii() {
|
|
3480
|
-
return /* @__PURE__ */
|
|
3500
|
+
return /* @__PURE__ */ b("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
|
|
3481
3501
|
}
|
|
3482
3502
|
function Li(e) {
|
|
3483
3503
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
|
|
3484
3504
|
}
|
|
3485
3505
|
function Ri({ value: e, mode: t, onChange: n, fieldId: i }) {
|
|
3486
|
-
return t === "display" ? Li(e) ? /* @__PURE__ */
|
|
3506
|
+
return t === "display" ? Li(e) ? /* @__PURE__ */ b("span", {
|
|
3487
3507
|
style: {
|
|
3488
3508
|
fontSize: 12.5,
|
|
3489
3509
|
color: "var(--text-4)"
|
|
3490
3510
|
},
|
|
3491
3511
|
children: "—"
|
|
3492
|
-
}) : /* @__PURE__ */
|
|
3493
|
-
fallback: /* @__PURE__ */
|
|
3494
|
-
children: /* @__PURE__ */
|
|
3512
|
+
}) : /* @__PURE__ */ b(r, {
|
|
3513
|
+
fallback: /* @__PURE__ */ b(Ii, {}),
|
|
3514
|
+
children: /* @__PURE__ */ b(Fi, {
|
|
3495
3515
|
value: e,
|
|
3496
3516
|
readOnly: !0
|
|
3497
3517
|
})
|
|
3498
|
-
}) : /* @__PURE__ */
|
|
3499
|
-
fallback: /* @__PURE__ */
|
|
3500
|
-
children: /* @__PURE__ */
|
|
3518
|
+
}) : /* @__PURE__ */ b(r, {
|
|
3519
|
+
fallback: /* @__PURE__ */ b(Ii, {}),
|
|
3520
|
+
children: /* @__PURE__ */ b(Fi, {
|
|
3501
3521
|
value: e,
|
|
3502
3522
|
onChange: n,
|
|
3503
3523
|
id: i
|
|
@@ -3510,11 +3530,11 @@ function zi(e) {
|
|
|
3510
3530
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3511
3531
|
}
|
|
3512
3532
|
function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3513
|
-
let { data: o } =
|
|
3533
|
+
let { data: o } = Y(), s = o?.languages?.length ? o.languages : [{
|
|
3514
3534
|
code: "en",
|
|
3515
3535
|
name: { en: "English" }
|
|
3516
3536
|
}], c = zi(n);
|
|
3517
|
-
if (r === "display") return /* @__PURE__ */
|
|
3537
|
+
if (r === "display") return /* @__PURE__ */ b("span", {
|
|
3518
3538
|
style: { fontSize: 12.5 },
|
|
3519
3539
|
children: Object.values(c)[0] ?? "—"
|
|
3520
3540
|
});
|
|
@@ -3526,7 +3546,7 @@ function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3526
3546
|
for (let e of Object.keys(n)) n[e] || delete n[e];
|
|
3527
3547
|
i?.(Object.keys(n).length > 0 ? n : null);
|
|
3528
3548
|
};
|
|
3529
|
-
return /* @__PURE__ */
|
|
3549
|
+
return /* @__PURE__ */ b("div", {
|
|
3530
3550
|
style: {
|
|
3531
3551
|
display: "flex",
|
|
3532
3552
|
flexDirection: "column",
|
|
@@ -3534,13 +3554,13 @@ function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3534
3554
|
},
|
|
3535
3555
|
children: s.map((n, r) => {
|
|
3536
3556
|
let i = a ? r === 0 ? a : `${a}-${n.code}` : void 0;
|
|
3537
|
-
return /* @__PURE__ */
|
|
3557
|
+
return /* @__PURE__ */ x("div", {
|
|
3538
3558
|
style: {
|
|
3539
3559
|
display: "flex",
|
|
3540
3560
|
alignItems: "center",
|
|
3541
3561
|
gap: 8
|
|
3542
3562
|
},
|
|
3543
|
-
children: [/* @__PURE__ */
|
|
3563
|
+
children: [/* @__PURE__ */ b("label", {
|
|
3544
3564
|
htmlFor: i,
|
|
3545
3565
|
style: {
|
|
3546
3566
|
width: 24,
|
|
@@ -3552,9 +3572,9 @@ function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3552
3572
|
fontWeight: 500
|
|
3553
3573
|
},
|
|
3554
3574
|
children: n.code
|
|
3555
|
-
}), /* @__PURE__ */
|
|
3575
|
+
}), /* @__PURE__ */ b("div", {
|
|
3556
3576
|
style: { flex: 1 },
|
|
3557
|
-
children: /* @__PURE__ */
|
|
3577
|
+
children: /* @__PURE__ */ b(P, {
|
|
3558
3578
|
id: i,
|
|
3559
3579
|
name: t ? `${t}.${n.code}` : void 0,
|
|
3560
3580
|
"aria-required": e.required && r === 0 ? !0 : void 0,
|
|
@@ -3573,11 +3593,11 @@ function Vi(e) {
|
|
|
3573
3593
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3574
3594
|
}
|
|
3575
3595
|
function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3576
|
-
let { data: o } =
|
|
3596
|
+
let { data: o } = Y(), s = o?.languages?.length ? o.languages : [{
|
|
3577
3597
|
code: "en",
|
|
3578
3598
|
name: { en: "English" }
|
|
3579
3599
|
}], c = Vi(n);
|
|
3580
|
-
if (r === "display") return /* @__PURE__ */
|
|
3600
|
+
if (r === "display") return /* @__PURE__ */ b("p", {
|
|
3581
3601
|
style: {
|
|
3582
3602
|
fontSize: 12.5,
|
|
3583
3603
|
whiteSpace: "pre-wrap",
|
|
@@ -3593,7 +3613,7 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3593
3613
|
for (let e of Object.keys(n)) n[e] || delete n[e];
|
|
3594
3614
|
i?.(Object.keys(n).length > 0 ? n : null);
|
|
3595
3615
|
};
|
|
3596
|
-
return /* @__PURE__ */
|
|
3616
|
+
return /* @__PURE__ */ b("div", {
|
|
3597
3617
|
style: {
|
|
3598
3618
|
display: "flex",
|
|
3599
3619
|
flexDirection: "column",
|
|
@@ -3601,13 +3621,13 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3601
3621
|
},
|
|
3602
3622
|
children: s.map((n, r) => {
|
|
3603
3623
|
let i = a ? r === 0 ? a : `${a}-${n.code}` : void 0;
|
|
3604
|
-
return /* @__PURE__ */
|
|
3624
|
+
return /* @__PURE__ */ x("div", {
|
|
3605
3625
|
style: {
|
|
3606
3626
|
display: "flex",
|
|
3607
3627
|
flexDirection: "column",
|
|
3608
3628
|
gap: 4
|
|
3609
3629
|
},
|
|
3610
|
-
children: [/* @__PURE__ */
|
|
3630
|
+
children: [/* @__PURE__ */ b("label", {
|
|
3611
3631
|
htmlFor: i,
|
|
3612
3632
|
style: {
|
|
3613
3633
|
fontSize: 10.5,
|
|
@@ -3617,7 +3637,7 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3617
3637
|
fontWeight: 500
|
|
3618
3638
|
},
|
|
3619
3639
|
children: n.code
|
|
3620
|
-
}), /* @__PURE__ */
|
|
3640
|
+
}), /* @__PURE__ */ b(Te, {
|
|
3621
3641
|
id: i,
|
|
3622
3642
|
name: t ? `${t}.${n.code}` : void 0,
|
|
3623
3643
|
ariaRequired: e.required && r === 0,
|
|
@@ -3633,22 +3653,22 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3633
3653
|
//#endregion
|
|
3634
3654
|
//#region src/components/fields/StructureField.tsx
|
|
3635
3655
|
function Ui(e) {
|
|
3636
|
-
let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } =
|
|
3637
|
-
return c ? t.array ? /* @__PURE__ */
|
|
3656
|
+
let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = Y(), c = t.structure ? s?.structures?.[t.structure] : void 0;
|
|
3657
|
+
return c ? t.array ? /* @__PURE__ */ b(Gi, {
|
|
3638
3658
|
structDef: c,
|
|
3639
3659
|
value: n,
|
|
3640
3660
|
mode: r,
|
|
3641
3661
|
onChange: i,
|
|
3642
3662
|
locale: a,
|
|
3643
3663
|
fieldId: o
|
|
3644
|
-
}) : /* @__PURE__ */
|
|
3664
|
+
}) : /* @__PURE__ */ b(Wi, {
|
|
3645
3665
|
structDef: c,
|
|
3646
3666
|
value: n,
|
|
3647
3667
|
mode: r,
|
|
3648
3668
|
onChange: i,
|
|
3649
3669
|
locale: a,
|
|
3650
3670
|
fieldId: o
|
|
3651
|
-
}) : /* @__PURE__ */
|
|
3671
|
+
}) : /* @__PURE__ */ b(Ri, { ...e });
|
|
3652
3672
|
}
|
|
3653
3673
|
function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
|
|
3654
3674
|
let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
|
|
@@ -3660,19 +3680,19 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3660
3680
|
padding: 12,
|
|
3661
3681
|
background: "var(--surface-2)"
|
|
3662
3682
|
};
|
|
3663
|
-
if (n === "display") return s.some((e) => o[e] != null && o[e] !== "") ? /* @__PURE__ */
|
|
3683
|
+
if (n === "display") return s.some((e) => o[e] != null && o[e] !== "") ? /* @__PURE__ */ b("div", {
|
|
3664
3684
|
style: c,
|
|
3665
3685
|
children: s.map((t) => {
|
|
3666
3686
|
let n = e.fields.get(t);
|
|
3667
3687
|
if (!n) return null;
|
|
3668
3688
|
let r = o[t];
|
|
3669
|
-
return r == null ? null : /* @__PURE__ */
|
|
3689
|
+
return r == null ? null : /* @__PURE__ */ x("div", {
|
|
3670
3690
|
style: {
|
|
3671
3691
|
display: "flex",
|
|
3672
3692
|
alignItems: "baseline",
|
|
3673
3693
|
gap: 8
|
|
3674
3694
|
},
|
|
3675
|
-
children: [/* @__PURE__ */
|
|
3695
|
+
children: [/* @__PURE__ */ b("span", {
|
|
3676
3696
|
style: {
|
|
3677
3697
|
fontSize: 11.5,
|
|
3678
3698
|
fontWeight: 500,
|
|
@@ -3680,13 +3700,13 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3680
3700
|
minWidth: 100,
|
|
3681
3701
|
flexShrink: 0
|
|
3682
3702
|
},
|
|
3683
|
-
children: n.display ?
|
|
3684
|
-
}), /* @__PURE__ */
|
|
3703
|
+
children: n.display ? L(n.display.name) : t
|
|
3704
|
+
}), /* @__PURE__ */ b("div", {
|
|
3685
3705
|
style: {
|
|
3686
3706
|
minWidth: 0,
|
|
3687
3707
|
flex: 1
|
|
3688
3708
|
},
|
|
3689
|
-
children: n.type === "structure" && n.structure ? /* @__PURE__ */
|
|
3709
|
+
children: n.type === "structure" && n.structure ? /* @__PURE__ */ b(Ui, {
|
|
3690
3710
|
field: n,
|
|
3691
3711
|
fieldName: t,
|
|
3692
3712
|
value: r,
|
|
@@ -3702,7 +3722,7 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3702
3722
|
})]
|
|
3703
3723
|
}, t);
|
|
3704
3724
|
})
|
|
3705
|
-
}) : /* @__PURE__ */
|
|
3725
|
+
}) : /* @__PURE__ */ b("span", {
|
|
3706
3726
|
style: {
|
|
3707
3727
|
fontSize: 12.5,
|
|
3708
3728
|
color: "var(--text-4)"
|
|
@@ -3715,22 +3735,22 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3715
3735
|
[e]: t
|
|
3716
3736
|
});
|
|
3717
3737
|
};
|
|
3718
|
-
return /* @__PURE__ */
|
|
3738
|
+
return /* @__PURE__ */ b("div", {
|
|
3719
3739
|
style: c,
|
|
3720
3740
|
id: a,
|
|
3721
3741
|
role: "group",
|
|
3722
3742
|
children: s.map((t) => {
|
|
3723
3743
|
let n = e.fields.get(t);
|
|
3724
|
-
return n ? /* @__PURE__ */
|
|
3744
|
+
return n ? /* @__PURE__ */ x("div", {
|
|
3725
3745
|
style: {
|
|
3726
3746
|
display: "flex",
|
|
3727
3747
|
flexDirection: "column",
|
|
3728
3748
|
gap: 2
|
|
3729
3749
|
},
|
|
3730
|
-
children: [/* @__PURE__ */
|
|
3750
|
+
children: [/* @__PURE__ */ b(Ce, {
|
|
3731
3751
|
required: n.required,
|
|
3732
|
-
children: n.display ?
|
|
3733
|
-
}), n.type === "structure" && n.structure ? /* @__PURE__ */
|
|
3752
|
+
children: n.display ? L(n.display.name) : t
|
|
3753
|
+
}), n.type === "structure" && n.structure ? /* @__PURE__ */ b(Ui, {
|
|
3734
3754
|
field: n,
|
|
3735
3755
|
fieldName: t,
|
|
3736
3756
|
value: o[t],
|
|
@@ -3751,19 +3771,19 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3751
3771
|
}
|
|
3752
3772
|
function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId: o }) {
|
|
3753
3773
|
let s = Array.isArray(n) ? n : [];
|
|
3754
|
-
if (r === "display") return s.length === 0 ? /* @__PURE__ */
|
|
3774
|
+
if (r === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
|
|
3755
3775
|
style: {
|
|
3756
3776
|
fontSize: 12.5,
|
|
3757
3777
|
color: "var(--text-4)"
|
|
3758
3778
|
},
|
|
3759
3779
|
children: "—"
|
|
3760
|
-
}) : /* @__PURE__ */
|
|
3780
|
+
}) : /* @__PURE__ */ b("div", {
|
|
3761
3781
|
style: {
|
|
3762
3782
|
display: "flex",
|
|
3763
3783
|
flexDirection: "column",
|
|
3764
3784
|
gap: 8
|
|
3765
3785
|
},
|
|
3766
|
-
children: s.map((t, n) => /* @__PURE__ */
|
|
3786
|
+
children: s.map((t, n) => /* @__PURE__ */ b(Wi, {
|
|
3767
3787
|
structDef: e,
|
|
3768
3788
|
value: t,
|
|
3769
3789
|
mode: "display",
|
|
@@ -3779,7 +3799,7 @@ function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3779
3799
|
let t = s.filter((t, n) => n !== e);
|
|
3780
3800
|
i?.(t);
|
|
3781
3801
|
};
|
|
3782
|
-
return /* @__PURE__ */
|
|
3802
|
+
return /* @__PURE__ */ x("div", {
|
|
3783
3803
|
style: {
|
|
3784
3804
|
display: "flex",
|
|
3785
3805
|
flexDirection: "column",
|
|
@@ -3787,29 +3807,29 @@ function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3787
3807
|
},
|
|
3788
3808
|
id: o,
|
|
3789
3809
|
role: "group",
|
|
3790
|
-
children: [s.map((n, r) => /* @__PURE__ */
|
|
3810
|
+
children: [s.map((n, r) => /* @__PURE__ */ x("div", {
|
|
3791
3811
|
style: { position: "relative" },
|
|
3792
|
-
children: [/* @__PURE__ */
|
|
3812
|
+
children: [/* @__PURE__ */ b(Wi, {
|
|
3793
3813
|
structDef: e,
|
|
3794
3814
|
value: n,
|
|
3795
3815
|
mode: "edit",
|
|
3796
3816
|
onChange: c(r),
|
|
3797
3817
|
locale: a
|
|
3798
|
-
}), /* @__PURE__ */
|
|
3818
|
+
}), /* @__PURE__ */ b("div", {
|
|
3799
3819
|
style: {
|
|
3800
3820
|
position: "absolute",
|
|
3801
3821
|
top: 6,
|
|
3802
3822
|
right: 6
|
|
3803
3823
|
},
|
|
3804
|
-
children: /* @__PURE__ */
|
|
3824
|
+
children: /* @__PURE__ */ b(O, {
|
|
3805
3825
|
size: 24,
|
|
3806
|
-
icon: /* @__PURE__ */
|
|
3826
|
+
icon: /* @__PURE__ */ b(t.trash, { size: 12 }),
|
|
3807
3827
|
onClick: u(r),
|
|
3808
3828
|
title: "Remove"
|
|
3809
3829
|
})
|
|
3810
3830
|
})]
|
|
3811
|
-
}, r)), /* @__PURE__ */
|
|
3812
|
-
icon: /* @__PURE__ */
|
|
3831
|
+
}, r)), /* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(D, {
|
|
3832
|
+
icon: /* @__PURE__ */ b(t.plus, { size: 13 }),
|
|
3813
3833
|
onClick: l,
|
|
3814
3834
|
children: "Add"
|
|
3815
3835
|
}) })]
|
|
@@ -3820,21 +3840,21 @@ function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3820
3840
|
var Ki = "[SET]";
|
|
3821
3841
|
function qi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3822
3842
|
let [s, c] = p(""), l = a !== void 0, u = n === Ki || typeof n == "string" && n !== "";
|
|
3823
|
-
return r === "display" ? u ? /* @__PURE__ */
|
|
3843
|
+
return r === "display" ? u ? /* @__PURE__ */ b("span", {
|
|
3824
3844
|
className: "mono",
|
|
3825
3845
|
style: {
|
|
3826
3846
|
fontSize: 12.5,
|
|
3827
3847
|
color: "var(--text-3)"
|
|
3828
3848
|
},
|
|
3829
3849
|
children: Ki
|
|
3830
|
-
}) : /* @__PURE__ */
|
|
3850
|
+
}) : /* @__PURE__ */ b("span", {
|
|
3831
3851
|
style: {
|
|
3832
3852
|
fontSize: 12.5,
|
|
3833
3853
|
color: "var(--text-4)",
|
|
3834
3854
|
fontStyle: "italic"
|
|
3835
3855
|
},
|
|
3836
3856
|
children: "Not set"
|
|
3837
|
-
}) : /* @__PURE__ */
|
|
3857
|
+
}) : /* @__PURE__ */ b(Ne, {
|
|
3838
3858
|
id: o,
|
|
3839
3859
|
name: t,
|
|
3840
3860
|
ariaRequired: e.required,
|
|
@@ -3850,21 +3870,21 @@ function qi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3850
3870
|
var Ji = "[SET]";
|
|
3851
3871
|
function Yi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3852
3872
|
let [s, c] = p(""), l = a !== void 0, u = n === Ji || typeof n == "string" && n !== "";
|
|
3853
|
-
return r === "display" ? u ? /* @__PURE__ */
|
|
3873
|
+
return r === "display" ? u ? /* @__PURE__ */ b("span", {
|
|
3854
3874
|
className: "mono",
|
|
3855
3875
|
style: {
|
|
3856
3876
|
fontSize: 12.5,
|
|
3857
3877
|
color: "var(--text-3)"
|
|
3858
3878
|
},
|
|
3859
3879
|
children: Ji
|
|
3860
|
-
}) : /* @__PURE__ */
|
|
3880
|
+
}) : /* @__PURE__ */ b("span", {
|
|
3861
3881
|
style: {
|
|
3862
3882
|
fontSize: 12.5,
|
|
3863
3883
|
color: "var(--text-4)",
|
|
3864
3884
|
fontStyle: "italic"
|
|
3865
3885
|
},
|
|
3866
3886
|
children: "Not set"
|
|
3867
|
-
}) : /* @__PURE__ */
|
|
3887
|
+
}) : /* @__PURE__ */ b(Ne, {
|
|
3868
3888
|
id: o,
|
|
3869
3889
|
name: t,
|
|
3870
3890
|
ariaRequired: e.required,
|
|
@@ -3882,19 +3902,19 @@ function Xi(e) {
|
|
|
3882
3902
|
}
|
|
3883
3903
|
function Zi({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
3884
3904
|
let s = Xi(r), [c, l] = p("");
|
|
3885
|
-
if (i === "display") return s.length === 0 ? /* @__PURE__ */
|
|
3905
|
+
if (i === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
|
|
3886
3906
|
style: {
|
|
3887
3907
|
fontSize: 12.5,
|
|
3888
3908
|
color: "var(--text-4)"
|
|
3889
3909
|
},
|
|
3890
3910
|
children: "—"
|
|
3891
|
-
}) : /* @__PURE__ */
|
|
3911
|
+
}) : /* @__PURE__ */ b("div", {
|
|
3892
3912
|
style: {
|
|
3893
3913
|
display: "flex",
|
|
3894
3914
|
flexWrap: "wrap",
|
|
3895
3915
|
gap: 4
|
|
3896
3916
|
},
|
|
3897
|
-
children: s.map((e, t) => /* @__PURE__ */
|
|
3917
|
+
children: s.map((e, t) => /* @__PURE__ */ b(N, {
|
|
3898
3918
|
tone: "slate",
|
|
3899
3919
|
children: e
|
|
3900
3920
|
}, t))
|
|
@@ -3905,31 +3925,31 @@ function Zi({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
3905
3925
|
}, d = (e) => {
|
|
3906
3926
|
a?.(s.filter((t, n) => n !== e));
|
|
3907
3927
|
};
|
|
3908
|
-
return /* @__PURE__ */
|
|
3928
|
+
return /* @__PURE__ */ x("div", {
|
|
3909
3929
|
style: {
|
|
3910
3930
|
display: "flex",
|
|
3911
3931
|
flexDirection: "column",
|
|
3912
3932
|
gap: 6
|
|
3913
3933
|
},
|
|
3914
|
-
children: [s.length > 0 && /* @__PURE__ */
|
|
3934
|
+
children: [s.length > 0 && /* @__PURE__ */ b("div", {
|
|
3915
3935
|
style: {
|
|
3916
3936
|
display: "flex",
|
|
3917
3937
|
flexWrap: "wrap",
|
|
3918
3938
|
gap: 4
|
|
3919
3939
|
},
|
|
3920
|
-
children: s.map((e, t) => /* @__PURE__ */
|
|
3940
|
+
children: s.map((e, t) => /* @__PURE__ */ b(N, {
|
|
3921
3941
|
tone: "slate",
|
|
3922
3942
|
onRemove: () => d(t),
|
|
3923
3943
|
children: e
|
|
3924
3944
|
}, t))
|
|
3925
|
-
}), /* @__PURE__ */
|
|
3945
|
+
}), /* @__PURE__ */ x("div", {
|
|
3926
3946
|
style: {
|
|
3927
3947
|
display: "flex",
|
|
3928
3948
|
gap: 4
|
|
3929
3949
|
},
|
|
3930
|
-
children: [/* @__PURE__ */
|
|
3950
|
+
children: [/* @__PURE__ */ b("div", {
|
|
3931
3951
|
style: { flex: 1 },
|
|
3932
|
-
children: /* @__PURE__ */
|
|
3952
|
+
children: /* @__PURE__ */ b(P, {
|
|
3933
3953
|
id: o,
|
|
3934
3954
|
name: n,
|
|
3935
3955
|
"aria-required": e.required || void 0,
|
|
@@ -3940,8 +3960,8 @@ function Zi({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
3940
3960
|
},
|
|
3941
3961
|
placeholder: "Add item…"
|
|
3942
3962
|
})
|
|
3943
|
-
}), /* @__PURE__ */
|
|
3944
|
-
icon: /* @__PURE__ */
|
|
3963
|
+
}), /* @__PURE__ */ b(D, {
|
|
3964
|
+
icon: /* @__PURE__ */ b(t.plus, { size: 13 }),
|
|
3945
3965
|
onClick: u,
|
|
3946
3966
|
children: "Add"
|
|
3947
3967
|
})]
|
|
@@ -3955,19 +3975,19 @@ function Qi(e) {
|
|
|
3955
3975
|
}
|
|
3956
3976
|
function $i({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
3957
3977
|
let s = Qi(r), [c, l] = p("");
|
|
3958
|
-
if (i === "display") return s.length === 0 ? /* @__PURE__ */
|
|
3978
|
+
if (i === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
|
|
3959
3979
|
style: {
|
|
3960
3980
|
fontSize: 12.5,
|
|
3961
3981
|
color: "var(--text-4)"
|
|
3962
3982
|
},
|
|
3963
3983
|
children: "—"
|
|
3964
|
-
}) : /* @__PURE__ */
|
|
3984
|
+
}) : /* @__PURE__ */ b("div", {
|
|
3965
3985
|
style: {
|
|
3966
3986
|
display: "flex",
|
|
3967
3987
|
flexWrap: "wrap",
|
|
3968
3988
|
gap: 4
|
|
3969
3989
|
},
|
|
3970
|
-
children: s.map((e, t) => /* @__PURE__ */
|
|
3990
|
+
children: s.map((e, t) => /* @__PURE__ */ b(N, {
|
|
3971
3991
|
tone: "slate",
|
|
3972
3992
|
children: e
|
|
3973
3993
|
}, t))
|
|
@@ -3980,31 +4000,31 @@ function $i({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
3980
4000
|
}, d = (e) => {
|
|
3981
4001
|
a?.(s.filter((t, n) => n !== e));
|
|
3982
4002
|
};
|
|
3983
|
-
return /* @__PURE__ */
|
|
4003
|
+
return /* @__PURE__ */ x("div", {
|
|
3984
4004
|
style: {
|
|
3985
4005
|
display: "flex",
|
|
3986
4006
|
flexDirection: "column",
|
|
3987
4007
|
gap: 6
|
|
3988
4008
|
},
|
|
3989
|
-
children: [s.length > 0 && /* @__PURE__ */
|
|
4009
|
+
children: [s.length > 0 && /* @__PURE__ */ b("div", {
|
|
3990
4010
|
style: {
|
|
3991
4011
|
display: "flex",
|
|
3992
4012
|
flexWrap: "wrap",
|
|
3993
4013
|
gap: 4
|
|
3994
4014
|
},
|
|
3995
|
-
children: s.map((e, t) => /* @__PURE__ */
|
|
4015
|
+
children: s.map((e, t) => /* @__PURE__ */ b(N, {
|
|
3996
4016
|
tone: "slate",
|
|
3997
4017
|
onRemove: () => d(t),
|
|
3998
4018
|
children: e
|
|
3999
4019
|
}, t))
|
|
4000
|
-
}), /* @__PURE__ */
|
|
4020
|
+
}), /* @__PURE__ */ x("div", {
|
|
4001
4021
|
style: {
|
|
4002
4022
|
display: "flex",
|
|
4003
4023
|
gap: 4
|
|
4004
4024
|
},
|
|
4005
|
-
children: [/* @__PURE__ */
|
|
4025
|
+
children: [/* @__PURE__ */ b("div", {
|
|
4006
4026
|
style: { flex: 1 },
|
|
4007
|
-
children: /* @__PURE__ */
|
|
4027
|
+
children: /* @__PURE__ */ b(P, {
|
|
4008
4028
|
id: o,
|
|
4009
4029
|
name: n,
|
|
4010
4030
|
"aria-required": e.required || void 0,
|
|
@@ -4016,8 +4036,8 @@ function $i({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
4016
4036
|
},
|
|
4017
4037
|
placeholder: "Add number…"
|
|
4018
4038
|
})
|
|
4019
|
-
}), /* @__PURE__ */
|
|
4020
|
-
icon: /* @__PURE__ */
|
|
4039
|
+
}), /* @__PURE__ */ b(D, {
|
|
4040
|
+
icon: /* @__PURE__ */ b(t.plus, { size: 13 }),
|
|
4021
4041
|
onClick: u,
|
|
4022
4042
|
children: "Add"
|
|
4023
4043
|
})]
|
|
@@ -4071,7 +4091,7 @@ function la(e) {
|
|
|
4071
4091
|
}
|
|
4072
4092
|
//#endregion
|
|
4073
4093
|
//#region src/components/file-widgets/upload.ts
|
|
4074
|
-
var
|
|
4094
|
+
var Q = class extends Error {
|
|
4075
4095
|
code;
|
|
4076
4096
|
status;
|
|
4077
4097
|
constructor(e, t, n) {
|
|
@@ -4083,7 +4103,7 @@ async function ua(e) {
|
|
|
4083
4103
|
try {
|
|
4084
4104
|
return await da(e, t ? await kt() : null);
|
|
4085
4105
|
} catch (n) {
|
|
4086
|
-
if (!(n instanceof
|
|
4106
|
+
if (!(n instanceof Q && n.status === 401 && (n.code === "TOKEN_REFRESH_NEEDED" || n.code === "UNAUTHORIZED"))) throw n;
|
|
4087
4107
|
let r = null;
|
|
4088
4108
|
try {
|
|
4089
4109
|
t ? (Ot(), r = await kt()) : await hn();
|
|
@@ -4093,7 +4113,7 @@ async function ua(e) {
|
|
|
4093
4113
|
try {
|
|
4094
4114
|
return await da(e, r);
|
|
4095
4115
|
} catch (e) {
|
|
4096
|
-
throw e instanceof
|
|
4116
|
+
throw e instanceof Q && e.status === 401 && _n()(), e;
|
|
4097
4117
|
}
|
|
4098
4118
|
}
|
|
4099
4119
|
}
|
|
@@ -4117,21 +4137,21 @@ function da(e, t) {
|
|
|
4117
4137
|
if (l.status >= 200 && l.status < 300) {
|
|
4118
4138
|
let t = pa(n);
|
|
4119
4139
|
if (!t || !t.id) {
|
|
4120
|
-
c(new
|
|
4140
|
+
c(new Q(l.status, "BAD_RESPONSE", "Upload returned no file id"));
|
|
4121
4141
|
return;
|
|
4122
4142
|
}
|
|
4123
4143
|
e(t);
|
|
4124
4144
|
return;
|
|
4125
4145
|
}
|
|
4126
4146
|
let r = n, i = r?.error?.code ?? "UPLOAD_FAILED", a = r?.error?.message ?? `Upload failed (${l.status})`;
|
|
4127
|
-
c(new
|
|
4147
|
+
c(new Q(l.status, i, a));
|
|
4128
4148
|
}, l.onerror = () => {
|
|
4129
|
-
c(new
|
|
4149
|
+
c(new Q(0, "NETWORK_ERROR", "Network error during upload"));
|
|
4130
4150
|
}, l.onabort = () => {
|
|
4131
|
-
c(new
|
|
4151
|
+
c(new Q(0, "ABORTED", "Upload aborted"));
|
|
4132
4152
|
}, s) {
|
|
4133
4153
|
if (s.aborted) {
|
|
4134
|
-
l.abort(), c(new
|
|
4154
|
+
l.abort(), c(new Q(0, "ABORTED", "Upload aborted"));
|
|
4135
4155
|
return;
|
|
4136
4156
|
}
|
|
4137
4157
|
s.addEventListener("abort", () => l.abort(), { once: !0 });
|
|
@@ -4173,7 +4193,7 @@ function va(e) {
|
|
|
4173
4193
|
return typeof e == "boolean" ? e : void 0;
|
|
4174
4194
|
}
|
|
4175
4195
|
async function ya(e) {
|
|
4176
|
-
await
|
|
4196
|
+
await J("files.discard", { file_id: e });
|
|
4177
4197
|
}
|
|
4178
4198
|
function ba(e, t, n) {
|
|
4179
4199
|
if (n && e.size > n) return {
|
|
@@ -4237,7 +4257,7 @@ function wa({ children: e }) {
|
|
|
4237
4257
|
t.current.clear(), await Promise.allSettled(e.map((e) => Promise.resolve(e.discard())));
|
|
4238
4258
|
}
|
|
4239
4259
|
}), []);
|
|
4240
|
-
return /* @__PURE__ */
|
|
4260
|
+
return /* @__PURE__ */ b(Ca.Provider, {
|
|
4241
4261
|
value: n,
|
|
4242
4262
|
children: e
|
|
4243
4263
|
});
|
|
@@ -4266,7 +4286,7 @@ function Ea() {
|
|
|
4266
4286
|
//#endregion
|
|
4267
4287
|
//#region src/components/fields/RichTextField.tsx
|
|
4268
4288
|
function Da(e) {
|
|
4269
|
-
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v,
|
|
4289
|
+
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v, y] = p(0), [S, C] = p(null), { register: w, unregister: T } = Ea(), E = c?.$files?.[i], O = d(() => na(a, E), [E, a]), k = O.markdown, A = n.files?.accepts, j = n.files?.max_size_bytes, M = (e, t = O.files) => {
|
|
4270
4290
|
let n = new Set(oa(e)), r = [];
|
|
4271
4291
|
for (let e of _.current) n.has(e) || r.push(e);
|
|
4272
4292
|
if (r.length > 0) {
|
|
@@ -4285,26 +4305,26 @@ function Da(e) {
|
|
|
4285
4305
|
markdown: e,
|
|
4286
4306
|
files: t
|
|
4287
4307
|
});
|
|
4288
|
-
},
|
|
4308
|
+
}, ee = (e, t, n) => {
|
|
4289
4309
|
let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length, o = `${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, s = n ? ra(e, n).files : e.files;
|
|
4290
|
-
|
|
4310
|
+
M(o, s), requestAnimationFrame(() => {
|
|
4291
4311
|
if (!r) return;
|
|
4292
4312
|
let e = i + t.length;
|
|
4293
4313
|
r.focus(), r.setSelectionRange(e, e);
|
|
4294
4314
|
});
|
|
4295
|
-
},
|
|
4315
|
+
}, te = async (e) => {
|
|
4296
4316
|
if (!r || !n.files) return;
|
|
4297
4317
|
let t = Array.from(e);
|
|
4298
4318
|
if (t.length === 0) return;
|
|
4299
|
-
C(null),
|
|
4319
|
+
C(null), y((e) => e + t.length);
|
|
4300
4320
|
let a = {
|
|
4301
4321
|
markdown: k,
|
|
4302
4322
|
files: O.files
|
|
4303
4323
|
};
|
|
4304
4324
|
for (let e of t) {
|
|
4305
|
-
let n = ba(e, A,
|
|
4325
|
+
let n = ba(e, A, j);
|
|
4306
4326
|
if (n) {
|
|
4307
|
-
C(n.message),
|
|
4327
|
+
C(n.message), y((e) => e - 1);
|
|
4308
4328
|
continue;
|
|
4309
4329
|
}
|
|
4310
4330
|
try {
|
|
@@ -4317,7 +4337,7 @@ function Da(e) {
|
|
|
4317
4337
|
let s = ka(n, o);
|
|
4318
4338
|
if (w(n.id, () => ya(n.id)), _.current.add(n.id), t.length === 1) {
|
|
4319
4339
|
let e = Oa(a.markdown, ca(s));
|
|
4320
|
-
|
|
4340
|
+
ee(a, e, s), a = ra({
|
|
4321
4341
|
markdown: `${a.markdown}${e}`,
|
|
4322
4342
|
files: a.files
|
|
4323
4343
|
}, s);
|
|
@@ -4326,38 +4346,38 @@ function Da(e) {
|
|
|
4326
4346
|
a = ra({
|
|
4327
4347
|
markdown: `${a.markdown}${e}`,
|
|
4328
4348
|
files: a.files
|
|
4329
|
-
}, s),
|
|
4349
|
+
}, s), M(a.markdown, a.files);
|
|
4330
4350
|
}
|
|
4331
4351
|
} catch (e) {
|
|
4332
|
-
C(e instanceof
|
|
4352
|
+
C(e instanceof Q ? e.message : "Upload failed");
|
|
4333
4353
|
} finally {
|
|
4334
|
-
|
|
4354
|
+
y((e) => e - 1);
|
|
4335
4355
|
}
|
|
4336
4356
|
}
|
|
4337
4357
|
};
|
|
4338
|
-
return o === "display" ? k ? /* @__PURE__ */
|
|
4358
|
+
return o === "display" ? k ? /* @__PURE__ */ b(Jr, {
|
|
4339
4359
|
content: k,
|
|
4340
4360
|
files: O.files
|
|
4341
|
-
}) : /* @__PURE__ */
|
|
4361
|
+
}) : /* @__PURE__ */ b("span", {
|
|
4342
4362
|
style: {
|
|
4343
4363
|
fontSize: 12.5,
|
|
4344
4364
|
color: "var(--text-4)"
|
|
4345
4365
|
},
|
|
4346
4366
|
children: "—"
|
|
4347
|
-
}) : l ? /* @__PURE__ */
|
|
4367
|
+
}) : l ? /* @__PURE__ */ b(P, {
|
|
4348
4368
|
id: u,
|
|
4349
4369
|
name: i,
|
|
4350
4370
|
"aria-required": n.required || void 0,
|
|
4351
4371
|
value: k,
|
|
4352
|
-
onChange: (e) =>
|
|
4353
|
-
}) : /* @__PURE__ */
|
|
4372
|
+
onChange: (e) => M(e)
|
|
4373
|
+
}) : /* @__PURE__ */ x("div", {
|
|
4354
4374
|
style: {
|
|
4355
4375
|
display: "flex",
|
|
4356
4376
|
flexDirection: "column",
|
|
4357
4377
|
gap: 10
|
|
4358
4378
|
},
|
|
4359
4379
|
children: [
|
|
4360
|
-
/* @__PURE__ */
|
|
4380
|
+
/* @__PURE__ */ x("div", {
|
|
4361
4381
|
style: {
|
|
4362
4382
|
display: "flex",
|
|
4363
4383
|
alignItems: "center",
|
|
@@ -4365,22 +4385,22 @@ function Da(e) {
|
|
|
4365
4385
|
flexWrap: "wrap"
|
|
4366
4386
|
},
|
|
4367
4387
|
children: [
|
|
4368
|
-
/* @__PURE__ */
|
|
4388
|
+
/* @__PURE__ */ b(D, {
|
|
4369
4389
|
kind: "ghost",
|
|
4370
4390
|
size: "xs",
|
|
4371
|
-
icon:
|
|
4391
|
+
icon: b(v > 0 ? Se : t.plus, { size: 12 }),
|
|
4372
4392
|
onClick: () => h.current?.click(),
|
|
4373
4393
|
disabled: !r || !n.files || v > 0,
|
|
4374
4394
|
children: v > 0 ? "Uploading…" : "Insert file"
|
|
4375
4395
|
}),
|
|
4376
|
-
/* @__PURE__ */
|
|
4396
|
+
/* @__PURE__ */ b("span", {
|
|
4377
4397
|
style: {
|
|
4378
4398
|
fontSize: 11.5,
|
|
4379
4399
|
color: "var(--text-3)"
|
|
4380
4400
|
},
|
|
4381
4401
|
children: "Stores markdown with inline declarion://file/<id> refs."
|
|
4382
4402
|
}),
|
|
4383
|
-
!r && /* @__PURE__ */
|
|
4403
|
+
!r && /* @__PURE__ */ b("span", {
|
|
4384
4404
|
style: {
|
|
4385
4405
|
fontSize: 11.5,
|
|
4386
4406
|
color: "var(--warn)"
|
|
@@ -4389,30 +4409,30 @@ function Da(e) {
|
|
|
4389
4409
|
})
|
|
4390
4410
|
]
|
|
4391
4411
|
}),
|
|
4392
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ b("input", {
|
|
4393
4413
|
ref: h,
|
|
4394
4414
|
type: "file",
|
|
4395
4415
|
hidden: !0,
|
|
4396
4416
|
accept: A?.join(","),
|
|
4397
4417
|
multiple: !0,
|
|
4398
4418
|
onChange: (e) => {
|
|
4399
|
-
e.target.files &&
|
|
4419
|
+
e.target.files && te(e.target.files), e.target.value = "";
|
|
4400
4420
|
}
|
|
4401
4421
|
}),
|
|
4402
|
-
/* @__PURE__ */
|
|
4422
|
+
/* @__PURE__ */ b("textarea", {
|
|
4403
4423
|
ref: m,
|
|
4404
4424
|
id: u,
|
|
4405
4425
|
name: i,
|
|
4406
4426
|
"aria-required": n.required || void 0,
|
|
4407
4427
|
value: k,
|
|
4408
|
-
onChange: (e) =>
|
|
4428
|
+
onChange: (e) => M(e.target.value),
|
|
4409
4429
|
onPaste: (e) => {
|
|
4410
4430
|
let t = Array.from(e.clipboardData.files ?? []).filter((e) => e.size > 0);
|
|
4411
|
-
t.length !== 0 && (e.preventDefault(),
|
|
4431
|
+
t.length !== 0 && (e.preventDefault(), te(t));
|
|
4412
4432
|
},
|
|
4413
4433
|
onDrop: (e) => {
|
|
4414
4434
|
let t = Array.from(e.dataTransfer.files ?? []).filter((e) => e.size > 0);
|
|
4415
|
-
t.length !== 0 && (e.preventDefault(),
|
|
4435
|
+
t.length !== 0 && (e.preventDefault(), te(t));
|
|
4416
4436
|
},
|
|
4417
4437
|
onDragOver: (e) => e.preventDefault(),
|
|
4418
4438
|
rows: 12,
|
|
@@ -4430,31 +4450,31 @@ function Da(e) {
|
|
|
4430
4450
|
color: "var(--text)"
|
|
4431
4451
|
}
|
|
4432
4452
|
}),
|
|
4433
|
-
S && /* @__PURE__ */
|
|
4453
|
+
S && /* @__PURE__ */ b("div", {
|
|
4434
4454
|
style: {
|
|
4435
4455
|
fontSize: 12,
|
|
4436
4456
|
color: "var(--danger)"
|
|
4437
4457
|
},
|
|
4438
4458
|
children: S
|
|
4439
4459
|
}),
|
|
4440
|
-
/* @__PURE__ */
|
|
4460
|
+
/* @__PURE__ */ x("div", {
|
|
4441
4461
|
style: {
|
|
4442
4462
|
border: "1px solid var(--border)",
|
|
4443
4463
|
borderRadius: 8,
|
|
4444
4464
|
padding: 12,
|
|
4445
4465
|
background: "var(--surface-2)"
|
|
4446
4466
|
},
|
|
4447
|
-
children: [/* @__PURE__ */
|
|
4467
|
+
children: [/* @__PURE__ */ b("div", {
|
|
4448
4468
|
style: {
|
|
4449
4469
|
fontSize: 11.5,
|
|
4450
4470
|
color: "var(--text-3)",
|
|
4451
4471
|
marginBottom: 8
|
|
4452
4472
|
},
|
|
4453
4473
|
children: "Preview"
|
|
4454
|
-
}), k ? /* @__PURE__ */
|
|
4474
|
+
}), k ? /* @__PURE__ */ b(Jr, {
|
|
4455
4475
|
content: k,
|
|
4456
4476
|
files: O.files
|
|
4457
|
-
}) : /* @__PURE__ */
|
|
4477
|
+
}) : /* @__PURE__ */ b("span", {
|
|
4458
4478
|
style: {
|
|
4459
4479
|
fontSize: 12.5,
|
|
4460
4480
|
color: "var(--text-4)"
|
|
@@ -4483,12 +4503,12 @@ function ka(e, t) {
|
|
|
4483
4503
|
}
|
|
4484
4504
|
//#endregion
|
|
4485
4505
|
//#region src/components/fields/cells/factories/text.ts
|
|
4486
|
-
var Aa = () => (e) => e == null || e === "" ? "—" :
|
|
4506
|
+
var Aa = () => (e) => e == null || e === "" ? "—" : I(e), ja = (e) => {
|
|
4487
4507
|
let { field: t, fieldName: n, locale: r = "en" } = e, i = Ma(t, n, r);
|
|
4488
4508
|
return (e) => {
|
|
4489
4509
|
if (e == null) return "—";
|
|
4490
4510
|
let t = !!e;
|
|
4491
|
-
return /* @__PURE__ */
|
|
4511
|
+
return /* @__PURE__ */ b(k, {
|
|
4492
4512
|
tone: t ? "emerald" : "slate",
|
|
4493
4513
|
size: "xs",
|
|
4494
4514
|
children: t ? i.trueLabel : i.falseLabel
|
|
@@ -4497,10 +4517,10 @@ var Aa = () => (e) => e == null || e === "" ? "—" : F(e), ja = (e) => {
|
|
|
4497
4517
|
};
|
|
4498
4518
|
function Ma(e, t, n) {
|
|
4499
4519
|
if (e.display?.bool_labels) return {
|
|
4500
|
-
trueLabel:
|
|
4501
|
-
falseLabel:
|
|
4520
|
+
trueLabel: L(e.display.bool_labels.true, n) || "Yes",
|
|
4521
|
+
falseLabel: L(e.display.bool_labels.false, n) || "No"
|
|
4502
4522
|
};
|
|
4503
|
-
let r = e.display?.name ?
|
|
4523
|
+
let r = e.display?.name ? L(e.display.name, n) : "";
|
|
4504
4524
|
if (r.startsWith("Is ")) {
|
|
4505
4525
|
let e = r.slice(3).trim();
|
|
4506
4526
|
return {
|
|
@@ -4556,10 +4576,10 @@ var Ia = (e) => {
|
|
|
4556
4576
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4557
4577
|
if (t.values) for (let e of t.values) r.set(e.code, {
|
|
4558
4578
|
tone: Fa(e.color),
|
|
4559
|
-
label:
|
|
4579
|
+
label: L(e.name, n) || e.code
|
|
4560
4580
|
});
|
|
4561
4581
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
|
|
4562
|
-
let t = r.get(e), a = i.color ? Fa(i.color) : t?.tone ?? "slate", o = (i.label ?
|
|
4582
|
+
let t = r.get(e), a = i.color ? Fa(i.color) : t?.tone ?? "slate", o = (i.label ? L(i.label, n) : "") || t?.label || e;
|
|
4563
4583
|
r.set(e, {
|
|
4564
4584
|
tone: a,
|
|
4565
4585
|
label: o
|
|
@@ -4567,8 +4587,8 @@ var Ia = (e) => {
|
|
|
4567
4587
|
}
|
|
4568
4588
|
return (e) => {
|
|
4569
4589
|
if (e == null || e === "") return "—";
|
|
4570
|
-
let t =
|
|
4571
|
-
return /* @__PURE__ */
|
|
4590
|
+
let t = I(e), n = r.get(t);
|
|
4591
|
+
return /* @__PURE__ */ b(k, {
|
|
4572
4592
|
tone: n?.tone ?? "slate",
|
|
4573
4593
|
size: "xs",
|
|
4574
4594
|
children: n?.label ?? t
|
|
@@ -4591,12 +4611,12 @@ var za = (e) => {
|
|
|
4591
4611
|
let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4592
4612
|
if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
|
|
4593
4613
|
tone: Ra(t.color),
|
|
4594
|
-
label:
|
|
4614
|
+
label: L(t.name, n) || t.code
|
|
4595
4615
|
});
|
|
4596
4616
|
return (e) => {
|
|
4597
4617
|
if (e == null || e === "") return "—";
|
|
4598
|
-
let t =
|
|
4599
|
-
return /* @__PURE__ */
|
|
4618
|
+
let t = I(e), n = r.get(t);
|
|
4619
|
+
return /* @__PURE__ */ b(k, {
|
|
4600
4620
|
tone: n?.tone ?? "slate",
|
|
4601
4621
|
size: "xs",
|
|
4602
4622
|
children: n?.label ?? t
|
|
@@ -4618,10 +4638,10 @@ function Va(e) {
|
|
|
4618
4638
|
var Ha = (e) => {
|
|
4619
4639
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4620
4640
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
|
|
4621
|
-
label: i.label &&
|
|
4641
|
+
label: i.label && L(i.label, n) || e,
|
|
4622
4642
|
tone: Va(i.color)
|
|
4623
4643
|
});
|
|
4624
|
-
return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */
|
|
4644
|
+
return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ b("span", {
|
|
4625
4645
|
style: {
|
|
4626
4646
|
display: "inline-flex",
|
|
4627
4647
|
gap: 4,
|
|
@@ -4629,41 +4649,41 @@ var Ha = (e) => {
|
|
|
4629
4649
|
},
|
|
4630
4650
|
children: e.map((e, t) => {
|
|
4631
4651
|
let n = String(e), i = r.get(n);
|
|
4632
|
-
return i?.tone ? /* @__PURE__ */
|
|
4652
|
+
return i?.tone ? /* @__PURE__ */ b(k, {
|
|
4633
4653
|
tone: i.tone,
|
|
4634
4654
|
size: "xs",
|
|
4635
4655
|
children: i.label
|
|
4636
|
-
}, `${n}-${t}`) : /* @__PURE__ */
|
|
4656
|
+
}, `${n}-${t}`) : /* @__PURE__ */ b(N, { children: i?.label ?? n }, `${n}-${t}`);
|
|
4637
4657
|
})
|
|
4638
4658
|
});
|
|
4639
4659
|
}, Ua = () => (e) => {
|
|
4640
4660
|
if (e == null || e === "") return "—";
|
|
4641
|
-
let { text: t, absolute: n } = mi(typeof e == "string" ? e :
|
|
4642
|
-
return /* @__PURE__ */
|
|
4661
|
+
let { text: t, absolute: n } = mi(typeof e == "string" ? e : I(e));
|
|
4662
|
+
return /* @__PURE__ */ b("span", {
|
|
4643
4663
|
title: n,
|
|
4644
4664
|
children: t
|
|
4645
4665
|
});
|
|
4646
|
-
}, Wa = () => (e) => e == null || e === "" ? "—" : pi(typeof e == "string" ? e :
|
|
4666
|
+
}, Wa = () => (e) => e == null || e === "" ? "—" : pi(typeof e == "string" ? e : I(e)), Ga = 60 * 1e3, Ka = 300 * 1e3, qa = () => (e) => {
|
|
4647
4667
|
if (e == null || e === "") return "—";
|
|
4648
|
-
let t = typeof e == "string" ? e :
|
|
4668
|
+
let t = typeof e == "string" ? e : I(e), n = new Date(t);
|
|
4649
4669
|
if (isNaN(n.getTime())) return t;
|
|
4650
4670
|
let r = pi(t), i = Date.now() - n.getTime();
|
|
4651
|
-
if (i <= 0) return /* @__PURE__ */
|
|
4671
|
+
if (i <= 0) return /* @__PURE__ */ x("span", {
|
|
4652
4672
|
title: r,
|
|
4653
|
-
children: ["in ",
|
|
4673
|
+
children: ["in ", w(n, /* @__PURE__ */ new Date(), { addSuffix: !1 })]
|
|
4654
4674
|
});
|
|
4655
|
-
if (i <= Ga) return /* @__PURE__ */
|
|
4675
|
+
if (i <= Ga) return /* @__PURE__ */ b("span", {
|
|
4656
4676
|
title: r,
|
|
4657
|
-
children: /* @__PURE__ */
|
|
4677
|
+
children: /* @__PURE__ */ b(k, {
|
|
4658
4678
|
tone: "slate",
|
|
4659
4679
|
size: "xs",
|
|
4660
4680
|
children: "due"
|
|
4661
4681
|
})
|
|
4662
4682
|
});
|
|
4663
|
-
let a =
|
|
4664
|
-
return /* @__PURE__ */
|
|
4683
|
+
let a = w(n, /* @__PURE__ */ new Date(), { addSuffix: !1 });
|
|
4684
|
+
return /* @__PURE__ */ b("span", {
|
|
4665
4685
|
title: r,
|
|
4666
|
-
children: /* @__PURE__ */
|
|
4686
|
+
children: /* @__PURE__ */ x(k, {
|
|
4667
4687
|
tone: i <= Ka ? "amber" : "rose",
|
|
4668
4688
|
size: "xs",
|
|
4669
4689
|
children: ["overdue ", a]
|
|
@@ -4674,7 +4694,7 @@ var Ha = (e) => {
|
|
|
4674
4694
|
return (e, t = {}) => {
|
|
4675
4695
|
if (e == null || e === "") return "—";
|
|
4676
4696
|
let c = typeof e == "number" ? e : Number(e);
|
|
4677
|
-
if (!Number.isFinite(c)) return
|
|
4697
|
+
if (!Number.isFinite(c)) return I(e);
|
|
4678
4698
|
let l = i ? t[i] : void 0, u = typeof l == "string" && l !== "" ? l : r, d = `${n}:${u}:${a}:${o}`, f = s.get(d);
|
|
4679
4699
|
return f || (f = new Intl.NumberFormat(n, {
|
|
4680
4700
|
style: "currency",
|
|
@@ -4703,19 +4723,19 @@ var Za = (e) => {
|
|
|
4703
4723
|
let { field: t, entities: r, screens: i, refs: a, surface: o } = e, s = t.ref?.entity, c = s ? r?.[s] : void 0, l = typeof a == "function" ? a : () => a, u = o === "detail", d = c?.display?.icon, f = t.display?.ref_display_field || "$display", p = c?.detail_screen, m = (p ? i?.[p] : void 0)?.route;
|
|
4704
4724
|
return (e, t) => {
|
|
4705
4725
|
if (e == null || e === "") return "—";
|
|
4706
|
-
let r =
|
|
4726
|
+
let r = I(e), i = Qa(r, s, l(), f), a = m ? m.replace(":id", encodeURIComponent(r)) : void 0;
|
|
4707
4727
|
if (u) {
|
|
4708
|
-
let e = /* @__PURE__ */
|
|
4728
|
+
let e = /* @__PURE__ */ x(y, { children: [d && /* @__PURE__ */ b("span", {
|
|
4709
4729
|
style: {
|
|
4710
4730
|
color: "var(--text-3)",
|
|
4711
4731
|
display: "flex",
|
|
4712
4732
|
flexShrink: 0
|
|
4713
4733
|
},
|
|
4714
|
-
children: /* @__PURE__ */
|
|
4734
|
+
children: /* @__PURE__ */ b(n, {
|
|
4715
4735
|
name: d,
|
|
4716
4736
|
size: 13
|
|
4717
4737
|
})
|
|
4718
|
-
}), /* @__PURE__ */
|
|
4738
|
+
}), /* @__PURE__ */ b("span", {
|
|
4719
4739
|
style: {
|
|
4720
4740
|
overflow: "hidden",
|
|
4721
4741
|
textOverflow: "ellipsis",
|
|
@@ -4723,17 +4743,17 @@ var Za = (e) => {
|
|
|
4723
4743
|
},
|
|
4724
4744
|
children: i
|
|
4725
4745
|
})] });
|
|
4726
|
-
return a ? /* @__PURE__ */
|
|
4746
|
+
return a ? /* @__PURE__ */ b("a", {
|
|
4727
4747
|
href: a,
|
|
4728
4748
|
rel: "noopener noreferrer",
|
|
4729
4749
|
className: "detail-ref-chip",
|
|
4730
4750
|
children: e
|
|
4731
|
-
}) : /* @__PURE__ */
|
|
4751
|
+
}) : /* @__PURE__ */ b("span", {
|
|
4732
4752
|
className: "detail-ref-chip",
|
|
4733
4753
|
children: e
|
|
4734
4754
|
});
|
|
4735
4755
|
}
|
|
4736
|
-
return a ? /* @__PURE__ */
|
|
4756
|
+
return a ? /* @__PURE__ */ b("a", {
|
|
4737
4757
|
href: a,
|
|
4738
4758
|
rel: "noopener noreferrer",
|
|
4739
4759
|
style: {
|
|
@@ -4747,7 +4767,7 @@ var Za = (e) => {
|
|
|
4747
4767
|
};
|
|
4748
4768
|
function Qa(e, t, n, r) {
|
|
4749
4769
|
let i = t && n ? n[t]?.[e] : void 0;
|
|
4750
|
-
return i ?
|
|
4770
|
+
return i ? R(i, r, e) : e;
|
|
4751
4771
|
}
|
|
4752
4772
|
//#endregion
|
|
4753
4773
|
//#region src/components/fields/cells/factories/url-helpers.ts
|
|
@@ -4800,7 +4820,7 @@ function oo(e) {
|
|
|
4800
4820
|
//#endregion
|
|
4801
4821
|
//#region src/components/fields/cells/factories/host-icons.tsx
|
|
4802
4822
|
function so(e, t = "0 0 24 24") {
|
|
4803
|
-
return (n) => /* @__PURE__ */
|
|
4823
|
+
return (n) => /* @__PURE__ */ b("svg", {
|
|
4804
4824
|
width: 16,
|
|
4805
4825
|
height: 16,
|
|
4806
4826
|
viewBox: t,
|
|
@@ -4815,17 +4835,17 @@ function so(e, t = "0 0 24 24") {
|
|
|
4815
4835
|
children: e
|
|
4816
4836
|
});
|
|
4817
4837
|
}
|
|
4818
|
-
var co = so(/* @__PURE__ */
|
|
4838
|
+
var co = so(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
4819
4839
|
cx: "12",
|
|
4820
4840
|
cy: "12",
|
|
4821
4841
|
r: "9"
|
|
4822
|
-
}), /* @__PURE__ */
|
|
4842
|
+
}), /* @__PURE__ */ b("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), lo = () => /* @__PURE__ */ b(e, {
|
|
4823
4843
|
size: 16,
|
|
4824
4844
|
style: {
|
|
4825
4845
|
flexShrink: 0,
|
|
4826
4846
|
color: "#0A66C2"
|
|
4827
4847
|
}
|
|
4828
|
-
}), uo = (e) => /* @__PURE__ */
|
|
4848
|
+
}), uo = (e) => /* @__PURE__ */ b("svg", {
|
|
4829
4849
|
width: 16,
|
|
4830
4850
|
height: 16,
|
|
4831
4851
|
viewBox: "0 0 24 24",
|
|
@@ -4833,8 +4853,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
|
|
|
4833
4853
|
"aria-hidden": "true",
|
|
4834
4854
|
style: { flexShrink: 0 },
|
|
4835
4855
|
...e,
|
|
4836
|
-
children: /* @__PURE__ */
|
|
4837
|
-
}), fo = (e) => /* @__PURE__ */
|
|
4856
|
+
children: /* @__PURE__ */ b("path", { d: "M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.21.7-3.89-1.55-3.89-1.55-.52-1.34-1.28-1.7-1.28-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.2 1.77 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.3 1.19-3.11-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.19a11.05 11.05 0 0 1 5.79 0c2.21-1.5 3.18-1.19 3.18-1.19.63 1.59.23 2.76.11 3.05.74.81 1.19 1.85 1.19 3.11 0 4.44-2.71 5.42-5.29 5.7.41.36.78 1.07.78 2.16 0 1.56-.01 2.81-.01 3.19 0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5z" })
|
|
4857
|
+
}), fo = (e) => /* @__PURE__ */ b("svg", {
|
|
4838
4858
|
width: 16,
|
|
4839
4859
|
height: 16,
|
|
4840
4860
|
viewBox: "0 0 24 24",
|
|
@@ -4842,8 +4862,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
|
|
|
4842
4862
|
"aria-hidden": "true",
|
|
4843
4863
|
style: { flexShrink: 0 },
|
|
4844
4864
|
...e,
|
|
4845
|
-
children: /* @__PURE__ */
|
|
4846
|
-
}), po = (e) => /* @__PURE__ */
|
|
4865
|
+
children: /* @__PURE__ */ b("path", { d: "M18.244 2H21.5l-7.62 8.71L23 22h-7.05l-5.52-7.21L4.07 22H.81l8.18-9.34L1 2h7.22l5 6.59L18.244 2zm-2.47 18h1.95L7.32 4h-2.1l10.55 16z" })
|
|
4866
|
+
}), po = (e) => /* @__PURE__ */ b("svg", {
|
|
4847
4867
|
width: 16,
|
|
4848
4868
|
height: 16,
|
|
4849
4869
|
viewBox: "0 0 24 24",
|
|
@@ -4851,8 +4871,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
|
|
|
4851
4871
|
"aria-hidden": "true",
|
|
4852
4872
|
style: { flexShrink: 0 },
|
|
4853
4873
|
...e,
|
|
4854
|
-
children: /* @__PURE__ */
|
|
4855
|
-
}), mo = (e) => /* @__PURE__ */
|
|
4874
|
+
children: /* @__PURE__ */ b("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2C0 8.1 0 12 0 12s0 3.9.5 5.8a3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1c.5-1.9.5-5.8.5-5.8s0-3.9-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z" })
|
|
4875
|
+
}), mo = (e) => /* @__PURE__ */ b("svg", {
|
|
4856
4876
|
width: 16,
|
|
4857
4877
|
height: 16,
|
|
4858
4878
|
viewBox: "0 0 24 24",
|
|
@@ -4860,8 +4880,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
|
|
|
4860
4880
|
"aria-hidden": "true",
|
|
4861
4881
|
style: { flexShrink: 0 },
|
|
4862
4882
|
...e,
|
|
4863
|
-
children: /* @__PURE__ */
|
|
4864
|
-
}), ho = (e) => /* @__PURE__ */
|
|
4883
|
+
children: /* @__PURE__ */ b("path", { d: "M24 5.45v13.1A1.45 1.45 0 0 1 22.55 20H19.5V9.27L12 14.7 4.5 9.27V20H1.45A1.45 1.45 0 0 1 0 18.55V5.45A1.45 1.45 0 0 1 1.45 4h.5l10.05 7.27L22.05 4h.5A1.45 1.45 0 0 1 24 5.45z" })
|
|
4884
|
+
}), ho = (e) => /* @__PURE__ */ x("svg", {
|
|
4865
4885
|
width: 16,
|
|
4866
4886
|
height: 16,
|
|
4867
4887
|
viewBox: "0 0 24 24",
|
|
@@ -4869,24 +4889,24 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
|
|
|
4869
4889
|
style: { flexShrink: 0 },
|
|
4870
4890
|
...e,
|
|
4871
4891
|
children: [
|
|
4872
|
-
/* @__PURE__ */
|
|
4892
|
+
/* @__PURE__ */ b("path", {
|
|
4873
4893
|
fill: "#E01E5A",
|
|
4874
4894
|
d: "M5.04 15.12a2.52 2.52 0 1 1-2.52-2.52h2.52v2.52zm1.27 0a2.52 2.52 0 1 1 5.04 0v6.32a2.52 2.52 0 1 1-5.04 0v-6.32z"
|
|
4875
4895
|
}),
|
|
4876
|
-
/* @__PURE__ */
|
|
4896
|
+
/* @__PURE__ */ b("path", {
|
|
4877
4897
|
fill: "#36C5F0",
|
|
4878
4898
|
d: "M8.83 5.04a2.52 2.52 0 1 1 2.52-2.52v2.52H8.83zm0 1.27a2.52 2.52 0 1 1 0 5.04H2.52a2.52 2.52 0 1 1 0-5.04h6.31z"
|
|
4879
4899
|
}),
|
|
4880
|
-
/* @__PURE__ */
|
|
4900
|
+
/* @__PURE__ */ b("path", {
|
|
4881
4901
|
fill: "#2EB67D",
|
|
4882
4902
|
d: "M18.96 8.83a2.52 2.52 0 1 1 2.52 2.52h-2.52V8.83zm-1.27 0a2.52 2.52 0 1 1-5.04 0V2.52a2.52 2.52 0 1 1 5.04 0v6.31z"
|
|
4883
4903
|
}),
|
|
4884
|
-
/* @__PURE__ */
|
|
4904
|
+
/* @__PURE__ */ b("path", {
|
|
4885
4905
|
fill: "#ECB22E",
|
|
4886
4906
|
d: "M15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zm0-1.27a2.52 2.52 0 1 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"
|
|
4887
4907
|
})
|
|
4888
4908
|
]
|
|
4889
|
-
}), go = (e) => /* @__PURE__ */
|
|
4909
|
+
}), go = (e) => /* @__PURE__ */ b("svg", {
|
|
4890
4910
|
width: 16,
|
|
4891
4911
|
height: 16,
|
|
4892
4912
|
viewBox: "0 0 24 24",
|
|
@@ -4894,7 +4914,7 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
|
|
|
4894
4914
|
"aria-hidden": "true",
|
|
4895
4915
|
style: { flexShrink: 0 },
|
|
4896
4916
|
...e,
|
|
4897
|
-
children: /* @__PURE__ */
|
|
4917
|
+
children: /* @__PURE__ */ b("path", { d: "M4.46 3.83 14.94 3a3.7 3.7 0 0 1 2.5.62l3 2.16a1.4 1.4 0 0 1 .56 1.31v13.06a1.7 1.7 0 0 1-1.66 1.7l-12.5.78a2.4 2.4 0 0 1-1.85-.62L2.5 19.7a1.7 1.7 0 0 1-.5-1.2V5.16c0-.74.6-1.27 1.46-1.33l1-.01zm.46 1.86c-.31 0-.46.16-.46.47v12.25c0 .31.16.47.46.47l11.62-.7c.31 0 .46-.16.46-.47V6c0-.32-.16-.47-.46-.47L4.92 5.7zm5.57 2.32c.16 0 .31.16.31.31v.46l3.7.23c.31 0 .46.16.46.47v8.32c0 .31-.16.47-.46.47l-3.7.23c-.31 0-.46-.16-.46-.47V8.78c0-.16.15-.32.15-.46l-.04-.31z" })
|
|
4898
4918
|
}), _o = {
|
|
4899
4919
|
"linkedin.com": lo,
|
|
4900
4920
|
"github.com": uo,
|
|
@@ -4919,15 +4939,15 @@ var yo = {
|
|
|
4919
4939
|
};
|
|
4920
4940
|
function bo({ domain: e, source: t }) {
|
|
4921
4941
|
let n = e ? e.toLowerCase() : "", r = n ? _o[n] : void 0;
|
|
4922
|
-
if (r) return /* @__PURE__ */
|
|
4942
|
+
if (r) return /* @__PURE__ */ b(r, {});
|
|
4923
4943
|
let i = vo(n, t);
|
|
4924
|
-
return i ? /* @__PURE__ */
|
|
4944
|
+
return i ? /* @__PURE__ */ b(xo, { src: i }) : /* @__PURE__ */ b(co, {});
|
|
4925
4945
|
}
|
|
4926
4946
|
function xo({ src: e }) {
|
|
4927
4947
|
let [t, n] = p(!1);
|
|
4928
4948
|
return l(() => {
|
|
4929
4949
|
n(!1);
|
|
4930
|
-
}, [e]), t ? /* @__PURE__ */
|
|
4950
|
+
}, [e]), t ? /* @__PURE__ */ b(co, {}) : /* @__PURE__ */ b("img", {
|
|
4931
4951
|
src: e,
|
|
4932
4952
|
alt: "",
|
|
4933
4953
|
width: 16,
|
|
@@ -4939,7 +4959,7 @@ function xo({ src: e }) {
|
|
|
4939
4959
|
onError: () => n(!0)
|
|
4940
4960
|
});
|
|
4941
4961
|
}
|
|
4942
|
-
var
|
|
4962
|
+
var $ = /* @__PURE__ */ b("span", {
|
|
4943
4963
|
style: {
|
|
4944
4964
|
fontSize: 12.5,
|
|
4945
4965
|
color: "var(--text-4)"
|
|
@@ -4955,15 +4975,15 @@ var Q = /* @__PURE__ */ y("span", {
|
|
|
4955
4975
|
}, Co = { fontSize: 12.5 }, wo = (e) => {
|
|
4956
4976
|
let n = e.field.display?.favicon_source ?? "google";
|
|
4957
4977
|
return (e) => {
|
|
4958
|
-
let r = e == null ? "" :
|
|
4959
|
-
if (!r) return
|
|
4978
|
+
let r = e == null ? "" : I(e);
|
|
4979
|
+
if (!r) return $;
|
|
4960
4980
|
let i = ro(r);
|
|
4961
|
-
if (i == null || !oo(i)) return /* @__PURE__ */
|
|
4981
|
+
if (i == null || !oo(i)) return /* @__PURE__ */ b("span", {
|
|
4962
4982
|
style: Co,
|
|
4963
4983
|
children: r
|
|
4964
4984
|
});
|
|
4965
4985
|
let a = io(i), o = ao(i, a ?? "") ?? a ?? r;
|
|
4966
|
-
return /* @__PURE__ */
|
|
4986
|
+
return /* @__PURE__ */ x("a", {
|
|
4967
4987
|
href: i,
|
|
4968
4988
|
target: "_blank",
|
|
4969
4989
|
rel: "noopener noreferrer",
|
|
@@ -4971,12 +4991,12 @@ var Q = /* @__PURE__ */ y("span", {
|
|
|
4971
4991
|
className: "mono",
|
|
4972
4992
|
style: So,
|
|
4973
4993
|
children: [
|
|
4974
|
-
/* @__PURE__ */
|
|
4994
|
+
/* @__PURE__ */ b(bo, {
|
|
4975
4995
|
domain: a,
|
|
4976
4996
|
source: n
|
|
4977
4997
|
}),
|
|
4978
4998
|
o,
|
|
4979
|
-
/* @__PURE__ */
|
|
4999
|
+
/* @__PURE__ */ b(t.external, { size: 11 })
|
|
4980
5000
|
]
|
|
4981
5001
|
});
|
|
4982
5002
|
};
|
|
@@ -4985,27 +5005,27 @@ var Q = /* @__PURE__ */ y("span", {
|
|
|
4985
5005
|
color: "var(--accent)",
|
|
4986
5006
|
textDecoration: "none"
|
|
4987
5007
|
}, Eo = () => (e) => {
|
|
4988
|
-
let t = e == null ? "" :
|
|
4989
|
-
return t ? /* @__PURE__ */
|
|
5008
|
+
let t = e == null ? "" : I(e);
|
|
5009
|
+
return t ? /* @__PURE__ */ b("a", {
|
|
4990
5010
|
href: `mailto:${t}`,
|
|
4991
5011
|
className: "mono",
|
|
4992
5012
|
style: To,
|
|
4993
5013
|
children: t
|
|
4994
|
-
}) :
|
|
5014
|
+
}) : $;
|
|
4995
5015
|
}, Do = {
|
|
4996
5016
|
fontSize: 12.5,
|
|
4997
5017
|
color: "var(--accent)",
|
|
4998
5018
|
textDecoration: "none"
|
|
4999
5019
|
}, Oo = { fontSize: 12.5 }, ko = /^[+()\-.\s\d]+$/, Ao = () => (e) => {
|
|
5000
|
-
let t = e == null ? "" :
|
|
5001
|
-
if (!t) return
|
|
5020
|
+
let t = e == null ? "" : I(e);
|
|
5021
|
+
if (!t) return $;
|
|
5002
5022
|
let n = t.trim();
|
|
5003
|
-
return ko.test(n) ? /* @__PURE__ */
|
|
5023
|
+
return ko.test(n) ? /* @__PURE__ */ b("a", {
|
|
5004
5024
|
href: `tel:${n.replace(/\s+/g, "")}`,
|
|
5005
5025
|
className: "mono",
|
|
5006
5026
|
style: Do,
|
|
5007
5027
|
children: t
|
|
5008
|
-
}) : /* @__PURE__ */
|
|
5028
|
+
}) : /* @__PURE__ */ b("span", {
|
|
5009
5029
|
style: Oo,
|
|
5010
5030
|
children: t
|
|
5011
5031
|
});
|
|
@@ -5031,29 +5051,29 @@ function Po(e, t) {
|
|
|
5031
5051
|
var Fo = (e) => {
|
|
5032
5052
|
let { field: t, fieldName: n, locale: r = "en" } = e, i = new Intl.NumberFormat(r), a = t.type === "decimal", o = t.unit ? t.unit.display || t.unit.storage : void 0;
|
|
5033
5053
|
return (e, t) => {
|
|
5034
|
-
if (e == null) return
|
|
5054
|
+
if (e == null) return $;
|
|
5035
5055
|
let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
|
|
5036
5056
|
if (a && typeof e == "string") s = Po(e, i);
|
|
5037
5057
|
else {
|
|
5038
5058
|
let t = typeof e == "number" ? e : Number(e);
|
|
5039
5059
|
s = Number.isFinite(t) ? i.format(t) : null;
|
|
5040
5060
|
}
|
|
5041
|
-
return s == null ? /* @__PURE__ */
|
|
5061
|
+
return s == null ? /* @__PURE__ */ b("span", {
|
|
5042
5062
|
style: No,
|
|
5043
5063
|
children: "—"
|
|
5044
|
-
}) : /* @__PURE__ */
|
|
5064
|
+
}) : /* @__PURE__ */ x("span", {
|
|
5045
5065
|
className: "num",
|
|
5046
5066
|
style: jo,
|
|
5047
|
-
children: [s, r && /* @__PURE__ */
|
|
5067
|
+
children: [s, r && /* @__PURE__ */ b("span", {
|
|
5048
5068
|
style: Mo,
|
|
5049
5069
|
children: r
|
|
5050
5070
|
})]
|
|
5051
5071
|
});
|
|
5052
5072
|
};
|
|
5053
|
-
}, Io = { fontSize: 12.5 }, Lo = () => (e) => e == null || e === "" ?
|
|
5073
|
+
}, Io = { fontSize: 12.5 }, Lo = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ b("code", {
|
|
5054
5074
|
className: "mono",
|
|
5055
5075
|
style: Io,
|
|
5056
|
-
children:
|
|
5076
|
+
children: I(e)
|
|
5057
5077
|
}), Ro = {
|
|
5058
5078
|
display: "inline-flex",
|
|
5059
5079
|
alignItems: "center",
|
|
@@ -5062,20 +5082,20 @@ var Fo = (e) => {
|
|
|
5062
5082
|
color: "var(--accent)",
|
|
5063
5083
|
textDecoration: "none"
|
|
5064
5084
|
}, zo = { fontSize: 12.5 }, Bo = () => (e) => {
|
|
5065
|
-
let n = e == null ? "" :
|
|
5066
|
-
if (!n) return
|
|
5085
|
+
let n = e == null ? "" : I(e);
|
|
5086
|
+
if (!n) return $;
|
|
5067
5087
|
let r = ro(n);
|
|
5068
|
-
return r == null || !oo(r) ? /* @__PURE__ */
|
|
5088
|
+
return r == null || !oo(r) ? /* @__PURE__ */ b("span", {
|
|
5069
5089
|
style: zo,
|
|
5070
5090
|
children: n
|
|
5071
|
-
}) : /* @__PURE__ */
|
|
5091
|
+
}) : /* @__PURE__ */ x("a", {
|
|
5072
5092
|
href: r,
|
|
5073
5093
|
target: "_blank",
|
|
5074
5094
|
rel: "noopener noreferrer",
|
|
5075
5095
|
title: n,
|
|
5076
5096
|
className: "mono",
|
|
5077
5097
|
style: Ro,
|
|
5078
|
-
children: [n, /* @__PURE__ */
|
|
5098
|
+
children: [n, /* @__PURE__ */ b(t.external, { size: 11 })]
|
|
5079
5099
|
});
|
|
5080
5100
|
}, Vo = 400, Ho = 2e3;
|
|
5081
5101
|
function Uo(e) {
|
|
@@ -5088,7 +5108,7 @@ function Go(e, t, n, r = 0) {
|
|
|
5088
5108
|
if (e == null || e === "") return "";
|
|
5089
5109
|
if (typeof e == "string") return Wo(e, t);
|
|
5090
5110
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
5091
|
-
if (typeof e != "object") return Wo(
|
|
5111
|
+
if (typeof e != "object") return Wo(I(e), t);
|
|
5092
5112
|
if (n.has(e)) return "[Circular]";
|
|
5093
5113
|
if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
|
|
5094
5114
|
n.add(e);
|
|
@@ -5113,16 +5133,16 @@ function Ko(e, t) {
|
|
|
5113
5133
|
var qo = (e) => {
|
|
5114
5134
|
let t = e.surface ?? "detail", n = Uo(e.field.display?.list_preview?.max_chars);
|
|
5115
5135
|
return (r) => {
|
|
5116
|
-
if (Li(r)) return
|
|
5136
|
+
if (Li(r)) return $;
|
|
5117
5137
|
if (t === "list") {
|
|
5118
5138
|
let e = Ko(r, n);
|
|
5119
|
-
return /* @__PURE__ */
|
|
5139
|
+
return /* @__PURE__ */ b("span", {
|
|
5120
5140
|
className: "font-mono text-xs text-muted-foreground",
|
|
5121
5141
|
title: e,
|
|
5122
5142
|
children: e
|
|
5123
5143
|
});
|
|
5124
5144
|
}
|
|
5125
|
-
return /* @__PURE__ */
|
|
5145
|
+
return /* @__PURE__ */ b(Ri, {
|
|
5126
5146
|
field: e.field,
|
|
5127
5147
|
fieldName: e.fieldName,
|
|
5128
5148
|
value: r,
|
|
@@ -5211,21 +5231,21 @@ function Yo(e) {
|
|
|
5211
5231
|
//#endregion
|
|
5212
5232
|
//#region src/components/fields/cells/factories/markdown.tsx
|
|
5213
5233
|
function Xo(e) {
|
|
5214
|
-
return /* @__PURE__ */
|
|
5234
|
+
return /* @__PURE__ */ b(Jr, { content: e });
|
|
5215
5235
|
}
|
|
5216
5236
|
var Zo = (e) => {
|
|
5217
5237
|
let t = e.surface === "list";
|
|
5218
5238
|
return (e) => {
|
|
5219
|
-
let n = e == null ? "" :
|
|
5220
|
-
if (!n) return
|
|
5239
|
+
let n = e == null ? "" : I(e);
|
|
5240
|
+
if (!n) return $;
|
|
5221
5241
|
if (!t) return Xo(n);
|
|
5222
5242
|
let { text: r, isPlain: i } = Yo(n);
|
|
5223
|
-
return i ? /* @__PURE__ */
|
|
5243
|
+
return i ? /* @__PURE__ */ b("span", {
|
|
5224
5244
|
title: r,
|
|
5225
5245
|
children: r
|
|
5226
|
-
}) : /* @__PURE__ */
|
|
5246
|
+
}) : /* @__PURE__ */ b(se, {
|
|
5227
5247
|
content: Xo(n),
|
|
5228
|
-
children: /* @__PURE__ */
|
|
5248
|
+
children: /* @__PURE__ */ b("span", {
|
|
5229
5249
|
title: r,
|
|
5230
5250
|
children: r
|
|
5231
5251
|
})
|
|
@@ -5238,18 +5258,18 @@ var Zo = (e) => {
|
|
|
5238
5258
|
fontSize: 12.5,
|
|
5239
5259
|
color: "var(--text-4)",
|
|
5240
5260
|
fontStyle: "italic"
|
|
5241
|
-
}, ts = () => (e) => e === Qo || typeof e == "string" && e !== "" ? /* @__PURE__ */
|
|
5261
|
+
}, ts = () => (e) => e === Qo || typeof e == "string" && e !== "" ? /* @__PURE__ */ b("span", {
|
|
5242
5262
|
className: "mono",
|
|
5243
5263
|
style: $o,
|
|
5244
5264
|
children: Qo
|
|
5245
|
-
}) : /* @__PURE__ */
|
|
5265
|
+
}) : /* @__PURE__ */ b("span", {
|
|
5246
5266
|
style: es,
|
|
5247
5267
|
children: "Not set"
|
|
5248
5268
|
});
|
|
5249
5269
|
//#endregion
|
|
5250
5270
|
//#region src/components/fields/cells/factories/richTextPreview.tsx
|
|
5251
5271
|
function ns(e, t) {
|
|
5252
|
-
return /* @__PURE__ */
|
|
5272
|
+
return /* @__PURE__ */ b(Jr, {
|
|
5253
5273
|
content: e,
|
|
5254
5274
|
files: t
|
|
5255
5275
|
});
|
|
@@ -5258,15 +5278,15 @@ var rs = (e) => {
|
|
|
5258
5278
|
let { fieldName: t } = e, n = e.surface === "list";
|
|
5259
5279
|
return (e, r) => {
|
|
5260
5280
|
let i = r?.$files?.[t], a = na(e, i);
|
|
5261
|
-
if (!a.markdown) return
|
|
5281
|
+
if (!a.markdown) return $;
|
|
5262
5282
|
if (!n) return ns(a.markdown, a.files);
|
|
5263
5283
|
let { text: o, isPlain: s } = Yo(a.markdown);
|
|
5264
|
-
return s ? /* @__PURE__ */
|
|
5284
|
+
return s ? /* @__PURE__ */ b("span", {
|
|
5265
5285
|
title: o,
|
|
5266
5286
|
children: o
|
|
5267
|
-
}) : /* @__PURE__ */
|
|
5287
|
+
}) : /* @__PURE__ */ b(se, {
|
|
5268
5288
|
content: ns(a.markdown, a.files),
|
|
5269
|
-
children: /* @__PURE__ */
|
|
5289
|
+
children: /* @__PURE__ */ b("span", {
|
|
5270
5290
|
title: o,
|
|
5271
5291
|
children: o
|
|
5272
5292
|
})
|
|
@@ -5312,20 +5332,20 @@ var cs = {
|
|
|
5312
5332
|
let { field: t, locale: n } = e, r = t.type === "multilang_text";
|
|
5313
5333
|
return (e) => {
|
|
5314
5334
|
let t = ss(os(e), n);
|
|
5315
|
-
if (!t) return r ? /* @__PURE__ */
|
|
5335
|
+
if (!t) return r ? /* @__PURE__ */ b("p", {
|
|
5316
5336
|
style: as,
|
|
5317
5337
|
children: "—"
|
|
5318
|
-
}) : /* @__PURE__ */
|
|
5338
|
+
}) : /* @__PURE__ */ b("span", {
|
|
5319
5339
|
style: is,
|
|
5320
5340
|
children: "—"
|
|
5321
5341
|
});
|
|
5322
5342
|
let [i, a] = t;
|
|
5323
|
-
return r ? /* @__PURE__ */
|
|
5343
|
+
return r ? /* @__PURE__ */ b("p", {
|
|
5324
5344
|
style: as,
|
|
5325
5345
|
lang: i,
|
|
5326
5346
|
dir: "auto",
|
|
5327
5347
|
children: a
|
|
5328
|
-
}) : /* @__PURE__ */
|
|
5348
|
+
}) : /* @__PURE__ */ b("span", {
|
|
5329
5349
|
style: is,
|
|
5330
5350
|
lang: i,
|
|
5331
5351
|
dir: "auto",
|
|
@@ -5373,11 +5393,11 @@ var us = {
|
|
|
5373
5393
|
};
|
|
5374
5394
|
for (let e of ni) if (!us[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
|
|
5375
5395
|
function ds(e) {
|
|
5376
|
-
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */
|
|
5396
|
+
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ b(Ui, { ...e });
|
|
5377
5397
|
if (e.mode === "edit") {
|
|
5378
5398
|
let t = us[e.field.type];
|
|
5379
5399
|
if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
|
|
5380
|
-
return /* @__PURE__ */
|
|
5400
|
+
return /* @__PURE__ */ b(t, { ...e });
|
|
5381
5401
|
}
|
|
5382
5402
|
if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
|
|
5383
5403
|
return ls({
|
|
@@ -5400,7 +5420,7 @@ function ps() {
|
|
|
5400
5420
|
if (e) return e.split("-")[0] || void 0;
|
|
5401
5421
|
}
|
|
5402
5422
|
function ms() {
|
|
5403
|
-
let e = Un((e) => e.user), { data: t } =
|
|
5423
|
+
let e = Un((e) => e.user), { data: t } = Y(), n = e?.language;
|
|
5404
5424
|
if (n && n.trim()) return n;
|
|
5405
5425
|
let r = t?.languages?.[0]?.code;
|
|
5406
5426
|
return r && r.trim() ? r : ps() || fs;
|
|
@@ -5418,73 +5438,73 @@ function _s(e) {
|
|
|
5418
5438
|
}
|
|
5419
5439
|
//#endregion
|
|
5420
5440
|
//#region src/lib/ui-actions.ts
|
|
5421
|
-
var vs = /\$\{\s*([^}]+?)\s*\}/g, ys = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/,
|
|
5422
|
-
function
|
|
5441
|
+
var vs = /\$\{\s*([^}]+?)\s*\}/g, ys = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/, bs = Symbol("unresolved");
|
|
5442
|
+
function xs(e, t) {
|
|
5423
5443
|
let n = e.match(ys);
|
|
5424
5444
|
if (n) {
|
|
5425
|
-
let r =
|
|
5426
|
-
return r ===
|
|
5445
|
+
let r = Ss(n[1], t);
|
|
5446
|
+
return r === bs ? e : r;
|
|
5427
5447
|
}
|
|
5428
5448
|
return e.replace(vs, (e, n) => {
|
|
5429
|
-
let r =
|
|
5430
|
-
return r ===
|
|
5449
|
+
let r = Ss(n, t);
|
|
5450
|
+
return r === bs ? e : I(r);
|
|
5431
5451
|
});
|
|
5432
5452
|
}
|
|
5433
|
-
function
|
|
5453
|
+
function Ss(e, t) {
|
|
5434
5454
|
if (e === "now") return di();
|
|
5435
5455
|
let [n, ...r] = e.split(".");
|
|
5436
|
-
if (n === "row") return !t.row || r.length === 0 ?
|
|
5456
|
+
if (n === "row") return !t.row || r.length === 0 ? bs : Cs(t.row, r);
|
|
5437
5457
|
if (n === "field" && r.length >= 2) {
|
|
5438
5458
|
let [e, t] = r, n = _s(e);
|
|
5439
|
-
return n ? n.getField(t) :
|
|
5459
|
+
return n ? n.getField(t) : bs;
|
|
5440
5460
|
}
|
|
5441
|
-
return n === "params" ? !t.params || r.length === 0 ?
|
|
5461
|
+
return n === "params" ? !t.params || r.length === 0 ? bs : Cs(t.params, r) : bs;
|
|
5442
5462
|
}
|
|
5443
|
-
function
|
|
5463
|
+
function Cs(e, t) {
|
|
5444
5464
|
return t.reduce((e, t) => {
|
|
5445
5465
|
if (e && typeof e == "object") return e[t];
|
|
5446
5466
|
}, e);
|
|
5447
5467
|
}
|
|
5448
|
-
async function
|
|
5468
|
+
async function ws(e, t) {
|
|
5449
5469
|
for (let n of e) try {
|
|
5450
|
-
await
|
|
5470
|
+
await Ts(n, t);
|
|
5451
5471
|
} catch (e) {
|
|
5452
5472
|
let t = e instanceof Error ? e.message : String(e);
|
|
5453
|
-
|
|
5473
|
+
Z.error(`ui_step failed: ${t}`);
|
|
5454
5474
|
return;
|
|
5455
5475
|
}
|
|
5456
5476
|
}
|
|
5457
|
-
async function
|
|
5477
|
+
async function Ts(e, t) {
|
|
5458
5478
|
if (e.copy_to_clipboard != null) {
|
|
5459
|
-
let n =
|
|
5479
|
+
let n = Ds(e.copy_to_clipboard, t);
|
|
5460
5480
|
await navigator.clipboard.writeText(n);
|
|
5461
5481
|
return;
|
|
5462
5482
|
}
|
|
5463
5483
|
if (e.set_field) {
|
|
5464
|
-
let { target: n, value: r } = e.set_field, { region: i, field: a } =
|
|
5484
|
+
let { target: n, value: r } = e.set_field, { region: i, field: a } = Os(n), o = _s(i);
|
|
5465
5485
|
if (!o) throw Error(`region "${i}" not registered`);
|
|
5466
|
-
o.setField(a,
|
|
5486
|
+
o.setField(a, Es(r, t));
|
|
5467
5487
|
return;
|
|
5468
5488
|
}
|
|
5469
5489
|
if (e.focus_field) {
|
|
5470
|
-
let { region: t, field: n } =
|
|
5490
|
+
let { region: t, field: n } = Os(e.focus_field), r = _s(t);
|
|
5471
5491
|
if (!r) throw Error(`region "${t}" not registered`);
|
|
5472
5492
|
r.focusField(n);
|
|
5473
5493
|
return;
|
|
5474
5494
|
}
|
|
5475
5495
|
if (e.show_toast) {
|
|
5476
|
-
let n =
|
|
5477
|
-
r === "success" ?
|
|
5496
|
+
let n = Ds(e.show_toast.message, t), r = e.show_toast.kind ?? "info";
|
|
5497
|
+
r === "success" ? Z.success(n) : r === "error" ? Z.error(n) : Z.info(n);
|
|
5478
5498
|
return;
|
|
5479
5499
|
}
|
|
5480
5500
|
}
|
|
5481
|
-
function Ts(e, t) {
|
|
5482
|
-
return typeof e == "string" ? bs(e, t) : e;
|
|
5483
|
-
}
|
|
5484
5501
|
function Es(e, t) {
|
|
5485
|
-
return
|
|
5502
|
+
return typeof e == "string" ? xs(e, t) : e;
|
|
5503
|
+
}
|
|
5504
|
+
function Ds(e, t) {
|
|
5505
|
+
return I(xs(e, t));
|
|
5486
5506
|
}
|
|
5487
|
-
function
|
|
5507
|
+
function Os(e) {
|
|
5488
5508
|
let t = e.indexOf(".");
|
|
5489
5509
|
if (t <= 0) throw Error(`invalid path "${e}" (expected "region.field")`);
|
|
5490
5510
|
return {
|
|
@@ -5492,12 +5512,12 @@ function Ds(e) {
|
|
|
5492
5512
|
field: e.slice(t + 1)
|
|
5493
5513
|
};
|
|
5494
5514
|
}
|
|
5495
|
-
function
|
|
5515
|
+
function ks(e) {
|
|
5496
5516
|
return !e.handler && !!e.ui_steps && e.ui_steps.length > 0;
|
|
5497
5517
|
}
|
|
5498
5518
|
//#endregion
|
|
5499
5519
|
//#region src/lib/mass-edit.ts
|
|
5500
|
-
function
|
|
5520
|
+
function As(e) {
|
|
5501
5521
|
if (!e) return [];
|
|
5502
5522
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5503
5523
|
for (let r of e.split(",")) {
|
|
@@ -5506,17 +5526,17 @@ function ks(e) {
|
|
|
5506
5526
|
}
|
|
5507
5527
|
return n;
|
|
5508
5528
|
}
|
|
5509
|
-
function
|
|
5529
|
+
function js(e, t) {
|
|
5510
5530
|
if (!e || !Ye(e, "update")) return [];
|
|
5511
|
-
let n = Array.isArray(t) ? t :
|
|
5531
|
+
let n = Array.isArray(t) ? t : As(t), r = n.length > 0 ? new Set(n) : null, i = ot(e), a = new Set(z(e)), o = r ? n : Ms(e, i, a), s = [];
|
|
5512
5532
|
for (let t of o) {
|
|
5513
5533
|
if (r && !r.has(t)) continue;
|
|
5514
|
-
let n =
|
|
5534
|
+
let n = Ns(e, t, i, a);
|
|
5515
5535
|
n && s.push(n);
|
|
5516
5536
|
}
|
|
5517
5537
|
return s;
|
|
5518
5538
|
}
|
|
5519
|
-
function
|
|
5539
|
+
function Ms(e, t, n) {
|
|
5520
5540
|
let r = [];
|
|
5521
5541
|
for (let [t, i] of e.fields) n.has(t) || i.auto || r.push(t);
|
|
5522
5542
|
if (!t) {
|
|
@@ -5525,7 +5545,7 @@ function js(e, t, n) {
|
|
|
5525
5545
|
}
|
|
5526
5546
|
return r;
|
|
5527
5547
|
}
|
|
5528
|
-
function
|
|
5548
|
+
function Ns(e, t, n, r) {
|
|
5529
5549
|
if (t.startsWith("$status.")) {
|
|
5530
5550
|
if (n) return null;
|
|
5531
5551
|
let r = t.slice(8), i = e.status_groups?.[r];
|
|
@@ -5533,7 +5553,7 @@ function Ms(e, t, n, r) {
|
|
|
5533
5553
|
code: t,
|
|
5534
5554
|
bare: r,
|
|
5535
5555
|
kind: "status",
|
|
5536
|
-
label:
|
|
5556
|
+
label: Ps(i.name, r),
|
|
5537
5557
|
statusGroup: i
|
|
5538
5558
|
} : null;
|
|
5539
5559
|
}
|
|
@@ -5544,7 +5564,7 @@ function Ms(e, t, n, r) {
|
|
|
5544
5564
|
code: t,
|
|
5545
5565
|
bare: r,
|
|
5546
5566
|
kind: "property",
|
|
5547
|
-
label:
|
|
5567
|
+
label: Ps(i.name, r),
|
|
5548
5568
|
property: i
|
|
5549
5569
|
} : null;
|
|
5550
5570
|
}
|
|
@@ -5554,18 +5574,18 @@ function Ms(e, t, n, r) {
|
|
|
5554
5574
|
code: t,
|
|
5555
5575
|
bare: t,
|
|
5556
5576
|
kind: "field",
|
|
5557
|
-
label:
|
|
5577
|
+
label: Ps(i.display?.name, t),
|
|
5558
5578
|
field: i
|
|
5559
5579
|
};
|
|
5560
5580
|
}
|
|
5561
|
-
function
|
|
5562
|
-
return e &&
|
|
5581
|
+
function Ps(e, t) {
|
|
5582
|
+
return e && L(e) || t;
|
|
5563
5583
|
}
|
|
5564
5584
|
//#endregion
|
|
5565
5585
|
//#region src/components/mass-edit/PropertyGridEditor.tsx
|
|
5566
|
-
var
|
|
5567
|
-
function
|
|
5568
|
-
let a = d(() =>
|
|
5586
|
+
var Fs = Symbol.for("declarion.mass-edit.multiple");
|
|
5587
|
+
function Is({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange: i }) {
|
|
5588
|
+
let a = d(() => js(e, t), [e, t]), o = d(() => Object.keys(r).map((e) => {
|
|
5569
5589
|
let t = a.find((t) => t.code === e);
|
|
5570
5590
|
return t ? {
|
|
5571
5591
|
target: t,
|
|
@@ -5575,8 +5595,8 @@ function Fs({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5575
5595
|
let e = new Set(o.map((e) => e.target.code));
|
|
5576
5596
|
return a.filter((t) => !e.has(t.code));
|
|
5577
5597
|
}, [o, a]), l = s((e) => {
|
|
5578
|
-
let t =
|
|
5579
|
-
a[e.code] = t ===
|
|
5598
|
+
let t = Vs(e, n), a = { ...r };
|
|
5599
|
+
a[e.code] = t === Fs ? void 0 : t, i(a);
|
|
5580
5600
|
}, [
|
|
5581
5601
|
r,
|
|
5582
5602
|
n,
|
|
@@ -5590,31 +5610,31 @@ function Fs({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5590
5610
|
let t = { ...r };
|
|
5591
5611
|
delete t[e], i(t);
|
|
5592
5612
|
}, [r, i]);
|
|
5593
|
-
return e ? /* @__PURE__ */
|
|
5613
|
+
return e ? /* @__PURE__ */ x("div", {
|
|
5594
5614
|
style: {
|
|
5595
5615
|
display: "flex",
|
|
5596
5616
|
flexDirection: "column",
|
|
5597
5617
|
gap: 8
|
|
5598
5618
|
},
|
|
5599
5619
|
children: [
|
|
5600
|
-
o.length === 0 && /* @__PURE__ */
|
|
5620
|
+
o.length === 0 && /* @__PURE__ */ b("div", {
|
|
5601
5621
|
style: {
|
|
5602
5622
|
fontSize: 12,
|
|
5603
5623
|
color: "var(--text-3)"
|
|
5604
5624
|
},
|
|
5605
5625
|
children: "No targets selected. Add a field, status, or property to edit across all selected rows."
|
|
5606
5626
|
}),
|
|
5607
|
-
o.map((e) => /* @__PURE__ */
|
|
5627
|
+
o.map((e) => /* @__PURE__ */ b(Ls, {
|
|
5608
5628
|
row: e,
|
|
5609
5629
|
onChange: (t) => u(e.target.code, t),
|
|
5610
5630
|
onRemove: () => f(e.target.code)
|
|
5611
5631
|
}, e.target.code)),
|
|
5612
|
-
/* @__PURE__ */
|
|
5632
|
+
/* @__PURE__ */ b(Bs, {
|
|
5613
5633
|
targets: c,
|
|
5614
5634
|
onPick: l
|
|
5615
5635
|
})
|
|
5616
5636
|
]
|
|
5617
|
-
}) : /* @__PURE__ */
|
|
5637
|
+
}) : /* @__PURE__ */ b("div", {
|
|
5618
5638
|
style: {
|
|
5619
5639
|
fontSize: 12,
|
|
5620
5640
|
color: "var(--text-3)"
|
|
@@ -5622,9 +5642,9 @@ function Fs({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5622
5642
|
children: "Entity schema unavailable. Mass edit requires an entity-bound action."
|
|
5623
5643
|
});
|
|
5624
5644
|
}
|
|
5625
|
-
function
|
|
5645
|
+
function Ls({ row: e, onChange: n, onRemove: r }) {
|
|
5626
5646
|
let { target: i } = e;
|
|
5627
|
-
return /* @__PURE__ */
|
|
5647
|
+
return /* @__PURE__ */ x("div", {
|
|
5628
5648
|
"data-testid": "mass-edit-row",
|
|
5629
5649
|
style: {
|
|
5630
5650
|
display: "grid",
|
|
@@ -5633,7 +5653,7 @@ function Is({ row: e, onChange: n, onRemove: r }) {
|
|
|
5633
5653
|
alignItems: "center"
|
|
5634
5654
|
},
|
|
5635
5655
|
children: [
|
|
5636
|
-
/* @__PURE__ */
|
|
5656
|
+
/* @__PURE__ */ b("div", {
|
|
5637
5657
|
style: {
|
|
5638
5658
|
fontSize: 12.5,
|
|
5639
5659
|
color: "var(--text-2)"
|
|
@@ -5641,28 +5661,28 @@ function Is({ row: e, onChange: n, onRemove: r }) {
|
|
|
5641
5661
|
title: i.code,
|
|
5642
5662
|
children: i.label
|
|
5643
5663
|
}),
|
|
5644
|
-
/* @__PURE__ */
|
|
5664
|
+
/* @__PURE__ */ b(Rs, {
|
|
5645
5665
|
row: e,
|
|
5646
5666
|
onChange: n
|
|
5647
5667
|
}),
|
|
5648
|
-
/* @__PURE__ */
|
|
5649
|
-
icon: /* @__PURE__ */
|
|
5668
|
+
/* @__PURE__ */ b(O, {
|
|
5669
|
+
icon: /* @__PURE__ */ b(t.x, { size: 12 }),
|
|
5650
5670
|
onClick: r,
|
|
5651
5671
|
title: "Remove target"
|
|
5652
5672
|
})
|
|
5653
5673
|
]
|
|
5654
5674
|
});
|
|
5655
5675
|
}
|
|
5656
|
-
function
|
|
5657
|
-
let { target: n } = e, r = ms(), i = e.value ===
|
|
5676
|
+
function Rs({ row: e, onChange: t }) {
|
|
5677
|
+
let { target: n } = e, r = ms(), i = e.value === Fs, a = i ? "<multiple values>" : void 0, o = i ? "" : e.value;
|
|
5658
5678
|
if (n.kind === "status" && n.statusGroup) {
|
|
5659
5679
|
let e = n.statusGroup.statuses.map((e) => ({
|
|
5660
5680
|
value: e.code,
|
|
5661
|
-
label:
|
|
5681
|
+
label: L(e.name) || e.code
|
|
5662
5682
|
}));
|
|
5663
|
-
return /* @__PURE__ */
|
|
5683
|
+
return /* @__PURE__ */ b("div", {
|
|
5664
5684
|
"data-testid": `value-${n.code}`,
|
|
5665
|
-
children: /* @__PURE__ */
|
|
5685
|
+
children: /* @__PURE__ */ b(F, {
|
|
5666
5686
|
value: typeof o == "string" ? o : "",
|
|
5667
5687
|
options: e,
|
|
5668
5688
|
onChange: t,
|
|
@@ -5670,8 +5690,8 @@ function Ls({ row: e, onChange: t }) {
|
|
|
5670
5690
|
})
|
|
5671
5691
|
});
|
|
5672
5692
|
}
|
|
5673
|
-
let s =
|
|
5674
|
-
return /* @__PURE__ */
|
|
5693
|
+
let s = zs(n);
|
|
5694
|
+
return /* @__PURE__ */ x("div", {
|
|
5675
5695
|
"data-testid": `value-${n.code}`,
|
|
5676
5696
|
style: { position: "relative" },
|
|
5677
5697
|
children: [ds({
|
|
@@ -5681,7 +5701,7 @@ function Ls({ row: e, onChange: t }) {
|
|
|
5681
5701
|
mode: "edit",
|
|
5682
5702
|
onChange: t,
|
|
5683
5703
|
locale: r
|
|
5684
|
-
}), a && /* @__PURE__ */
|
|
5704
|
+
}), a && /* @__PURE__ */ b("div", {
|
|
5685
5705
|
"data-testid": `multiple-values-${n.code}`,
|
|
5686
5706
|
style: {
|
|
5687
5707
|
fontSize: 11,
|
|
@@ -5693,7 +5713,7 @@ function Ls({ row: e, onChange: t }) {
|
|
|
5693
5713
|
})]
|
|
5694
5714
|
});
|
|
5695
5715
|
}
|
|
5696
|
-
function
|
|
5716
|
+
function zs(e) {
|
|
5697
5717
|
if (e.kind === "field" && e.field) return e.field;
|
|
5698
5718
|
if (e.kind === "property" && e.property) {
|
|
5699
5719
|
let t = e.property;
|
|
@@ -5708,15 +5728,15 @@ function Rs(e) {
|
|
|
5708
5728
|
}
|
|
5709
5729
|
return { type: "string" };
|
|
5710
5730
|
}
|
|
5711
|
-
function
|
|
5731
|
+
function Bs({ targets: e, onPick: n }) {
|
|
5712
5732
|
let [r, i] = p(!1);
|
|
5713
|
-
return e.length === 0 ? null : r ? /* @__PURE__ */
|
|
5733
|
+
return e.length === 0 ? null : r ? /* @__PURE__ */ b("div", {
|
|
5714
5734
|
"data-testid": "mass-edit-target-picker",
|
|
5715
5735
|
style: {
|
|
5716
5736
|
alignSelf: "flex-start",
|
|
5717
5737
|
minWidth: 220
|
|
5718
5738
|
},
|
|
5719
|
-
children: /* @__PURE__ */
|
|
5739
|
+
children: /* @__PURE__ */ b(F, {
|
|
5720
5740
|
value: "",
|
|
5721
5741
|
placeholder: "Select target...",
|
|
5722
5742
|
options: e.map((e) => ({
|
|
@@ -5728,14 +5748,14 @@ function zs({ targets: e, onPick: n }) {
|
|
|
5728
5748
|
r && n(r), i(!1);
|
|
5729
5749
|
}
|
|
5730
5750
|
})
|
|
5731
|
-
}) : /* @__PURE__ */
|
|
5751
|
+
}) : /* @__PURE__ */ x(D, {
|
|
5732
5752
|
kind: "ghost",
|
|
5733
5753
|
onClick: () => i(!0),
|
|
5734
5754
|
style: { alignSelf: "flex-start" },
|
|
5735
|
-
children: [/* @__PURE__ */
|
|
5755
|
+
children: [/* @__PURE__ */ b(t.plus, { size: 12 }), " Add target"]
|
|
5736
5756
|
});
|
|
5737
5757
|
}
|
|
5738
|
-
function
|
|
5758
|
+
function Vs(e, t) {
|
|
5739
5759
|
if (!t || t.length === 0 || e.kind !== "field") return;
|
|
5740
5760
|
let n, r = !1;
|
|
5741
5761
|
for (let i of t) {
|
|
@@ -5744,16 +5764,16 @@ function Bs(e, t) {
|
|
|
5744
5764
|
n = t, r = !0;
|
|
5745
5765
|
continue;
|
|
5746
5766
|
}
|
|
5747
|
-
if (n !== t) return
|
|
5767
|
+
if (n !== t) return Fs;
|
|
5748
5768
|
}
|
|
5749
5769
|
return n;
|
|
5750
5770
|
}
|
|
5751
5771
|
//#endregion
|
|
5752
5772
|
//#region src/components/shared/ActionDialog.tsx
|
|
5753
|
-
var
|
|
5754
|
-
function
|
|
5773
|
+
var Hs = /^\$row\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
|
|
5774
|
+
function Us(e, t) {
|
|
5755
5775
|
if (typeof e != "string") return e ?? "";
|
|
5756
|
-
let n = e.match(
|
|
5776
|
+
let n = e.match(Hs);
|
|
5757
5777
|
if (n) {
|
|
5758
5778
|
let r = n[1].split("."), i = t;
|
|
5759
5779
|
for (let e of r) {
|
|
@@ -5763,11 +5783,11 @@ function Hs(e, t) {
|
|
|
5763
5783
|
}
|
|
5764
5784
|
i = i[e];
|
|
5765
5785
|
}
|
|
5766
|
-
return i === void 0 ? (typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row is missing
|
|
5786
|
+
return i === void 0 ? ((t == null || !(r[0] in t)) && typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row is missing field '${r[0]}'`), "") : i ?? "";
|
|
5767
5787
|
}
|
|
5768
|
-
return
|
|
5788
|
+
return xs(e, { row: t });
|
|
5769
5789
|
}
|
|
5770
|
-
function
|
|
5790
|
+
function Ws(e) {
|
|
5771
5791
|
return {
|
|
5772
5792
|
type: e.type ?? "string",
|
|
5773
5793
|
required: e.required,
|
|
@@ -5777,21 +5797,22 @@ function Us(e) {
|
|
|
5777
5797
|
} : void 0,
|
|
5778
5798
|
enum: e.enum,
|
|
5779
5799
|
values: e.values,
|
|
5800
|
+
structure: e.structure,
|
|
5780
5801
|
ref: Ke(e.ref)
|
|
5781
5802
|
};
|
|
5782
5803
|
}
|
|
5783
|
-
function
|
|
5804
|
+
function Gs(e, t) {
|
|
5784
5805
|
if (!e.includes("${")) return e;
|
|
5785
|
-
let n =
|
|
5786
|
-
return n == null ? "" :
|
|
5806
|
+
let n = xs(e, { params: t });
|
|
5807
|
+
return n == null ? "" : I(n);
|
|
5787
5808
|
}
|
|
5788
|
-
var
|
|
5789
|
-
function
|
|
5809
|
+
var Ks = /\$\{\s*([^}]+?)\s*\}/g;
|
|
5810
|
+
function qs(e, t) {
|
|
5790
5811
|
let n = `params.${t}`;
|
|
5791
|
-
for (let t of e.matchAll(
|
|
5812
|
+
for (let t of e.matchAll(Ks)) if (t[1] === n) return !0;
|
|
5792
5813
|
return !1;
|
|
5793
5814
|
}
|
|
5794
|
-
function
|
|
5815
|
+
function Js({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
5795
5816
|
let i = d(() => {
|
|
5796
5817
|
let t = r ? Object.entries(r) : [];
|
|
5797
5818
|
return [{
|
|
@@ -5799,22 +5820,22 @@ function qs({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
|
5799
5820
|
label: e.required ? "Select status group…" : "—"
|
|
5800
5821
|
}, ...t.map(([e, t]) => ({
|
|
5801
5822
|
value: e,
|
|
5802
|
-
label:
|
|
5823
|
+
label: L(t.name) || e
|
|
5803
5824
|
}))];
|
|
5804
5825
|
}, [r, e.required]);
|
|
5805
|
-
return /* @__PURE__ */
|
|
5826
|
+
return /* @__PURE__ */ b(F, {
|
|
5806
5827
|
value: typeof t == "string" ? t : "",
|
|
5807
5828
|
options: i,
|
|
5808
5829
|
onChange: (e) => n(e),
|
|
5809
5830
|
placeholder: "Select status group…"
|
|
5810
5831
|
});
|
|
5811
5832
|
}
|
|
5812
|
-
function
|
|
5833
|
+
function Ys({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
5813
5834
|
let a = d(() => {
|
|
5814
5835
|
if (!r) return [];
|
|
5815
5836
|
let t = e.filter?.status_group;
|
|
5816
5837
|
if (t) {
|
|
5817
|
-
let e =
|
|
5838
|
+
let e = Gs(t, i);
|
|
5818
5839
|
return e && r[e] ? r[e].statuses : [];
|
|
5819
5840
|
}
|
|
5820
5841
|
return Object.values(r).flatMap((e) => e.statuses);
|
|
@@ -5827,26 +5848,26 @@ function Js({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
|
5827
5848
|
label: a.length === 0 ? "Select status group first" : "Select status…"
|
|
5828
5849
|
}, ...a.map((e) => ({
|
|
5829
5850
|
value: e.code,
|
|
5830
|
-
label:
|
|
5851
|
+
label: L(e.name) || e.code
|
|
5831
5852
|
}))], [a]);
|
|
5832
|
-
return /* @__PURE__ */
|
|
5853
|
+
return /* @__PURE__ */ b(F, {
|
|
5833
5854
|
value: typeof t == "string" ? t : "",
|
|
5834
5855
|
options: o,
|
|
5835
5856
|
onChange: (e) => n(e),
|
|
5836
5857
|
placeholder: "Select status…"
|
|
5837
5858
|
});
|
|
5838
5859
|
}
|
|
5839
|
-
function
|
|
5840
|
-
let { data: u } =
|
|
5860
|
+
function Xs({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, isPending: o, row: c, bulkSelection: l }) {
|
|
5861
|
+
let { data: u } = Y(), f = ms(), m = r.resolved_params, h = r.resolved_hidden_defaults ?? {}, g = d(() => m ? Array.from(m) : [], [m]), _ = d(() => {
|
|
5841
5862
|
if (!(!r.entity || !u)) return u.entities[r.entity]?.status_groups;
|
|
5842
|
-
}, [r.entity, u]),
|
|
5863
|
+
}, [r.entity, u]), v = d(() => {
|
|
5843
5864
|
if (!(!r.entity || !u)) return u.entities[r.entity];
|
|
5844
5865
|
}, [r.entity, u]), S = d(() => {
|
|
5845
|
-
if (
|
|
5846
|
-
for (let [e, t] of
|
|
5847
|
-
return
|
|
5866
|
+
if (v) {
|
|
5867
|
+
for (let [e, t] of v.fields) if (t.primary) return e;
|
|
5868
|
+
return v.primary_key?.[0];
|
|
5848
5869
|
}
|
|
5849
|
-
}, [
|
|
5870
|
+
}, [v]), [C, w] = p(s(() => {
|
|
5850
5871
|
let e = { ...h };
|
|
5851
5872
|
for (let [t, n] of g) {
|
|
5852
5873
|
if (n.type === "id_array") {
|
|
@@ -5858,11 +5879,11 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5858
5879
|
continue;
|
|
5859
5880
|
}
|
|
5860
5881
|
if (n.type === "bool") {
|
|
5861
|
-
let r =
|
|
5882
|
+
let r = Us(n.default, c);
|
|
5862
5883
|
e[t] = r === !0 || r === "true";
|
|
5863
5884
|
continue;
|
|
5864
5885
|
}
|
|
5865
|
-
e[t] =
|
|
5886
|
+
e[t] = Us(n.default, c);
|
|
5866
5887
|
}
|
|
5867
5888
|
return e;
|
|
5868
5889
|
}, [
|
|
@@ -5880,11 +5901,11 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5880
5901
|
for (let [t, n] of m) {
|
|
5881
5902
|
if (n.type !== "status") continue;
|
|
5882
5903
|
let i = n.filter?.status_group;
|
|
5883
|
-
i &&
|
|
5904
|
+
i && qs(i, e) && (r[t] = "");
|
|
5884
5905
|
}
|
|
5885
5906
|
return r;
|
|
5886
5907
|
});
|
|
5887
|
-
}, [m]),
|
|
5908
|
+
}, [m]), E = s(() => {
|
|
5888
5909
|
let e = { ...C };
|
|
5889
5910
|
for (let [t, n] of g) {
|
|
5890
5911
|
let r = C[t], i = r == null || r === "";
|
|
@@ -5897,7 +5918,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5897
5918
|
g,
|
|
5898
5919
|
a
|
|
5899
5920
|
]);
|
|
5900
|
-
return e ? /* @__PURE__ */
|
|
5921
|
+
return e ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
|
|
5901
5922
|
onClick: () => n(!1),
|
|
5902
5923
|
style: {
|
|
5903
5924
|
position: "fixed",
|
|
@@ -5906,7 +5927,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5906
5927
|
zIndex: 60,
|
|
5907
5928
|
backdropFilter: "blur(2px)"
|
|
5908
5929
|
}
|
|
5909
|
-
}), /* @__PURE__ */
|
|
5930
|
+
}), /* @__PURE__ */ x("div", {
|
|
5910
5931
|
"data-testid": "action-dialog",
|
|
5911
5932
|
role: "dialog",
|
|
5912
5933
|
"aria-modal": "true",
|
|
@@ -5930,7 +5951,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5930
5951
|
minWidth: 0
|
|
5931
5952
|
},
|
|
5932
5953
|
children: [
|
|
5933
|
-
/* @__PURE__ */
|
|
5954
|
+
/* @__PURE__ */ x("div", {
|
|
5934
5955
|
style: {
|
|
5935
5956
|
padding: "14px 18px",
|
|
5936
5957
|
display: "flex",
|
|
@@ -5938,7 +5959,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5938
5959
|
gap: 10
|
|
5939
5960
|
},
|
|
5940
5961
|
children: [
|
|
5941
|
-
/* @__PURE__ */
|
|
5962
|
+
/* @__PURE__ */ b("span", {
|
|
5942
5963
|
style: {
|
|
5943
5964
|
width: 28,
|
|
5944
5965
|
height: 28,
|
|
@@ -5950,36 +5971,36 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5950
5971
|
justifyContent: "center",
|
|
5951
5972
|
flexShrink: 0
|
|
5952
5973
|
},
|
|
5953
|
-
children: /* @__PURE__ */
|
|
5974
|
+
children: /* @__PURE__ */ b(t.bolt, { size: 15 })
|
|
5954
5975
|
}),
|
|
5955
|
-
/* @__PURE__ */
|
|
5976
|
+
/* @__PURE__ */ x("div", {
|
|
5956
5977
|
style: {
|
|
5957
5978
|
flex: 1,
|
|
5958
5979
|
minWidth: 0
|
|
5959
5980
|
},
|
|
5960
|
-
children: [/* @__PURE__ */
|
|
5981
|
+
children: [/* @__PURE__ */ b("div", {
|
|
5961
5982
|
style: {
|
|
5962
5983
|
fontSize: 14,
|
|
5963
5984
|
fontWeight: 600,
|
|
5964
5985
|
color: "var(--text)"
|
|
5965
5986
|
},
|
|
5966
5987
|
children: i
|
|
5967
|
-
}), /* @__PURE__ */
|
|
5988
|
+
}), /* @__PURE__ */ b("div", {
|
|
5968
5989
|
style: {
|
|
5969
5990
|
fontSize: 11.5,
|
|
5970
5991
|
color: "var(--text-3)",
|
|
5971
5992
|
marginTop: 2
|
|
5972
5993
|
},
|
|
5973
|
-
children:
|
|
5994
|
+
children: L(r.display?.description) || "Fill in the parameters below to execute this action."
|
|
5974
5995
|
})]
|
|
5975
5996
|
}),
|
|
5976
|
-
/* @__PURE__ */
|
|
5977
|
-
icon: /* @__PURE__ */
|
|
5997
|
+
/* @__PURE__ */ b(O, {
|
|
5998
|
+
icon: /* @__PURE__ */ b(t.x, { size: 14 }),
|
|
5978
5999
|
onClick: () => n(!1)
|
|
5979
6000
|
})
|
|
5980
6001
|
]
|
|
5981
6002
|
}),
|
|
5982
|
-
/* @__PURE__ */
|
|
6003
|
+
/* @__PURE__ */ b("div", {
|
|
5983
6004
|
style: {
|
|
5984
6005
|
padding: "12px 18px 16px",
|
|
5985
6006
|
display: "flex",
|
|
@@ -5990,60 +6011,60 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5990
6011
|
minHeight: 0
|
|
5991
6012
|
},
|
|
5992
6013
|
children: g.map(([e, t]) => {
|
|
5993
|
-
let n =
|
|
6014
|
+
let n = L(t.display?.name) || e;
|
|
5994
6015
|
if (t.type === "id_array") return null;
|
|
5995
6016
|
let r;
|
|
5996
6017
|
if (t.type === "entity_patch") {
|
|
5997
6018
|
let n = typeof t.filter?.targets == "string" ? t.filter.targets : void 0;
|
|
5998
|
-
r = /* @__PURE__ */
|
|
5999
|
-
entity:
|
|
6019
|
+
r = /* @__PURE__ */ b(Is, {
|
|
6020
|
+
entity: v,
|
|
6000
6021
|
filterTargets: n,
|
|
6001
6022
|
selectedRows: l,
|
|
6002
6023
|
value: C[e] ?? {},
|
|
6003
6024
|
onChange: (t) => T(e, t)
|
|
6004
6025
|
});
|
|
6005
|
-
} else r = t.type === "status_group" ? /* @__PURE__ */
|
|
6026
|
+
} else r = t.type === "status_group" ? /* @__PURE__ */ b(Js, {
|
|
6006
6027
|
param: t,
|
|
6007
6028
|
value: C[e],
|
|
6008
6029
|
onChange: (t) => T(e, t),
|
|
6009
6030
|
statusGroups: _,
|
|
6010
6031
|
formData: C
|
|
6011
|
-
}) : t.type === "status" ? /* @__PURE__ */
|
|
6032
|
+
}) : t.type === "status" ? /* @__PURE__ */ b(Ys, {
|
|
6012
6033
|
param: t,
|
|
6013
6034
|
value: C[e],
|
|
6014
6035
|
onChange: (t) => T(e, t),
|
|
6015
6036
|
statusGroups: _,
|
|
6016
6037
|
formData: C
|
|
6017
6038
|
}) : ds({
|
|
6018
|
-
field:
|
|
6039
|
+
field: Ws(t),
|
|
6019
6040
|
fieldName: e,
|
|
6020
6041
|
value: C[e],
|
|
6021
6042
|
mode: "edit",
|
|
6022
6043
|
onChange: (t) => T(e, t),
|
|
6023
6044
|
locale: f
|
|
6024
6045
|
});
|
|
6025
|
-
return /* @__PURE__ */
|
|
6046
|
+
return /* @__PURE__ */ x("div", {
|
|
6026
6047
|
style: { minWidth: 0 },
|
|
6027
6048
|
children: [
|
|
6028
|
-
/* @__PURE__ */
|
|
6049
|
+
/* @__PURE__ */ b(Ce, {
|
|
6029
6050
|
required: t.required,
|
|
6030
6051
|
children: n
|
|
6031
6052
|
}),
|
|
6032
6053
|
r,
|
|
6033
|
-
t.display?.description && /* @__PURE__ */
|
|
6054
|
+
t.display?.description && /* @__PURE__ */ b("p", {
|
|
6034
6055
|
style: {
|
|
6035
6056
|
fontSize: 11,
|
|
6036
6057
|
color: "var(--text-3)",
|
|
6037
6058
|
marginTop: 4,
|
|
6038
6059
|
marginBottom: 0
|
|
6039
6060
|
},
|
|
6040
|
-
children:
|
|
6061
|
+
children: L(t.display.description)
|
|
6041
6062
|
})
|
|
6042
6063
|
]
|
|
6043
6064
|
}, e);
|
|
6044
6065
|
})
|
|
6045
6066
|
}),
|
|
6046
|
-
/* @__PURE__ */
|
|
6067
|
+
/* @__PURE__ */ x("div", {
|
|
6047
6068
|
style: {
|
|
6048
6069
|
padding: "10px 16px",
|
|
6049
6070
|
borderTop: "1px solid var(--divider)",
|
|
@@ -6056,16 +6077,16 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6056
6077
|
minWidth: 0
|
|
6057
6078
|
},
|
|
6058
6079
|
children: [
|
|
6059
|
-
/* @__PURE__ */
|
|
6060
|
-
/* @__PURE__ */
|
|
6080
|
+
/* @__PURE__ */ b("div", { style: { flex: 1 } }),
|
|
6081
|
+
/* @__PURE__ */ b(D, {
|
|
6061
6082
|
onClick: () => n(!1),
|
|
6062
6083
|
disabled: o,
|
|
6063
6084
|
children: "Cancel"
|
|
6064
6085
|
}),
|
|
6065
|
-
/* @__PURE__ */
|
|
6086
|
+
/* @__PURE__ */ b(D, {
|
|
6066
6087
|
kind: "primary",
|
|
6067
|
-
icon:
|
|
6068
|
-
onClick:
|
|
6088
|
+
icon: b(o ? Se : t.bolt, { size: 13 }),
|
|
6089
|
+
onClick: E,
|
|
6069
6090
|
disabled: o,
|
|
6070
6091
|
children: o ? "Executing…" : "Execute"
|
|
6071
6092
|
})
|
|
@@ -6076,17 +6097,17 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6076
6097
|
}
|
|
6077
6098
|
//#endregion
|
|
6078
6099
|
//#region src/components/shared/ActionResultDialog.tsx
|
|
6079
|
-
function
|
|
6100
|
+
function Zs({ open: e, onClose: n, display: r }) {
|
|
6080
6101
|
let i = f(null);
|
|
6081
6102
|
return l(() => {
|
|
6082
6103
|
e && i.current?.focus();
|
|
6083
|
-
}, [e]), e ? /* @__PURE__ */
|
|
6104
|
+
}, [e]), e ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", { style: {
|
|
6084
6105
|
position: "fixed",
|
|
6085
6106
|
inset: 0,
|
|
6086
6107
|
background: "var(--scrim)",
|
|
6087
6108
|
zIndex: 60,
|
|
6088
6109
|
backdropFilter: "blur(2px)"
|
|
6089
|
-
} }), /* @__PURE__ */
|
|
6110
|
+
} }), /* @__PURE__ */ x("div", {
|
|
6090
6111
|
ref: i,
|
|
6091
6112
|
role: "dialog",
|
|
6092
6113
|
"aria-modal": "true",
|
|
@@ -6114,7 +6135,7 @@ function Xs({ open: e, onClose: n, display: r }) {
|
|
|
6114
6135
|
outline: "none"
|
|
6115
6136
|
},
|
|
6116
6137
|
children: [
|
|
6117
|
-
/* @__PURE__ */
|
|
6138
|
+
/* @__PURE__ */ x("div", {
|
|
6118
6139
|
style: {
|
|
6119
6140
|
padding: "14px 18px",
|
|
6120
6141
|
display: "flex",
|
|
@@ -6122,7 +6143,7 @@ function Xs({ open: e, onClose: n, display: r }) {
|
|
|
6122
6143
|
gap: 10
|
|
6123
6144
|
},
|
|
6124
6145
|
children: [
|
|
6125
|
-
/* @__PURE__ */
|
|
6146
|
+
/* @__PURE__ */ b("span", {
|
|
6126
6147
|
style: {
|
|
6127
6148
|
width: 28,
|
|
6128
6149
|
height: 28,
|
|
@@ -6134,21 +6155,21 @@ function Xs({ open: e, onClose: n, display: r }) {
|
|
|
6134
6155
|
justifyContent: "center",
|
|
6135
6156
|
flexShrink: 0
|
|
6136
6157
|
},
|
|
6137
|
-
children: /* @__PURE__ */
|
|
6158
|
+
children: /* @__PURE__ */ b(t.check, { size: 15 })
|
|
6138
6159
|
}),
|
|
6139
|
-
/* @__PURE__ */
|
|
6160
|
+
/* @__PURE__ */ x("div", {
|
|
6140
6161
|
style: {
|
|
6141
6162
|
flex: 1,
|
|
6142
6163
|
minWidth: 0
|
|
6143
6164
|
},
|
|
6144
|
-
children: [/* @__PURE__ */
|
|
6165
|
+
children: [/* @__PURE__ */ b("div", {
|
|
6145
6166
|
style: {
|
|
6146
6167
|
fontSize: 14,
|
|
6147
6168
|
fontWeight: 600,
|
|
6148
6169
|
color: "var(--text)"
|
|
6149
6170
|
},
|
|
6150
6171
|
children: r.title ?? "Action Result"
|
|
6151
|
-
}), r.message && /* @__PURE__ */
|
|
6172
|
+
}), r.message && /* @__PURE__ */ b("div", {
|
|
6152
6173
|
style: {
|
|
6153
6174
|
fontSize: 11.5,
|
|
6154
6175
|
color: "var(--text-3)",
|
|
@@ -6157,13 +6178,13 @@ function Xs({ open: e, onClose: n, display: r }) {
|
|
|
6157
6178
|
children: r.message
|
|
6158
6179
|
})]
|
|
6159
6180
|
}),
|
|
6160
|
-
/* @__PURE__ */
|
|
6161
|
-
icon: /* @__PURE__ */
|
|
6181
|
+
/* @__PURE__ */ b(O, {
|
|
6182
|
+
icon: /* @__PURE__ */ b(t.x, { size: 14 }),
|
|
6162
6183
|
onClick: n
|
|
6163
6184
|
})
|
|
6164
6185
|
]
|
|
6165
6186
|
}),
|
|
6166
|
-
r.fields && r.fields.length > 0 && /* @__PURE__ */
|
|
6187
|
+
r.fields && r.fields.length > 0 && /* @__PURE__ */ b("div", {
|
|
6167
6188
|
style: {
|
|
6168
6189
|
padding: "12px 18px 16px",
|
|
6169
6190
|
display: "flex",
|
|
@@ -6171,9 +6192,9 @@ function Xs({ open: e, onClose: n, display: r }) {
|
|
|
6171
6192
|
gap: 12,
|
|
6172
6193
|
overflowY: "auto"
|
|
6173
6194
|
},
|
|
6174
|
-
children: r.fields.map((e, t) => /* @__PURE__ */
|
|
6195
|
+
children: r.fields.map((e, t) => /* @__PURE__ */ b(Qs, { field: e }, t))
|
|
6175
6196
|
}),
|
|
6176
|
-
/* @__PURE__ */
|
|
6197
|
+
/* @__PURE__ */ x("div", {
|
|
6177
6198
|
style: {
|
|
6178
6199
|
padding: "10px 16px",
|
|
6179
6200
|
borderTop: "1px solid var(--divider)",
|
|
@@ -6185,7 +6206,7 @@ function Xs({ open: e, onClose: n, display: r }) {
|
|
|
6185
6206
|
background: "var(--surface-2)",
|
|
6186
6207
|
flexShrink: 0
|
|
6187
6208
|
},
|
|
6188
|
-
children: [/* @__PURE__ */
|
|
6209
|
+
children: [/* @__PURE__ */ b("div", { style: { flex: 1 } }), /* @__PURE__ */ b(D, {
|
|
6189
6210
|
kind: "primary",
|
|
6190
6211
|
onClick: n,
|
|
6191
6212
|
children: "Close"
|
|
@@ -6194,7 +6215,7 @@ function Xs({ open: e, onClose: n, display: r }) {
|
|
|
6194
6215
|
]
|
|
6195
6216
|
})] }) : null;
|
|
6196
6217
|
}
|
|
6197
|
-
function
|
|
6218
|
+
function Qs({ field: e }) {
|
|
6198
6219
|
let n = e.href ?? e.download_url ?? e.value, r = e.type === "download", i = r || e.type === "link", a = n ? Zr(n) : void 0, [o, s] = p(!1), [c, l] = p(null);
|
|
6199
6220
|
async function u() {
|
|
6200
6221
|
if (a) {
|
|
@@ -6236,14 +6257,14 @@ function Zs({ field: e }) {
|
|
|
6236
6257
|
fontSize: 12.5,
|
|
6237
6258
|
lineHeight: 1.4
|
|
6238
6259
|
};
|
|
6239
|
-
return /* @__PURE__ */
|
|
6260
|
+
return /* @__PURE__ */ x("div", {
|
|
6240
6261
|
style: {
|
|
6241
6262
|
display: "flex",
|
|
6242
6263
|
flexDirection: "column",
|
|
6243
6264
|
gap: 4
|
|
6244
6265
|
},
|
|
6245
6266
|
children: [
|
|
6246
|
-
/* @__PURE__ */
|
|
6267
|
+
/* @__PURE__ */ b("div", {
|
|
6247
6268
|
style: {
|
|
6248
6269
|
fontSize: 11.5,
|
|
6249
6270
|
fontWeight: 500,
|
|
@@ -6251,7 +6272,7 @@ function Zs({ field: e }) {
|
|
|
6251
6272
|
},
|
|
6252
6273
|
children: e.label
|
|
6253
6274
|
}),
|
|
6254
|
-
r && a && /* @__PURE__ */
|
|
6275
|
+
r && a && /* @__PURE__ */ x("button", {
|
|
6255
6276
|
type: "button",
|
|
6256
6277
|
onClick: u,
|
|
6257
6278
|
disabled: o,
|
|
@@ -6259,32 +6280,32 @@ function Zs({ field: e }) {
|
|
|
6259
6280
|
...d,
|
|
6260
6281
|
cursor: o ? "default" : "pointer"
|
|
6261
6282
|
},
|
|
6262
|
-
children: [
|
|
6283
|
+
children: [b(o ? t.loader : t.download, { size: 14 }), /* @__PURE__ */ b("span", { children: o ? "Downloading…" : "Download" })]
|
|
6263
6284
|
}),
|
|
6264
|
-
c && /* @__PURE__ */
|
|
6285
|
+
c && /* @__PURE__ */ b("div", {
|
|
6265
6286
|
style: {
|
|
6266
6287
|
fontSize: 11.5,
|
|
6267
6288
|
color: "var(--danger)"
|
|
6268
6289
|
},
|
|
6269
6290
|
children: c
|
|
6270
6291
|
}),
|
|
6271
|
-
f && a ? /* @__PURE__ */
|
|
6292
|
+
f && a ? /* @__PURE__ */ x("div", {
|
|
6272
6293
|
style: {
|
|
6273
6294
|
display: "flex",
|
|
6274
6295
|
alignItems: "center",
|
|
6275
6296
|
gap: 8,
|
|
6276
6297
|
minWidth: 0
|
|
6277
6298
|
},
|
|
6278
|
-
children: [/* @__PURE__ */
|
|
6299
|
+
children: [/* @__PURE__ */ x("a", {
|
|
6279
6300
|
href: a,
|
|
6280
6301
|
target: "_blank",
|
|
6281
6302
|
rel: "noopener noreferrer",
|
|
6282
6303
|
style: m,
|
|
6283
6304
|
title: e.value,
|
|
6284
|
-
children: [/* @__PURE__ */
|
|
6305
|
+
children: [/* @__PURE__ */ b(t.link, {
|
|
6285
6306
|
size: 14,
|
|
6286
6307
|
style: { flexShrink: 0 }
|
|
6287
|
-
}), /* @__PURE__ */
|
|
6308
|
+
}), /* @__PURE__ */ b("span", {
|
|
6288
6309
|
style: {
|
|
6289
6310
|
overflow: "hidden",
|
|
6290
6311
|
textOverflow: "ellipsis",
|
|
@@ -6292,13 +6313,13 @@ function Zs({ field: e }) {
|
|
|
6292
6313
|
},
|
|
6293
6314
|
children: e.value
|
|
6294
6315
|
})]
|
|
6295
|
-
}), e.copyable && /* @__PURE__ */
|
|
6296
|
-
}) : /* @__PURE__ */
|
|
6316
|
+
}), e.copyable && /* @__PURE__ */ b(ri, { value: e.value })]
|
|
6317
|
+
}) : /* @__PURE__ */ x("div", {
|
|
6297
6318
|
style: {
|
|
6298
6319
|
position: "relative",
|
|
6299
6320
|
width: "100%"
|
|
6300
6321
|
},
|
|
6301
|
-
children: [/* @__PURE__ */
|
|
6322
|
+
children: [/* @__PURE__ */ b("div", {
|
|
6302
6323
|
className: e.monospace ? "mono" : void 0,
|
|
6303
6324
|
style: {
|
|
6304
6325
|
borderRadius: 6,
|
|
@@ -6310,13 +6331,13 @@ function Zs({ field: e }) {
|
|
|
6310
6331
|
color: "var(--text)"
|
|
6311
6332
|
},
|
|
6312
6333
|
children: e.value
|
|
6313
|
-
}), e.copyable && /* @__PURE__ */
|
|
6334
|
+
}), e.copyable && /* @__PURE__ */ b("div", {
|
|
6314
6335
|
style: {
|
|
6315
6336
|
position: "absolute",
|
|
6316
6337
|
top: 4,
|
|
6317
6338
|
right: 4
|
|
6318
6339
|
},
|
|
6319
|
-
children: /* @__PURE__ */
|
|
6340
|
+
children: /* @__PURE__ */ b(ri, { value: e.value })
|
|
6320
6341
|
})]
|
|
6321
6342
|
})
|
|
6322
6343
|
]
|
|
@@ -6324,7 +6345,7 @@ function Zs({ field: e }) {
|
|
|
6324
6345
|
}
|
|
6325
6346
|
//#endregion
|
|
6326
6347
|
//#region src/components/shared/ActionRunner.tsx
|
|
6327
|
-
function
|
|
6348
|
+
function $s(e) {
|
|
6328
6349
|
if (!e || typeof e != "object") return { kind: "success" };
|
|
6329
6350
|
let t = e, n = t.status, r = t.success?.length ?? 0, i = t.errors?.length ?? 0, a = t.skipped?.length ?? 0, o = t.errors?.[0]?.error;
|
|
6330
6351
|
if (n === "partial") {
|
|
@@ -6339,15 +6360,15 @@ function Qs(e) {
|
|
|
6339
6360
|
detail: "No items matched"
|
|
6340
6361
|
} : n === "accepted" ? { kind: "accepted" } : { kind: "success" };
|
|
6341
6362
|
}
|
|
6342
|
-
function
|
|
6363
|
+
function ec(e) {
|
|
6343
6364
|
if (!e || typeof e != "object") return null;
|
|
6344
6365
|
let t = e.result;
|
|
6345
6366
|
if (!t || typeof t != "object") return null;
|
|
6346
6367
|
let n = t.$display;
|
|
6347
6368
|
return !n || typeof n != "object" ? null : n;
|
|
6348
6369
|
}
|
|
6349
|
-
function
|
|
6350
|
-
let t =
|
|
6370
|
+
function tc(e) {
|
|
6371
|
+
let t = ec(e)?.fields;
|
|
6351
6372
|
if (!Array.isArray(t)) return null;
|
|
6352
6373
|
for (let e of t) {
|
|
6353
6374
|
if (e?.type !== "download") continue;
|
|
@@ -6359,12 +6380,12 @@ function ec(e) {
|
|
|
6359
6380
|
}
|
|
6360
6381
|
return null;
|
|
6361
6382
|
}
|
|
6362
|
-
function
|
|
6383
|
+
function nc(e) {
|
|
6363
6384
|
if (!e || typeof e != "object") return;
|
|
6364
6385
|
let t = e.result;
|
|
6365
6386
|
!t || typeof t != "object" || "impersonation_session_id" in t && window.location.assign("/");
|
|
6366
6387
|
}
|
|
6367
|
-
function
|
|
6388
|
+
function rc(e) {
|
|
6368
6389
|
if (e instanceof $n) {
|
|
6369
6390
|
let t = e.response.errors ?? [];
|
|
6370
6391
|
if (t.length === 1) return {
|
|
@@ -6377,7 +6398,7 @@ function nc(e) {
|
|
|
6377
6398
|
detail: n ? `${t.length} failed · ${n}` : `${t.length} failed`
|
|
6378
6399
|
};
|
|
6379
6400
|
}
|
|
6380
|
-
return e instanceof
|
|
6401
|
+
return e instanceof B ? {
|
|
6381
6402
|
kind: "error",
|
|
6382
6403
|
detail: e.message
|
|
6383
6404
|
} : {
|
|
@@ -6385,56 +6406,69 @@ function nc(e) {
|
|
|
6385
6406
|
detail: e instanceof Error ? e.message : String(e)
|
|
6386
6407
|
};
|
|
6387
6408
|
}
|
|
6388
|
-
var
|
|
6389
|
-
function
|
|
6390
|
-
let e = c(
|
|
6409
|
+
var ic = i(null);
|
|
6410
|
+
function ac() {
|
|
6411
|
+
let e = c(ic);
|
|
6391
6412
|
if (!e) throw Error("useActionRunner must be used within <ActionRunnerProvider>");
|
|
6392
6413
|
return e;
|
|
6393
6414
|
}
|
|
6394
|
-
function
|
|
6415
|
+
function oc(e) {
|
|
6395
6416
|
let t = {}, n = e.action?.resolved_hidden_defaults;
|
|
6396
6417
|
if (n) for (let [e, r] of Object.entries(n)) r !== void 0 && (t[e] = r);
|
|
6397
6418
|
return t;
|
|
6398
6419
|
}
|
|
6399
|
-
function
|
|
6400
|
-
let t = Mr(), { data: n } =
|
|
6420
|
+
function sc({ children: e }) {
|
|
6421
|
+
let t = Mr(), { data: n } = Y(), [r, i] = p(null), [a, o] = p(0), [c, l] = p(null), u = s((e) => {
|
|
6401
6422
|
if (e?.progress_screen) return n?.screens[e.progress_screen]?.route;
|
|
6402
6423
|
}, [n?.screens]), f = s((e, n, r, i, a) => {
|
|
6403
6424
|
let o = () => {
|
|
6404
|
-
let n =
|
|
6405
|
-
|
|
6425
|
+
let n = cc(a), i = u(r), o = n ? `Job ${n} queued` : "Running in background";
|
|
6426
|
+
Z.success(`${e} started`, o, i ? { action: {
|
|
6406
6427
|
label: "View",
|
|
6407
6428
|
onClick: () => t(i)
|
|
6408
6429
|
} } : void 0);
|
|
6409
6430
|
};
|
|
6410
6431
|
switch (i.kind) {
|
|
6411
6432
|
case "success": {
|
|
6412
|
-
let t =
|
|
6433
|
+
let t = tc(a), r = t ? { action: {
|
|
6413
6434
|
label: "Download",
|
|
6414
6435
|
onClick: () => {
|
|
6415
6436
|
ei(t.url, t.filename).catch((e) => {
|
|
6416
|
-
|
|
6437
|
+
Z.error("Download failed", e instanceof Error ? e.message : String(e));
|
|
6417
6438
|
});
|
|
6418
6439
|
}
|
|
6419
6440
|
} } : void 0;
|
|
6420
|
-
n ? o() :
|
|
6441
|
+
n ? o() : Z.success(`${e} complete`, void 0, r);
|
|
6421
6442
|
return;
|
|
6422
6443
|
}
|
|
6423
6444
|
case "accepted":
|
|
6424
6445
|
o();
|
|
6425
6446
|
return;
|
|
6426
6447
|
case "skipped":
|
|
6427
|
-
|
|
6448
|
+
Z.info(e, i.detail);
|
|
6428
6449
|
return;
|
|
6429
6450
|
case "partial":
|
|
6430
|
-
|
|
6451
|
+
Z.warning(`${e} partially completed`, i.detail);
|
|
6431
6452
|
return;
|
|
6432
6453
|
case "error":
|
|
6433
|
-
|
|
6454
|
+
Z.error(`${e} failed`, i.detail);
|
|
6434
6455
|
return;
|
|
6435
6456
|
}
|
|
6436
|
-
}, [t, u]), m = s((e) => {
|
|
6437
|
-
|
|
6457
|
+
}, [t, u]), m = _(), h = s((e, t, n) => {
|
|
6458
|
+
if (t.kind === "success" || t.kind === "accepted" || t.kind === "partial") {
|
|
6459
|
+
let t = e.entity ?? e.action?.entity;
|
|
6460
|
+
if (t) for (let e of [
|
|
6461
|
+
"entity-data",
|
|
6462
|
+
"entity-count",
|
|
6463
|
+
"entity-item"
|
|
6464
|
+
]) m.invalidateQueries({ queryKey: [e, t] });
|
|
6465
|
+
}
|
|
6466
|
+
if (t.kind !== "success" && t.kind !== "accepted") return;
|
|
6467
|
+
e.onSuccess?.(n);
|
|
6468
|
+
let r = ec(n);
|
|
6469
|
+
r && l(r), nc(n);
|
|
6470
|
+
}, [m]), g = s((e) => {
|
|
6471
|
+
let t = e.action, n = e.destructive ?? t?.destructive ?? !1, r = e.longRunning ?? t?.long_running ?? !1, a = e.title || L(t?.display?.name) || "Action";
|
|
6438
6472
|
return t?.resolved_params && t.resolved_params.length > 0 ? (i({
|
|
6439
6473
|
id: Symbol(),
|
|
6440
6474
|
opts: e,
|
|
@@ -6450,22 +6484,18 @@ function oc({ children: e }) {
|
|
|
6450
6484
|
}), Promise.resolve()) : (async (n) => {
|
|
6451
6485
|
o((e) => e + 1);
|
|
6452
6486
|
try {
|
|
6453
|
-
let i = await e.execute(n), o =
|
|
6454
|
-
|
|
6455
|
-
e.onSuccess?.(i);
|
|
6456
|
-
let t = $s(i);
|
|
6457
|
-
t && l(t), tc(i);
|
|
6458
|
-
}
|
|
6487
|
+
let i = await e.execute(n), o = $s(i);
|
|
6488
|
+
f(a, r, t, o, i), h(e, o, i);
|
|
6459
6489
|
} catch (e) {
|
|
6460
|
-
f(a, r, t,
|
|
6490
|
+
f(a, r, t, rc(e));
|
|
6461
6491
|
} finally {
|
|
6462
6492
|
o((e) => Math.max(0, e - 1));
|
|
6463
6493
|
}
|
|
6464
|
-
})(
|
|
6465
|
-
}, [f]),
|
|
6466
|
-
run:
|
|
6467
|
-
isRunning:
|
|
6468
|
-
}), [
|
|
6494
|
+
})(oc(e));
|
|
6495
|
+
}, [f, h]), v = a > 0 || !!r?.pending, y = d(() => ({
|
|
6496
|
+
run: g,
|
|
6497
|
+
isRunning: v
|
|
6498
|
+
}), [g, v]), S = r?.opts.action, C = s(async (e) => {
|
|
6469
6499
|
if (!r) return;
|
|
6470
6500
|
let t = r.id, n = r, a = n.opts.action, s = n.opts.longRunning ?? a?.long_running ?? !1;
|
|
6471
6501
|
i((e) => e?.id === t ? {
|
|
@@ -6473,58 +6503,53 @@ function oc({ children: e }) {
|
|
|
6473
6503
|
pending: !0
|
|
6474
6504
|
} : e), o((e) => e + 1);
|
|
6475
6505
|
try {
|
|
6476
|
-
let r = await n.opts.execute(e), o =
|
|
6477
|
-
|
|
6478
|
-
n.opts.onSuccess?.(r);
|
|
6479
|
-
let e = $s(r);
|
|
6480
|
-
e && l(e), tc(r);
|
|
6481
|
-
}
|
|
6482
|
-
o.kind !== "partial" && i((e) => e?.id === t ? null : e);
|
|
6506
|
+
let r = await n.opts.execute(e), o = $s(r);
|
|
6507
|
+
f(n.title, s, a, o, r), h(n.opts, o, r), o.kind !== "partial" && i((e) => e?.id === t ? null : e);
|
|
6483
6508
|
} catch (e) {
|
|
6484
|
-
f(n.title, s, a,
|
|
6509
|
+
f(n.title, s, a, rc(e));
|
|
6485
6510
|
} finally {
|
|
6486
6511
|
o((e) => Math.max(0, e - 1)), i((e) => e?.id === t ? {
|
|
6487
6512
|
...e,
|
|
6488
6513
|
pending: !1
|
|
6489
6514
|
} : e);
|
|
6490
6515
|
}
|
|
6491
|
-
}, [
|
|
6492
|
-
|
|
6493
|
-
|
|
6516
|
+
}, [
|
|
6517
|
+
r,
|
|
6518
|
+
f,
|
|
6519
|
+
h
|
|
6520
|
+
]);
|
|
6521
|
+
return /* @__PURE__ */ x(ic.Provider, {
|
|
6522
|
+
value: y,
|
|
6494
6523
|
children: [
|
|
6495
6524
|
e,
|
|
6496
|
-
c && /* @__PURE__ */
|
|
6525
|
+
c && /* @__PURE__ */ b(Zs, {
|
|
6497
6526
|
open: !0,
|
|
6498
6527
|
onClose: () => l(null),
|
|
6499
6528
|
display: c
|
|
6500
6529
|
}),
|
|
6501
|
-
r?.kind === "params" &&
|
|
6530
|
+
r?.kind === "params" && S && /* @__PURE__ */ b(Xs, {
|
|
6502
6531
|
open: !0,
|
|
6503
6532
|
onOpenChange: (e) => {
|
|
6504
6533
|
e || i(null);
|
|
6505
6534
|
},
|
|
6506
|
-
action:
|
|
6535
|
+
action: S,
|
|
6507
6536
|
actionName: r.title,
|
|
6508
|
-
onSubmit:
|
|
6537
|
+
onSubmit: C,
|
|
6509
6538
|
isPending: r.pending,
|
|
6510
|
-
bulkSelection: r.opts.bulkSelection
|
|
6539
|
+
bulkSelection: r.opts.bulkSelection,
|
|
6540
|
+
row: r.opts.row
|
|
6511
6541
|
}),
|
|
6512
|
-
r?.kind === "confirm" && /* @__PURE__ */
|
|
6542
|
+
r?.kind === "confirm" && /* @__PURE__ */ b(uc, {
|
|
6513
6543
|
state: r,
|
|
6514
6544
|
onClose: () => i(null),
|
|
6515
6545
|
onExecute: async (e) => {
|
|
6516
6546
|
let t = r.id, n = r, a = n.opts.action, s = n.opts.longRunning ?? a?.long_running ?? !1, c = !1;
|
|
6517
6547
|
o((e) => e + 1);
|
|
6518
6548
|
try {
|
|
6519
|
-
let t = await n.opts.execute(e), r =
|
|
6520
|
-
|
|
6521
|
-
n.opts.onSuccess?.(t);
|
|
6522
|
-
let e = $s(t);
|
|
6523
|
-
e && l(e), tc(t);
|
|
6524
|
-
}
|
|
6525
|
-
c = r.kind === "partial";
|
|
6549
|
+
let t = await n.opts.execute(e), r = $s(t);
|
|
6550
|
+
f(n.title, s, a, r, t), h(n.opts, r, t), c = r.kind === "partial";
|
|
6526
6551
|
} catch (e) {
|
|
6527
|
-
f(n.title, s, a,
|
|
6552
|
+
f(n.title, s, a, rc(e));
|
|
6528
6553
|
} finally {
|
|
6529
6554
|
o((e) => Math.max(0, e - 1)), c || i((e) => e?.id === t ? null : e);
|
|
6530
6555
|
}
|
|
@@ -6533,17 +6558,17 @@ function oc({ children: e }) {
|
|
|
6533
6558
|
]
|
|
6534
6559
|
});
|
|
6535
6560
|
}
|
|
6536
|
-
function sc(e) {
|
|
6537
|
-
return cc(e) ?? cc(e?.result);
|
|
6538
|
-
}
|
|
6539
6561
|
function cc(e) {
|
|
6562
|
+
return lc(e) ?? lc(e?.result);
|
|
6563
|
+
}
|
|
6564
|
+
function lc(e) {
|
|
6540
6565
|
if (!e || typeof e != "object") return;
|
|
6541
6566
|
let t = e, n = t.job_id ?? t.id;
|
|
6542
6567
|
return typeof n == "string" ? n : void 0;
|
|
6543
6568
|
}
|
|
6544
|
-
function
|
|
6569
|
+
function uc({ state: e, onClose: n, onExecute: r }) {
|
|
6545
6570
|
let { title: i, opts: a } = e, [o, s] = p(!1), c = a.action, l = a.destructive ?? c?.destructive ?? !1;
|
|
6546
|
-
return /* @__PURE__ */
|
|
6571
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
|
|
6547
6572
|
onClick: n,
|
|
6548
6573
|
style: {
|
|
6549
6574
|
position: "fixed",
|
|
@@ -6552,7 +6577,7 @@ function lc({ state: e, onClose: n, onExecute: r }) {
|
|
|
6552
6577
|
zIndex: 60,
|
|
6553
6578
|
backdropFilter: "blur(2px)"
|
|
6554
6579
|
}
|
|
6555
|
-
}), /* @__PURE__ */
|
|
6580
|
+
}), /* @__PURE__ */ x("div", {
|
|
6556
6581
|
style: {
|
|
6557
6582
|
position: "fixed",
|
|
6558
6583
|
top: "50%",
|
|
@@ -6566,7 +6591,7 @@ function lc({ state: e, onClose: n, onExecute: r }) {
|
|
|
6566
6591
|
border: "1px solid var(--border)",
|
|
6567
6592
|
overflow: "hidden"
|
|
6568
6593
|
},
|
|
6569
|
-
children: [/* @__PURE__ */
|
|
6594
|
+
children: [/* @__PURE__ */ x("div", {
|
|
6570
6595
|
style: {
|
|
6571
6596
|
padding: "14px 18px 0",
|
|
6572
6597
|
display: "flex",
|
|
@@ -6574,7 +6599,7 @@ function lc({ state: e, onClose: n, onExecute: r }) {
|
|
|
6574
6599
|
gap: 10
|
|
6575
6600
|
},
|
|
6576
6601
|
children: [
|
|
6577
|
-
/* @__PURE__ */
|
|
6602
|
+
/* @__PURE__ */ b("span", {
|
|
6578
6603
|
style: {
|
|
6579
6604
|
width: 28,
|
|
6580
6605
|
height: 28,
|
|
@@ -6585,18 +6610,18 @@ function lc({ state: e, onClose: n, onExecute: r }) {
|
|
|
6585
6610
|
alignItems: "center",
|
|
6586
6611
|
justifyContent: "center"
|
|
6587
6612
|
},
|
|
6588
|
-
children:
|
|
6613
|
+
children: b(l ? t.trash : t.bolt, { size: 15 })
|
|
6589
6614
|
}),
|
|
6590
|
-
/* @__PURE__ */
|
|
6615
|
+
/* @__PURE__ */ x("div", {
|
|
6591
6616
|
style: { flex: 1 },
|
|
6592
|
-
children: [/* @__PURE__ */
|
|
6617
|
+
children: [/* @__PURE__ */ b("div", {
|
|
6593
6618
|
style: {
|
|
6594
6619
|
fontSize: 14,
|
|
6595
6620
|
fontWeight: 600,
|
|
6596
6621
|
color: "var(--text)"
|
|
6597
6622
|
},
|
|
6598
6623
|
children: i
|
|
6599
|
-
}), /* @__PURE__ */
|
|
6624
|
+
}), /* @__PURE__ */ b("div", {
|
|
6600
6625
|
style: {
|
|
6601
6626
|
fontSize: 11.5,
|
|
6602
6627
|
color: "var(--text-3)"
|
|
@@ -6604,12 +6629,12 @@ function lc({ state: e, onClose: n, onExecute: r }) {
|
|
|
6604
6629
|
children: "This cannot be undone. Confirm to proceed."
|
|
6605
6630
|
})]
|
|
6606
6631
|
}),
|
|
6607
|
-
/* @__PURE__ */
|
|
6608
|
-
icon: /* @__PURE__ */
|
|
6632
|
+
/* @__PURE__ */ b(O, {
|
|
6633
|
+
icon: /* @__PURE__ */ b(t.x, { size: 14 }),
|
|
6609
6634
|
onClick: n
|
|
6610
6635
|
})
|
|
6611
6636
|
]
|
|
6612
|
-
}), /* @__PURE__ */
|
|
6637
|
+
}), /* @__PURE__ */ x("div", {
|
|
6613
6638
|
style: {
|
|
6614
6639
|
padding: "10px 16px",
|
|
6615
6640
|
borderTop: "1px solid var(--divider)",
|
|
@@ -6619,19 +6644,19 @@ function lc({ state: e, onClose: n, onExecute: r }) {
|
|
|
6619
6644
|
background: "var(--surface-2)"
|
|
6620
6645
|
},
|
|
6621
6646
|
children: [
|
|
6622
|
-
/* @__PURE__ */
|
|
6623
|
-
/* @__PURE__ */
|
|
6647
|
+
/* @__PURE__ */ b("div", { style: { flex: 1 } }),
|
|
6648
|
+
/* @__PURE__ */ b(D, {
|
|
6624
6649
|
onClick: n,
|
|
6625
6650
|
children: "Cancel"
|
|
6626
6651
|
}),
|
|
6627
|
-
/* @__PURE__ */
|
|
6652
|
+
/* @__PURE__ */ b(D, {
|
|
6628
6653
|
kind: "primary",
|
|
6629
6654
|
danger: l,
|
|
6630
|
-
icon:
|
|
6655
|
+
icon: b(o ? Se : t.bolt, { size: 13 }),
|
|
6631
6656
|
onClick: async () => {
|
|
6632
6657
|
s(!0);
|
|
6633
6658
|
try {
|
|
6634
|
-
await r(
|
|
6659
|
+
await r(oc(a));
|
|
6635
6660
|
} finally {
|
|
6636
6661
|
s(!1);
|
|
6637
6662
|
}
|
|
@@ -6644,19 +6669,19 @@ function lc({ state: e, onClose: n, onExecute: r }) {
|
|
|
6644
6669
|
}
|
|
6645
6670
|
//#endregion
|
|
6646
6671
|
//#region src/hooks/useCurrentScreen.tsx
|
|
6647
|
-
var
|
|
6648
|
-
function
|
|
6649
|
-
let { data: n } =
|
|
6672
|
+
var dc = i(void 0);
|
|
6673
|
+
function fc({ code: e, children: t }) {
|
|
6674
|
+
let { data: n } = Y(), r = d(() => ({
|
|
6650
6675
|
code: e,
|
|
6651
6676
|
screen: n?.screens[e]
|
|
6652
6677
|
}), [e, n]);
|
|
6653
|
-
return /* @__PURE__ */
|
|
6678
|
+
return /* @__PURE__ */ b(dc.Provider, {
|
|
6654
6679
|
value: r,
|
|
6655
6680
|
children: t
|
|
6656
6681
|
});
|
|
6657
6682
|
}
|
|
6658
|
-
function
|
|
6659
|
-
return c(
|
|
6683
|
+
function pc() {
|
|
6684
|
+
return c(dc);
|
|
6660
6685
|
}
|
|
6661
6686
|
//#endregion
|
|
6662
|
-
export { Cr as $, lt as $t, Ni as A, Te as An,
|
|
6687
|
+
export { Cr as $, lt as $t, Ni as A, Te as An, G as At, $r as B, N as Bn, Ot as Bt, Sa as C, Ce as Cn, Bn as Ct, sa as D, Ie as Dn, Mn as Dt, na as E, Re as En, jn as Et, Oi as F, be as Fn, gn as Ft, Pr as G, O as Gn, _t as Gt, Jr as H, j as Hn, St as Ht, pi as I, ue as In, Ft as It, kr as J, ht as Jt, Nr as K, D as Kn, vt as Kt, di as L, ve as Ln, Rt as Lt, Ai as M, Le as Mn, J as Mt, Di as N, Se as Nn, hn as Nt, oa as O, F as On, Rn as Ot, ki as P, xe as Pn, _n as Pt, Sr as Q, st as Qt, ri as R, pe as Rn, zt as Rt, ya as S, ke as Sn, zn as St, ba as T, Ne as Tn, Pn as Tt, Z as U, A as Un, Ct as Ut, Zr as V, se as Vn, wt as Vt, Mr as W, k as Wn, Dt as Wt, wr as X, B as Xt, Er as Y, mt as Yt, Tr as Z, ct as Zt, ls as _, R as _n, Un as _t, Zs as a, Ye as an, Xn as at, Ta as b, I as bn, Nn as bt, Is as c, Ve as cn, Kn as ct, As as d, Ze as dn, Zn as dt, Be as en, mr as et, ws as f, tt as fn, rr as ft, ds as g, nt as gn, Y as gt, ms as h, Je as hn, Jn as ht, ac as i, qe as in, Yn as it, ji as j, P as jn, q as jt, ta as k, Pe as kn, Fn as kt, Vs as l, z as ln, Gn as lt, gs as m, Qe as mn, or as mt, pc as n, it as nn, tr as nt, Xs as o, Xe as on, cr as ot, ks as p, $e as pn, sr as pt, jr as q, yt as qt, sc as r, at as rn, qn as rt, Fs as s, Ge as sn, Qn as st, fc as t, rt as tn, $n as tt, js as u, L as un, lr as ut, wa as v, We as vn, Hn as vt, ua as w, Fe as wn, Ln as wt, Q as x, ze as xn, Vn as xt, Ea as y, et as yn, An as yt, ei as z, ye as zn, kt as zt };
|