@oomol-lab/open-flow 0.1.0-beta.15 → 0.1.0-beta.17
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/browser/{createResourceDialog-mW21KMfJ.js → createResourceDialog-DOWv3Zj0.js} +24 -25
- package/dist/browser/dist-B_T-OpQp.js +4 -0
- package/dist/browser/{dist-C46JByB-.js → dist-Dz6Nglsd.js} +61 -61
- package/dist/browser/{esm-DOipoo54.js → esm-B7A42FzW.js} +11 -1
- package/dist/browser/flow-authoring.js +1464 -1463
- package/dist/browser/flow-change.js +1 -0
- package/dist/browser/flowChanges-BDLNaCWZ.js +11014 -0
- package/dist/browser/{flowRunInputEditorStore-NPGePkvP.js → flowRunInputEditorStore-BBqQIOCR.js} +1017 -4100
- package/dist/browser/{flowWorkspace-wssXq1cX.js → flowWorkspace-BtNfkYuG.js} +78243 -89430
- package/dist/browser/i18n-CNu41MKH.js +7021 -0
- package/dist/browser/inputValues-CQlPBtdF.js +43 -0
- package/dist/browser/{languages-i3Xmpt6S.js → languages-C0zQ4GSo.js} +2 -13
- package/dist/browser/licenses.md +78 -713
- package/dist/browser/main-BDnNHhkU.js +50 -0
- package/dist/browser/{markdownContent-BawLYUjh.js → markdownContent-BBgH9ZIV.js} +18 -18
- package/dist/browser/theme.css +429 -2
- package/dist/browser/ui-input.d.ts +3 -0
- package/dist/browser/ui-label.d.ts +3 -0
- package/dist/browser/ui-textarea.d.ts +3 -0
- package/dist/browser/ui.css +2 -0
- package/dist/browser/ui.css.d.ts +1 -0
- package/dist/browser/ui.d.ts +12 -0
- package/dist/browser/ui.js +2598 -0
- package/dist/browser/useValueChanged-DUuqLWPg.js +2944 -0
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +1013 -712
- package/dist/browser/workbenchSelect-Bb3cewZj.js +11666 -0
- package/dist/common/control-api-conformance.js +395 -399
- package/dist/common/control-api-errors.d.ts +5 -0
- package/dist/common/control-api.d.ts +1 -6
- package/dist/common/control-api.js +1034 -1018
- package/dist/common/control-requests.js +1 -0
- package/dist/common/engine-contract.d.ts +2 -0
- package/dist/common/flow-encoding.js +1 -0
- package/dist/common/flow-semantics.js +2802 -2767
- package/dist/common/mcp.d.ts +220 -0
- package/dist/common/mcp.js +2959 -1495
- package/dist/common/runtime-contract.d.ts +2 -1
- package/dist/common/runtime-contract.js +99 -28
- package/dist/common/scheduler.js +1254 -1253
- package/package.json +9 -1
- package/dist/browser/DesignerIcon-Bzpx8BtG.js +0 -2272
- package/dist/browser/dist-CP0883sY.js +0 -4
- package/dist/browser/flowChanges-DYV6OEQd.js +0 -14094
- package/dist/browser/getPseudoElementBounds-Dfqo78k7.js +0 -7151
- package/dist/browser/inputValues-CEe8GspD.js +0 -30
- package/dist/browser/main-DmjVyuWr.js +0 -76
- package/dist/browser/select-DIMWIiL5.js +0 -7428
- package/dist/browser/workbenchSelect-NZCIKdkk.js +0 -30
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
import { a as r, i,
|
|
3
|
-
import { $ as s,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { i as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as ft from "effect/Fiber";
|
|
1
|
+
import { a as e, i as t, l as n } from "./dist-Dz6Nglsd.js";
|
|
2
|
+
import { a as r, i, r as a, t as o } from "./main-BDnNHhkU.js";
|
|
3
|
+
import { $ as s, $t as c, A as l, C as u, Ct as d, D as f, Dt as p, F as m, G as h, I as g, J as _, L as v, M as y, N as b, O as x, P as S, Q as C, Qt as w, R as T, S as E, St as D, T as O, Tt as ee, X as k, Zt as A, _ as j, _t as te, a as M, at as ne, b as re, bt as ie, c as ae, ct as oe, d as se, dt as ce, en as le, et as ue, f as de, ft as fe, g as pe, gt as me, h as he, ht as ge, it as _e, jt as ve, k as N, l as ye, lt as be, m as xe, mt as Se, o as Ce, ot as we, p as Te, pt as P, q as F, r as I, rt as Ee, s as De, st as Oe, t as ke, tn as L, tt as Ae, u as je, ut as Me, v as Ne, vt as Pe, w as Fe, x as Ie, xt as Le, y as Re, yt as ze, z as R } from "./flowChanges-BDLNaCWZ.js";
|
|
4
|
+
import { Y as Be, c as z, i as B, q as V } from "./useValueChanged-DUuqLWPg.js";
|
|
5
|
+
import { $t as Ve, An as He, C as Ue, Dn as We, E as Ge, Nt as Ke, On as qe, Pt as Je, Rt as Ye, S as Xe, T as Ze, Tn as Qe, b as $e, kn as et, l as H, t as tt, w as nt, x as rt, zt as U } from "./workbenchSelect-Bb3cewZj.js";
|
|
6
|
+
import { t as W } from "./i18n-CNu41MKH.js";
|
|
7
|
+
import { i as it, n as at, r as ot, t as st } from "./languages-C0zQ4GSo.js";
|
|
8
|
+
import { Suspense as ct, lazy as lt, useEffect as G, useRef as K, useState as q } from "react";
|
|
9
|
+
import { Fragment as ut, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
10
|
+
import * as dt from "effect/Cause";
|
|
11
|
+
import * as X from "effect/Effect";
|
|
12
|
+
import * as ft from "effect/Exit";
|
|
13
|
+
import * as pt from "effect/Fiber";
|
|
15
14
|
//#region src/workbench/browser/runtime/navigation.ts
|
|
16
|
-
var
|
|
15
|
+
var mt = class {
|
|
17
16
|
#e;
|
|
18
17
|
#t;
|
|
19
18
|
#n;
|
|
@@ -23,10 +22,10 @@ var pt = class {
|
|
|
23
22
|
#o;
|
|
24
23
|
#s;
|
|
25
24
|
#c;
|
|
26
|
-
constructor(e,
|
|
27
|
-
this.#r =
|
|
25
|
+
constructor(e, t, r) {
|
|
26
|
+
this.#r = n("design"), this.#i = 0, this.#a = !1, this.#o = !1, this.#s = !1, this.#c = [], this.$ = { view: this.#r }, this.#l = () => {
|
|
28
27
|
this.#o && !this.#s && this.#u(this.#r.value, !0);
|
|
29
|
-
}, this.#t =
|
|
28
|
+
}, this.#t = t, this.#e = r, this.#n = e, this.#r.set(t.view);
|
|
30
29
|
}
|
|
31
30
|
async start() {
|
|
32
31
|
let e = this.#t, t = ++this.#i;
|
|
@@ -72,7 +71,7 @@ var pt = class {
|
|
|
72
71
|
this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
|
|
73
72
|
}
|
|
74
73
|
async apply(e) {
|
|
75
|
-
if (
|
|
74
|
+
if (ht(e, this.#t)) return;
|
|
76
75
|
this.#t = e;
|
|
77
76
|
let t = ++this.#i;
|
|
78
77
|
this.#s = !0;
|
|
@@ -88,59 +87,59 @@ var pt = class {
|
|
|
88
87
|
flowId: n,
|
|
89
88
|
view: n == null ? "design" : e
|
|
90
89
|
};
|
|
91
|
-
|
|
90
|
+
ht(r, this.#t) || (this.#t = r, this.#e(r, { replace: t })), this.#r.set(r.view);
|
|
92
91
|
}
|
|
93
92
|
};
|
|
94
|
-
function
|
|
93
|
+
function ht(e, t) {
|
|
95
94
|
return e.flowId == t.flowId && e.view == t.view;
|
|
96
95
|
}
|
|
97
96
|
//#endregion
|
|
98
97
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
99
|
-
var
|
|
100
|
-
label:
|
|
98
|
+
var gt = lt(() => import("./createResourceDialog-DOWv3Zj0.js")), _t = it.map((e) => ({
|
|
99
|
+
label: ot[e],
|
|
101
100
|
value: e
|
|
102
101
|
}));
|
|
103
|
-
function
|
|
104
|
-
let n =
|
|
105
|
-
return t == null ? null : /* @__PURE__ */
|
|
102
|
+
function vt({ language: e, onLanguageChange: t }) {
|
|
103
|
+
let n = i(), [r, a] = q(null);
|
|
104
|
+
return t == null ? null : /* @__PURE__ */ Y("div", {
|
|
106
105
|
className: "resource-language",
|
|
107
106
|
ref: a,
|
|
108
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ J("span", {
|
|
109
108
|
className: "sr-only",
|
|
110
109
|
children: n("language.label")
|
|
111
|
-
}), /* @__PURE__ */
|
|
110
|
+
}), /* @__PURE__ */ J(tt, {
|
|
112
111
|
ariaLabel: n("language.label"),
|
|
113
112
|
onValueChange: (e) => t(e),
|
|
114
|
-
options:
|
|
115
|
-
portalRoot:
|
|
113
|
+
options: _t,
|
|
114
|
+
portalRoot: r,
|
|
116
115
|
value: e
|
|
117
116
|
})]
|
|
118
117
|
});
|
|
119
118
|
}
|
|
120
|
-
function
|
|
121
|
-
let [c, l] =
|
|
122
|
-
async function
|
|
123
|
-
|
|
119
|
+
function yt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: s }) {
|
|
120
|
+
let [c, l] = q(null), u = K(null), f = K(null), m = K(null), h = a(), g = i(), [_, v] = q("idle"), [y, b] = q(n.name), [x, S] = q(), C = n.live != null && n.live.revisionId != n.draftRevisionId;
|
|
121
|
+
async function w(e) {
|
|
122
|
+
S(e == "publish" ? "publish" : "enabled");
|
|
124
123
|
try {
|
|
125
124
|
e == "publish" ? await s.workspace.publishFlow(n) : await s.workspace.setFlowEnabled(n, e);
|
|
126
125
|
} finally {
|
|
127
|
-
|
|
126
|
+
S(void 0);
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
|
-
let
|
|
131
|
-
async function
|
|
129
|
+
let T = U(y);
|
|
130
|
+
async function E(e) {
|
|
132
131
|
e.preventDefault();
|
|
133
|
-
let t =
|
|
134
|
-
|
|
132
|
+
let t = y.trim();
|
|
133
|
+
U(t) == null && await s.workspace.renameFlow(n.flowId, t) && v("idle");
|
|
135
134
|
}
|
|
136
|
-
async function
|
|
137
|
-
await s.workspace.deleteFlow(n.flowId) &&
|
|
135
|
+
async function D() {
|
|
136
|
+
await s.workspace.deleteFlow(n.flowId) && v("idle");
|
|
138
137
|
}
|
|
139
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ Y("div", {
|
|
140
139
|
className: "resource-item-row",
|
|
141
140
|
ref: l,
|
|
142
141
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ Y(V, {
|
|
144
143
|
"aria-disabled": n.status == "retiring",
|
|
145
144
|
className: "resource-list-row flow-columns",
|
|
146
145
|
nativeButton: !1,
|
|
@@ -149,264 +148,264 @@ function vt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
|
|
|
149
148
|
e.preventDefault();
|
|
150
149
|
return;
|
|
151
150
|
}
|
|
152
|
-
|
|
151
|
+
ce(e, () => o(n));
|
|
153
152
|
},
|
|
154
|
-
render: /* @__PURE__ */
|
|
153
|
+
render: /* @__PURE__ */ J("a", { href: n.status == "retiring" ? void 0 : r }),
|
|
155
154
|
tabIndex: n.status == "retiring" ? -1 : void 0,
|
|
156
155
|
variant: "ghost",
|
|
157
156
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ Y("span", {
|
|
159
158
|
className: "resource-primary-cell",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ J("span", {
|
|
161
160
|
className: "resource-icon",
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
}), /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ J(H, { name: "flow" })
|
|
162
|
+
}), /* @__PURE__ */ Y("span", { children: [/* @__PURE__ */ Y("span", {
|
|
164
163
|
className: "flex min-w-0 items-center gap-2",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ J("strong", {
|
|
166
165
|
className: "min-w-0 truncate",
|
|
167
166
|
children: n.name
|
|
168
|
-
}), e != null && /* @__PURE__ */
|
|
167
|
+
}), e != null && /* @__PURE__ */ J(A, {
|
|
169
168
|
className: "min-w-0 shrink",
|
|
170
169
|
title: e,
|
|
171
170
|
variant: "secondary",
|
|
172
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ J("span", {
|
|
173
172
|
className: "truncate",
|
|
174
173
|
children: e
|
|
175
174
|
})
|
|
176
175
|
})]
|
|
177
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ J("code", {
|
|
178
177
|
translate: "no",
|
|
179
178
|
children: n.flowId
|
|
180
179
|
})] })]
|
|
181
180
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ J("time", {
|
|
183
182
|
dateTime: n.updatedAt,
|
|
184
|
-
children: new Date(n.updatedAt).toLocaleString(
|
|
183
|
+
children: new Date(n.updatedAt).toLocaleString(h)
|
|
185
184
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ J("span", {
|
|
187
186
|
className: "resource-status",
|
|
188
|
-
children:
|
|
187
|
+
children: g(n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : C ? "resource.unpublishedChanges" : "resource.isPublished")
|
|
189
188
|
})
|
|
190
189
|
]
|
|
191
190
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ Y("div", {
|
|
193
192
|
className: "resource-live-controls",
|
|
194
|
-
"aria-busy":
|
|
195
|
-
children: [n.live == null ? /* @__PURE__ */
|
|
193
|
+
"aria-busy": x != null,
|
|
194
|
+
children: [n.live == null ? /* @__PURE__ */ J("span", {
|
|
196
195
|
className: "resource-status",
|
|
197
|
-
title:
|
|
196
|
+
title: g("resource.publishFirst"),
|
|
198
197
|
children: "—"
|
|
199
|
-
}) : /* @__PURE__ */
|
|
198
|
+
}) : /* @__PURE__ */ Y(He, {
|
|
200
199
|
className: "resource-enable",
|
|
201
|
-
title:
|
|
202
|
-
children: [/* @__PURE__ */
|
|
203
|
-
"aria-label":
|
|
200
|
+
title: g("resource.enabledHint"),
|
|
201
|
+
children: [/* @__PURE__ */ J(fe, {
|
|
202
|
+
"aria-label": g("resource.enableFlow", { name: n.name }),
|
|
204
203
|
checked: n.live?.enabled ?? !1,
|
|
205
|
-
disabled: n.status != "active" || n.live == null || t != null ||
|
|
206
|
-
onCheckedChange: (e) => void
|
|
204
|
+
disabled: n.status != "active" || n.live == null || t != null || x != null,
|
|
205
|
+
onCheckedChange: (e) => void w(e),
|
|
207
206
|
size: "sm"
|
|
208
|
-
}), /* @__PURE__ */
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
-
disabled: n.status != "active" || t != null ||
|
|
211
|
-
onClick: () => void
|
|
207
|
+
}), /* @__PURE__ */ J("span", { children: g(n.live?.enabled ? "resource.enabled" : "resource.disabled") })]
|
|
208
|
+
}), /* @__PURE__ */ J(V, {
|
|
209
|
+
disabled: n.status != "active" || t != null || x != null || n.live != null && !C,
|
|
210
|
+
onClick: () => void w("publish"),
|
|
212
211
|
size: "sm",
|
|
213
212
|
variant: "outline",
|
|
214
|
-
children:
|
|
213
|
+
children: g(x == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
|
|
215
214
|
})]
|
|
216
215
|
}),
|
|
217
|
-
n.status == "active" && /* @__PURE__ */
|
|
218
|
-
"aria-label":
|
|
219
|
-
disabled: t != null ||
|
|
220
|
-
render: /* @__PURE__ */
|
|
216
|
+
n.status == "active" && /* @__PURE__ */ Y(d, { children: [/* @__PURE__ */ J(ve, {
|
|
217
|
+
"aria-label": g("sidebar.flowActions", { name: n.name }),
|
|
218
|
+
disabled: t != null || x != null,
|
|
219
|
+
render: /* @__PURE__ */ J(V, {
|
|
221
220
|
className: "resource-row-more",
|
|
222
221
|
ref: u,
|
|
223
222
|
size: "icon-sm",
|
|
224
223
|
variant: "ghost",
|
|
225
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ J(H, { name: "more" })
|
|
226
225
|
})
|
|
227
|
-
}), /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ Y(ee, {
|
|
228
227
|
align: "end",
|
|
229
228
|
className: "min-w-36",
|
|
230
229
|
container: c,
|
|
231
|
-
finalFocus:
|
|
232
|
-
children: [/* @__PURE__ */
|
|
230
|
+
finalFocus: _ == "idle",
|
|
231
|
+
children: [/* @__PURE__ */ J(p, {
|
|
233
232
|
onClick: () => {
|
|
234
|
-
|
|
233
|
+
b(n.name), v("rename");
|
|
235
234
|
},
|
|
236
|
-
children:
|
|
237
|
-
}), /* @__PURE__ */
|
|
238
|
-
onClick: () =>
|
|
235
|
+
children: g("common.rename")
|
|
236
|
+
}), /* @__PURE__ */ J(p, {
|
|
237
|
+
onClick: () => v("delete"),
|
|
239
238
|
variant: "destructive",
|
|
240
|
-
children:
|
|
239
|
+
children: g("common.delete")
|
|
241
240
|
})]
|
|
242
241
|
})] }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
open:
|
|
242
|
+
/* @__PURE__ */ J($e, {
|
|
243
|
+
open: _ == "rename",
|
|
245
244
|
onOpenChange: (e) => {
|
|
246
|
-
e ||
|
|
245
|
+
e || v("idle");
|
|
247
246
|
},
|
|
248
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ J(Xe, {
|
|
249
248
|
container: c,
|
|
250
|
-
initialFocus:
|
|
249
|
+
initialFocus: f,
|
|
251
250
|
finalFocus: u,
|
|
252
|
-
closeLabel:
|
|
253
|
-
children: /* @__PURE__ */
|
|
251
|
+
closeLabel: g("common.cancel"),
|
|
252
|
+
children: /* @__PURE__ */ Y("form", {
|
|
254
253
|
className: "flex flex-col gap-4",
|
|
255
|
-
onSubmit: (e) => void
|
|
254
|
+
onSubmit: (e) => void E(e),
|
|
256
255
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
"data-invalid":
|
|
256
|
+
/* @__PURE__ */ J(Ze, { children: /* @__PURE__ */ J(Ge, { children: g("sidebar.renameFlow", { name: n.name }) }) }),
|
|
257
|
+
/* @__PURE__ */ Y(Qe, {
|
|
258
|
+
"data-invalid": y.length > 0 && T != null,
|
|
260
259
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ J(et, {
|
|
262
261
|
htmlFor: `rename-flow-${n.flowId}`,
|
|
263
|
-
children:
|
|
262
|
+
children: g("resource.flowName")
|
|
264
263
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ J(z, {
|
|
266
265
|
autoComplete: "off",
|
|
267
|
-
"aria-invalid":
|
|
268
|
-
"aria-describedby":
|
|
266
|
+
"aria-invalid": y.length > 0 && T != null,
|
|
267
|
+
"aria-describedby": y.length > 0 && T != null ? `rename-error-${n.flowId}` : void 0,
|
|
269
268
|
id: `rename-flow-${n.flowId}`,
|
|
270
269
|
name: "flow-name",
|
|
271
|
-
onChange: (e) =>
|
|
272
|
-
ref:
|
|
270
|
+
onChange: (e) => b(e.target.value),
|
|
271
|
+
ref: f,
|
|
273
272
|
required: !0,
|
|
274
|
-
value:
|
|
273
|
+
value: y
|
|
275
274
|
}),
|
|
276
|
-
|
|
275
|
+
y.length > 0 && T != null && /* @__PURE__ */ J(We, {
|
|
277
276
|
id: `rename-error-${n.flowId}`,
|
|
278
|
-
children:
|
|
277
|
+
children: g(`resource.nameIssue.${T}`, { max: 80 })
|
|
279
278
|
})
|
|
280
279
|
]
|
|
281
280
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
render: /* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ Y(nt, { children: [/* @__PURE__ */ J(rt, {
|
|
282
|
+
render: /* @__PURE__ */ J(V, { variant: "outline" }),
|
|
284
283
|
type: "button",
|
|
285
|
-
children:
|
|
286
|
-
}), /* @__PURE__ */
|
|
287
|
-
disabled: t != null ||
|
|
284
|
+
children: g("common.cancel")
|
|
285
|
+
}), /* @__PURE__ */ J(V, {
|
|
286
|
+
disabled: t != null || T != null,
|
|
288
287
|
type: "submit",
|
|
289
|
-
children:
|
|
288
|
+
children: g("common.save")
|
|
290
289
|
})] })
|
|
291
290
|
]
|
|
292
291
|
})
|
|
293
292
|
})
|
|
294
293
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
open:
|
|
294
|
+
/* @__PURE__ */ J($e, {
|
|
295
|
+
open: _ == "delete",
|
|
297
296
|
onOpenChange: (e) => {
|
|
298
|
-
e ||
|
|
297
|
+
e || v("idle");
|
|
299
298
|
},
|
|
300
|
-
children: /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ Y(Xe, {
|
|
301
300
|
container: c,
|
|
302
|
-
initialFocus:
|
|
301
|
+
initialFocus: m,
|
|
303
302
|
finalFocus: u,
|
|
304
303
|
showCloseButton: !1,
|
|
305
|
-
children: [/* @__PURE__ */
|
|
306
|
-
render: /* @__PURE__ */
|
|
307
|
-
ref:
|
|
304
|
+
children: [/* @__PURE__ */ Y(Ze, { children: [/* @__PURE__ */ J(Ge, { children: g("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ J(Ue, { children: g("resource.deleteDescription") })] }), /* @__PURE__ */ Y(nt, { children: [/* @__PURE__ */ J(rt, {
|
|
305
|
+
render: /* @__PURE__ */ J(V, {
|
|
306
|
+
ref: m,
|
|
308
307
|
variant: "outline"
|
|
309
308
|
}),
|
|
310
|
-
children:
|
|
311
|
-
}), /* @__PURE__ */
|
|
309
|
+
children: g("common.cancel")
|
|
310
|
+
}), /* @__PURE__ */ J(V, {
|
|
312
311
|
disabled: t != null,
|
|
313
|
-
onClick: () => void
|
|
312
|
+
onClick: () => void D(),
|
|
314
313
|
variant: "destructive",
|
|
315
|
-
children:
|
|
314
|
+
children: g(t == "flow" ? "common.deleting" : "common.delete")
|
|
316
315
|
})] })]
|
|
317
316
|
})
|
|
318
317
|
})
|
|
319
318
|
]
|
|
320
319
|
});
|
|
321
320
|
}
|
|
322
|
-
function
|
|
323
|
-
return /* @__PURE__ */
|
|
321
|
+
function bt() {
|
|
322
|
+
return /* @__PURE__ */ Y("div", {
|
|
324
323
|
"aria-hidden": "true",
|
|
325
324
|
className: "resource-list-row resource-skeleton-row flow-columns",
|
|
326
325
|
children: [
|
|
327
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ Y("span", {
|
|
328
327
|
className: "resource-primary-cell",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ J(P, { className: "size-8 shrink-0" }), /* @__PURE__ */ Y("span", {
|
|
330
329
|
className: "resource-skeleton-copy",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ J(P, { className: "h-3.5 w-36" }), /* @__PURE__ */ J(P, { className: "h-2.5 w-48 max-w-full" })]
|
|
332
331
|
})]
|
|
333
332
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ J(P, { className: "h-3 w-28" }),
|
|
334
|
+
/* @__PURE__ */ J(P, { className: "h-3 w-16" })
|
|
336
335
|
]
|
|
337
336
|
});
|
|
338
337
|
}
|
|
339
|
-
function
|
|
340
|
-
let h =
|
|
338
|
+
function xt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction: s, hostTitle: c, language: l, onCreateFlow: u, onHostAction: d, onLanguageChange: f, onSelectFlow: p, store: m }) {
|
|
339
|
+
let h = i(), g = r(m.workspace.$.busy), _ = r(m.workspace.$.flowLoadFailed), v = r(m.workspace.$.flowLoadMoreFailed), y = r(m.workspace.$.flowLoading), b = r(m.workspace.$.flowLoadingMore), x = r(m.workspace.$.flowNextCursor), S = r(m.workspace.$.flowRefreshing), C = r(m.workspace.$.flows), w = r(m.workspace.$.flowTotal), [T, E] = q(!1), [O, ee] = q(""), [k, A] = q(""), j = O.trim().toLocaleLowerCase(), M = C.filter((e) => e.name.toLocaleLowerCase().includes(j));
|
|
341
340
|
async function ne(e) {
|
|
342
341
|
e.preventDefault();
|
|
343
|
-
let t =
|
|
344
|
-
|
|
342
|
+
let t = k.trim();
|
|
343
|
+
U(t) != null || !await u(t) || (E(!1), A(""));
|
|
345
344
|
}
|
|
346
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ J("main", {
|
|
347
346
|
className: "resource-browser",
|
|
348
|
-
children: /* @__PURE__ */
|
|
349
|
-
className:
|
|
347
|
+
children: /* @__PURE__ */ Y("div", {
|
|
348
|
+
className: Be("resource-page", e != "default" && "resource-page-full"),
|
|
350
349
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ J("h1", {
|
|
352
351
|
className: "sr-only",
|
|
353
352
|
children: h("resource.flows")
|
|
354
353
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ Y("section", {
|
|
356
355
|
"aria-labelledby": "flow-list-title",
|
|
357
356
|
className: "resource-list-section",
|
|
358
357
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ Y("div", {
|
|
360
359
|
className: "resource-list-title",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
362
361
|
className: "resource-list-heading",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
364
363
|
id: "flow-list-title",
|
|
365
364
|
children: h("resource.allFlows")
|
|
366
|
-
}), !y && /* @__PURE__ */
|
|
367
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), !y && /* @__PURE__ */ J("span", { children: h("resource.flowCount", { count: w ?? C.length }) })]
|
|
366
|
+
}), /* @__PURE__ */ Y("div", {
|
|
368
367
|
className: "resource-list-actions",
|
|
369
368
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ J(vt, {
|
|
371
370
|
language: l,
|
|
372
371
|
onLanguageChange: f
|
|
373
372
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ Y(Se, {
|
|
375
374
|
className: "w-full sm:w-56",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ J(ge, { children: /* @__PURE__ */ J(H, {
|
|
377
376
|
name: "search",
|
|
378
377
|
size: 17
|
|
379
|
-
}) }), /* @__PURE__ */
|
|
378
|
+
}) }), /* @__PURE__ */ J(me, {
|
|
380
379
|
autoComplete: "off",
|
|
381
380
|
"aria-label": h("resource.searchFlows"),
|
|
382
381
|
name: "flow-search",
|
|
383
382
|
onChange: (e) => ee(e.target.value),
|
|
384
383
|
placeholder: h("resource.searchFlows"),
|
|
385
|
-
value:
|
|
384
|
+
value: O
|
|
386
385
|
})]
|
|
387
386
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ J(V, {
|
|
389
388
|
"aria-label": h("common.refresh"),
|
|
390
389
|
disabled: y || S || g != null,
|
|
391
390
|
onClick: () => void m.workspace.reloadFlows(),
|
|
392
391
|
size: "icon",
|
|
393
392
|
title: h("common.refresh"),
|
|
394
393
|
variant: "outline",
|
|
395
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ J(H, {
|
|
396
395
|
className: S ? "animate-spin" : void 0,
|
|
397
396
|
name: "refresh"
|
|
398
397
|
})
|
|
399
398
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ Y(V, {
|
|
401
400
|
className: "resource-page-primary-action",
|
|
402
401
|
disabled: g != null,
|
|
403
402
|
onClick: () => E(!0),
|
|
404
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ J(H, {
|
|
405
404
|
"data-icon": "inline-start",
|
|
406
405
|
name: "plus"
|
|
407
406
|
}), h("resource.newFlow")]
|
|
408
407
|
}),
|
|
409
|
-
s != null && c != null && d != null && /* @__PURE__ */
|
|
408
|
+
s != null && c != null && d != null && /* @__PURE__ */ J(Me, {
|
|
410
409
|
action: s,
|
|
411
410
|
onAction: d,
|
|
412
411
|
title: c
|
|
@@ -414,58 +413,58 @@ function bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
414
413
|
]
|
|
415
414
|
})]
|
|
416
415
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ Y("div", {
|
|
418
417
|
"aria-hidden": "true",
|
|
419
418
|
className: "resource-list-columns flow-columns",
|
|
420
419
|
children: [
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ J("span", { children: h("resource.name") }),
|
|
421
|
+
/* @__PURE__ */ J("span", { children: h("resource.updated") }),
|
|
422
|
+
/* @__PURE__ */ J("span", { children: h("resource.publication") }),
|
|
423
|
+
/* @__PURE__ */ J("span", { children: h("resource.enabledColumn") })
|
|
425
424
|
]
|
|
426
425
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ J("div", {
|
|
428
427
|
className: "resource-list",
|
|
429
|
-
children: y ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */
|
|
428
|
+
children: y ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ J(bt, {}, t)) : _ ? /* @__PURE__ */ Y(te, {
|
|
430
429
|
className: "min-h-64",
|
|
431
430
|
role: "alert",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ Y(ie, { children: [
|
|
432
|
+
/* @__PURE__ */ J(Le, {
|
|
434
433
|
variant: "icon",
|
|
435
|
-
children: /* @__PURE__ */
|
|
434
|
+
children: /* @__PURE__ */ J(H, {
|
|
436
435
|
name: "alert",
|
|
437
436
|
size: 20
|
|
438
437
|
})
|
|
439
438
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
] }), /* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ J(D, { children: h("resource.flowsLoadFailed") }),
|
|
440
|
+
/* @__PURE__ */ J(ze, { children: h("resource.flowsLoadFailedDescription") })
|
|
441
|
+
] }), /* @__PURE__ */ J(Pe, { children: /* @__PURE__ */ J(V, {
|
|
443
442
|
onClick: () => void m.retryFlows(),
|
|
444
443
|
variant: "outline",
|
|
445
444
|
children: h("empty.retry")
|
|
446
445
|
}) })]
|
|
447
|
-
}) :
|
|
446
|
+
}) : M.length == 0 ? /* @__PURE__ */ Y(te, {
|
|
448
447
|
className: "min-h-64",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
448
|
+
children: [/* @__PURE__ */ Y(ie, { children: [
|
|
449
|
+
/* @__PURE__ */ J(Le, {
|
|
451
450
|
variant: "icon",
|
|
452
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ J(H, {
|
|
453
452
|
name: "flow",
|
|
454
453
|
size: 20
|
|
455
454
|
})
|
|
456
455
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
] }),
|
|
456
|
+
/* @__PURE__ */ J(D, { children: h(j.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
|
|
457
|
+
/* @__PURE__ */ J(ze, { children: h(j.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
|
|
458
|
+
] }), j.length == 0 && /* @__PURE__ */ J(Pe, { children: /* @__PURE__ */ Y(V, {
|
|
460
459
|
onClick: () => E(!0),
|
|
461
460
|
variant: "outline",
|
|
462
|
-
children: [/* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ J(H, {
|
|
463
462
|
"data-icon": "inline-start",
|
|
464
463
|
name: "plus"
|
|
465
464
|
}), h("resource.newFlow")]
|
|
466
465
|
}) })]
|
|
467
|
-
}) :
|
|
468
|
-
badge:
|
|
466
|
+
}) : M.map((e) => /* @__PURE__ */ J(yt, {
|
|
467
|
+
badge: a?.[e.flowId],
|
|
469
468
|
busy: g,
|
|
470
469
|
flow: e,
|
|
471
470
|
href: o(e),
|
|
@@ -473,9 +472,9 @@ function bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
473
472
|
store: m
|
|
474
473
|
}, e.flowId))
|
|
475
474
|
}),
|
|
476
|
-
x != null && /* @__PURE__ */
|
|
475
|
+
x != null && /* @__PURE__ */ J("div", {
|
|
477
476
|
className: "resource-list-footer",
|
|
478
|
-
children: /* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ J(V, {
|
|
479
478
|
disabled: b || S,
|
|
480
479
|
onClick: () => void m.workspace.loadMoreFlows(),
|
|
481
480
|
variant: "outline",
|
|
@@ -484,16 +483,16 @@ function bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
484
483
|
})
|
|
485
484
|
]
|
|
486
485
|
}),
|
|
487
|
-
T && /* @__PURE__ */
|
|
486
|
+
T && /* @__PURE__ */ J(ct, {
|
|
488
487
|
fallback: null,
|
|
489
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ J(gt, {
|
|
490
489
|
disabled: t,
|
|
491
490
|
field: n,
|
|
492
491
|
id: "flow-name",
|
|
493
|
-
issue:
|
|
492
|
+
issue: U(k),
|
|
494
493
|
label: h("resource.flowName"),
|
|
495
|
-
name:
|
|
496
|
-
onNameChange:
|
|
494
|
+
name: k,
|
|
495
|
+
onNameChange: A,
|
|
497
496
|
onOpenChange: E,
|
|
498
497
|
onSubmit: (e) => void ne(e),
|
|
499
498
|
pending: g == "flow",
|
|
@@ -506,7 +505,7 @@ function bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
506
505
|
}
|
|
507
506
|
//#endregion
|
|
508
507
|
//#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
|
|
509
|
-
var
|
|
508
|
+
var St = (e) => crypto.getRandomValues(new Uint8Array(e)), Ct = (e, t, n) => {
|
|
510
509
|
let r = 256 - 256 % e.length;
|
|
511
510
|
if (r === 256) {
|
|
512
511
|
let r = e.length - 1;
|
|
@@ -528,29 +527,29 @@ var xt = (e) => crypto.getRandomValues(new Uint8Array(e)), St = (e, t, n) => {
|
|
|
528
527
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
529
528
|
}
|
|
530
529
|
};
|
|
531
|
-
},
|
|
530
|
+
}, wt = (e, t = 21) => Ct(e, t | 0, St);
|
|
532
531
|
//#endregion
|
|
533
532
|
//#region src/flow/common/edgeChanges.ts
|
|
534
|
-
function
|
|
535
|
-
return
|
|
533
|
+
function Tt(e, t, n) {
|
|
534
|
+
return Dt(e, t)?.edges.some((e) => B(e, n)) ? [] : [{
|
|
536
535
|
edge: n,
|
|
537
536
|
kind: "graph.edge.connect",
|
|
538
537
|
target: t
|
|
539
538
|
}];
|
|
540
539
|
}
|
|
541
|
-
function
|
|
542
|
-
return
|
|
540
|
+
function Et(e, t, n) {
|
|
541
|
+
return Dt(e, t)?.edges.some((e) => B(e, n)) ? [{
|
|
543
542
|
edge: n,
|
|
544
543
|
kind: "graph.edge.disconnect",
|
|
545
544
|
target: t
|
|
546
545
|
}] : [];
|
|
547
546
|
}
|
|
548
|
-
function
|
|
547
|
+
function Dt(e, t) {
|
|
549
548
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
550
549
|
}
|
|
551
550
|
//#endregion
|
|
552
551
|
//#region src/flow/common/moduleChanges.ts
|
|
553
|
-
async function
|
|
552
|
+
async function Ot(e) {
|
|
554
553
|
try {
|
|
555
554
|
let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
|
|
556
555
|
errorRecovery: !0,
|
|
@@ -566,7 +565,7 @@ async function Dt(e) {
|
|
|
566
565
|
return [];
|
|
567
566
|
}
|
|
568
567
|
}
|
|
569
|
-
function
|
|
568
|
+
function kt(e, t, n, r, i) {
|
|
570
569
|
return [{
|
|
571
570
|
beforeImports: n,
|
|
572
571
|
beforeSource: t,
|
|
@@ -576,7 +575,7 @@ function Ot(e, t, n, r, i) {
|
|
|
576
575
|
source: r
|
|
577
576
|
}];
|
|
578
577
|
}
|
|
579
|
-
var
|
|
578
|
+
var At = wt("23456789abcdefghjkmnpqrstuvwxyz", 10), Z = {
|
|
580
579
|
activities: [],
|
|
581
580
|
activitiesLoadFailed: !1,
|
|
582
581
|
activitiesLoading: !1,
|
|
@@ -591,25 +590,25 @@ var kt = Ct("23456789abcdefghjkmnpqrstuvwxyz", 10), J = {
|
|
|
591
590
|
publications: [],
|
|
592
591
|
publishing: !1,
|
|
593
592
|
refreshing: !1
|
|
594
|
-
},
|
|
595
|
-
function
|
|
593
|
+
}, jt = 20, Mt = 50, Nt = 750;
|
|
594
|
+
function Q(e, t) {
|
|
596
595
|
return e?.flowId == t.flowId;
|
|
597
596
|
}
|
|
598
|
-
var
|
|
597
|
+
var Pt = class {
|
|
599
598
|
#e;
|
|
600
599
|
#t;
|
|
601
600
|
#n;
|
|
602
|
-
#r = new
|
|
603
|
-
#i = new
|
|
601
|
+
#r = new s();
|
|
602
|
+
#i = new s();
|
|
604
603
|
#a;
|
|
605
|
-
#o = new
|
|
606
|
-
#s = new
|
|
604
|
+
#o = new s();
|
|
605
|
+
#s = new s();
|
|
607
606
|
#c;
|
|
608
|
-
#l =
|
|
607
|
+
#l = n(Z);
|
|
609
608
|
#u;
|
|
610
609
|
#d;
|
|
611
610
|
#f;
|
|
612
|
-
constructor(t, n, r, i, a =
|
|
611
|
+
constructor(t, n, r, i, a = L, o = W()) {
|
|
613
612
|
this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
|
|
614
613
|
activities: e(this.#l, (e) => e.activities),
|
|
615
614
|
activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
|
|
@@ -643,17 +642,17 @@ var Nt = class {
|
|
|
643
642
|
this.#l.dispose();
|
|
644
643
|
}
|
|
645
644
|
reset() {
|
|
646
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(
|
|
645
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(Z);
|
|
647
646
|
}
|
|
648
647
|
async load(e) {
|
|
649
|
-
let t = { flowId: e }, n = this.#l.value, r = n.loaded &&
|
|
650
|
-
|
|
648
|
+
let t = { flowId: e }, n = this.#l.value, r = n.loaded && Q(n.target, t), i = this.#r.begin();
|
|
649
|
+
Q(n.target, t) || (this.#i.invalidate(), this.#y(), this.#f = void 0), r ? this.#S({
|
|
651
650
|
loadFailed: !1,
|
|
652
651
|
loadingMore: !1,
|
|
653
652
|
loadMoreFailed: !1,
|
|
654
653
|
refreshing: !0
|
|
655
654
|
}) : (this.#c(void 0), this.#l.set({
|
|
656
|
-
...
|
|
655
|
+
...Z,
|
|
657
656
|
loading: !0,
|
|
658
657
|
target: t
|
|
659
658
|
}));
|
|
@@ -683,7 +682,7 @@ var Nt = class {
|
|
|
683
682
|
loadFailed: !r,
|
|
684
683
|
loading: !1,
|
|
685
684
|
refreshing: !1
|
|
686
|
-
}), this.#c(
|
|
685
|
+
}), this.#c(C(e, this.#n.t));
|
|
687
686
|
}
|
|
688
687
|
}
|
|
689
688
|
async loadMore() {
|
|
@@ -697,7 +696,7 @@ var Nt = class {
|
|
|
697
696
|
try {
|
|
698
697
|
let e = await this.#e.listPublications(n.flowId, {
|
|
699
698
|
cursor: t,
|
|
700
|
-
limit:
|
|
699
|
+
limit: Mt
|
|
701
700
|
});
|
|
702
701
|
if (!r()) return;
|
|
703
702
|
let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
|
|
@@ -712,7 +711,7 @@ var Nt = class {
|
|
|
712
711
|
this.#S({
|
|
713
712
|
loadMoreFailed: !0,
|
|
714
713
|
loadingMore: !1
|
|
715
|
-
}), this.#c(
|
|
714
|
+
}), this.#c(C(e, this.#n.t));
|
|
716
715
|
}
|
|
717
716
|
}
|
|
718
717
|
async publish() {
|
|
@@ -739,7 +738,7 @@ var Nt = class {
|
|
|
739
738
|
publishing: e.status == "pending"
|
|
740
739
|
}), await this.#_(r, e, s, t.name)) : !1;
|
|
741
740
|
} catch (e) {
|
|
742
|
-
return s() ? (e instanceof
|
|
741
|
+
return s() ? (e instanceof c && e.code == "live.conflict" && await this.#m(r), this.#c(C(e, this.#n.t)), !1) : !1;
|
|
743
742
|
} finally {
|
|
744
743
|
s() && this.#S({ publishing: !1 });
|
|
745
744
|
}
|
|
@@ -765,7 +764,7 @@ var Nt = class {
|
|
|
765
764
|
message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
|
|
766
765
|
}), !0);
|
|
767
766
|
} catch (e) {
|
|
768
|
-
return s() ? (e instanceof
|
|
767
|
+
return s() ? (e instanceof c && e.code == "live.conflict" && await this.#m(r), this.#c(C(e, this.#n.t)), !1) : !1;
|
|
769
768
|
} finally {
|
|
770
769
|
s() && this.#S({ rollingBackPublicationId: void 0 });
|
|
771
770
|
}
|
|
@@ -800,13 +799,13 @@ var Nt = class {
|
|
|
800
799
|
testingTriggerId: void 0,
|
|
801
800
|
testResult: void 0
|
|
802
801
|
});
|
|
803
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit:
|
|
802
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: jt })]);
|
|
804
803
|
if (n()) {
|
|
805
804
|
if (r.status == "rejected") {
|
|
806
805
|
this.#S({
|
|
807
806
|
activitiesLoading: !1,
|
|
808
807
|
detailLoading: !1
|
|
809
|
-
}), this.#c(
|
|
808
|
+
}), this.#c(C(r.reason, this.#n.t));
|
|
810
809
|
return;
|
|
811
810
|
}
|
|
812
811
|
this.#S({
|
|
@@ -820,7 +819,7 @@ var Nt = class {
|
|
|
820
819
|
}) : (this.#S({
|
|
821
820
|
activitiesLoadFailed: !0,
|
|
822
821
|
activitiesLoading: !1
|
|
823
|
-
}), this.#c(
|
|
822
|
+
}), this.#c(C(i.reason, this.#n.t)));
|
|
824
823
|
}
|
|
825
824
|
}
|
|
826
825
|
async loadMoreTriggerActivities() {
|
|
@@ -834,7 +833,7 @@ var Nt = class {
|
|
|
834
833
|
try {
|
|
835
834
|
let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
|
|
836
835
|
cursor: t,
|
|
837
|
-
limit:
|
|
836
|
+
limit: jt
|
|
838
837
|
});
|
|
839
838
|
if (!i() || this.#l.value.selectedTriggerId != n) return;
|
|
840
839
|
let a = new Set(this.#l.value.activities.map((e) => e.activityId));
|
|
@@ -849,7 +848,7 @@ var Nt = class {
|
|
|
849
848
|
this.#S({
|
|
850
849
|
activitiesLoadFailed: !0,
|
|
851
850
|
activitiesLoadingMore: !1
|
|
852
|
-
}), this.#c(
|
|
851
|
+
}), this.#c(C(e, this.#n.t));
|
|
853
852
|
}
|
|
854
853
|
}
|
|
855
854
|
async testTrigger() {
|
|
@@ -864,7 +863,7 @@ var Nt = class {
|
|
|
864
863
|
let e = await this.#e.testFlowPollTrigger(n.flowId, t);
|
|
865
864
|
return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#S({ testResult: e }), !0);
|
|
866
865
|
} catch (e) {
|
|
867
|
-
return i() && this.#l.value.selectedTriggerId == t && this.#c(
|
|
866
|
+
return i() && this.#l.value.selectedTriggerId == t && this.#c(C(e, this.#n.t)), !1;
|
|
868
867
|
} finally {
|
|
869
868
|
i() && this.#l.value.selectedTriggerId == t && this.#S({ testingTriggerId: void 0 });
|
|
870
869
|
}
|
|
@@ -883,16 +882,16 @@ var Nt = class {
|
|
|
883
882
|
message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
|
|
884
883
|
}), !0) : !1;
|
|
885
884
|
} catch (e) {
|
|
886
|
-
return n() && this.#c(
|
|
885
|
+
return n() && this.#c(C(e, this.#n.t)), !1;
|
|
887
886
|
} finally {
|
|
888
887
|
n() && this.#S({ changingTriggerId: void 0 });
|
|
889
888
|
}
|
|
890
889
|
}
|
|
891
890
|
async #p(e, t) {
|
|
892
891
|
let n = this.#r.begin(), [r, i, a] = await this.#h(e, t).catch((t) => {
|
|
893
|
-
throw n() &&
|
|
892
|
+
throw n() && Q(this.#l.value.target, e) && this.#S({ refreshing: !1 }), t;
|
|
894
893
|
});
|
|
895
|
-
t?.throwIfAborted(), n() && this.#u.updateLive(r), n() &&
|
|
894
|
+
t?.throwIfAborted(), n() && this.#u.updateLive(r), n() && Q(this.#l.value.target, e) && this.#S({
|
|
896
895
|
bindings: a,
|
|
897
896
|
live: r,
|
|
898
897
|
loaded: !0,
|
|
@@ -916,7 +915,7 @@ var Nt = class {
|
|
|
916
915
|
this.#e.getLive(e.flowId, t),
|
|
917
916
|
this.#e.listPublications(e.flowId, {
|
|
918
917
|
includeTotal: !0,
|
|
919
|
-
limit:
|
|
918
|
+
limit: Mt
|
|
920
919
|
}, t),
|
|
921
920
|
this.#e.listFlowTriggerBindings(e.flowId, t)
|
|
922
921
|
]);
|
|
@@ -926,7 +925,7 @@ var Nt = class {
|
|
|
926
925
|
if (t != null && t != "") try {
|
|
927
926
|
return await this.#e.getPublishOperation(e.flowId, t);
|
|
928
927
|
} catch (t) {
|
|
929
|
-
if (t instanceof
|
|
928
|
+
if (t instanceof c && t.code == "publication.operation-not-found") {
|
|
930
929
|
this.#a.setItem(this.#b(e.flowId), "");
|
|
931
930
|
return;
|
|
932
931
|
}
|
|
@@ -935,7 +934,7 @@ var Nt = class {
|
|
|
935
934
|
}
|
|
936
935
|
async #_(e, t, n, r) {
|
|
937
936
|
this.#y();
|
|
938
|
-
let i =
|
|
937
|
+
let i = X.runFork(X.gen({ self: this }, function* () {
|
|
939
938
|
let i = yield* this.#v(e, t, n);
|
|
940
939
|
if (i == null || !n()) return !1;
|
|
941
940
|
if (this.#f = void 0, this.#x(e, {
|
|
@@ -945,11 +944,11 @@ var Nt = class {
|
|
|
945
944
|
kind: "error",
|
|
946
945
|
message: i.issue.message
|
|
947
946
|
}), !1;
|
|
948
|
-
let a = yield*
|
|
947
|
+
let a = yield* X.tryPromise({
|
|
949
948
|
try: (t) => this.#p(e, t),
|
|
950
949
|
catch: (e) => e
|
|
951
|
-
}).pipe(
|
|
952
|
-
onFailure: (e) => (n() && this.#c(
|
|
950
|
+
}).pipe(X.match({
|
|
951
|
+
onFailure: (e) => (n() && this.#c(C(e, this.#n.t)), !1),
|
|
953
952
|
onSuccess: () => !0
|
|
954
953
|
}));
|
|
955
954
|
return n() ? (a && this.#c({
|
|
@@ -958,34 +957,34 @@ var Nt = class {
|
|
|
958
957
|
}), !0) : !1;
|
|
959
958
|
}));
|
|
960
959
|
this.#d = i;
|
|
961
|
-
let a = await
|
|
962
|
-
if (
|
|
963
|
-
if (
|
|
964
|
-
throw
|
|
960
|
+
let a = await X.runPromiseExit(pt.join(i));
|
|
961
|
+
if (ft.isSuccess(a)) return a.value;
|
|
962
|
+
if (dt.hasInterruptsOnly(a.cause)) return !1;
|
|
963
|
+
throw dt.squash(a.cause);
|
|
965
964
|
}
|
|
966
965
|
#v(e, t, n) {
|
|
967
|
-
return
|
|
966
|
+
return X.gen({ self: this }, function* () {
|
|
968
967
|
let r = t;
|
|
969
968
|
for (; r.status == "pending";) {
|
|
970
|
-
if (yield*
|
|
971
|
-
let t = yield*
|
|
969
|
+
if (yield* X.sleep(Nt), !n()) return;
|
|
970
|
+
let t = yield* X.tryPromise({
|
|
972
971
|
try: (t) => this.#e.getPublishOperation(e.flowId, r.operationId, t),
|
|
973
972
|
catch: (e) => e
|
|
974
|
-
}).pipe(
|
|
973
|
+
}).pipe(X.match({
|
|
975
974
|
onFailure: (e) => ({ error: e }),
|
|
976
975
|
onSuccess: (e) => ({ value: e })
|
|
977
976
|
}));
|
|
978
977
|
if (!n()) return;
|
|
979
978
|
if ("error" in t) {
|
|
980
979
|
let n = t.error;
|
|
981
|
-
if (n instanceof
|
|
980
|
+
if (n instanceof c && n.code == "publication.operation-not-found") {
|
|
982
981
|
this.#a.setItem(this.#b(e.flowId), ""), this.#x(e, {
|
|
983
982
|
operation: void 0,
|
|
984
983
|
publishing: !1
|
|
985
|
-
}), this.#c(
|
|
984
|
+
}), this.#c(C(n, this.#n.t));
|
|
986
985
|
return;
|
|
987
986
|
}
|
|
988
|
-
this.#c(
|
|
987
|
+
this.#c(C(n, this.#n.t));
|
|
989
988
|
continue;
|
|
990
989
|
}
|
|
991
990
|
r = t.value, this.#x(e, { operation: r });
|
|
@@ -1000,8 +999,8 @@ var Nt = class {
|
|
|
1000
999
|
return `publish-operation:${e}`;
|
|
1001
1000
|
}
|
|
1002
1001
|
#x(e, t) {
|
|
1003
|
-
|
|
1004
|
-
...
|
|
1002
|
+
Q(this.#l.value.target, e) ? this.#S(t) : this.#l.set({
|
|
1003
|
+
...Z,
|
|
1005
1004
|
...t,
|
|
1006
1005
|
target: e
|
|
1007
1006
|
});
|
|
@@ -1012,21 +1011,21 @@ var Nt = class {
|
|
|
1012
1011
|
...e
|
|
1013
1012
|
});
|
|
1014
1013
|
}
|
|
1015
|
-
},
|
|
1016
|
-
function
|
|
1014
|
+
}, Ft = { starting: !1 };
|
|
1015
|
+
function It(e) {
|
|
1017
1016
|
switch (e.kind) {
|
|
1018
1017
|
case "condition": return { [e.node.input.handle]: e.node.input };
|
|
1019
|
-
case "subflow": return
|
|
1020
|
-
case "task": return
|
|
1018
|
+
case "subflow": return Ye(e.definition?.inputs ?? []);
|
|
1019
|
+
case "task": return Ye(e.definition?.inputs ?? []);
|
|
1021
1020
|
case "value": return {};
|
|
1022
1021
|
case "wait": return { [e.node.input.handle]: e.node.input };
|
|
1023
1022
|
}
|
|
1024
1023
|
}
|
|
1025
|
-
function
|
|
1024
|
+
function Lt(e) {
|
|
1026
1025
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
1027
1026
|
}
|
|
1028
|
-
function
|
|
1029
|
-
let n =
|
|
1027
|
+
function $(e, t) {
|
|
1028
|
+
let n = F(e), r = n.graph({ kind: "flow" });
|
|
1030
1029
|
if (r == null) return [];
|
|
1031
1030
|
let i = /* @__PURE__ */ new Set([t]), a = [t];
|
|
1032
1031
|
for (; a.length > 0;) {
|
|
@@ -1038,13 +1037,13 @@ function X(e, t) {
|
|
|
1038
1037
|
if (r.kind == "trigger") return r.trigger.kind == "manual" || r.trigger.kind == "cron" ? [] : [{
|
|
1039
1038
|
definitions: [{
|
|
1040
1039
|
handle: "payload",
|
|
1041
|
-
jsonSchema:
|
|
1040
|
+
jsonSchema: k(r.trigger),
|
|
1042
1041
|
nullable: !1
|
|
1043
1042
|
}],
|
|
1044
1043
|
nodeId: e,
|
|
1045
1044
|
title: r.trigger.name
|
|
1046
1045
|
}];
|
|
1047
|
-
let i = Object.entries(
|
|
1046
|
+
let i = Object.entries(It(r)).filter(([e, t]) => r.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
1048
1047
|
handle: e,
|
|
1049
1048
|
jsonSchema: t.jsonSchema,
|
|
1050
1049
|
nullable: t.nullable
|
|
@@ -1052,19 +1051,19 @@ function X(e, t) {
|
|
|
1052
1051
|
return i.length == 0 ? [] : [{
|
|
1053
1052
|
definitions: i,
|
|
1054
1053
|
nodeId: e,
|
|
1055
|
-
title:
|
|
1054
|
+
title: Lt(r)
|
|
1056
1055
|
}];
|
|
1057
1056
|
});
|
|
1058
1057
|
}
|
|
1059
|
-
function
|
|
1058
|
+
function Rt(e) {
|
|
1060
1059
|
return JSON.stringify(e.map((e) => [e.nodeId, e.definitions.map((e) => [
|
|
1061
1060
|
e.handle,
|
|
1062
1061
|
e.jsonSchema,
|
|
1063
1062
|
e.nullable
|
|
1064
1063
|
])]));
|
|
1065
1064
|
}
|
|
1066
|
-
async function
|
|
1067
|
-
let { FlowRunInputEditorStore: i } = await import("./flowRunInputEditorStore-
|
|
1065
|
+
async function zt(e, t, n, r) {
|
|
1066
|
+
let { FlowRunInputEditorStore: i } = await import("./flowRunInputEditorStore-BBqQIOCR.js").then((e) => e.n);
|
|
1068
1067
|
return e.map((e) => {
|
|
1069
1068
|
let a = new i(e.definitions, t);
|
|
1070
1069
|
return e.nodeId == n && a.replaceValues({ payload: {} }), r?.[e.nodeId] != null && a.replaceValues(r[e.nodeId]), {
|
|
@@ -1074,28 +1073,28 @@ async function Lt(e, t, n, r) {
|
|
|
1074
1073
|
};
|
|
1075
1074
|
});
|
|
1076
1075
|
}
|
|
1077
|
-
function
|
|
1076
|
+
function Bt(e) {
|
|
1078
1077
|
return Object.fromEntries(e.map((e) => [e.nodeId, e.editor.values()]));
|
|
1079
1078
|
}
|
|
1080
|
-
function
|
|
1079
|
+
function Vt(e, t) {
|
|
1081
1080
|
return {
|
|
1082
1081
|
inputs: Object.fromEntries(e.filter((e) => e.nodeId != t).map((e) => [e.nodeId, e.editor.values()])),
|
|
1083
1082
|
payload: e.find((e) => e.nodeId == t)?.editor.values().payload ?? {}
|
|
1084
1083
|
};
|
|
1085
1084
|
}
|
|
1086
|
-
var
|
|
1085
|
+
var Ht = class {
|
|
1087
1086
|
#e;
|
|
1088
1087
|
#t;
|
|
1089
1088
|
#n;
|
|
1090
1089
|
#r;
|
|
1091
|
-
#i = new
|
|
1092
|
-
#a = new
|
|
1090
|
+
#i = new s();
|
|
1091
|
+
#a = new s();
|
|
1093
1092
|
#o;
|
|
1094
1093
|
#s = /* @__PURE__ */ new Map();
|
|
1095
1094
|
#c;
|
|
1096
|
-
#l =
|
|
1095
|
+
#l = n(Ft);
|
|
1097
1096
|
#u;
|
|
1098
|
-
constructor(t, n, r, i, a =
|
|
1097
|
+
constructor(t, n, r, i, a = W(), o = L) {
|
|
1099
1098
|
this.#e = i, this.#t = t, this.#o = n, this.#c = r, this.#r = a, this.#n = o, this.$ = {
|
|
1100
1099
|
inputRequest: e(this.#l, (e) => e.inputRequest),
|
|
1101
1100
|
starting: e(this.#l, (e) => e.starting),
|
|
@@ -1110,14 +1109,14 @@ var Bt = class {
|
|
|
1110
1109
|
reset() {
|
|
1111
1110
|
this.#i.invalidate(), this.#a.invalidate(), this.#u = void 0;
|
|
1112
1111
|
let e = this.#l.value.inputRequest;
|
|
1113
|
-
this.#h(e), this.#l.set(
|
|
1112
|
+
this.#h(e), this.#l.set(Ft), this.#p(e);
|
|
1114
1113
|
}
|
|
1115
1114
|
async requestDraft(e, t, n) {
|
|
1116
1115
|
let r = this.#a.begin();
|
|
1117
1116
|
try {
|
|
1118
1117
|
return await this.#d("draft", e, t, t.revisionId, r, void 0, n);
|
|
1119
1118
|
} catch (e) {
|
|
1120
|
-
return r() && this.#c(
|
|
1119
|
+
return r() && this.#c(C(e, this.#r.t)), "unavailable";
|
|
1121
1120
|
} finally {
|
|
1122
1121
|
r() && this.#g({ starting: !1 });
|
|
1123
1122
|
}
|
|
@@ -1127,16 +1126,16 @@ var Bt = class {
|
|
|
1127
1126
|
try {
|
|
1128
1127
|
return await this.#d("draft", e, t, t.revisionId, r, void 0, n, !0);
|
|
1129
1128
|
} catch (e) {
|
|
1130
|
-
return r() && this.#c(
|
|
1129
|
+
return r() && this.#c(C(e, this.#r.t)), "unavailable";
|
|
1131
1130
|
} finally {
|
|
1132
1131
|
r() && this.#g({ starting: !1 });
|
|
1133
1132
|
}
|
|
1134
1133
|
}
|
|
1135
1134
|
inputStatus(e, t, n) {
|
|
1136
|
-
let r =
|
|
1135
|
+
let r = $(t, n);
|
|
1137
1136
|
if (r.length == 0) return "none";
|
|
1138
1137
|
let i = this.#s.get(this.#m(e, n));
|
|
1139
|
-
return i?.valid == 1 && i.signature ==
|
|
1138
|
+
return i?.valid == 1 && i.signature == Rt(r) ? "ready" : "missing";
|
|
1140
1139
|
}
|
|
1141
1140
|
async requestLive(e) {
|
|
1142
1141
|
let t = this.#a.begin();
|
|
@@ -1147,7 +1146,7 @@ var Bt = class {
|
|
|
1147
1146
|
let r = await this.#t.getRevision(e.flowId, n.revisionId);
|
|
1148
1147
|
return t() ? await this.#d("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
|
|
1149
1148
|
} catch (e) {
|
|
1150
|
-
return t() && this.#c(
|
|
1149
|
+
return t() && this.#c(C(e, this.#r.t)), "unavailable";
|
|
1151
1150
|
} finally {
|
|
1152
1151
|
t() && this.#g({ starting: !1 });
|
|
1153
1152
|
}
|
|
@@ -1164,45 +1163,45 @@ var Bt = class {
|
|
|
1164
1163
|
attempted: !0
|
|
1165
1164
|
} }), !1;
|
|
1166
1165
|
this.#h(e);
|
|
1167
|
-
let { inputs: t, payload: n } =
|
|
1166
|
+
let { inputs: t, payload: n } = Vt(e.groups, e.triggerId), r = await this.#f(e.source, e.flow, e.revisionId, {
|
|
1168
1167
|
nodeId: e.triggerId,
|
|
1169
1168
|
payload: n
|
|
1170
1169
|
}, t, e.publicationId);
|
|
1171
1170
|
return r && this.#l.value.inputRequest === e && this.dismissInputs(), r;
|
|
1172
1171
|
}
|
|
1173
1172
|
async selectTrigger(e) {
|
|
1174
|
-
let
|
|
1175
|
-
if (
|
|
1173
|
+
let n = this.#l.value.inputRequest;
|
|
1174
|
+
if (n == null || !n.triggers.some((t) => t.nodeId == e)) return;
|
|
1176
1175
|
let r = this.#a.begin();
|
|
1177
|
-
this.#h(
|
|
1176
|
+
this.#h(n), this.#g({ starting: !0 });
|
|
1178
1177
|
try {
|
|
1179
|
-
let i =
|
|
1180
|
-
if (!r() || this.#l.value.inputRequest !==
|
|
1178
|
+
let i = $(n.revision, e), a = this.#s.get(this.#m(n.flow.flowId, e)), o = await zt(i, this.#r.lang$, e, a?.values);
|
|
1179
|
+
if (!r() || this.#l.value.inputRequest !== n) {
|
|
1181
1180
|
for (let e of o) e.editor.dispose();
|
|
1182
1181
|
return;
|
|
1183
1182
|
}
|
|
1184
|
-
let s =
|
|
1183
|
+
let s = t((e) => o.every((t) => e(t.editor.valid$)));
|
|
1185
1184
|
this.#g({ inputRequest: {
|
|
1186
|
-
...
|
|
1185
|
+
...n,
|
|
1187
1186
|
attempted: !1,
|
|
1188
1187
|
groups: o,
|
|
1189
1188
|
triggerId: e,
|
|
1190
1189
|
valid: s
|
|
1191
|
-
} }), this.#p(
|
|
1190
|
+
} }), this.#p(n);
|
|
1192
1191
|
} catch (e) {
|
|
1193
|
-
r() && this.#c(
|
|
1192
|
+
r() && this.#c(C(e, this.#r.t));
|
|
1194
1193
|
} finally {
|
|
1195
1194
|
r() && this.#g({ starting: !1 });
|
|
1196
1195
|
}
|
|
1197
1196
|
}
|
|
1198
|
-
async #d(e,
|
|
1197
|
+
async #d(e, n, r, i, a, o, s, c = !1) {
|
|
1199
1198
|
let l = this.#l.value.inputRequest;
|
|
1200
1199
|
this.#h(l), this.#g({
|
|
1201
1200
|
inputRequest: void 0,
|
|
1202
1201
|
starting: !0,
|
|
1203
1202
|
submitting: void 0
|
|
1204
1203
|
}), this.#p(l);
|
|
1205
|
-
let u =
|
|
1204
|
+
let u = F(r).graph({ kind: "flow" }), d = Object.entries(u?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
|
|
1206
1205
|
nodeId: e,
|
|
1207
1206
|
title: t.name
|
|
1208
1207
|
}]);
|
|
@@ -1215,28 +1214,28 @@ var Bt = class {
|
|
|
1215
1214
|
kind: "error",
|
|
1216
1215
|
message: this.#r.t("runInput.selectTrigger")
|
|
1217
1216
|
}), "unavailable";
|
|
1218
|
-
let p = f == null ? [] :
|
|
1217
|
+
let p = f == null ? [] : $(r, f.nodeId), m = Rt(p), h = f == null ? void 0 : this.#s.get(this.#m(n.flowId, f.nodeId)), g = f == null ? [] : await zt(p, this.#r.lang$, f.nodeId, h?.values);
|
|
1219
1218
|
if (!a()) {
|
|
1220
1219
|
for (let e of g) e.editor.dispose();
|
|
1221
1220
|
return "unavailable";
|
|
1222
1221
|
}
|
|
1223
|
-
if (!c && f != null && g.length == 0) return await this.#f(e,
|
|
1222
|
+
if (!c && f != null && g.length == 0) return await this.#f(e, n, i, {
|
|
1224
1223
|
nodeId: f.nodeId,
|
|
1225
1224
|
payload: {}
|
|
1226
1225
|
}, {}, o) ? "started" : "unavailable";
|
|
1227
1226
|
if (!c && f != null && h?.valid == 1 && h.signature == m && g.every((e) => e.editor.valid$.value)) {
|
|
1228
|
-
let
|
|
1227
|
+
let t = Vt(g, f.nodeId);
|
|
1229
1228
|
for (let e of g) e.editor.dispose();
|
|
1230
|
-
return await this.#f(e,
|
|
1229
|
+
return await this.#f(e, n, i, {
|
|
1231
1230
|
nodeId: f.nodeId,
|
|
1232
|
-
payload:
|
|
1233
|
-
},
|
|
1231
|
+
payload: t.payload
|
|
1232
|
+
}, t.inputs, o) ? "started" : "unavailable";
|
|
1234
1233
|
}
|
|
1235
|
-
let _ =
|
|
1234
|
+
let _ = t((e) => f != null && g.every((t) => e(t.editor.valid$)));
|
|
1236
1235
|
return this.#g({
|
|
1237
1236
|
inputRequest: {
|
|
1238
1237
|
attempted: !1,
|
|
1239
|
-
flow:
|
|
1238
|
+
flow: n,
|
|
1240
1239
|
groups: g,
|
|
1241
1240
|
revision: r,
|
|
1242
1241
|
triggers: d,
|
|
@@ -1287,7 +1286,7 @@ var Bt = class {
|
|
|
1287
1286
|
});
|
|
1288
1287
|
return !o() || !s() ? !1 : (this.#u = void 0, this.#o.follow(d, s));
|
|
1289
1288
|
} catch (e) {
|
|
1290
|
-
return o() && s() && this.#c(
|
|
1289
|
+
return o() && s() && this.#c(C(e, this.#r.t)), !1;
|
|
1291
1290
|
} finally {
|
|
1292
1291
|
o() && this.#g({
|
|
1293
1292
|
starting: !1,
|
|
@@ -1306,9 +1305,9 @@ var Bt = class {
|
|
|
1306
1305
|
}
|
|
1307
1306
|
#h(e) {
|
|
1308
1307
|
e?.triggerId != null && e.groups.length != 0 && this.#s.set(this.#m(e.flow.flowId, e.triggerId), {
|
|
1309
|
-
signature:
|
|
1308
|
+
signature: Rt($(e.revision, e.triggerId)),
|
|
1310
1309
|
valid: e.valid.value,
|
|
1311
|
-
values:
|
|
1310
|
+
values: Bt(e.groups)
|
|
1312
1311
|
});
|
|
1313
1312
|
}
|
|
1314
1313
|
#g(e) {
|
|
@@ -1317,18 +1316,18 @@ var Bt = class {
|
|
|
1317
1316
|
...e
|
|
1318
1317
|
});
|
|
1319
1318
|
}
|
|
1320
|
-
},
|
|
1319
|
+
}, Ut = {
|
|
1321
1320
|
actions: {},
|
|
1322
1321
|
catalogs: {}
|
|
1323
1322
|
};
|
|
1324
|
-
function
|
|
1323
|
+
function Wt(e) {
|
|
1325
1324
|
return Object.entries(e).map(([e, t]) => ({
|
|
1326
1325
|
description: t.description,
|
|
1327
1326
|
handle: e,
|
|
1328
1327
|
jsonSchema: t.jsonSchema
|
|
1329
1328
|
}));
|
|
1330
1329
|
}
|
|
1331
|
-
function
|
|
1330
|
+
function Gt(e, t) {
|
|
1332
1331
|
return {
|
|
1333
1332
|
connector: e,
|
|
1334
1333
|
description: e.authenticated && e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
|
|
@@ -1336,15 +1335,15 @@ function Q(e, t) {
|
|
|
1336
1335
|
service: e.serviceName
|
|
1337
1336
|
}) : e.description,
|
|
1338
1337
|
group: t("addNode.connectorActions"),
|
|
1339
|
-
icon:
|
|
1338
|
+
icon: R(e),
|
|
1340
1339
|
id: `connector:${e.actionId}`,
|
|
1341
|
-
inputs:
|
|
1340
|
+
inputs: Wt(e.inputs),
|
|
1342
1341
|
kind: "connector",
|
|
1343
1342
|
label: e.name,
|
|
1344
|
-
outputs:
|
|
1343
|
+
outputs: Wt(e.outputs)
|
|
1345
1344
|
};
|
|
1346
1345
|
}
|
|
1347
|
-
function
|
|
1346
|
+
function Kt(e, t) {
|
|
1348
1347
|
let n = /* @__PURE__ */ new Map();
|
|
1349
1348
|
for (let t of e) {
|
|
1350
1349
|
let e = n.get(t.serviceId) ?? [];
|
|
@@ -1352,7 +1351,7 @@ function Ut(e, t) {
|
|
|
1352
1351
|
}
|
|
1353
1352
|
return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
|
|
1354
1353
|
let n = e[0], r = e.map((e) => {
|
|
1355
|
-
let n =
|
|
1354
|
+
let n = Gt(e, t);
|
|
1356
1355
|
return {
|
|
1357
1356
|
description: n.description,
|
|
1358
1357
|
label: n.label,
|
|
@@ -1363,7 +1362,7 @@ function Ut(e, t) {
|
|
|
1363
1362
|
choices: r,
|
|
1364
1363
|
description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
|
|
1365
1364
|
group: t("addNode.connectorActions"),
|
|
1366
|
-
icon:
|
|
1365
|
+
icon: R(n),
|
|
1367
1366
|
id: `connector-provider:${n.serviceId}`,
|
|
1368
1367
|
inputs: [],
|
|
1369
1368
|
kind: "connector-group",
|
|
@@ -1373,12 +1372,12 @@ function Ut(e, t) {
|
|
|
1373
1372
|
};
|
|
1374
1373
|
});
|
|
1375
1374
|
}
|
|
1376
|
-
function
|
|
1375
|
+
function qt(e, t) {
|
|
1377
1376
|
return {
|
|
1378
1377
|
choices: [],
|
|
1379
1378
|
description: t("addNode.connectorBrowseActions"),
|
|
1380
1379
|
group: t("addNode.connectorActions"),
|
|
1381
|
-
icon:
|
|
1380
|
+
icon: R(e),
|
|
1382
1381
|
id: `connector-provider:${e.serviceId}`,
|
|
1383
1382
|
inputs: [],
|
|
1384
1383
|
kind: "connector-group",
|
|
@@ -1387,7 +1386,7 @@ function Wt(e, t) {
|
|
|
1387
1386
|
serviceId: e.serviceId
|
|
1388
1387
|
};
|
|
1389
1388
|
}
|
|
1390
|
-
function
|
|
1389
|
+
function Jt(e, t) {
|
|
1391
1390
|
if (e == null) return;
|
|
1392
1391
|
let n = e.kind == "wait" ? e.node.notification?.taskId : e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
|
|
1393
1392
|
if (n == null) return;
|
|
@@ -1399,10 +1398,10 @@ function Gt(e, t) {
|
|
|
1399
1398
|
taskId: n
|
|
1400
1399
|
};
|
|
1401
1400
|
}
|
|
1402
|
-
function
|
|
1401
|
+
function Yt(e, t, n) {
|
|
1403
1402
|
if (e == null) return [];
|
|
1404
1403
|
let r = [];
|
|
1405
|
-
for (let i of [...
|
|
1404
|
+
for (let i of [..._(e.revision.content).tasks].toSorted()) {
|
|
1406
1405
|
let a = e.task(i);
|
|
1407
1406
|
if (a?.executor.kind != "connector") continue;
|
|
1408
1407
|
let o = t[a.executor.action];
|
|
@@ -1419,7 +1418,7 @@ function Kt(e, t, n) {
|
|
|
1419
1418
|
}
|
|
1420
1419
|
return r;
|
|
1421
1420
|
}
|
|
1422
|
-
var
|
|
1421
|
+
var Xt = class {
|
|
1423
1422
|
#e;
|
|
1424
1423
|
#t;
|
|
1425
1424
|
#n;
|
|
@@ -1436,13 +1435,13 @@ var qt = class {
|
|
|
1436
1435
|
#p;
|
|
1437
1436
|
#m;
|
|
1438
1437
|
#h;
|
|
1439
|
-
constructor(r, i, a, o,
|
|
1440
|
-
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new
|
|
1438
|
+
constructor(r, i, a, o, c = W()) {
|
|
1439
|
+
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new s(), this.#o = new s(), this.#d = n(Ut), this.#h = !1, this.browseAddNodeOptions = async (e) => {
|
|
1441
1440
|
if (this.#h) return;
|
|
1442
1441
|
let t = this.#f.$.flowId.value;
|
|
1443
1442
|
if (t == null) return;
|
|
1444
1443
|
let n = this.#m ?? await this.#e.listConnectorProviders(e, t);
|
|
1445
|
-
if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) =>
|
|
1444
|
+
if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => qt(e, this.#t.t));
|
|
1446
1445
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
1447
1446
|
if (this.#h) return;
|
|
1448
1447
|
let n = this.#f.$.flowId.value, r = this.#m?.find((t) => `connector-provider:${t.serviceId}` == e);
|
|
@@ -1453,7 +1452,7 @@ var qt = class {
|
|
|
1453
1452
|
return this.#r.set(r.serviceId, a), this.#b({ actions: {
|
|
1454
1453
|
...this.#d.value.actions,
|
|
1455
1454
|
...Object.fromEntries(a.map((e) => [e.actionId, e]))
|
|
1456
|
-
} }), a.map((e) =>
|
|
1455
|
+
} }), a.map((e) => Gt(e, this.#t.t));
|
|
1457
1456
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1458
1457
|
if (this.#h) return;
|
|
1459
1458
|
let n = this.#f.$.flowId.value;
|
|
@@ -1462,17 +1461,17 @@ var qt = class {
|
|
|
1462
1461
|
if (t.aborted || this.#h || n != this.#f.$.flowId.value) return;
|
|
1463
1462
|
let a = { ...this.#d.value.actions };
|
|
1464
1463
|
for (let e of i) a[e.actionId] = e;
|
|
1465
|
-
if (this.#b({ actions: a }), r.length != 0) return i.map((e) =>
|
|
1464
|
+
if (this.#b({ actions: a }), r.length != 0) return i.map((e) => Gt(e, this.#t.t));
|
|
1466
1465
|
let o = new Map(i.map((e) => [e.actionId, e]));
|
|
1467
1466
|
for (let e of this.#f.$.revision.value?.connectorActionIds ?? []) {
|
|
1468
1467
|
let t = a[e];
|
|
1469
1468
|
t != null && o.set(e, t);
|
|
1470
1469
|
}
|
|
1471
|
-
return
|
|
1472
|
-
}, this.#e = r, this.#n = o, this.#f = i, this.#u = a, this.#t =
|
|
1473
|
-
let
|
|
1474
|
-
this.#l =
|
|
1475
|
-
let t =
|
|
1470
|
+
return Kt([...o.values()], this.#t.t);
|
|
1471
|
+
}, this.#e = r, this.#n = o, this.#f = i, this.#u = a, this.#t = c;
|
|
1472
|
+
let l = e(this.#d, (e) => e.actions), u = e(this.#d, (e) => e.catalogs);
|
|
1473
|
+
this.#l = t((e) => {
|
|
1474
|
+
let t = Jt(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
|
|
1476
1475
|
if (t == null) return { authorizationPending: !1 };
|
|
1477
1476
|
let r = n.actions[t.actionId], a = r == null ? void 0 : n.catalogs[r.serviceId], o = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
|
|
1478
1477
|
return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
|
|
@@ -1485,10 +1484,10 @@ var qt = class {
|
|
|
1485
1484
|
};
|
|
1486
1485
|
}), this.$ = {
|
|
1487
1486
|
actionLoading: e(this.#d, (e) => e.actionLoading),
|
|
1488
|
-
actions:
|
|
1489
|
-
catalogs:
|
|
1487
|
+
actions: l,
|
|
1488
|
+
catalogs: u,
|
|
1490
1489
|
connectionLoading: e(this.#d, (e) => e.connectionLoading),
|
|
1491
|
-
diagnostics:
|
|
1490
|
+
diagnostics: t((e) => Yt(e(i.$.revision), e(l), e(u))),
|
|
1492
1491
|
selectedAction: e(this.#l, (e) => e.action),
|
|
1493
1492
|
selectedActionError: e(this.#l, (e) => e.actionError),
|
|
1494
1493
|
selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
|
|
@@ -1503,11 +1502,11 @@ var qt = class {
|
|
|
1503
1502
|
this.#l.dispose(), this.#d.dispose();
|
|
1504
1503
|
}
|
|
1505
1504
|
reset() {
|
|
1506
|
-
this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(
|
|
1505
|
+
this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(Ut));
|
|
1507
1506
|
}
|
|
1508
1507
|
async refresh(e = !1) {
|
|
1509
1508
|
if (this.#h) return;
|
|
1510
|
-
let t = this.#o.begin(), n = this.#f.$.flowId.value, r =
|
|
1509
|
+
let t = this.#o.begin(), n = this.#f.$.flowId.value, r = Jt(this.#f.$.selection.value, this.#f.$.revision.value);
|
|
1511
1510
|
if (n == null || r == null) {
|
|
1512
1511
|
(this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#b({
|
|
1513
1512
|
actionLoading: void 0,
|
|
@@ -1531,7 +1530,7 @@ var qt = class {
|
|
|
1531
1530
|
} catch (e) {
|
|
1532
1531
|
this.#x(t, n) && this.#b({ actionError: {
|
|
1533
1532
|
actionId: r.actionId,
|
|
1534
|
-
message:
|
|
1533
|
+
message: C(e, this.#t.t).message
|
|
1535
1534
|
} });
|
|
1536
1535
|
} finally {
|
|
1537
1536
|
this.#x(t, n) && this.#d.value.actionLoading == r.actionId && this.#b({ actionLoading: void 0 });
|
|
@@ -1543,7 +1542,7 @@ var qt = class {
|
|
|
1543
1542
|
let r = await this.#e.listConnectorConnections(e, t, n);
|
|
1544
1543
|
t.aborted || this.#h || n != this.#f.$.flowId.value || this.#b({ catalogs: {
|
|
1545
1544
|
...this.#d.value.catalogs,
|
|
1546
|
-
[e]:
|
|
1545
|
+
[e]: N(r)
|
|
1547
1546
|
} });
|
|
1548
1547
|
}
|
|
1549
1548
|
async loadCodeAction(e, t) {
|
|
@@ -1574,7 +1573,7 @@ var qt = class {
|
|
|
1574
1573
|
serviceId: e
|
|
1575
1574
|
}, this.#b({ authorizationServiceId: e });
|
|
1576
1575
|
} catch (e) {
|
|
1577
|
-
this.#h || this.#u(
|
|
1576
|
+
this.#h || this.#u(C(e, this.#t.t));
|
|
1578
1577
|
}
|
|
1579
1578
|
}
|
|
1580
1579
|
async setConnection(e, t) {
|
|
@@ -1607,13 +1606,13 @@ var qt = class {
|
|
|
1607
1606
|
a = await this.#e.listConnectorConnections(t, void 0, e);
|
|
1608
1607
|
} catch (n) {
|
|
1609
1608
|
this.#x(r, e) && this.#b({ connectionError: {
|
|
1610
|
-
message:
|
|
1609
|
+
message: C(n, this.#t.t).message,
|
|
1611
1610
|
serviceId: t
|
|
1612
1611
|
} });
|
|
1613
1612
|
return;
|
|
1614
1613
|
}
|
|
1615
1614
|
if (!this.#x(r, e)) return;
|
|
1616
|
-
let o =
|
|
1615
|
+
let o = N(a);
|
|
1617
1616
|
return this.#b({ catalogs: {
|
|
1618
1617
|
...this.#d.value.catalogs,
|
|
1619
1618
|
[t]: o
|
|
@@ -1653,7 +1652,7 @@ var qt = class {
|
|
|
1653
1652
|
}
|
|
1654
1653
|
if (!this.#x(e, t)) return;
|
|
1655
1654
|
let i = /* @__PURE__ */ new Set();
|
|
1656
|
-
for (let e of
|
|
1655
|
+
for (let e of _(n.revision.content).tasks) {
|
|
1657
1656
|
let t = n.task(e);
|
|
1658
1657
|
if (t?.executor.kind != "connector") continue;
|
|
1659
1658
|
let r = this.#d.value.actions[t.executor.action];
|
|
@@ -1661,8 +1660,8 @@ var qt = class {
|
|
|
1661
1660
|
}
|
|
1662
1661
|
await Promise.all([...i].map((n) => this.#v(t, n, !1, e)));
|
|
1663
1662
|
}
|
|
1664
|
-
},
|
|
1665
|
-
function $(e, t) {
|
|
1663
|
+
}, Zt = { catalogs: {} }, Qt = "trigger:";
|
|
1664
|
+
function $t(e, t) {
|
|
1666
1665
|
if (e?.kind != "trigger") return;
|
|
1667
1666
|
let n = e.trigger;
|
|
1668
1667
|
if (n.kind != "poll" && n.kind != "integration") return;
|
|
@@ -1673,15 +1672,15 @@ function $(e, t) {
|
|
|
1673
1672
|
triggerId: e.id
|
|
1674
1673
|
};
|
|
1675
1674
|
}
|
|
1676
|
-
function
|
|
1675
|
+
function en(e, t) {
|
|
1677
1676
|
return {
|
|
1678
1677
|
description: t.t("addNode.triggerNeedsConnection", { provider: e.provider }),
|
|
1679
1678
|
group: t.t("addNode.integrationTriggers"),
|
|
1680
|
-
icon:
|
|
1679
|
+
icon: R({
|
|
1681
1680
|
serviceId: e.provider,
|
|
1682
1681
|
serviceName: e.provider
|
|
1683
1682
|
}),
|
|
1684
|
-
id: `${
|
|
1683
|
+
id: `${Qt}${e.key}`,
|
|
1685
1684
|
inputs: [],
|
|
1686
1685
|
kind: "trigger",
|
|
1687
1686
|
label: e.displayName,
|
|
@@ -1695,7 +1694,7 @@ function Xt(e, t) {
|
|
|
1695
1694
|
}
|
|
1696
1695
|
};
|
|
1697
1696
|
}
|
|
1698
|
-
var
|
|
1697
|
+
var tn = class {
|
|
1699
1698
|
#e;
|
|
1700
1699
|
#t;
|
|
1701
1700
|
#n;
|
|
@@ -1708,12 +1707,12 @@ var Zt = class {
|
|
|
1708
1707
|
#l;
|
|
1709
1708
|
#u;
|
|
1710
1709
|
#d;
|
|
1711
|
-
constructor(r, i, a, o,
|
|
1712
|
-
this.#t = new AbortController(), this.#a = new
|
|
1710
|
+
constructor(r, i, a, o, c = W()) {
|
|
1711
|
+
this.#t = new AbortController(), this.#a = new s(), this.#o = /* @__PURE__ */ new Set(), this.#l = n(Zt), this.#d = !1, this.browseAddNodeOptions = async (e) => {
|
|
1713
1712
|
let t = this.#u.$.flowId.value;
|
|
1714
1713
|
if (e.aborted || this.#d || t == null || this.#u.$.target.value?.kind != "flow") return [];
|
|
1715
1714
|
let n = await this.#f();
|
|
1716
|
-
if (!(e.aborted || this.#d || t != this.#u.$.flowId.value)) return [...n.values()].map((e) =>
|
|
1715
|
+
if (!(e.aborted || this.#d || t != this.#u.$.flowId.value)) return [...n.values()].map((e) => en(e, this.#i));
|
|
1717
1716
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1718
1717
|
let n = this.#u.$.flowId.value;
|
|
1719
1718
|
if (t.aborted || this.#d || n == null || this.#u.$.target.value?.kind != "flow") return [];
|
|
@@ -1727,9 +1726,9 @@ var Zt = class {
|
|
|
1727
1726
|
e.name,
|
|
1728
1727
|
e.provider,
|
|
1729
1728
|
e.type
|
|
1730
|
-
].some((e) => e.toLowerCase().includes(r))).map((e) =>
|
|
1731
|
-
}, this.#n = r, this.#r = o, this.#i =
|
|
1732
|
-
let t = e(i.$.selection), n = $(t, i), r = e(this.#l);
|
|
1729
|
+
].some((e) => e.toLowerCase().includes(r))).map((e) => en(e, this.#i));
|
|
1730
|
+
}, this.#n = r, this.#r = o, this.#i = c, this.#c = a, this.#u = i, this.#s = t((e) => {
|
|
1731
|
+
let t = e(i.$.selection), n = $t(t, i), r = e(this.#l);
|
|
1733
1732
|
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
1734
1733
|
let a = t.trigger;
|
|
1735
1734
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
@@ -1756,11 +1755,11 @@ var Zt = class {
|
|
|
1756
1755
|
this.#s.dispose(), this.#l.dispose();
|
|
1757
1756
|
}
|
|
1758
1757
|
reset() {
|
|
1759
|
-
this.#d || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#o.clear(), this.#a.invalidate(), this.#l.set(
|
|
1758
|
+
this.#d || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#o.clear(), this.#a.invalidate(), this.#l.set(Zt));
|
|
1760
1759
|
}
|
|
1761
1760
|
async refresh(e = !1) {
|
|
1762
1761
|
if (this.#d) return;
|
|
1763
|
-
let t = this.#a.begin(), n = this.#u.$.flowId.value, r = $(this.#u.$.selection.value, this.#u);
|
|
1762
|
+
let t = this.#a.begin(), n = this.#u.$.flowId.value, r = $t(this.#u.$.selection.value, this.#u);
|
|
1764
1763
|
if (n == null || r == null) {
|
|
1765
1764
|
this.#l.value.connectionLoading != null && this.#p({ connectionLoading: void 0 });
|
|
1766
1765
|
return;
|
|
@@ -1774,7 +1773,7 @@ var Zt = class {
|
|
|
1774
1773
|
connectionLoading: r.provider
|
|
1775
1774
|
});
|
|
1776
1775
|
try {
|
|
1777
|
-
let e =
|
|
1776
|
+
let e = N(await this.#n.listConnectorConnections(r.provider, void 0, n));
|
|
1778
1777
|
if (!this.#m(t, n)) return;
|
|
1779
1778
|
this.#o.delete(r.provider), this.#p({ catalogs: {
|
|
1780
1779
|
...this.#l.value.catalogs,
|
|
@@ -1782,7 +1781,7 @@ var Zt = class {
|
|
|
1782
1781
|
} });
|
|
1783
1782
|
} catch (e) {
|
|
1784
1783
|
this.#m(t, n) && this.#p({ connectionError: {
|
|
1785
|
-
message:
|
|
1784
|
+
message: C(e, this.#i.t).message,
|
|
1786
1785
|
provider: r.provider
|
|
1787
1786
|
} });
|
|
1788
1787
|
} finally {
|
|
@@ -1801,7 +1800,7 @@ var Zt = class {
|
|
|
1801
1800
|
}
|
|
1802
1801
|
!this.#d && t == this.#u.$.flowId.value && this.#p({ authorizationProvider: e });
|
|
1803
1802
|
} catch (e) {
|
|
1804
|
-
this.#d || this.#c(
|
|
1803
|
+
this.#d || this.#c(C(e, this.#i.t));
|
|
1805
1804
|
}
|
|
1806
1805
|
}
|
|
1807
1806
|
async setConnection(e, t) {
|
|
@@ -1810,7 +1809,7 @@ var Zt = class {
|
|
|
1810
1809
|
async refreshAfterAuthorization() {
|
|
1811
1810
|
if (this.#d) return;
|
|
1812
1811
|
let e = this.#l.value.authorizationProvider;
|
|
1813
|
-
e != null && (this.#o.add(e), this.#p({ authorizationProvider: void 0 }), $(this.#u.$.selection.value, this.#u)?.provider == e && await this.refresh(!0));
|
|
1812
|
+
e != null && (this.#o.add(e), this.#p({ authorizationProvider: void 0 }), $t(this.#u.$.selection.value, this.#u)?.provider == e && await this.refresh(!0));
|
|
1814
1813
|
}
|
|
1815
1814
|
#f() {
|
|
1816
1815
|
if (this.#e != null) return this.#e;
|
|
@@ -1830,8 +1829,176 @@ var Zt = class {
|
|
|
1830
1829
|
}
|
|
1831
1830
|
};
|
|
1832
1831
|
//#endregion
|
|
1832
|
+
//#region src/flow/common/inverseChanges.ts
|
|
1833
|
+
function nn(e, t) {
|
|
1834
|
+
let n = e, r = [];
|
|
1835
|
+
for (let e of t) {
|
|
1836
|
+
let t = Je(n, [e]), i = [];
|
|
1837
|
+
switch (e.kind) {
|
|
1838
|
+
case "graph.node.create":
|
|
1839
|
+
i.push({
|
|
1840
|
+
kind: "graph.node.delete",
|
|
1841
|
+
nodeId: e.nodeId,
|
|
1842
|
+
target: e.target
|
|
1843
|
+
});
|
|
1844
|
+
break;
|
|
1845
|
+
case "graph.node.delete": {
|
|
1846
|
+
let { target: r, nodeId: a } = e, o = r.kind == "flow" ? n.document.graph : n.document.subflows[r.id].graph, s = r.kind == "flow" ? t.document.graph : t.document.subflows[r.id].graph;
|
|
1847
|
+
i.push({
|
|
1848
|
+
kind: "graph.node.create",
|
|
1849
|
+
nodeId: a,
|
|
1850
|
+
target: r,
|
|
1851
|
+
node: o.nodes[a]
|
|
1852
|
+
});
|
|
1853
|
+
for (let [e, t] of Object.entries(s.nodes)) {
|
|
1854
|
+
let n = o.nodes[e];
|
|
1855
|
+
if (!(!("inputs" in t) || !("inputs" in n))) for (let a of /* @__PURE__ */ new Set([...Object.keys(n.inputs), ...Object.keys(t.inputs)])) B(t.inputs[a], n.inputs[a]) || i.push({
|
|
1856
|
+
kind: "graph.node.input.set",
|
|
1857
|
+
target: r,
|
|
1858
|
+
nodeId: e,
|
|
1859
|
+
handle: a,
|
|
1860
|
+
before: t.inputs[a],
|
|
1861
|
+
value: n.inputs[a]
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
for (let e of s.edges) i.push({
|
|
1865
|
+
kind: "graph.edge.disconnect",
|
|
1866
|
+
target: r,
|
|
1867
|
+
edge: e
|
|
1868
|
+
});
|
|
1869
|
+
for (let e of o.edges) i.push({
|
|
1870
|
+
kind: "graph.edge.connect",
|
|
1871
|
+
target: r,
|
|
1872
|
+
edge: e
|
|
1873
|
+
});
|
|
1874
|
+
if (r.kind == "subflow") {
|
|
1875
|
+
let { graph: e, ...a } = n.document.subflows[r.id], { graph: o, ...s } = t.document.subflows[r.id];
|
|
1876
|
+
B(s, a) || i.push({
|
|
1877
|
+
kind: "subflow.definition.set",
|
|
1878
|
+
subflowId: r.id,
|
|
1879
|
+
before: s,
|
|
1880
|
+
definition: a
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
break;
|
|
1884
|
+
}
|
|
1885
|
+
case "graph.edge.connect":
|
|
1886
|
+
i.push({
|
|
1887
|
+
...e,
|
|
1888
|
+
kind: "graph.edge.disconnect"
|
|
1889
|
+
});
|
|
1890
|
+
break;
|
|
1891
|
+
case "graph.edge.disconnect": {
|
|
1892
|
+
let { target: r } = e, a = r.kind == "flow" ? n.document.graph : n.document.subflows[r.id].graph, o = r.kind == "flow" ? t.document.graph : t.document.subflows[r.id].graph;
|
|
1893
|
+
i.push(...o.edges.map((e) => ({
|
|
1894
|
+
kind: "graph.edge.disconnect",
|
|
1895
|
+
target: r,
|
|
1896
|
+
edge: e
|
|
1897
|
+
}))), i.push(...a.edges.map((e) => ({
|
|
1898
|
+
kind: "graph.edge.connect",
|
|
1899
|
+
target: r,
|
|
1900
|
+
edge: e
|
|
1901
|
+
})));
|
|
1902
|
+
break;
|
|
1903
|
+
}
|
|
1904
|
+
case "module.create":
|
|
1905
|
+
i.push({
|
|
1906
|
+
kind: "module.delete",
|
|
1907
|
+
moduleId: e.moduleId
|
|
1908
|
+
});
|
|
1909
|
+
break;
|
|
1910
|
+
case "module.delete":
|
|
1911
|
+
i.push({
|
|
1912
|
+
kind: "module.create",
|
|
1913
|
+
moduleId: e.moduleId,
|
|
1914
|
+
module: n.modules[e.moduleId]
|
|
1915
|
+
});
|
|
1916
|
+
break;
|
|
1917
|
+
case "binding.create":
|
|
1918
|
+
i.push({
|
|
1919
|
+
kind: "binding.delete",
|
|
1920
|
+
bindingId: e.bindingId
|
|
1921
|
+
});
|
|
1922
|
+
break;
|
|
1923
|
+
case "binding.delete":
|
|
1924
|
+
i.push({
|
|
1925
|
+
kind: "binding.create",
|
|
1926
|
+
bindingId: e.bindingId,
|
|
1927
|
+
binding: n.document.bindings[e.bindingId]
|
|
1928
|
+
});
|
|
1929
|
+
break;
|
|
1930
|
+
case "task.create":
|
|
1931
|
+
i.push({
|
|
1932
|
+
kind: "task.delete",
|
|
1933
|
+
taskId: e.taskId
|
|
1934
|
+
});
|
|
1935
|
+
break;
|
|
1936
|
+
case "task.delete":
|
|
1937
|
+
i.push({
|
|
1938
|
+
kind: "task.create",
|
|
1939
|
+
taskId: e.taskId,
|
|
1940
|
+
task: n.document.tasks[e.taskId]
|
|
1941
|
+
});
|
|
1942
|
+
break;
|
|
1943
|
+
case "graph.node.input.set":
|
|
1944
|
+
i.push({
|
|
1945
|
+
...e,
|
|
1946
|
+
before: e.value,
|
|
1947
|
+
value: e.before
|
|
1948
|
+
});
|
|
1949
|
+
break;
|
|
1950
|
+
default: throw Error(`Unsupported canvas history operation: ${e.kind}`);
|
|
1951
|
+
}
|
|
1952
|
+
r.push(i), n = t;
|
|
1953
|
+
}
|
|
1954
|
+
return r.toReversed().flat();
|
|
1955
|
+
}
|
|
1956
|
+
//#endregion
|
|
1957
|
+
//#region src/workbench/browser/runtime/stores/canvasHistory.ts
|
|
1958
|
+
var rn = class {
|
|
1959
|
+
constructor() {
|
|
1960
|
+
this.state$ = n({
|
|
1961
|
+
canUndo: !1,
|
|
1962
|
+
canRedo: !1,
|
|
1963
|
+
applying: !1,
|
|
1964
|
+
failed: !1,
|
|
1965
|
+
undo: void 0,
|
|
1966
|
+
redo: void 0
|
|
1967
|
+
}), this.#e = [], this.#t = [], this.generation = 0, this.pending = 0, this.applying = !1, this.failed = !1;
|
|
1968
|
+
}
|
|
1969
|
+
#e;
|
|
1970
|
+
#t;
|
|
1971
|
+
clear() {
|
|
1972
|
+
let e = this.#e.length + this.#t.length > 0;
|
|
1973
|
+
return this.generation++, this.#e.length = 0, this.#t.length = 0, this.publish(), e;
|
|
1974
|
+
}
|
|
1975
|
+
record(e) {
|
|
1976
|
+
if (this.#t.length = 0, this.#e.push(e), this.#n([e]) > 10485760) return this.clear(), !1;
|
|
1977
|
+
for (; this.#e.length > 30 || this.#n(this.#e) > 10485760;) this.#e.shift();
|
|
1978
|
+
return this.publish(), !0;
|
|
1979
|
+
}
|
|
1980
|
+
complete(e) {
|
|
1981
|
+
let t = e ? this.#t : this.#e, n = e ? this.#e : this.#t, r = t.pop();
|
|
1982
|
+
r != null && n.push(r), this.publish();
|
|
1983
|
+
}
|
|
1984
|
+
publish() {
|
|
1985
|
+
let e = this.pending == 0 && !this.applying && !this.failed;
|
|
1986
|
+
this.state$.set({
|
|
1987
|
+
canUndo: e && this.#e.length > 0,
|
|
1988
|
+
canRedo: e && this.#t.length > 0,
|
|
1989
|
+
applying: this.applying,
|
|
1990
|
+
failed: this.failed,
|
|
1991
|
+
undo: this.#e.at(-1),
|
|
1992
|
+
redo: this.#t.at(-1)
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
#n(e) {
|
|
1996
|
+
return new TextEncoder().encode(JSON.stringify(e)).byteLength;
|
|
1997
|
+
}
|
|
1998
|
+
};
|
|
1999
|
+
//#endregion
|
|
1833
2000
|
//#region src/workbench/browser/runtime/stores/draftChanges.ts
|
|
1834
|
-
function
|
|
2001
|
+
function an(e, t) {
|
|
1835
2002
|
if (e.length != 1 || t.length != 1) return;
|
|
1836
2003
|
let n = e[0], r = t[0];
|
|
1837
2004
|
if (n?.kind == "graph.node.field.set" && r?.kind == "graph.node.field.set") return n.nodeId != r.nodeId || n.field != r.field || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
|
|
@@ -1851,7 +2018,7 @@ function Qt(e, t) {
|
|
|
1851
2018
|
value: r.value
|
|
1852
2019
|
}];
|
|
1853
2020
|
}
|
|
1854
|
-
var
|
|
2021
|
+
var on = class {
|
|
1855
2022
|
#e;
|
|
1856
2023
|
#t;
|
|
1857
2024
|
#n;
|
|
@@ -1879,34 +2046,37 @@ var $t = class {
|
|
|
1879
2046
|
this.#a = e;
|
|
1880
2047
|
let t = e, n = [];
|
|
1881
2048
|
for (let e of this.#o) try {
|
|
1882
|
-
t =
|
|
2049
|
+
t = I(t, e.changes), n.push(e);
|
|
1883
2050
|
} catch (t) {
|
|
1884
|
-
if (!(t instanceof
|
|
2051
|
+
if (!(t instanceof Ke)) throw t;
|
|
1885
2052
|
e.active = !1;
|
|
1886
2053
|
}
|
|
1887
2054
|
return this.#o = n, t;
|
|
1888
2055
|
}
|
|
1889
2056
|
project(e) {
|
|
1890
|
-
return this.#o.reduce((e, t) =>
|
|
2057
|
+
return this.#o.reduce((e, t) => I(e, t.changes), e);
|
|
2058
|
+
}
|
|
2059
|
+
async settled() {
|
|
2060
|
+
await this.#s;
|
|
1891
2061
|
}
|
|
1892
2062
|
enqueue(e) {
|
|
1893
2063
|
let t = this.#s.then(e);
|
|
1894
2064
|
return this.#s = t, t;
|
|
1895
2065
|
}
|
|
1896
2066
|
async change(e, t, n, r = !0) {
|
|
1897
|
-
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 :
|
|
2067
|
+
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : an(i.changes, n);
|
|
1898
2068
|
if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
|
|
1899
2069
|
this.#t.beforeChange(r);
|
|
1900
2070
|
let o = {
|
|
1901
2071
|
...e,
|
|
1902
2072
|
active: !0,
|
|
1903
|
-
changeId:
|
|
2073
|
+
changeId: L(),
|
|
1904
2074
|
changes: n,
|
|
1905
2075
|
started: !1
|
|
1906
2076
|
};
|
|
1907
2077
|
this.#a ??= t, this.#o.push(o), this.#t.apply(this.project(this.#a)), this.#i += 1;
|
|
1908
2078
|
let s = this.#s.then(() => (o.started = !0, this.#c(o)));
|
|
1909
|
-
o.result = s, this.#s = s.then(() => void 0);
|
|
2079
|
+
o.result = s, this.#s = s.then(() => void 0, () => void 0);
|
|
1910
2080
|
try {
|
|
1911
2081
|
return await s;
|
|
1912
2082
|
} finally {
|
|
@@ -1925,21 +2095,21 @@ var $t = class {
|
|
|
1925
2095
|
let r = this.#l(e, n, t);
|
|
1926
2096
|
return this.#o.length == 0 && this.#t.check(), r;
|
|
1927
2097
|
} catch (n) {
|
|
1928
|
-
if (n instanceof
|
|
2098
|
+
if (n instanceof c && n.code == "flow.revision-conflict") {
|
|
1929
2099
|
if (!t && await this.#t.recover(e)) {
|
|
1930
|
-
t = !0, e.changeId =
|
|
2100
|
+
t = !0, e.changeId = L();
|
|
1931
2101
|
continue;
|
|
1932
2102
|
}
|
|
1933
2103
|
t && await this.#t.recover(e), this.#u(e);
|
|
1934
2104
|
} else {
|
|
1935
|
-
if (!(n instanceof
|
|
2105
|
+
if (!(n instanceof c) && !t) {
|
|
1936
2106
|
let n = this.#a?.revisionId;
|
|
1937
2107
|
if (await this.#t.recover(e)) {
|
|
1938
|
-
t = !0, e.active && this.#a?.revisionId != n && (e.changeId =
|
|
2108
|
+
t = !0, e.active && this.#a?.revisionId != n && (e.changeId = L());
|
|
1939
2109
|
continue;
|
|
1940
2110
|
}
|
|
1941
2111
|
}
|
|
1942
|
-
this.#u(e), this.#t.current(e) && this.#r(
|
|
2112
|
+
this.#u(e), this.#t.current(e) && this.#r(C(n, this.#n.t));
|
|
1943
2113
|
}
|
|
1944
2114
|
return;
|
|
1945
2115
|
}
|
|
@@ -1948,7 +2118,7 @@ var $t = class {
|
|
|
1948
2118
|
#l(e, t, n) {
|
|
1949
2119
|
let r = {
|
|
1950
2120
|
...n.revision,
|
|
1951
|
-
content:
|
|
2121
|
+
content: I(t, e.changes).content
|
|
1952
2122
|
};
|
|
1953
2123
|
this.#o = this.#o.filter((t) => t !== e), this.#a = r;
|
|
1954
2124
|
let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
|
|
@@ -1957,7 +2127,7 @@ var $t = class {
|
|
|
1957
2127
|
#u(e) {
|
|
1958
2128
|
e.active = !1, this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
|
|
1959
2129
|
}
|
|
1960
|
-
},
|
|
2130
|
+
}, sn = 50, cn = {
|
|
1961
2131
|
failed: !1,
|
|
1962
2132
|
loaded: !1,
|
|
1963
2133
|
loading: !0,
|
|
@@ -1965,12 +2135,12 @@ var $t = class {
|
|
|
1965
2135
|
loadMoreFailed: !1,
|
|
1966
2136
|
refreshing: !1,
|
|
1967
2137
|
flows: []
|
|
1968
|
-
},
|
|
2138
|
+
}, ln = class {
|
|
1969
2139
|
#e;
|
|
1970
2140
|
#t;
|
|
1971
|
-
#n = new
|
|
2141
|
+
#n = new s();
|
|
1972
2142
|
#r;
|
|
1973
|
-
#i =
|
|
2143
|
+
#i = n(cn);
|
|
1974
2144
|
#a = new AbortController();
|
|
1975
2145
|
#o = /* @__PURE__ */ new Set();
|
|
1976
2146
|
#s = !1;
|
|
@@ -2017,7 +2187,7 @@ var $t = class {
|
|
|
2017
2187
|
try {
|
|
2018
2188
|
let t = await this.#e.listFlows({
|
|
2019
2189
|
includeTotal: !0,
|
|
2020
|
-
limit:
|
|
2190
|
+
limit: sn
|
|
2021
2191
|
});
|
|
2022
2192
|
if (!e()) return;
|
|
2023
2193
|
this.#c({
|
|
@@ -2034,7 +2204,7 @@ var $t = class {
|
|
|
2034
2204
|
failed: !t,
|
|
2035
2205
|
loading: !1,
|
|
2036
2206
|
refreshing: !1
|
|
2037
|
-
}), this.#r(
|
|
2207
|
+
}), this.#r(C(n, this.#t.t));
|
|
2038
2208
|
}
|
|
2039
2209
|
}
|
|
2040
2210
|
async loadMore() {
|
|
@@ -2048,7 +2218,7 @@ var $t = class {
|
|
|
2048
2218
|
try {
|
|
2049
2219
|
let e = await this.#e.listFlows({
|
|
2050
2220
|
cursor: t,
|
|
2051
|
-
limit:
|
|
2221
|
+
limit: sn
|
|
2052
2222
|
});
|
|
2053
2223
|
if (!r()) return;
|
|
2054
2224
|
let n = new Set(this.#i.value.flows.map((e) => e.flowId));
|
|
@@ -2062,7 +2232,7 @@ var $t = class {
|
|
|
2062
2232
|
this.#c({
|
|
2063
2233
|
loadingMore: !1,
|
|
2064
2234
|
loadMoreFailed: !0
|
|
2065
|
-
}), this.#r(
|
|
2235
|
+
}), this.#r(C(e, this.#t.t));
|
|
2066
2236
|
}
|
|
2067
2237
|
}
|
|
2068
2238
|
async setEnabled(e, t) {
|
|
@@ -2072,7 +2242,7 @@ var $t = class {
|
|
|
2072
2242
|
let n = await this.#e.setFlowEnabled(e.flowId, e.live.publicationId, t);
|
|
2073
2243
|
this.#s || this.include(n);
|
|
2074
2244
|
} catch (e) {
|
|
2075
|
-
this.#s || (this.#r(
|
|
2245
|
+
this.#s || (this.#r(C(e, this.#t.t)), await this.reload());
|
|
2076
2246
|
} finally {
|
|
2077
2247
|
this.#o.delete(e.flowId);
|
|
2078
2248
|
}
|
|
@@ -2084,9 +2254,9 @@ var $t = class {
|
|
|
2084
2254
|
try {
|
|
2085
2255
|
let t = await this.#e.publishFlow(e.flowId, e.draftRevisionId, e.live?.publicationId ?? null);
|
|
2086
2256
|
if (this.#s) return;
|
|
2087
|
-
let n = await
|
|
2257
|
+
let n = await X.runPromise(X.gen({ self: this }, function* () {
|
|
2088
2258
|
let n = t;
|
|
2089
|
-
for (; n.status == "pending";) yield*
|
|
2259
|
+
for (; n.status == "pending";) yield* X.sleep(1e3), n = yield* X.tryPromise((t) => this.#e.getPublishOperation(e.flowId, n.operationId, t));
|
|
2090
2260
|
return n;
|
|
2091
2261
|
}), { signal: this.#a.signal });
|
|
2092
2262
|
if (this.#s) return;
|
|
@@ -2098,7 +2268,7 @@ var $t = class {
|
|
|
2098
2268
|
message: this.#t.t("notice.published", { name: e.name })
|
|
2099
2269
|
}), this.include(await this.#e.getFlow(e.flowId));
|
|
2100
2270
|
} catch (e) {
|
|
2101
|
-
this.#s || this.#r(
|
|
2271
|
+
this.#s || this.#r(C(e, this.#t.t));
|
|
2102
2272
|
} finally {
|
|
2103
2273
|
this.#o.delete(e.flowId);
|
|
2104
2274
|
}
|
|
@@ -2140,7 +2310,7 @@ var $t = class {
|
|
|
2140
2310
|
...e
|
|
2141
2311
|
});
|
|
2142
2312
|
}
|
|
2143
|
-
},
|
|
2313
|
+
}, un = class {
|
|
2144
2314
|
#e;
|
|
2145
2315
|
#t;
|
|
2146
2316
|
#n;
|
|
@@ -2158,10 +2328,13 @@ var $t = class {
|
|
|
2158
2328
|
dispose() {
|
|
2159
2329
|
this.#o = !0, this.#s = [];
|
|
2160
2330
|
}
|
|
2331
|
+
async settled() {
|
|
2332
|
+
await this.#i;
|
|
2333
|
+
}
|
|
2161
2334
|
async change(e, t, n, r) {
|
|
2162
|
-
if (this.#o || this.#a == null) return;
|
|
2335
|
+
if (this.#o || this.#a == null) return !1;
|
|
2163
2336
|
let i = r(t.value);
|
|
2164
|
-
if (i
|
|
2337
|
+
if (B(i, t.value)) return !0;
|
|
2165
2338
|
let a = {
|
|
2166
2339
|
current: n,
|
|
2167
2340
|
flowId: e,
|
|
@@ -2170,20 +2343,22 @@ var $t = class {
|
|
|
2170
2343
|
this.#s.push(a), this.#r({
|
|
2171
2344
|
...t,
|
|
2172
2345
|
value: i
|
|
2173
|
-
})
|
|
2346
|
+
});
|
|
2347
|
+
let o = !1;
|
|
2348
|
+
return this.#i = this.#i.then(async () => {
|
|
2174
2349
|
if (this.#o || !n()) return;
|
|
2175
2350
|
let t = this.#a, i = r(t.value);
|
|
2176
|
-
if (i
|
|
2177
|
-
this.#c(a, t);
|
|
2351
|
+
if (B(i, t.value)) {
|
|
2352
|
+
this.#c(a, t), o = !0;
|
|
2178
2353
|
return;
|
|
2179
2354
|
}
|
|
2180
2355
|
try {
|
|
2181
2356
|
let r = await this.#e.updatePresentation(e, t.revision, i);
|
|
2182
2357
|
if (this.#o || !n()) return;
|
|
2183
|
-
this.#c(a, r);
|
|
2358
|
+
this.#c(a, r), o = !0;
|
|
2184
2359
|
} catch (r) {
|
|
2185
2360
|
if (this.#o || !n()) return;
|
|
2186
|
-
if (r instanceof
|
|
2361
|
+
if (r instanceof c && r.code == "flow.presentation-conflict") try {
|
|
2187
2362
|
let t = await this.#e.getPresentation(e);
|
|
2188
2363
|
if (this.#o || !n()) return;
|
|
2189
2364
|
this.#c(a, t), this.#n({
|
|
@@ -2191,11 +2366,11 @@ var $t = class {
|
|
|
2191
2366
|
message: this.#t.t("notice.layoutConflict")
|
|
2192
2367
|
});
|
|
2193
2368
|
} catch (e) {
|
|
2194
|
-
!this.#o && n() && this.#n(
|
|
2369
|
+
!this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(C(e, this.#t.t));
|
|
2195
2370
|
}
|
|
2196
|
-
else this.#c(a, t), this.#n(
|
|
2371
|
+
else this.#c(a, t), this.#n(C(r, this.#t.t));
|
|
2197
2372
|
}
|
|
2198
|
-
}), await this.#i;
|
|
2373
|
+
}), await this.#i, o;
|
|
2199
2374
|
}
|
|
2200
2375
|
#c(e, t) {
|
|
2201
2376
|
this.#s = this.#s.filter((t) => t !== e), this.#a = t;
|
|
@@ -2205,21 +2380,21 @@ var $t = class {
|
|
|
2205
2380
|
value: n
|
|
2206
2381
|
});
|
|
2207
2382
|
}
|
|
2208
|
-
},
|
|
2383
|
+
}, dn = {
|
|
2209
2384
|
checkLoading: !1,
|
|
2210
2385
|
selectedNodeIds: [],
|
|
2211
2386
|
workspaceLoadFailed: !1,
|
|
2212
2387
|
workspaceLoading: !1
|
|
2213
2388
|
};
|
|
2214
|
-
function
|
|
2389
|
+
function fn(e) {
|
|
2215
2390
|
return e.workspaceLoading ? "loading" : e.moduleSaveStatus == null ? e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved" : e.moduleSaveStatus;
|
|
2216
2391
|
}
|
|
2217
|
-
function
|
|
2392
|
+
function pn(e, t) {
|
|
2218
2393
|
if (t.phase != null) return t.phase;
|
|
2219
2394
|
let n = e?.content.modules[t.moduleId];
|
|
2220
2395
|
return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
|
|
2221
2396
|
}
|
|
2222
|
-
function
|
|
2397
|
+
function mn(e, t, n) {
|
|
2223
2398
|
if (e == null || t == null || n.length != 1) return;
|
|
2224
2399
|
let r = e.node(t, n[0]);
|
|
2225
2400
|
if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
|
|
@@ -2227,42 +2402,42 @@ function cn(e, t, n) {
|
|
|
2227
2402
|
source: r.module.source
|
|
2228
2403
|
};
|
|
2229
2404
|
}
|
|
2230
|
-
var
|
|
2405
|
+
var hn = class {
|
|
2231
2406
|
#e;
|
|
2232
|
-
#t =
|
|
2407
|
+
#t = n(dn);
|
|
2233
2408
|
#n;
|
|
2234
|
-
constructor(
|
|
2409
|
+
constructor(n, r) {
|
|
2235
2410
|
let i = e(this.#t, (e) => e.busy), a = e(this.#t, (e) => e.checkLoading), o = e(this.#t, (e) => e.diagnosticFocus), s = e(this.#t, (e) => e.diagnostics), c = e(this.#t, (e) => e.draft), l = e(this.#t, (e) => {
|
|
2236
2411
|
if (e.moduleEditor == null) return;
|
|
2237
2412
|
let { phase: t, ...n } = e.moduleEditor;
|
|
2238
2413
|
return {
|
|
2239
2414
|
...n,
|
|
2240
|
-
status:
|
|
2415
|
+
status: pn(e.draft, e.moduleEditor)
|
|
2241
2416
|
};
|
|
2242
|
-
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation),
|
|
2417
|
+
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : F(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
|
|
2243
2418
|
this.#e = e(this.#t, (e) => ({
|
|
2244
|
-
revision: e.draft == null ? void 0 :
|
|
2419
|
+
revision: e.draft == null ? void 0 : F(e.draft),
|
|
2245
2420
|
target: e.target
|
|
2246
2421
|
}), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
|
|
2247
|
-
let
|
|
2248
|
-
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return
|
|
2422
|
+
let y = e(this.#t, (e) => {
|
|
2423
|
+
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return F(e.draft).selection(e.target, e.selectedNodeIds[0]);
|
|
2249
2424
|
});
|
|
2250
2425
|
this.$ = {
|
|
2251
|
-
addNodeOptions:
|
|
2252
|
-
let { revision:
|
|
2253
|
-
return
|
|
2426
|
+
addNodeOptions: t((e) => {
|
|
2427
|
+
let { revision: t, target: r } = e(this.#e);
|
|
2428
|
+
return O(t?.revision, r, e(n.t$));
|
|
2254
2429
|
}),
|
|
2255
2430
|
busy: i,
|
|
2256
2431
|
checkLoading: a,
|
|
2257
2432
|
diagnosticFocus: o,
|
|
2258
|
-
diagnosticItems: e(this.#t, (e) =>
|
|
2433
|
+
diagnosticItems: e(this.#t, (e) => Ae(e.draft == null ? void 0 : F(e.draft), e.target, e.diagnostics)),
|
|
2259
2434
|
diagnostics: s,
|
|
2260
2435
|
draft: c,
|
|
2261
|
-
flow:
|
|
2262
|
-
let t = e(
|
|
2436
|
+
flow: t((e) => {
|
|
2437
|
+
let t = e(f);
|
|
2263
2438
|
return t == null ? void 0 : e(r.$.flows).find((e) => e.flowId == t);
|
|
2264
2439
|
}),
|
|
2265
|
-
flowId:
|
|
2440
|
+
flowId: f,
|
|
2266
2441
|
flowLoadFailed: r.$.failed,
|
|
2267
2442
|
flowLoadMoreFailed: r.$.loadMoreFailed,
|
|
2268
2443
|
flowLoading: r.$.loading,
|
|
@@ -2271,22 +2446,22 @@ var ln = class {
|
|
|
2271
2446
|
flowRefreshing: r.$.refreshing,
|
|
2272
2447
|
flowTotal: r.$.total,
|
|
2273
2448
|
flows: r.$.flows,
|
|
2274
|
-
inspectorDiagnostics: e(this.#t, (e) =>
|
|
2275
|
-
live:
|
|
2449
|
+
inspectorDiagnostics: e(this.#t, (e) => ue(e.draft == null ? void 0 : F(e.draft), e.target, e.diagnostics, y.value)),
|
|
2450
|
+
live: p,
|
|
2276
2451
|
moduleEditor: l,
|
|
2277
2452
|
nodeFocus: u,
|
|
2278
2453
|
presentation: d,
|
|
2279
|
-
revision:
|
|
2280
|
-
selection:
|
|
2281
|
-
selectedNodeIds:
|
|
2282
|
-
status: e(this.#t,
|
|
2283
|
-
target:
|
|
2284
|
-
targetFlow:
|
|
2454
|
+
revision: m,
|
|
2455
|
+
selection: y,
|
|
2456
|
+
selectedNodeIds: h,
|
|
2457
|
+
status: e(this.#t, fn),
|
|
2458
|
+
target: g,
|
|
2459
|
+
targetFlow: t((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
|
|
2285
2460
|
targetName: e(this.#t, (e) => {
|
|
2286
|
-
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id :
|
|
2461
|
+
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : F(e.draft).subflow(e.target.id)?.name ?? e.target.id;
|
|
2287
2462
|
}),
|
|
2288
|
-
workspaceLoadFailed:
|
|
2289
|
-
workspaceLoading:
|
|
2463
|
+
workspaceLoadFailed: _,
|
|
2464
|
+
workspaceLoading: v
|
|
2290
2465
|
}, this.#n = new Set(Object.values(r.$));
|
|
2291
2466
|
}
|
|
2292
2467
|
get value() {
|
|
@@ -2302,17 +2477,17 @@ var ln = class {
|
|
|
2302
2477
|
for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
|
|
2303
2478
|
this.#e.dispose(), this.#t.dispose();
|
|
2304
2479
|
}
|
|
2305
|
-
},
|
|
2480
|
+
}, gn = {
|
|
2306
2481
|
x: 40,
|
|
2307
2482
|
y: 40
|
|
2308
2483
|
};
|
|
2309
|
-
function
|
|
2484
|
+
function _n(e, t) {
|
|
2310
2485
|
if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
|
|
2311
2486
|
}
|
|
2312
|
-
var
|
|
2487
|
+
var vn = class {
|
|
2313
2488
|
#e;
|
|
2314
2489
|
#t;
|
|
2315
|
-
#n
|
|
2490
|
+
#n;
|
|
2316
2491
|
#r;
|
|
2317
2492
|
#i;
|
|
2318
2493
|
#a;
|
|
@@ -2320,42 +2495,44 @@ var fn = class {
|
|
|
2320
2495
|
#s;
|
|
2321
2496
|
#c;
|
|
2322
2497
|
#l;
|
|
2323
|
-
#u
|
|
2498
|
+
#u;
|
|
2324
2499
|
#d;
|
|
2325
2500
|
#f;
|
|
2326
|
-
#p
|
|
2327
|
-
#m
|
|
2328
|
-
#h
|
|
2329
|
-
#g
|
|
2330
|
-
#_
|
|
2331
|
-
#v
|
|
2501
|
+
#p;
|
|
2502
|
+
#m;
|
|
2503
|
+
#h;
|
|
2504
|
+
#g;
|
|
2505
|
+
#_;
|
|
2506
|
+
#v;
|
|
2332
2507
|
#y;
|
|
2333
2508
|
#b;
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2509
|
+
#x;
|
|
2510
|
+
#S;
|
|
2511
|
+
constructor(e, t, n = At, r = W(), i = () => {}) {
|
|
2512
|
+
this.#n = new s(), this.#u = /* @__PURE__ */ new Map(), this.#d = new rn(), this.history$ = this.#d.state$, this.#h = 0, this.#g = 0, this.#_ = !1, this.#v = !1, this.#y = !1, this.#b = 0, this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new ln(e, t, r), this.#l = new hn(r, this.#o), this.#t = new on(e, t, r, {
|
|
2513
|
+
apply: (e, t) => this.#O(e, "local", t),
|
|
2337
2514
|
beforeChange: (e) => {
|
|
2338
|
-
e && (this.#
|
|
2515
|
+
e && (this.#V({ busy: "designer" }), this.#c(void 0));
|
|
2339
2516
|
},
|
|
2340
|
-
check: () => void this.#
|
|
2341
|
-
current: (e) => this.#
|
|
2517
|
+
check: () => void this.#N(),
|
|
2518
|
+
current: (e) => this.#R(e),
|
|
2342
2519
|
diagnostics: () => this.#l.value.diagnostics,
|
|
2343
2520
|
finishChanges: () => {
|
|
2344
|
-
!this.#
|
|
2521
|
+
!this.#v && this.#l.value.busy == "designer" && this.#V({ busy: void 0 });
|
|
2345
2522
|
},
|
|
2346
2523
|
headChanged: (e, t) => this.#o.advanceHead(e, t),
|
|
2347
|
-
recover: (e) => this.#
|
|
2348
|
-
}), this.#a = new
|
|
2524
|
+
recover: (e) => (this.retryHistorySync(), this.#F(e, !0))
|
|
2525
|
+
}), this.#a = new un(e, t, (e) => this.#V({ presentation: e }), r), this.$ = this.#l.$;
|
|
2349
2526
|
}
|
|
2350
2527
|
dispose() {
|
|
2351
|
-
this.#
|
|
2528
|
+
this.#v = !0, this.#n.invalidate(), this.#a.dispose(), this.#x?.(), this.#S?.(), this.history$.dispose(), this.#l.dispose(), this.#o.dispose();
|
|
2352
2529
|
}
|
|
2353
2530
|
async start(e) {
|
|
2354
|
-
if (this.#
|
|
2531
|
+
if (this.#x == null) {
|
|
2355
2532
|
let e = this.#e.watchFlowCatalog(() => void this.reloadFlows());
|
|
2356
|
-
this.#
|
|
2533
|
+
this.#x = e.stop, await e.ready;
|
|
2357
2534
|
}
|
|
2358
|
-
this.#
|
|
2535
|
+
this.#v || (await this.reloadFlows(), this.#v || await this.selectFlow(e));
|
|
2359
2536
|
}
|
|
2360
2537
|
async reloadFlows() {
|
|
2361
2538
|
await this.#o.reload();
|
|
@@ -2370,9 +2547,10 @@ var fn = class {
|
|
|
2370
2547
|
await this.#o.loadMore();
|
|
2371
2548
|
}
|
|
2372
2549
|
async selectFlow(e) {
|
|
2373
|
-
if (!await this.saveModuleEditor()) return !1;
|
|
2550
|
+
if (this.#d.applying || !await this.saveModuleEditor() || this.#v) return !1;
|
|
2551
|
+
this.#d.clear(), this.#d.failed = !1, this.#d.publish();
|
|
2374
2552
|
let t = this.#n.begin();
|
|
2375
|
-
if (this.#t.reset(), this.#a.reset(), this.#
|
|
2553
|
+
if (this.#t.reset(), this.#a.reset(), this.#g = 0, this.#_ = !1, this.#y = !1, this.#S?.(), this.#S = void 0, this.#V({
|
|
2376
2554
|
checkLoading: !1,
|
|
2377
2555
|
diagnosticFocus: void 0,
|
|
2378
2556
|
diagnostics: void 0,
|
|
@@ -2389,26 +2567,26 @@ var fn = class {
|
|
|
2389
2567
|
}), e == null) return !0;
|
|
2390
2568
|
try {
|
|
2391
2569
|
let n = !1, r, i = this.#e.watchFlow(e, (e) => {
|
|
2392
|
-
t() && (this.#t.committed == null ? (n = !0, r = e) : e != this.#t.committed.revisionId && this.#
|
|
2570
|
+
t() && (this.#t.committed == null ? (n = !0, r = e) : e != this.#t.committed.revisionId && this.#P(e));
|
|
2393
2571
|
}, (e) => {
|
|
2394
2572
|
t() && this.#s(e);
|
|
2395
2573
|
});
|
|
2396
|
-
if (this.#
|
|
2574
|
+
if (this.#S = i.stop, await i.ready, !t()) return !1;
|
|
2397
2575
|
let { flow: a, draft: o, live: s, presentation: c } = await this.#e.getEditor(e);
|
|
2398
2576
|
if (!t()) return !1;
|
|
2399
|
-
this.#t.reset(o), this.#a.reset(c), this.#o.include(a), this.#
|
|
2577
|
+
this.#t.reset(o), this.#a.reset(c), this.#o.include(a), this.#V({
|
|
2400
2578
|
draft: o,
|
|
2401
2579
|
live: s,
|
|
2402
2580
|
presentation: c,
|
|
2403
2581
|
target: { kind: "flow" },
|
|
2404
2582
|
workspaceLoadFailed: !1,
|
|
2405
2583
|
workspaceLoading: !1
|
|
2406
|
-
}), await this.#
|
|
2584
|
+
}), await this.#D(t), n && r != o.revisionId && this.#P(r);
|
|
2407
2585
|
} catch (e) {
|
|
2408
2586
|
if (!t()) return !1;
|
|
2409
|
-
this.#
|
|
2410
|
-
let n = e instanceof
|
|
2411
|
-
return this.#
|
|
2587
|
+
this.#S?.(), this.#S = void 0;
|
|
2588
|
+
let n = e instanceof c && e.code == le.flowNotFound;
|
|
2589
|
+
return this.#V(n ? {
|
|
2412
2590
|
flowId: void 0,
|
|
2413
2591
|
target: void 0,
|
|
2414
2592
|
workspaceLoadFailed: !1,
|
|
@@ -2419,39 +2597,39 @@ var fn = class {
|
|
|
2419
2597
|
}), this.#c(n ? {
|
|
2420
2598
|
kind: "error",
|
|
2421
2599
|
message: this.#r.t("notice.flowMissing")
|
|
2422
|
-
} :
|
|
2600
|
+
} : C(e, this.#r.t)), !1;
|
|
2423
2601
|
}
|
|
2424
2602
|
return !0;
|
|
2425
2603
|
}
|
|
2426
2604
|
selectTarget(e) {
|
|
2427
|
-
return this.#
|
|
2605
|
+
return !this.#d.applying && (B(e, this.#l.value.target) || this.#d.clear(), this.#C(), this.#V({
|
|
2428
2606
|
diagnosticFocus: void 0,
|
|
2429
2607
|
diagnostics: void 0,
|
|
2430
2608
|
moduleEditor: void 0,
|
|
2431
2609
|
nodeFocus: void 0,
|
|
2432
2610
|
selectedNodeIds: [],
|
|
2433
2611
|
target: e
|
|
2434
|
-
}), this.#
|
|
2612
|
+
}), this.#N(), !0);
|
|
2435
2613
|
}
|
|
2436
2614
|
selectNodes(e) {
|
|
2437
|
-
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#
|
|
2615
|
+
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#C(), this.#V({
|
|
2438
2616
|
diagnosticFocus: void 0,
|
|
2439
|
-
moduleEditor:
|
|
2617
|
+
moduleEditor: mn(this.#l.value.draft == null ? void 0 : F(this.#l.value.draft), this.#l.value.target, e),
|
|
2440
2618
|
nodeFocus: void 0,
|
|
2441
2619
|
selectedNodeIds: e
|
|
2442
2620
|
}), !0);
|
|
2443
2621
|
}
|
|
2444
2622
|
async createFlow(e, t) {
|
|
2445
2623
|
if (await this.saveModuleEditor()) {
|
|
2446
|
-
this.#
|
|
2624
|
+
this.#V({ busy: "flow" }), this.#c(void 0);
|
|
2447
2625
|
try {
|
|
2448
2626
|
if (t == null) return await this.#o.create(e);
|
|
2449
2627
|
let n = await this.#e.getFlow(await t(e));
|
|
2450
2628
|
return this.#o.insert(n), n;
|
|
2451
2629
|
} catch (e) {
|
|
2452
|
-
this.#
|
|
2630
|
+
this.#v || this.#c(C(e, this.#r.t));
|
|
2453
2631
|
} finally {
|
|
2454
|
-
this.#
|
|
2632
|
+
this.#V({ busy: void 0 });
|
|
2455
2633
|
}
|
|
2456
2634
|
}
|
|
2457
2635
|
}
|
|
@@ -2459,24 +2637,24 @@ var fn = class {
|
|
|
2459
2637
|
if (!await this.saveModuleEditor()) return !1;
|
|
2460
2638
|
let t = this.#o.flow(e);
|
|
2461
2639
|
if (t == null || t.status == "retiring") return !1;
|
|
2462
|
-
this.#
|
|
2640
|
+
this.#V({ busy: "flow" }), this.#c(void 0);
|
|
2463
2641
|
try {
|
|
2464
|
-
return await this.#e.deleteFlow(e), !this.#
|
|
2642
|
+
return await this.#e.deleteFlow(e), !this.#v && (this.#o.remove(e), this.#c({
|
|
2465
2643
|
kind: "success",
|
|
2466
2644
|
message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
|
|
2467
2645
|
}), !0);
|
|
2468
2646
|
} catch (e) {
|
|
2469
|
-
return this.#
|
|
2647
|
+
return this.#v || this.#c(C(e, this.#r.t)), !1;
|
|
2470
2648
|
} finally {
|
|
2471
|
-
this.#
|
|
2649
|
+
this.#V({ busy: void 0 });
|
|
2472
2650
|
}
|
|
2473
2651
|
}
|
|
2474
2652
|
async createResource(e) {
|
|
2475
2653
|
if (!await this.saveModuleEditor() || this.#l.value.draft == null) return !1;
|
|
2476
2654
|
let t = this.#i();
|
|
2477
|
-
this.#
|
|
2478
|
-
let n = await this.#
|
|
2479
|
-
return this.#
|
|
2655
|
+
this.#V({ busy: "resource" }), this.#c(void 0);
|
|
2656
|
+
let n = await this.#E(Ce(t, e), !1);
|
|
2657
|
+
return this.#V({ busy: void 0 }), n != null && (this.selectTarget({
|
|
2480
2658
|
id: t,
|
|
2481
2659
|
kind: "subflow"
|
|
2482
2660
|
}), this.#c({
|
|
@@ -2488,14 +2666,14 @@ var fn = class {
|
|
|
2488
2666
|
let n = this.#o.flow(e), r = t.trim();
|
|
2489
2667
|
if (n == null || r.length == 0) return !1;
|
|
2490
2668
|
if (n.name == r) return !0;
|
|
2491
|
-
this.#
|
|
2669
|
+
this.#V({ busy: "flow" }), this.#c(void 0);
|
|
2492
2670
|
let i;
|
|
2493
2671
|
try {
|
|
2494
2672
|
i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
|
|
2495
2673
|
} catch (e) {
|
|
2496
|
-
this.#
|
|
2674
|
+
this.#v || this.#c(C(e, this.#r.t));
|
|
2497
2675
|
}
|
|
2498
|
-
return this.#
|
|
2676
|
+
return this.#V({ busy: void 0 }), i != null && (this.#c({
|
|
2499
2677
|
kind: "success",
|
|
2500
2678
|
message: this.#r.t("notice.flowRenamed", { name: r })
|
|
2501
2679
|
}), !0);
|
|
@@ -2505,87 +2683,92 @@ var fn = class {
|
|
|
2505
2683
|
let r = this.#l.value.draft, i = this.#l.value.target;
|
|
2506
2684
|
if (r == null || i == null) return;
|
|
2507
2685
|
let a = this.#i();
|
|
2508
|
-
if (e.kind == "comment") return await this.#
|
|
2509
|
-
let o =
|
|
2686
|
+
if (e.kind == "comment") return await this.#T(i, a, t);
|
|
2687
|
+
let o = F(r), s = Fe(e, o, i, this.#r.t);
|
|
2510
2688
|
if (s == null) return;
|
|
2511
|
-
let c = n?.(a), l =
|
|
2689
|
+
let c = n?.(a), l = ke(o, i, a, s, this.#i);
|
|
2512
2690
|
if (l == null) return;
|
|
2513
|
-
let u = c == null ? l : [...l, ...
|
|
2691
|
+
let u = c == null ? l : [...l, ...Tt(I(r, l).content, i, {
|
|
2514
2692
|
source: c.source,
|
|
2515
2693
|
target: c.target,
|
|
2516
2694
|
...c.sourceHandle.startsWith("$branch:") ? { sourceHandle: c.sourceHandle.slice(8) } : {}
|
|
2517
|
-
})]
|
|
2518
|
-
this
|
|
2519
|
-
let f = this.moveNodes({ [a]: t });
|
|
2520
|
-
if (await d != null && (await f, !this.#g)) return this.#I({ nodeFocus: {
|
|
2695
|
+
})];
|
|
2696
|
+
if (await this.#j("add", 1, u, (e) => v(e, i, { [a]: t }), [a]) && !this.#v) return this.#V({ nodeFocus: {
|
|
2521
2697
|
nodeId: a,
|
|
2522
|
-
requestId: ++this.#
|
|
2698
|
+
requestId: ++this.#b
|
|
2523
2699
|
} }), a;
|
|
2524
2700
|
}
|
|
2525
2701
|
async connect(e) {
|
|
2526
2702
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2527
2703
|
if (t == null || n == null) return;
|
|
2528
|
-
let r =
|
|
2704
|
+
let r = Tt(t.revision.content, n, {
|
|
2529
2705
|
source: e.source,
|
|
2530
2706
|
target: e.target,
|
|
2531
2707
|
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
2532
2708
|
});
|
|
2533
|
-
r.length > 0 && await this.#
|
|
2709
|
+
r.length > 0 && await this.#j("connect", 1, r);
|
|
2534
2710
|
}
|
|
2535
2711
|
async disconnect(e) {
|
|
2536
2712
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2537
2713
|
if (t == null || n == null) return;
|
|
2538
|
-
let r =
|
|
2714
|
+
let r = Et(t.revision.content, n, {
|
|
2539
2715
|
source: e.source,
|
|
2540
2716
|
target: e.target,
|
|
2541
2717
|
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
2542
2718
|
});
|
|
2543
|
-
r.length > 0 && await this.#
|
|
2719
|
+
r.length > 0 && await this.#j("disconnect", 1, r);
|
|
2544
2720
|
}
|
|
2545
2721
|
async deleteSelectedNodes() {
|
|
2546
2722
|
if (!await this.saveModuleEditor()) return;
|
|
2547
2723
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
2548
2724
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2549
|
-
let n =
|
|
2550
|
-
this
|
|
2725
|
+
let n = [...this.#l.value.selectedNodeIds], r = x(this.#l.value.presentation?.value ?? {}, t), i = new Set(this.#l.value.selectedNodeIds.filter((e) => r.has(e))), a = De(e, t, this.#l.value.selectedNodeIds);
|
|
2726
|
+
await this.#j("delete", this.#l.value.selectedNodeIds.length, a, (e) => {
|
|
2727
|
+
let r = i.size == 0 ? e : y(e, t, i);
|
|
2728
|
+
for (let e of n) r = g(r, t, e, !1);
|
|
2729
|
+
return r;
|
|
2730
|
+
}, []);
|
|
2551
2731
|
}
|
|
2552
2732
|
copySelectedNodes() {
|
|
2553
2733
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
2554
2734
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2555
2735
|
let n = new Set(this.#l.value.selectedNodeIds);
|
|
2556
|
-
this.#
|
|
2557
|
-
|
|
2736
|
+
this.#m = {
|
|
2737
|
+
hiddenNodeIds: this.#I().nodes.flatMap((e) => e.contentHidden && n.has(e.id) ? [e.id] : []),
|
|
2738
|
+
comments: this.#I().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
|
|
2558
2739
|
content: e.content,
|
|
2559
2740
|
position: e.position,
|
|
2560
2741
|
sourceId: e.id,
|
|
2561
2742
|
title: e.title
|
|
2562
2743
|
}] : []),
|
|
2563
|
-
nodes:
|
|
2744
|
+
nodes: M(e, t, this.#l.value.selectedNodeIds)
|
|
2564
2745
|
};
|
|
2565
2746
|
}
|
|
2566
|
-
async pasteNodes(e, t =
|
|
2747
|
+
async pasteNodes(e, t = gn) {
|
|
2567
2748
|
if (!await this.saveModuleEditor()) return;
|
|
2568
2749
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2569
|
-
if (n == null || r == null || this.#
|
|
2570
|
-
let i =
|
|
2750
|
+
if (n == null || r == null || this.#m == null) return;
|
|
2751
|
+
let i = new Set(this.#m.hiddenNodeIds), a = ae(n, r, this.#m.nodes, this.#i), o = this.#m.comments.map((e) => ({
|
|
2571
2752
|
...e,
|
|
2572
2753
|
nodeId: this.#i()
|
|
2573
2754
|
}));
|
|
2574
|
-
if (
|
|
2575
|
-
let s = new Map(this.#
|
|
2755
|
+
if (a.nodeIds.length == 0 && o.length == 0) return;
|
|
2756
|
+
let s = new Map(this.#I().nodes.map((e) => [e.id, e])), c = /* @__PURE__ */ new Set([...a.nodeIds, ...o.map((e) => e.nodeId)]), l = new Set([...s].filter(([e]) => !c.has(e)).map(([, e]) => `${e.position.x}\0${e.position.y}`)), u = [...a.sourceIds.map((t) => e?.[t] ?? s.get(t)?.position ?? {
|
|
2576
2757
|
x: 80,
|
|
2577
2758
|
y: 80
|
|
2578
2759
|
}), ...o.map((e) => e.position)], d = 1;
|
|
2579
2760
|
if (t.x != 0 || t.y != 0) for (; u.some((e) => l.has(`${e.x + t.x * d}\0${e.y + t.y * d}`));) d += 1;
|
|
2580
|
-
let f = Object.fromEntries(
|
|
2581
|
-
let
|
|
2582
|
-
return [
|
|
2583
|
-
x: (
|
|
2584
|
-
y: (
|
|
2761
|
+
let f = Object.fromEntries(a.sourceIds.map((n, r) => {
|
|
2762
|
+
let i = e?.[n] ?? s.get(n)?.position;
|
|
2763
|
+
return [a.nodeIds[r], {
|
|
2764
|
+
x: (i?.x ?? 80) + t.x * d,
|
|
2765
|
+
y: (i?.y ?? 80) + t.y * d
|
|
2585
2766
|
}];
|
|
2586
|
-
}))
|
|
2587
|
-
|
|
2588
|
-
|
|
2767
|
+
}));
|
|
2768
|
+
await this.#j("paste", c.size, a.changes, (e) => {
|
|
2769
|
+
let n = v(e, r, f);
|
|
2770
|
+
for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n = g(n, r, a.nodeIds[e], !0));
|
|
2771
|
+
for (let e of o) i.has(e.sourceId) && (n = g(n, r, e.nodeId, !0)), n = S(n, r, e.nodeId, {
|
|
2589
2772
|
content: e.content,
|
|
2590
2773
|
position: {
|
|
2591
2774
|
x: e.position.x + t.x * d,
|
|
@@ -2594,8 +2777,7 @@ var fn = class {
|
|
|
2594
2777
|
title: this.#r.t("addNode.commentCopy", { title: e.title })
|
|
2595
2778
|
});
|
|
2596
2779
|
return n;
|
|
2597
|
-
});
|
|
2598
|
-
this.selectNodes([...i.nodeIds, ...o.map((e) => e.nodeId)]), (a == null || await a != null) && await p;
|
|
2780
|
+
}, [...a.nodeIds, ...o.map((e) => e.nodeId)]);
|
|
2599
2781
|
}
|
|
2600
2782
|
async duplicateSelectedNodes(e, t) {
|
|
2601
2783
|
this.copySelectedNodes(), await this.pasteNodes(e, t);
|
|
@@ -2603,36 +2785,36 @@ var fn = class {
|
|
|
2603
2785
|
async saveNodeSettings(e, t) {
|
|
2604
2786
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2605
2787
|
if (n == null || r == null) return !1;
|
|
2606
|
-
let i =
|
|
2607
|
-
return i != null && await this.#
|
|
2788
|
+
let i = pe(n, r, e, t);
|
|
2789
|
+
return i != null && await this.#E(i) != null;
|
|
2608
2790
|
}
|
|
2609
2791
|
async saveNodeDescription(e, t) {
|
|
2610
2792
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2611
2793
|
if (n == null || r == null) return !1;
|
|
2612
|
-
let i =
|
|
2613
|
-
return i != null && await this.#
|
|
2794
|
+
let i = Te(n, r, e, t);
|
|
2795
|
+
return i != null && await this.#E(i) != null;
|
|
2614
2796
|
}
|
|
2615
2797
|
async saveNodeIcon(e, t) {
|
|
2616
2798
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2617
2799
|
if (n == null || r == null) return !1;
|
|
2618
|
-
let i =
|
|
2619
|
-
return i != null && await this.#
|
|
2800
|
+
let i = xe(n, r, e, t);
|
|
2801
|
+
return i != null && await this.#E(i) != null;
|
|
2620
2802
|
}
|
|
2621
2803
|
async saveNodeTitle(e, t) {
|
|
2622
2804
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2623
2805
|
if (n == null || r == null) return !1;
|
|
2624
|
-
let i =
|
|
2625
|
-
return i != null && await this.#
|
|
2806
|
+
let i = he(n, r, e, t);
|
|
2807
|
+
return i != null && await this.#E(i) != null;
|
|
2626
2808
|
}
|
|
2627
2809
|
async setInputValue(e, t, n) {
|
|
2628
2810
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2629
2811
|
if (r == null || i == null) return !1;
|
|
2630
|
-
let a =
|
|
2631
|
-
return a != null && await this.#
|
|
2812
|
+
let a = ye(r, i, e, t, n);
|
|
2813
|
+
return a != null && await this.#E(a) != null;
|
|
2632
2814
|
}
|
|
2633
2815
|
async setInputSource(e, t, n) {
|
|
2634
2816
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2635
|
-
return r == null || i == null ? !1 : await this.#
|
|
2817
|
+
return r == null || i == null ? !1 : await this.#E(we(r.revision.content, i, e, t, [{
|
|
2636
2818
|
kind: "node",
|
|
2637
2819
|
...n
|
|
2638
2820
|
}])) != null;
|
|
@@ -2640,36 +2822,40 @@ var fn = class {
|
|
|
2640
2822
|
async setInputVariable(e, t, n) {
|
|
2641
2823
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2642
2824
|
if (r == null || i == null) return !1;
|
|
2643
|
-
let a = n == null ?
|
|
2644
|
-
return a != null && await this.#
|
|
2825
|
+
let a = n == null ? ye(r, i, e, t, void 0) : je(r, i, e, t, n, this.#i());
|
|
2826
|
+
return a != null && await this.#E(a) != null;
|
|
2645
2827
|
}
|
|
2646
2828
|
async saveCondition(e, t) {
|
|
2647
2829
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2648
2830
|
if (n == null || r == null) return !1;
|
|
2649
|
-
let i =
|
|
2650
|
-
return i != null && await this.#
|
|
2831
|
+
let i = de(n, r, e, t);
|
|
2832
|
+
return i != null && await this.#E(i) != null;
|
|
2651
2833
|
}
|
|
2652
2834
|
async saveValue(e, t) {
|
|
2653
2835
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2654
2836
|
if (n == null || r == null) return !1;
|
|
2655
|
-
let i =
|
|
2656
|
-
return i != null && await this.#
|
|
2837
|
+
let i = Ie(n, r, e, t);
|
|
2838
|
+
return i != null && await this.#E(i) != null;
|
|
2657
2839
|
}
|
|
2658
2840
|
async saveWait(e, t) {
|
|
2659
2841
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2660
2842
|
if (n == null || r?.kind != "flow") return !1;
|
|
2661
|
-
let i =
|
|
2662
|
-
return i != null && await this.#
|
|
2843
|
+
let i = E(n, r, e, t);
|
|
2844
|
+
return i != null && await this.#E(i) != null;
|
|
2663
2845
|
}
|
|
2664
2846
|
async setWaitNotification(e, t) {
|
|
2665
|
-
let n = this.$.revision.value, r = n == null ? void 0 :
|
|
2666
|
-
return r != null && await this.#
|
|
2847
|
+
let n = this.$.revision.value, r = n == null ? void 0 : se(n, e, t, this.#i());
|
|
2848
|
+
return r != null && await this.#E(r) != null;
|
|
2849
|
+
}
|
|
2850
|
+
async saveNodeContentHidden(e, t) {
|
|
2851
|
+
let n = this.#l.value.target, r = this.#I().nodes.find((t) => t.id == e);
|
|
2852
|
+
n != null && r != null && r.kind != "condition" && await this.#k((r) => g(r, n, e, t));
|
|
2667
2853
|
}
|
|
2668
2854
|
async saveComment(e, t) {
|
|
2669
2855
|
let n = this.#l.value.target;
|
|
2670
2856
|
if (n == null) return;
|
|
2671
|
-
let r = this.#
|
|
2672
|
-
r != null && await this.#
|
|
2857
|
+
let r = this.#I().nodes.find((t) => t.id == e)?.position;
|
|
2858
|
+
r != null && await this.#k((i) => S(i, n, e, {
|
|
2673
2859
|
...t,
|
|
2674
2860
|
position: r
|
|
2675
2861
|
}));
|
|
@@ -2677,66 +2863,67 @@ var fn = class {
|
|
|
2677
2863
|
async saveTaskSettings(e, t) {
|
|
2678
2864
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2679
2865
|
if (n == null || r == null) return !1;
|
|
2680
|
-
let i =
|
|
2681
|
-
return i != null && await this.#
|
|
2866
|
+
let i = Ne(n, r, e, t);
|
|
2867
|
+
return i != null && await this.#E(i) != null;
|
|
2682
2868
|
}
|
|
2683
2869
|
async saveCodeActions(e, t) {
|
|
2684
2870
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2685
2871
|
if (n == null || r == null) return !1;
|
|
2686
|
-
let i =
|
|
2687
|
-
return i == null || await this.#
|
|
2872
|
+
let i = _e(n.revision.content, r, e, t);
|
|
2873
|
+
return i == null || await this.#E(i) != null;
|
|
2688
2874
|
}
|
|
2689
2875
|
async saveTaskPorts(e, t) {
|
|
2690
2876
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2691
2877
|
if (n == null || r == null) return !1;
|
|
2692
|
-
let i =
|
|
2693
|
-
return i != null && await this.#
|
|
2878
|
+
let i = re(n, r, e, t);
|
|
2879
|
+
return i != null && await this.#E(i) != null;
|
|
2694
2880
|
}
|
|
2695
2881
|
async saveTaskAdditionalInputs(e, t) {
|
|
2696
2882
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2697
2883
|
if (n == null || r == null) return !1;
|
|
2698
|
-
let i =
|
|
2699
|
-
return i != null && await this.#
|
|
2884
|
+
let i = Re(n, r, e, t);
|
|
2885
|
+
return i != null && await this.#E(i) != null;
|
|
2700
2886
|
}
|
|
2701
2887
|
async setConnectorConnection(e, t) {
|
|
2702
2888
|
let n = this.$.revision.value;
|
|
2703
2889
|
if (n == null) return !1;
|
|
2704
|
-
let r =
|
|
2705
|
-
return r != null && await this.#
|
|
2890
|
+
let r = ne(n.revision.content, e, t);
|
|
2891
|
+
return r != null && await this.#E(r) != null;
|
|
2706
2892
|
}
|
|
2707
2893
|
async saveTriggerConfig(e, t, n) {
|
|
2708
2894
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2709
2895
|
if (r == null || i?.kind != "flow") return !1;
|
|
2710
|
-
let a =
|
|
2711
|
-
return a != null && await this.#
|
|
2896
|
+
let a = oe(r.revision.content, i, e, t, n);
|
|
2897
|
+
return a != null && await this.#E(a) != null;
|
|
2712
2898
|
}
|
|
2713
2899
|
async saveTriggerSchedule(e, t) {
|
|
2714
2900
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2715
2901
|
if (n == null || r?.kind != "flow") return !1;
|
|
2716
|
-
let i =
|
|
2717
|
-
return i != null && await this.#
|
|
2902
|
+
let i = be(n.revision.content, r, e, t);
|
|
2903
|
+
return i != null && await this.#E(i) != null;
|
|
2718
2904
|
}
|
|
2719
2905
|
async saveWebhook(e, t) {
|
|
2720
2906
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2721
2907
|
if (n == null || r?.kind != "flow") return !1;
|
|
2722
|
-
let i =
|
|
2723
|
-
return i != null && await this.#
|
|
2908
|
+
let i = u(n, r, e, t);
|
|
2909
|
+
return i != null && await this.#E(i) != null;
|
|
2724
2910
|
}
|
|
2725
2911
|
async setTriggerConnection(e, t) {
|
|
2726
2912
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2727
2913
|
if (n == null || r?.kind != "flow") return !1;
|
|
2728
|
-
let i =
|
|
2729
|
-
return i != null && await this.#
|
|
2914
|
+
let i = Oe(n.revision.content, r, e, t);
|
|
2915
|
+
return i != null && await this.#E(i) != null;
|
|
2730
2916
|
}
|
|
2731
2917
|
async saveSubflowSettings(e, t) {
|
|
2732
2918
|
let n = this.$.revision.value;
|
|
2733
2919
|
if (n == null) return !1;
|
|
2734
|
-
let r =
|
|
2735
|
-
return r != null && await this.#
|
|
2920
|
+
let r = j(n, e, t);
|
|
2921
|
+
return r != null && await this.#E(r) != null;
|
|
2736
2922
|
}
|
|
2737
2923
|
updateModuleSource(e) {
|
|
2738
2924
|
let t = this.#l.value.moduleEditor;
|
|
2739
|
-
if (t == null || t.source == e) return;
|
|
2925
|
+
if (this.#d.applying || this.#d.failed || t == null || t.source == e) return;
|
|
2926
|
+
this.#A();
|
|
2740
2927
|
let n = this.#u.get(t.moduleId)?.base ?? this.#l.value.draft?.content.modules[t.moduleId];
|
|
2741
2928
|
n != null && (this.#u.set(t.moduleId, {
|
|
2742
2929
|
base: n,
|
|
@@ -2745,14 +2932,14 @@ var fn = class {
|
|
|
2745
2932
|
phase: void 0,
|
|
2746
2933
|
source: e
|
|
2747
2934
|
}
|
|
2748
|
-
}), this.#
|
|
2935
|
+
}), this.#B());
|
|
2749
2936
|
}
|
|
2750
2937
|
discardModuleChanges() {
|
|
2751
2938
|
let e = this.#l.value.moduleEditor;
|
|
2752
|
-
if (e == null || this.#
|
|
2939
|
+
if (e == null || this.#p != null) return;
|
|
2753
2940
|
this.#u.delete(e.moduleId);
|
|
2754
2941
|
let t = this.#l.value.draft?.content.modules[e.moduleId];
|
|
2755
|
-
this.#
|
|
2942
|
+
this.#V({ moduleEditor: t == null ? void 0 : {
|
|
2756
2943
|
moduleId: e.moduleId,
|
|
2757
2944
|
source: t.source
|
|
2758
2945
|
} });
|
|
@@ -2761,44 +2948,44 @@ var fn = class {
|
|
|
2761
2948
|
return this.#u.size > 0;
|
|
2762
2949
|
}
|
|
2763
2950
|
async saveModuleEditor() {
|
|
2764
|
-
if (this.#
|
|
2951
|
+
if (this.#v) return !1;
|
|
2765
2952
|
for (let e of this.#u.values()) e.editor.phase == "failed" && (e.editor = {
|
|
2766
2953
|
...e.editor,
|
|
2767
2954
|
phase: void 0
|
|
2768
2955
|
});
|
|
2769
|
-
return this.#
|
|
2956
|
+
return this.#B(), await this.#C();
|
|
2770
2957
|
}
|
|
2771
|
-
#
|
|
2772
|
-
if (this.#
|
|
2773
|
-
if (this.#
|
|
2958
|
+
#C() {
|
|
2959
|
+
if (this.#p != null) return this.#p;
|
|
2960
|
+
if (this.#v) return Promise.resolve(!1);
|
|
2774
2961
|
if (![...this.#u.values()].some((e) => e.editor.phase != "failed")) return Promise.resolve(this.#u.size == 0);
|
|
2775
2962
|
let e = this.#n.capture();
|
|
2776
|
-
return this.#
|
|
2777
|
-
this.#
|
|
2778
|
-
}), this.#
|
|
2963
|
+
return this.#p = this.#w(e).finally(() => {
|
|
2964
|
+
this.#p = void 0;
|
|
2965
|
+
}), this.#p;
|
|
2779
2966
|
}
|
|
2780
|
-
async #
|
|
2781
|
-
for (; !this.#
|
|
2967
|
+
async #w(e) {
|
|
2968
|
+
for (; !this.#v && e();) {
|
|
2782
2969
|
let t = [...this.#u.entries()].find(([, e]) => e.editor.phase != "failed");
|
|
2783
2970
|
if (t == null) return this.#u.size == 0;
|
|
2784
2971
|
let [n, r] = t, i = r.editor.source;
|
|
2785
2972
|
r.editor = {
|
|
2786
2973
|
...r.editor,
|
|
2787
2974
|
phase: "saving"
|
|
2788
|
-
}, this.#
|
|
2975
|
+
}, this.#B();
|
|
2789
2976
|
try {
|
|
2790
|
-
let t = await
|
|
2791
|
-
if (this.#
|
|
2977
|
+
let t = await Ot(i);
|
|
2978
|
+
if (this.#v || !e()) return !1;
|
|
2792
2979
|
let a = this.#l.value.draft?.content.modules[n];
|
|
2793
2980
|
if (a == null || a.source != r.base.source || JSON.stringify(a.imports) != JSON.stringify(r.base.imports)) throw Error(this.#r.t("notice.moduleUpdated"));
|
|
2794
|
-
let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#
|
|
2795
|
-
if (this.#
|
|
2981
|
+
let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#E(kt(n, r.base.source, r.base.imports, i, t), !1);
|
|
2982
|
+
if (this.#v || !e()) return !1;
|
|
2796
2983
|
let s = this.#u.get(n);
|
|
2797
2984
|
if (s == null) continue;
|
|
2798
2985
|
o == null ? s.editor = {
|
|
2799
2986
|
...s.editor,
|
|
2800
2987
|
phase: "failed"
|
|
2801
|
-
} : s.editor.source == i ? (this.#u.delete(n), this.#l.value.moduleEditor?.moduleId == n && this.#
|
|
2988
|
+
} : s.editor.source == i ? (this.#u.delete(n), this.#l.value.moduleEditor?.moduleId == n && this.#V({ moduleEditor: {
|
|
2802
2989
|
moduleId: n,
|
|
2803
2990
|
source: i
|
|
2804
2991
|
} })) : (s.base = {
|
|
@@ -2810,87 +2997,102 @@ var fn = class {
|
|
|
2810
2997
|
phase: void 0
|
|
2811
2998
|
});
|
|
2812
2999
|
} catch (t) {
|
|
2813
|
-
if (this.#
|
|
3000
|
+
if (this.#v || !e()) return !1;
|
|
2814
3001
|
let r = this.#u.get(n);
|
|
2815
3002
|
r != null && (r.editor = {
|
|
2816
3003
|
...r.editor,
|
|
2817
3004
|
phase: "failed"
|
|
2818
|
-
}), this.#c(
|
|
3005
|
+
}), this.#c(C(t, this.#r.t));
|
|
2819
3006
|
}
|
|
2820
|
-
this.#
|
|
3007
|
+
this.#B();
|
|
2821
3008
|
}
|
|
2822
3009
|
return !1;
|
|
2823
3010
|
}
|
|
2824
3011
|
async moveNodes(e) {
|
|
2825
3012
|
let t = this.#l.value.target;
|
|
2826
|
-
t != null && await this.#
|
|
3013
|
+
t != null && await this.#j("move", Object.keys(e).length, [], (n) => v(n, t, e));
|
|
2827
3014
|
}
|
|
2828
3015
|
async moveViewport(e) {
|
|
2829
3016
|
let t = this.#l.value.target;
|
|
2830
|
-
t != null && await this.#
|
|
3017
|
+
t != null && await this.#k((n) => m(n, t, e), !0);
|
|
2831
3018
|
}
|
|
2832
3019
|
async check() {
|
|
2833
|
-
await this.#
|
|
3020
|
+
await this.#N();
|
|
2834
3021
|
}
|
|
2835
3022
|
async refreshFlows() {
|
|
2836
3023
|
await this.reloadFlows();
|
|
2837
3024
|
}
|
|
2838
3025
|
updateLive(e) {
|
|
2839
|
-
e.flowId == this.#l.value.flowId && this.#
|
|
3026
|
+
e.flowId == this.#l.value.flowId && this.#V({ live: e });
|
|
2840
3027
|
}
|
|
2841
3028
|
locateNode(e) {
|
|
2842
3029
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2843
|
-
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#
|
|
3030
|
+
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#V({ nodeFocus: {
|
|
2844
3031
|
nodeId: e,
|
|
2845
|
-
requestId: ++this.#
|
|
3032
|
+
requestId: ++this.#b
|
|
2846
3033
|
} }), !0);
|
|
2847
3034
|
}
|
|
2848
3035
|
locateDiagnostic(e) {
|
|
2849
|
-
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#
|
|
3036
|
+
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#V({ diagnosticFocus: {
|
|
2850
3037
|
...e.location,
|
|
2851
3038
|
diagnostic: e.diagnostic,
|
|
2852
|
-
requestId: ++this.#
|
|
3039
|
+
requestId: ++this.#h
|
|
2853
3040
|
} }), !0);
|
|
2854
3041
|
}
|
|
2855
|
-
async #
|
|
2856
|
-
let r = Math.max(0, ...this.#
|
|
3042
|
+
async #T(e, t, n) {
|
|
3043
|
+
let r = Math.max(0, ...this.#I().nodes.flatMap((e) => {
|
|
2857
3044
|
if (e.kind != "comment") return [];
|
|
2858
3045
|
let t = /#(\d+)$/.exec(e.title);
|
|
2859
3046
|
return t == null ? [] : [Number(t[1])];
|
|
2860
|
-
}))
|
|
3047
|
+
}));
|
|
3048
|
+
if (!(!await this.#j("add", 1, [], (i) => S(i, e, t, {
|
|
2861
3049
|
content: "",
|
|
2862
3050
|
position: n,
|
|
2863
3051
|
title: this.#r.t("addNode.commentName", { number: r + 1 })
|
|
2864
|
-
}));
|
|
2865
|
-
if (this.selectNodes([t]), await i, !this.#g) return t;
|
|
3052
|
+
}), [t]) || this.#v)) return t;
|
|
2866
3053
|
}
|
|
2867
|
-
async #
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
3054
|
+
async #E(e, t = !0, n = !1) {
|
|
3055
|
+
if (this.#v || (this.#d.applying || this.#d.failed) && !n) return;
|
|
3056
|
+
let r = this.#l.value.flowId, i = this.#l.value.draft;
|
|
3057
|
+
if (r == null || i == null) return;
|
|
3058
|
+
if (e.length == 0 || B(I(i, e).content, i.content)) return i;
|
|
3059
|
+
let a = !n && this.#d.clear(), o = this.#n.capture();
|
|
3060
|
+
this.#d.pending++, this.#d.publish();
|
|
3061
|
+
try {
|
|
3062
|
+
let n = this.#t.change({
|
|
3063
|
+
current: o,
|
|
3064
|
+
flowId: r
|
|
3065
|
+
}, i, e, t);
|
|
3066
|
+
a && this.#c({
|
|
3067
|
+
kind: "success",
|
|
3068
|
+
message: this.#r.t("history.cleared")
|
|
3069
|
+
});
|
|
3070
|
+
let s = await n;
|
|
3071
|
+
return s == null && o() && this.retryHistorySync(), s;
|
|
3072
|
+
} finally {
|
|
3073
|
+
this.#d.pending--, this.#v || this.#d.publish();
|
|
3074
|
+
}
|
|
2873
3075
|
}
|
|
2874
|
-
async #
|
|
3076
|
+
async #D(e) {
|
|
2875
3077
|
for (let t = 0; t < 2 && e(); t += 1) {
|
|
2876
3078
|
let t = this.#l.value.draft;
|
|
2877
3079
|
if (t == null) return;
|
|
2878
|
-
let n =
|
|
3080
|
+
let n = Ee(t.content);
|
|
2879
3081
|
if (n.length == 0) {
|
|
2880
|
-
this.#
|
|
3082
|
+
this.#N();
|
|
2881
3083
|
return;
|
|
2882
3084
|
}
|
|
2883
|
-
if (await this.#
|
|
3085
|
+
if (await this.#E(n, !1) != null || !e()) return;
|
|
2884
3086
|
if (this.#l.value.draft?.revisionId == t.revisionId) break;
|
|
2885
3087
|
}
|
|
2886
|
-
e() && this.#
|
|
3088
|
+
e() && this.#N();
|
|
2887
3089
|
}
|
|
2888
|
-
#
|
|
2889
|
-
let r = this.#l.value.draft, { revision: i, selectedNodeIds: a, target: o } = this.#
|
|
3090
|
+
#O(e, t, n = !1) {
|
|
3091
|
+
let r = this.#l.value.draft, { revision: i, selectedNodeIds: a, target: o } = this.#L(e), s = this.#l.value.moduleEditor, c = s != null && (t == "external" || r != null) && pn(r, s) != "saved", l;
|
|
2890
3092
|
return l = c ? t == "external" ? {
|
|
2891
3093
|
...s,
|
|
2892
3094
|
phase: "failed"
|
|
2893
|
-
} : s :
|
|
3095
|
+
} : s : mn(i, o, a), this.#V({
|
|
2894
3096
|
diagnostics: n ? this.#l.value.diagnostics : void 0,
|
|
2895
3097
|
draft: e,
|
|
2896
3098
|
moduleEditor: l,
|
|
@@ -2898,30 +3100,125 @@ var fn = class {
|
|
|
2898
3100
|
target: o
|
|
2899
3101
|
}), c;
|
|
2900
3102
|
}
|
|
2901
|
-
async #
|
|
2902
|
-
if (this.#
|
|
2903
|
-
let
|
|
2904
|
-
|
|
3103
|
+
async #k(e, t = !1) {
|
|
3104
|
+
if (this.#v || (this.#d.applying || this.#d.failed) && !t) return !1;
|
|
3105
|
+
let n = this.#l.value.flowId, r = this.#l.value.presentation;
|
|
3106
|
+
if (n == null || r == null) return !1;
|
|
3107
|
+
if (B(e(r.value), r.value)) return !0;
|
|
3108
|
+
t || this.#A();
|
|
3109
|
+
let i = this.#n.capture();
|
|
3110
|
+
this.#d.pending++, this.#d.publish();
|
|
3111
|
+
try {
|
|
3112
|
+
let t = await this.#a.change(n, r, i, e);
|
|
3113
|
+
return !t && i() && this.retryHistorySync(), t;
|
|
3114
|
+
} finally {
|
|
3115
|
+
this.#d.pending--, this.#v || this.#d.publish();
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
#A() {
|
|
3119
|
+
this.#d.clear() && this.#c({
|
|
3120
|
+
kind: "success",
|
|
3121
|
+
message: this.#r.t("history.cleared")
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
async #j(e, t, n, r, i = this.#l.value.selectedNodeIds) {
|
|
3125
|
+
if (this.#v || this.#d.applying || this.#d.failed) return !1;
|
|
3126
|
+
let { draft: a, target: o, presentation: s, selectedNodeIds: c } = this.#l.value;
|
|
3127
|
+
if (a == null || o == null || s == null) return !1;
|
|
3128
|
+
let l = r?.(s.value) ?? s.value, u = f(s.value, l, o);
|
|
3129
|
+
if (B(I(a, n).content, a.content) && u.nodeIds.length == 0) return !0;
|
|
3130
|
+
let d = this.#d.generation, p = nn(a.content, n);
|
|
3131
|
+
this.#d.pending++;
|
|
3132
|
+
let m = this.#d.record({
|
|
3133
|
+
action: e,
|
|
3134
|
+
count: t,
|
|
3135
|
+
target: o,
|
|
3136
|
+
forward: n,
|
|
3137
|
+
inverse: p,
|
|
3138
|
+
presentation: u,
|
|
3139
|
+
beforeSelection: c,
|
|
3140
|
+
afterSelection: i
|
|
3141
|
+
});
|
|
3142
|
+
try {
|
|
3143
|
+
let e = n.length == 0 ? Promise.resolve(a) : this.#E(n, !0, !0), t = r == null ? Promise.resolve(!0) : this.#k(r, !0);
|
|
3144
|
+
this.selectNodes(i), m || this.#c({
|
|
3145
|
+
kind: "success",
|
|
3146
|
+
message: this.#r.t("history.tooLarge")
|
|
3147
|
+
});
|
|
3148
|
+
let [o, s] = await Promise.all([e, t]);
|
|
3149
|
+
return o != null && s && (!m || d == this.#d.generation);
|
|
3150
|
+
} catch (e) {
|
|
3151
|
+
return this.#c(C(e, this.#r.t)), this.retryHistorySync(), !1;
|
|
3152
|
+
} finally {
|
|
3153
|
+
this.#d.pending--, this.#v || this.#d.publish();
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
async undo() {
|
|
3157
|
+
await this.#M(!1);
|
|
3158
|
+
}
|
|
3159
|
+
async redo() {
|
|
3160
|
+
await this.#M(!0);
|
|
3161
|
+
}
|
|
3162
|
+
async #M(e) {
|
|
3163
|
+
let t = this.history$.value;
|
|
3164
|
+
if (!(e ? t.canRedo : t.canUndo)) return;
|
|
3165
|
+
let n = e ? t.redo : t.undo;
|
|
3166
|
+
if (n == null) return;
|
|
3167
|
+
let r = this.#d.generation;
|
|
3168
|
+
this.#d.applying = !0, this.#d.publish();
|
|
3169
|
+
try {
|
|
3170
|
+
let [t, i] = await Promise.all([this.#E(e ? n.forward : n.inverse, !0, !0), this.#k((t) => b(t, n.target, n.presentation, e), !0)]);
|
|
3171
|
+
t != null && i && r == this.#d.generation && (this.selectNodes(e ? n.afterSelection : n.beforeSelection), this.#d.complete(e));
|
|
3172
|
+
} catch (e) {
|
|
3173
|
+
this.#c(C(e, this.#r.t)), this.retryHistorySync();
|
|
3174
|
+
} finally {
|
|
3175
|
+
this.#d.applying = !1, this.#v || this.#d.publish();
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
async retryHistorySync() {
|
|
3179
|
+
if (this.#v || this.#f != null) return this.#f;
|
|
3180
|
+
let e = this.#l.value.flowId;
|
|
3181
|
+
if (e == null) return;
|
|
3182
|
+
let t = this.#n.capture();
|
|
3183
|
+
this.#d.failed = !0, this.#d.clear();
|
|
3184
|
+
let n = async () => {
|
|
3185
|
+
if (await Promise.allSettled([this.#t.settled(), this.#a.settled()]), !(!t() || this.#v)) try {
|
|
3186
|
+
let { draft: n, presentation: r } = await this.#e.getEditor(e);
|
|
3187
|
+
if (!t() || this.#v) return;
|
|
3188
|
+
this.#t.reset(n), this.#a.reset(r), this.#O(n, "external"), this.#V({ presentation: r }), this.#o.advanceHead(e, n.revisionId), this.#d.failed = !1, this.#c({
|
|
3189
|
+
kind: "error",
|
|
3190
|
+
message: this.#r.t("history.resynced")
|
|
3191
|
+
}), this.#N();
|
|
3192
|
+
} catch {
|
|
3193
|
+
t() && !this.#v && this.#c({
|
|
3194
|
+
kind: "error",
|
|
3195
|
+
message: this.#r.t("history.syncFailed")
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
return this.#f = n().finally(() => {
|
|
3200
|
+
this.#f = void 0, this.#v || this.#d.publish();
|
|
3201
|
+
}), this.#f;
|
|
2905
3202
|
}
|
|
2906
|
-
async #
|
|
2907
|
-
if (this.#
|
|
3203
|
+
async #N() {
|
|
3204
|
+
if (this.#v) return;
|
|
2908
3205
|
let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
|
|
2909
3206
|
if (e == null || t == null || n == null) {
|
|
2910
|
-
n ?? this.#
|
|
3207
|
+
n ?? this.#V({
|
|
2911
3208
|
checkLoading: !1,
|
|
2912
3209
|
diagnostics: void 0
|
|
2913
3210
|
});
|
|
2914
3211
|
return;
|
|
2915
3212
|
}
|
|
2916
|
-
this.#
|
|
3213
|
+
this.#V({
|
|
2917
3214
|
checkLoading: !0,
|
|
2918
3215
|
diagnosticFocus: void 0
|
|
2919
3216
|
});
|
|
2920
3217
|
try {
|
|
2921
3218
|
let n = await this.#e.checkFlow(e, t.revisionId);
|
|
2922
|
-
if (!this.#
|
|
3219
|
+
if (!this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
|
|
2923
3220
|
let e = this.#l.value.live;
|
|
2924
|
-
this.#
|
|
3221
|
+
this.#V({
|
|
2925
3222
|
diagnostics: n,
|
|
2926
3223
|
live: e == null ? void 0 : {
|
|
2927
3224
|
...e,
|
|
@@ -2930,16 +3227,16 @@ var fn = class {
|
|
|
2930
3227
|
});
|
|
2931
3228
|
}
|
|
2932
3229
|
} catch (n) {
|
|
2933
|
-
!this.#
|
|
3230
|
+
!this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(C(n, this.#r.t));
|
|
2934
3231
|
} finally {
|
|
2935
|
-
!this.#
|
|
3232
|
+
!this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#V({ checkLoading: !1 });
|
|
2936
3233
|
}
|
|
2937
3234
|
}
|
|
2938
|
-
async #
|
|
2939
|
-
if (this.#
|
|
3235
|
+
async #P(e) {
|
|
3236
|
+
if (this.#v) return;
|
|
2940
3237
|
let t = this.#l.value.flowId;
|
|
2941
|
-
if (t == null || (this.#
|
|
2942
|
-
this.#
|
|
3238
|
+
if (t == null || (this.#g += 1, e != null && (this.#_ = !0), this.#y)) return;
|
|
3239
|
+
this.#y = !0;
|
|
2943
3240
|
let n = {
|
|
2944
3241
|
current: this.#n.capture(),
|
|
2945
3242
|
flowId: t
|
|
@@ -2947,72 +3244,76 @@ var fn = class {
|
|
|
2947
3244
|
await this.#t.enqueue(async () => {
|
|
2948
3245
|
let e;
|
|
2949
3246
|
do {
|
|
2950
|
-
e = this.#
|
|
2951
|
-
let t = this.#
|
|
2952
|
-
this.#
|
|
2953
|
-
} while (this.#
|
|
2954
|
-
}), this.#
|
|
3247
|
+
e = this.#g;
|
|
3248
|
+
let t = this.#_;
|
|
3249
|
+
this.#_ = !1, await this.#F(n, !1, t);
|
|
3250
|
+
} while (this.#R(n) && e != this.#g);
|
|
3251
|
+
}), this.#R(n) && (this.#y = !1);
|
|
2955
3252
|
}
|
|
2956
|
-
async #
|
|
3253
|
+
async #F(e, t, n = !1) {
|
|
2957
3254
|
try {
|
|
2958
3255
|
let t = this.#t.committed;
|
|
2959
3256
|
if (t == null) return !1;
|
|
2960
3257
|
let r = await this.#e.syncDraft(e.flowId);
|
|
2961
|
-
if (!this.#
|
|
3258
|
+
if (!this.#R(e)) return !1;
|
|
2962
3259
|
let i = r.draft;
|
|
2963
3260
|
if (i.revisionId == t.revisionId) return !0;
|
|
2964
|
-
|
|
3261
|
+
this.#d.clear() && this.#c({
|
|
3262
|
+
kind: "success",
|
|
3263
|
+
message: this.#r.t("history.external")
|
|
3264
|
+
});
|
|
3265
|
+
let a = this.#t.replaceCommitted(i), o = this.#O(a, "external");
|
|
2965
3266
|
return this.#o.advanceHead(e.flowId, i.revisionId), n && this.#c({
|
|
2966
3267
|
kind: o ? "error" : "success",
|
|
2967
3268
|
message: this.#r.t(o ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
2968
|
-
}), this.#
|
|
3269
|
+
}), this.#N(), !0;
|
|
2969
3270
|
} catch (n) {
|
|
2970
|
-
return t && this.#
|
|
3271
|
+
return t && this.#R(e) && this.#c(C(n, this.#r.t)), !1;
|
|
2971
3272
|
}
|
|
2972
3273
|
}
|
|
2973
|
-
#
|
|
3274
|
+
#I() {
|
|
2974
3275
|
let e = this.#l.value;
|
|
2975
|
-
return
|
|
3276
|
+
return l(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
|
|
2976
3277
|
}
|
|
2977
|
-
#
|
|
2978
|
-
let t =
|
|
3278
|
+
#L(e) {
|
|
3279
|
+
let t = F(e), n = _n(t, this.#l.value.target);
|
|
2979
3280
|
return {
|
|
2980
3281
|
revision: t,
|
|
2981
3282
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
|
|
2982
3283
|
target: n
|
|
2983
3284
|
};
|
|
2984
3285
|
}
|
|
2985
|
-
#
|
|
2986
|
-
return !this.#
|
|
3286
|
+
#R(e) {
|
|
3287
|
+
return !this.#v && e.flowId == this.#l.value.flowId && e.current();
|
|
2987
3288
|
}
|
|
2988
|
-
#
|
|
3289
|
+
#z(e) {
|
|
2989
3290
|
let t = e == null ? void 0 : this.#u.get(e.moduleId)?.editor ?? e, n;
|
|
2990
3291
|
return [...this.#u.values()].some((e) => e.editor.phase == "failed") ? n = "failed" : this.#u.size > 0 && (n = "saving"), {
|
|
2991
3292
|
moduleEditor: t,
|
|
2992
3293
|
moduleSaveStatus: n
|
|
2993
3294
|
};
|
|
2994
3295
|
}
|
|
2995
|
-
#
|
|
2996
|
-
this.#
|
|
3296
|
+
#B() {
|
|
3297
|
+
this.#v || this.#l.set(this.#z(this.#l.value.moduleEditor));
|
|
2997
3298
|
}
|
|
2998
|
-
#
|
|
2999
|
-
if (this.#
|
|
3299
|
+
#V(e) {
|
|
3300
|
+
if (this.#v) return;
|
|
3000
3301
|
let t = Object.hasOwn(e, "moduleEditor") ? e.moduleEditor : this.#l.value.moduleEditor;
|
|
3001
3302
|
this.#l.set({
|
|
3002
3303
|
...e,
|
|
3003
|
-
...this.#
|
|
3304
|
+
...this.#z(t)
|
|
3004
3305
|
});
|
|
3005
3306
|
}
|
|
3006
3307
|
};
|
|
3007
3308
|
//#endregion
|
|
3008
3309
|
//#region src/workbench/browser/runtime/stores/workbenchStore.ts
|
|
3009
|
-
function
|
|
3310
|
+
function yn(e) {
|
|
3010
3311
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
3011
3312
|
}
|
|
3012
|
-
function
|
|
3013
|
-
return e == null || t == null ? [] :
|
|
3313
|
+
function bn(e, t) {
|
|
3314
|
+
return e == null || t == null ? [] : F(e).designerInputs(t);
|
|
3014
3315
|
}
|
|
3015
|
-
function
|
|
3316
|
+
function xn(e, t, n, r, i) {
|
|
3016
3317
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
|
|
3017
3318
|
let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
|
|
3018
3319
|
return typeof a == "string" ? new Map(r.flatMap((t) => {
|
|
@@ -3020,11 +3321,14 @@ function hn(e, t, n, r, i) {
|
|
|
3020
3321
|
return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
|
|
3021
3322
|
})) : /* @__PURE__ */ new Map();
|
|
3022
3323
|
}
|
|
3023
|
-
var
|
|
3324
|
+
var Sn = { openExternalPage: async () => !1 }, Cn = class {
|
|
3024
3325
|
#e;
|
|
3025
3326
|
#t;
|
|
3026
3327
|
#n;
|
|
3027
3328
|
#r;
|
|
3329
|
+
get variablesEnabled() {
|
|
3330
|
+
return this.#i;
|
|
3331
|
+
}
|
|
3028
3332
|
#i;
|
|
3029
3333
|
#a;
|
|
3030
3334
|
#o;
|
|
@@ -3032,22 +3336,22 @@ var gn = { openExternalPage: async () => !1 }, _n = class {
|
|
|
3032
3336
|
#c;
|
|
3033
3337
|
#l;
|
|
3034
3338
|
#u;
|
|
3035
|
-
constructor(r, i, a =
|
|
3036
|
-
this.#t = new
|
|
3339
|
+
constructor(r, i, a = L, o = W(), c = Sn, u = !0) {
|
|
3340
|
+
this.#t = new s(), this.#r = n(), this.#a = n([]), this.#o = n(!1), this.#s = n(!1), this.#c = !0, this.#u = !1, this.provideAddNodeOptions = async (e, t) => await this.#d([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => {
|
|
3037
3341
|
let t = await Promise.all([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)]);
|
|
3038
3342
|
if (!(e.aborted || this.#u)) return t.flatMap((e) => e ?? []);
|
|
3039
3343
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
3040
3344
|
if (!e.startsWith("trigger:")) return await this.connectors.provideAddNodeOptionChoices(e, t);
|
|
3041
|
-
}, this.#e = r, this.results = r, this.#n = o, this.#i =
|
|
3042
|
-
let
|
|
3345
|
+
}, this.#e = r, this.results = r, this.#n = o, this.#i = u;
|
|
3346
|
+
let d = (e) => {
|
|
3043
3347
|
this.#u || this.#r.set(e);
|
|
3044
3348
|
};
|
|
3045
|
-
this.runs = new
|
|
3349
|
+
this.runs = new h(r, d, o), this.workspace = new vn(r, d, At, o, (e) => {
|
|
3046
3350
|
e.kind == "run.created" ? this.#f(r, e) : this.runs.changed(e.runId);
|
|
3047
|
-
}), this.connectors = new
|
|
3351
|
+
}), this.connectors = new Xt(r, this.workspace, d, c, o), this.triggers = new tn(r, this.workspace, d, c, o), this.publications = new Pt(r, this.workspace, d, i, a, o), this.runRequests = new Ht(r, this.runs, d, async (e) => {
|
|
3048
3352
|
if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#u || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
|
|
3049
3353
|
}, o, a);
|
|
3050
|
-
let
|
|
3354
|
+
let f = t((e) => {
|
|
3051
3355
|
let t = e(this.workspace.$.diagnostics);
|
|
3052
3356
|
if (t == null) return;
|
|
3053
3357
|
let n = e(this.connectors.$.diagnostics);
|
|
@@ -3056,32 +3360,29 @@ var gn = { openExternalPage: async () => !1 }, _n = class {
|
|
|
3056
3360
|
diagnostics: [...t.diagnostics, ...n],
|
|
3057
3361
|
valid: !1
|
|
3058
3362
|
};
|
|
3059
|
-
}), p = /* @__PURE__ */ new Map(), m,
|
|
3363
|
+
}), p = /* @__PURE__ */ new Map(), m, g = t((e) => {
|
|
3060
3364
|
let t = e(this.workspace.$.draft);
|
|
3061
3365
|
m != t?.flowId && (p.clear(), m = t?.flowId);
|
|
3062
|
-
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(
|
|
3063
|
-
...
|
|
3064
|
-
r == null || n == null ? void 0 :
|
|
3366
|
+
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(f)?.diagnostics ?? e(this.connectors.$.diagnostics), a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), u = e(this.runs.$.run), d = e(this.runs.$.events), h = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, g = [
|
|
3367
|
+
...bn(t, n),
|
|
3368
|
+
r == null || n == null ? void 0 : T(r, n),
|
|
3065
3369
|
i,
|
|
3066
3370
|
a,
|
|
3067
3371
|
s,
|
|
3068
3372
|
c,
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
inputs: y
|
|
3081
|
-
}), x;
|
|
3082
|
-
}), _ = e(h, pn);
|
|
3373
|
+
u,
|
|
3374
|
+
d,
|
|
3375
|
+
...u == null ? [] : [t?.revisionId]
|
|
3376
|
+
], _ = p.get(h);
|
|
3377
|
+
if (_ != null && _.inputs.length == g.length && _.inputs.every((e, t) => e === g[t])) return _.graph;
|
|
3378
|
+
let v = l(t, n, r, i, a, s, c, u, d);
|
|
3379
|
+
return p.set(h, {
|
|
3380
|
+
graph: v,
|
|
3381
|
+
inputs: g
|
|
3382
|
+
}), v;
|
|
3383
|
+
}), _ = e(g, yn);
|
|
3083
3384
|
this.$ = {
|
|
3084
|
-
busy:
|
|
3385
|
+
busy: t((e) => {
|
|
3085
3386
|
let t = e(this.workspace.$.busy);
|
|
3086
3387
|
if (t != null) return t;
|
|
3087
3388
|
if (e(this.runRequests.$.starting)) return "run";
|
|
@@ -3090,13 +3391,13 @@ var gn = { openExternalPage: async () => !1 }, _n = class {
|
|
|
3090
3391
|
if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
|
|
3091
3392
|
if (e(this.publications.$.changingTriggerId) != null) return "trigger";
|
|
3092
3393
|
}),
|
|
3093
|
-
diagnosticItems:
|
|
3094
|
-
diagnostics:
|
|
3095
|
-
designer:
|
|
3394
|
+
diagnosticItems: t((e) => Ae(e(this.workspace.$.revision), e(this.workspace.$.target), e(f))),
|
|
3395
|
+
diagnostics: f,
|
|
3396
|
+
designer: g,
|
|
3096
3397
|
designerNodeById: _,
|
|
3097
3398
|
notice: this.#r,
|
|
3098
|
-
runEventNodes:
|
|
3099
|
-
selectedDesignerNode:
|
|
3399
|
+
runEventNodes: t((e) => xn(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(_))),
|
|
3400
|
+
selectedDesignerNode: t((e) => {
|
|
3100
3401
|
let t = e(this.workspace.$.selectedNodeIds);
|
|
3101
3402
|
return t.length == 1 ? e(_).get(t[0]) : void 0;
|
|
3102
3403
|
}),
|
|
@@ -3131,7 +3432,7 @@ var gn = { openExternalPage: async () => !1 }, _n = class {
|
|
|
3131
3432
|
if (this.#u) return;
|
|
3132
3433
|
this.#a.set(e.map((e) => e.name)), this.#o.set(!0);
|
|
3133
3434
|
} catch (e) {
|
|
3134
|
-
this.#c = !0, this.#u || this.#r.set(
|
|
3435
|
+
this.#c = !0, this.#u || this.#r.set(C(e, this.#n.t));
|
|
3135
3436
|
} finally {
|
|
3136
3437
|
this.#l = void 0, this.#u || this.#s.set(!1);
|
|
3137
3438
|
}
|
|
@@ -3176,7 +3477,7 @@ var gn = { openExternalPage: async () => !1 }, _n = class {
|
|
|
3176
3477
|
if (t.aborted || this.#u) return;
|
|
3177
3478
|
let r = n.filter((e) => e.status == "rejected");
|
|
3178
3479
|
if (r.length > 0 && r.length == n.length) throw r[0].reason;
|
|
3179
|
-
return r.length > 0 && this.#r.set(
|
|
3480
|
+
return r.length > 0 && this.#r.set(C(r[0].reason, this.#n.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
|
|
3180
3481
|
}
|
|
3181
3482
|
async refreshSelectedConnector(e = !1) {
|
|
3182
3483
|
await this.connectors.refresh(e);
|
|
@@ -3209,13 +3510,13 @@ var gn = { openExternalPage: async () => !1 }, _n = class {
|
|
|
3209
3510
|
return;
|
|
3210
3511
|
}
|
|
3211
3512
|
}
|
|
3212
|
-
},
|
|
3213
|
-
function
|
|
3214
|
-
let l = s != null && c != null && i != null, u = s ?? "", d = /* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3513
|
+
}, wn = lt(() => import("./flowWorkspace-BtNfkYuG.js").then((e) => e.t));
|
|
3514
|
+
function Tn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: c }) {
|
|
3515
|
+
let l = s != null && c != null && i != null, u = s ?? "", d = /* @__PURE__ */ Y(ut, { children: [
|
|
3516
|
+
/* @__PURE__ */ J("div", {
|
|
3216
3517
|
"aria-hidden": "true",
|
|
3217
3518
|
className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
3218
|
-
children: /* @__PURE__ */
|
|
3519
|
+
children: /* @__PURE__ */ Y("svg", {
|
|
3219
3520
|
className: "size-5",
|
|
3220
3521
|
fill: "none",
|
|
3221
3522
|
stroke: "currentColor",
|
|
@@ -3223,40 +3524,40 @@ function yn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
3223
3524
|
strokeLinejoin: "round",
|
|
3224
3525
|
strokeWidth: "1.8",
|
|
3225
3526
|
viewBox: "0 0 24 24",
|
|
3226
|
-
children: [/* @__PURE__ */
|
|
3527
|
+
children: [/* @__PURE__ */ J("rect", {
|
|
3227
3528
|
height: "9",
|
|
3228
3529
|
rx: "2",
|
|
3229
3530
|
width: "14",
|
|
3230
3531
|
x: "5",
|
|
3231
3532
|
y: "11"
|
|
3232
|
-
}), /* @__PURE__ */
|
|
3533
|
+
}), /* @__PURE__ */ J("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
|
|
3233
3534
|
})
|
|
3234
3535
|
}),
|
|
3235
|
-
/* @__PURE__ */
|
|
3536
|
+
/* @__PURE__ */ Y("header", {
|
|
3236
3537
|
className: "flex flex-col gap-2",
|
|
3237
|
-
children: [/* @__PURE__ */
|
|
3538
|
+
children: [/* @__PURE__ */ J("h1", {
|
|
3238
3539
|
className: "text-xl font-semibold tracking-tight text-balance",
|
|
3239
3540
|
children: o
|
|
3240
|
-
}), /* @__PURE__ */
|
|
3541
|
+
}), /* @__PURE__ */ J("p", {
|
|
3241
3542
|
className: "text-sm/relaxed text-muted-foreground text-pretty",
|
|
3242
3543
|
children: t
|
|
3243
3544
|
})]
|
|
3244
3545
|
}),
|
|
3245
|
-
l && /* @__PURE__ */
|
|
3546
|
+
l && /* @__PURE__ */ J(qe, { children: /* @__PURE__ */ Y(Qe, {
|
|
3246
3547
|
"data-invalid": n != null,
|
|
3247
3548
|
children: [
|
|
3248
|
-
/* @__PURE__ */
|
|
3549
|
+
/* @__PURE__ */ J(et, {
|
|
3249
3550
|
htmlFor: "session-token",
|
|
3250
3551
|
children: c
|
|
3251
3552
|
}),
|
|
3252
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ J(z, {
|
|
3253
3554
|
autoComplete: "username",
|
|
3254
3555
|
name: "username",
|
|
3255
3556
|
type: "hidden",
|
|
3256
3557
|
value: "open-flow",
|
|
3257
3558
|
readOnly: !0
|
|
3258
3559
|
}),
|
|
3259
|
-
/* @__PURE__ */
|
|
3560
|
+
/* @__PURE__ */ J(z, {
|
|
3260
3561
|
autoComplete: "current-password",
|
|
3261
3562
|
"aria-invalid": n != null,
|
|
3262
3563
|
autoFocus: !0,
|
|
@@ -3268,29 +3569,29 @@ function yn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
3268
3569
|
type: "password",
|
|
3269
3570
|
value: u
|
|
3270
3571
|
}),
|
|
3271
|
-
n != null && /* @__PURE__ */
|
|
3572
|
+
n != null && /* @__PURE__ */ J(We, { children: n })
|
|
3272
3573
|
]
|
|
3273
3574
|
}) }),
|
|
3274
|
-
e != null && r != null && /* @__PURE__ */
|
|
3575
|
+
e != null && r != null && /* @__PURE__ */ Y(V, {
|
|
3275
3576
|
disabled: a || l && u.length == 0,
|
|
3276
3577
|
size: "lg",
|
|
3277
3578
|
type: "submit",
|
|
3278
|
-
children: [a && /* @__PURE__ */
|
|
3579
|
+
children: [a && /* @__PURE__ */ J(Ve, {
|
|
3279
3580
|
"aria-label": e,
|
|
3280
3581
|
"data-icon": "inline-start"
|
|
3281
3582
|
}), e]
|
|
3282
3583
|
}),
|
|
3283
|
-
a && e == null && /* @__PURE__ */
|
|
3584
|
+
a && e == null && /* @__PURE__ */ J(Ve, { "aria-label": t })
|
|
3284
3585
|
] }), f = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
|
|
3285
|
-
return /* @__PURE__ */
|
|
3586
|
+
return /* @__PURE__ */ J("main", {
|
|
3286
3587
|
className: "open-flow-workbench",
|
|
3287
|
-
children: /* @__PURE__ */
|
|
3588
|
+
children: /* @__PURE__ */ J("div", {
|
|
3288
3589
|
className: "grid h-full overflow-auto bg-muted/20 p-4",
|
|
3289
|
-
children: r == null ? /* @__PURE__ */
|
|
3590
|
+
children: r == null ? /* @__PURE__ */ J("section", {
|
|
3290
3591
|
"aria-busy": a,
|
|
3291
3592
|
className: f,
|
|
3292
3593
|
children: d
|
|
3293
|
-
}) : /* @__PURE__ */
|
|
3594
|
+
}) : /* @__PURE__ */ J("form", {
|
|
3294
3595
|
"aria-busy": a,
|
|
3295
3596
|
className: f,
|
|
3296
3597
|
onSubmit: r,
|
|
@@ -3299,19 +3600,19 @@ function yn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
3299
3600
|
})
|
|
3300
3601
|
});
|
|
3301
3602
|
}
|
|
3302
|
-
function
|
|
3303
|
-
let n =
|
|
3304
|
-
return
|
|
3603
|
+
function En({ host: e, store: t }) {
|
|
3604
|
+
let n = r(t.$.notice);
|
|
3605
|
+
return G(() => e.notify(n), [e, n]), G(() => () => e.notify(void 0), [e]), null;
|
|
3305
3606
|
}
|
|
3306
|
-
function
|
|
3307
|
-
let g =
|
|
3308
|
-
return /* @__PURE__ */
|
|
3607
|
+
function Dn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: i, flowBadges: a, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
|
|
3608
|
+
let g = r(m.workspace.$.flowId);
|
|
3609
|
+
return /* @__PURE__ */ J("div", {
|
|
3309
3610
|
className: "app-shell",
|
|
3310
|
-
children: g == null ? /* @__PURE__ */
|
|
3611
|
+
children: g == null ? /* @__PURE__ */ J(xt, {
|
|
3311
3612
|
catalogWidth: e,
|
|
3312
3613
|
createFlowDisabled: n,
|
|
3313
|
-
createFlowField:
|
|
3314
|
-
flowBadges:
|
|
3614
|
+
createFlowField: i,
|
|
3615
|
+
flowBadges: a,
|
|
3315
3616
|
hrefForFlow: (e) => o({
|
|
3316
3617
|
flowId: e.flowId,
|
|
3317
3618
|
view: "design"
|
|
@@ -3324,12 +3625,12 @@ function xn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3324
3625
|
onLanguageChange: p,
|
|
3325
3626
|
onSelectFlow: (e) => void u.selectFlow(e),
|
|
3326
3627
|
store: m
|
|
3327
|
-
}) : /* @__PURE__ */
|
|
3328
|
-
fallback: /* @__PURE__ */
|
|
3628
|
+
}) : /* @__PURE__ */ J(ct, {
|
|
3629
|
+
fallback: /* @__PURE__ */ J("main", {
|
|
3329
3630
|
"aria-busy": "true",
|
|
3330
3631
|
className: "workspace"
|
|
3331
3632
|
}),
|
|
3332
|
-
children: /* @__PURE__ */
|
|
3633
|
+
children: /* @__PURE__ */ J(wn, {
|
|
3333
3634
|
hostAction: s,
|
|
3334
3635
|
hostTitle: c,
|
|
3335
3636
|
hrefFor: o,
|
|
@@ -3342,18 +3643,18 @@ function xn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3342
3643
|
})
|
|
3343
3644
|
});
|
|
3344
3645
|
}
|
|
3345
|
-
function
|
|
3346
|
-
let y =
|
|
3646
|
+
function On({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onHostAction: p, onLanguageChange: m, onNavigate: h, preferences: g, theme: _, variables: v = !0 }) {
|
|
3647
|
+
let y = K(h);
|
|
3347
3648
|
y.current = h;
|
|
3348
|
-
let [{ i18n: b, navigation: x, store: S }] =
|
|
3349
|
-
let e =
|
|
3649
|
+
let [{ i18n: b, navigation: x, store: S }] = q(() => {
|
|
3650
|
+
let e = W(u), t = new Cn(new w((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, L, e, a, v);
|
|
3350
3651
|
return {
|
|
3351
3652
|
i18n: e,
|
|
3352
|
-
navigation: new
|
|
3653
|
+
navigation: new mt(t, d, (e, t) => y.current(e, t)),
|
|
3353
3654
|
store: t
|
|
3354
3655
|
};
|
|
3355
3656
|
});
|
|
3356
|
-
return
|
|
3657
|
+
return G(() => {
|
|
3357
3658
|
x.start();
|
|
3358
3659
|
let e = () => {
|
|
3359
3660
|
S.connectors.refreshAfterAuthorization(), S.triggers.refreshAfterAuthorization(), S.invalidateVariableNames();
|
|
@@ -3365,17 +3666,17 @@ function Sn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3365
3666
|
b,
|
|
3366
3667
|
x,
|
|
3367
3668
|
S
|
|
3368
|
-
]),
|
|
3669
|
+
]), G(() => void x.apply(d), [d, x]), G(() => {
|
|
3369
3670
|
b.lang != u && b.switchLang(u);
|
|
3370
|
-
}, [b, u]), /* @__PURE__ */
|
|
3671
|
+
}, [b, u]), /* @__PURE__ */ J(o, {
|
|
3371
3672
|
i18n: b,
|
|
3372
|
-
children: /* @__PURE__ */
|
|
3673
|
+
children: /* @__PURE__ */ Y("div", {
|
|
3373
3674
|
className: "open-flow-theme open-flow-workbench",
|
|
3374
3675
|
"data-theme": _,
|
|
3375
|
-
children: [/* @__PURE__ */
|
|
3676
|
+
children: [/* @__PURE__ */ J(En, {
|
|
3376
3677
|
host: a,
|
|
3377
3678
|
store: S
|
|
3378
|
-
}), /* @__PURE__ */
|
|
3679
|
+
}), /* @__PURE__ */ J(Dn, {
|
|
3379
3680
|
catalogWidth: e,
|
|
3380
3681
|
createFlow: t,
|
|
3381
3682
|
createFlowDisabled: n,
|
|
@@ -3395,8 +3696,8 @@ function Sn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3395
3696
|
})
|
|
3396
3697
|
});
|
|
3397
3698
|
}
|
|
3398
|
-
function
|
|
3399
|
-
return /* @__PURE__ */
|
|
3699
|
+
function kn({ sessionKey: e, ...t }) {
|
|
3700
|
+
return /* @__PURE__ */ J(On, { ...t }, e);
|
|
3400
3701
|
}
|
|
3401
3702
|
//#endregion
|
|
3402
|
-
export {
|
|
3703
|
+
export { Tn as OpenFlowSessionGate, kn as OpenFlowWorkbench, st as isWorkbenchLanguage, at as resolveWorkbenchLanguage, ot as workbenchLanguageNames, it as workbenchLanguages };
|