@alfadocs/ui-kit-debug 1.69.0 → 1.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/_chunks/workflow-webhook-action-D6K7Jgc2.js +832 -0
  2. package/dist/_chunks/workflow-webhook-action-D6K7Jgc2.js.map +1 -0
  3. package/dist/agent-catalog.json +12 -2
  4. package/dist/agent-i18n/en.json +2 -1
  5. package/dist/i18n/locales/ar.d.ts +13 -1
  6. package/dist/i18n/locales/ar.d.ts.map +1 -1
  7. package/dist/i18n/locales/ar.js +13 -1
  8. package/dist/i18n/locales/ar.js.map +1 -1
  9. package/dist/i18n/locales/de.d.ts +13 -1
  10. package/dist/i18n/locales/de.d.ts.map +1 -1
  11. package/dist/i18n/locales/de.js +13 -1
  12. package/dist/i18n/locales/de.js.map +1 -1
  13. package/dist/i18n/locales/el.d.ts +13 -1
  14. package/dist/i18n/locales/el.d.ts.map +1 -1
  15. package/dist/i18n/locales/el.js +13 -1
  16. package/dist/i18n/locales/el.js.map +1 -1
  17. package/dist/i18n/locales/en.d.ts +13 -1
  18. package/dist/i18n/locales/en.d.ts.map +1 -1
  19. package/dist/i18n/locales/en.js +13 -1
  20. package/dist/i18n/locales/en.js.map +1 -1
  21. package/dist/i18n/locales/es.d.ts +13 -1
  22. package/dist/i18n/locales/es.d.ts.map +1 -1
  23. package/dist/i18n/locales/es.js +13 -1
  24. package/dist/i18n/locales/es.js.map +1 -1
  25. package/dist/i18n/locales/fr.d.ts +13 -1
  26. package/dist/i18n/locales/fr.d.ts.map +1 -1
  27. package/dist/i18n/locales/fr.js +13 -1
  28. package/dist/i18n/locales/fr.js.map +1 -1
  29. package/dist/i18n/locales/hi.d.ts +13 -1
  30. package/dist/i18n/locales/hi.d.ts.map +1 -1
  31. package/dist/i18n/locales/hi.js +13 -1
  32. package/dist/i18n/locales/hi.js.map +1 -1
  33. package/dist/i18n/locales/it.d.ts +13 -1
  34. package/dist/i18n/locales/it.d.ts.map +1 -1
  35. package/dist/i18n/locales/it.js +13 -1
  36. package/dist/i18n/locales/it.js.map +1 -1
  37. package/dist/i18n/locales/ja.d.ts +13 -1
  38. package/dist/i18n/locales/ja.d.ts.map +1 -1
  39. package/dist/i18n/locales/ja.js +13 -1
  40. package/dist/i18n/locales/ja.js.map +1 -1
  41. package/dist/i18n/locales/nl.d.ts +13 -1
  42. package/dist/i18n/locales/nl.d.ts.map +1 -1
  43. package/dist/i18n/locales/nl.js +13 -1
  44. package/dist/i18n/locales/nl.js.map +1 -1
  45. package/dist/i18n/locales/pl.d.ts +13 -1
  46. package/dist/i18n/locales/pl.d.ts.map +1 -1
  47. package/dist/i18n/locales/pl.js +13 -1
  48. package/dist/i18n/locales/pl.js.map +1 -1
  49. package/dist/i18n/locales/pt.d.ts +13 -1
  50. package/dist/i18n/locales/pt.d.ts.map +1 -1
  51. package/dist/i18n/locales/pt.js +13 -1
  52. package/dist/i18n/locales/pt.js.map +1 -1
  53. package/dist/i18n/locales/ro.d.ts +13 -1
  54. package/dist/i18n/locales/ro.d.ts.map +1 -1
  55. package/dist/i18n/locales/ro.js +13 -1
  56. package/dist/i18n/locales/ro.js.map +1 -1
  57. package/dist/i18n/locales/ru.d.ts +13 -1
  58. package/dist/i18n/locales/ru.d.ts.map +1 -1
  59. package/dist/i18n/locales/ru.js +13 -1
  60. package/dist/i18n/locales/ru.js.map +1 -1
  61. package/dist/i18n/locales/sq.d.ts +13 -1
  62. package/dist/i18n/locales/sq.d.ts.map +1 -1
  63. package/dist/i18n/locales/sq.js +13 -1
  64. package/dist/i18n/locales/sq.js.map +1 -1
  65. package/dist/i18n/locales/sv.d.ts +13 -1
  66. package/dist/i18n/locales/sv.d.ts.map +1 -1
  67. package/dist/i18n/locales/sv.js +13 -1
  68. package/dist/i18n/locales/sv.js.map +1 -1
  69. package/dist/i18n/locales/tr.d.ts +13 -1
  70. package/dist/i18n/locales/tr.d.ts.map +1 -1
  71. package/dist/i18n/locales/tr.js +13 -1
  72. package/dist/i18n/locales/tr.js.map +1 -1
  73. package/dist/i18n/locales/zh.d.ts +13 -1
  74. package/dist/i18n/locales/zh.d.ts.map +1 -1
  75. package/dist/i18n/locales/zh.js +13 -1
  76. package/dist/i18n/locales/zh.js.map +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/locales/ar.json +13 -1
  79. package/dist/locales/de.json +13 -1
  80. package/dist/locales/el.json +13 -1
  81. package/dist/locales/en.json +13 -1
  82. package/dist/locales/es.json +13 -1
  83. package/dist/locales/fr.json +13 -1
  84. package/dist/locales/hi.json +13 -1
  85. package/dist/locales/it.json +13 -1
  86. package/dist/locales/ja.json +13 -1
  87. package/dist/locales/nl.json +13 -1
  88. package/dist/locales/pl.json +13 -1
  89. package/dist/locales/pt.json +13 -1
  90. package/dist/locales/ro.json +13 -1
  91. package/dist/locales/ru.json +13 -1
  92. package/dist/locales/sq.json +13 -1
  93. package/dist/locales/sv.json +13 -1
  94. package/dist/locales/tr.json +13 -1
  95. package/dist/locales/zh.json +13 -1
  96. package/dist/patterns/workflow-webhook-action/index.d.ts +1 -1
  97. package/dist/patterns/workflow-webhook-action/index.d.ts.map +1 -1
  98. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  99. package/dist/patterns/workflow-webhook-action/workflow-webhook-action.d.ts +29 -3
  100. package/dist/patterns/workflow-webhook-action/workflow-webhook-action.d.ts.map +1 -1
  101. package/package.json +1 -1
  102. package/dist/_chunks/workflow-webhook-action-Ct8tFYi7.js +0 -691
  103. package/dist/_chunks/workflow-webhook-action-Ct8tFYi7.js.map +0 -1
@@ -1,691 +0,0 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as It, useId as ee, useRef as i, useState as u, useEffect as I, useCallback as Nt } from "react";
3
- import { useTranslation as Me } from "react-i18next";
4
- import { c as h } from "./index-D2ZczOXr.js";
5
- import { C as Fe } from "./code-block-RSKdF3E-.js";
6
- import { A as k } from "./accordion-Ch3xp0mX.js";
7
- import { A as Se } from "./alert-9kEwDza3.js";
8
- import { B as Et } from "./badge-BUk4RjTS.js";
9
- import { B as Oe } from "./button-D-MQxsA_.js";
10
- import { I as Rt } from "./icon-button-C_1TgRiK.js";
11
- import { C as Le } from "./card-BA4Ig_kn.js";
12
- import { C as Bt } from "./checkbox-BjDv-r3o.js";
13
- import { F as Ft } from "./field-array-BJYc1xSu.js";
14
- import { F as _ } from "./form-field-Ani72sVY.js";
15
- import { P as St } from "./password-input-BokZ_rnT.js";
16
- import { T as te } from "./text-input-CaG9ApoE.js";
17
- import { T as Ot } from "./token-insert-menu-CQvV4u1m.js";
18
- import { u as _e } from "./use-copy-to-clipboard-Cyfc_dlv.js";
19
- import { u as Lt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
20
- import { c as Tt } from "./createLucideIcon-DhHxpK9K.js";
21
- import { C as qe } from "./check-DrFSN__t.js";
22
- import { C as oe } from "./circle-alert-rGDZ73Wh.js";
23
- import { C as je } from "./copy-vRpqqHtY.js";
24
- /**
25
- * @license lucide-react v1.22.0 - ISC
26
- *
27
- * This source code is licensed under the ISC license.
28
- * See the LICENSE file in the root directory of this source tree.
29
- */
30
- const Dt = [
31
- [
32
- "path",
33
- {
34
- d: "M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",
35
- key: "1s6t7t"
36
- }
37
- ],
38
- ["circle", { cx: "16.5", cy: "7.5", r: ".5", fill: "currentColor", key: "w0ekpg" }]
39
- ], Pt = Tt("key-round", Dt), Wo = [
40
- "url",
41
- "secret",
42
- "legalBasisConfirmed",
43
- "parameters"
44
- ], Mt = h(
45
- "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)] ds:text-start ds:text-[var(--foreground)]"
46
- ), _t = h(
47
- "ds:m-0 ds:grid ds:gap-x-[var(--spacing-xl)] ds:gap-y-[var(--spacing-md)]",
48
- {
49
- variants: {
50
- twoColumns: {
51
- true: "ds:grid-cols-2",
52
- false: "ds:grid-cols-1"
53
- }
54
- },
55
- defaultVariants: { twoColumns: !1 }
56
- }
57
- ), Te = h(
58
- "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-sm)]"
59
- ), De = h("type-title-item ds:text-foreground"), qt = h(
60
- "ds:min-w-0 ds:rounded-[var(--radius-sm)] ds:bg-[var(--muted)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:font-mono type-body-sm ds:text-foreground ds:[overflow-wrap:anywhere]"
61
- ), q = h("type-body-sm ds:text-muted-foreground"), jt = h(
62
- "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive"
63
- ), Ht = h(
64
- "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2"
65
- ), Kt = "https://", Xt = 2048, zt = 720, He = "wf12-e345-a67", $t = {
66
- sentAt: "2026-10-12T09:00:00+02:00",
67
- idempotencyKey: He,
68
- practiceId: 1234,
69
- workflowId: 12,
70
- workflowActionId: 67,
71
- workflowEnrollmentId: 345,
72
- patientId: 5678
73
- }, Ut = [
74
- "Content-Type: application/json",
75
- `X-AlfaDocs-Idempotency-Key: ${He}`,
76
- "X-AlfaDocs-Request-Timestamp: 1791788400000",
77
- "X-AlfaDocs-Signature: sha256=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
78
- ].join(`
79
- `), Ke = (a) => a === null ? "" : String(a), ne = (a) => a.original !== void 0 && a.name === a.original.name && a.value === Ke(a.original.value), Jt = (a) => a.flatMap((s) => s.original !== void 0 && ne(s) ? [[s.original.name, s.original.value]] : s.name.trim() === "" ? [] : [[s.name, s.value]]), Gt = (a) => a.length === 0 ? "" : `{${a.map(
80
- ([s, w]) => `${JSON.stringify(s)}:${JSON.stringify(w)}`
81
- ).join(",")}}`, Yt = () => {
82
- const a = new Uint8Array(32);
83
- return globalThis.crypto.getRandomValues(a), Array.from(a, (s) => s.toString(16).padStart(2, "0")).join(
84
- ""
85
- );
86
- }, Pe = (a) => a != null && a.url ? { kind: "url" } : a != null && a.secret ? { kind: "secret" } : a != null && a.legalBasisConfirmed ? { kind: "legal" } : a != null && a.parameters ? { kind: "parametersError" } : null;
87
- function Qt({ name: a, description: s, onCopied: w }) {
88
- const { t: c } = Me("ui"), { status: p, copy: f } = _e(), b = p === "copied", N = p === "error";
89
- return /* @__PURE__ */ d("div", { className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
90
- /* @__PURE__ */ d("dt", { className: "ds:flex ds:min-w-0 ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
91
- /* @__PURE__ */ o("code", { dir: "ltr", className: qt(), children: a }),
92
- /* @__PURE__ */ o(
93
- Rt,
94
- {
95
- icon: b ? /* @__PURE__ */ o(qe, {}) : N ? /* @__PURE__ */ o(oe, {}) : /* @__PURE__ */ o(je, {}),
96
- size: "sm",
97
- intent: "ghost",
98
- "aria-label": c("keyValuePair.copy", { label: a }),
99
- "data-action": "copy-field",
100
- "data-copied": b ? "true" : void 0,
101
- onClick: () => void f(a).then(w)
102
- }
103
- ),
104
- b ? /* @__PURE__ */ o("span", { "aria-hidden": "true", className: "type-body-sm ds:text-success", children: c("copyField.copied") }) : N ? /* @__PURE__ */ o("span", { "aria-hidden": "true", className: "type-body-sm ds:text-destructive", children: c("copyField.copyFailed") }) : null
105
- ] }),
106
- /* @__PURE__ */ o("dd", { className: "ds:m-0 type-body-sm ds:text-muted-foreground", children: s })
107
- ] });
108
- }
109
- const Zt = It(
110
- ({
111
- children: a,
112
- initialValues: s,
113
- hasSavedSecret: w = !1,
114
- errors: c,
115
- fieldNames: p,
116
- placeholders: f,
117
- onValueChange: b,
118
- layout: N = "two-column",
119
- className: Xe,
120
- ...ze
121
- }, W) => {
122
- const { t: n } = Me("ui"), $e = [
123
- ["patientId", n("workflowWebhookAction.sent.patientId")],
124
- ["practiceId", n("workflowWebhookAction.sent.practiceId")],
125
- ["workflowId", n("workflowWebhookAction.sent.workflowId")],
126
- ["workflowActionId", n("workflowWebhookAction.sent.workflowActionId")],
127
- [
128
- "workflowEnrollmentId",
129
- n("workflowWebhookAction.sent.workflowEnrollmentId")
130
- ],
131
- ["sentAt", n("workflowWebhookAction.sent.sentAt")],
132
- ["idempotencyKey", n("workflowWebhookAction.sent.idempotencyKey")],
133
- ["parameters", n("workflowWebhookAction.sent.parameters")]
134
- ], Ue = [
135
- ["X-AlfaDocs-Signature", n("workflowWebhookAction.headers.signature")],
136
- [
137
- "X-AlfaDocs-Request-Timestamp",
138
- n("workflowWebhookAction.headers.timestamp")
139
- ],
140
- [
141
- "X-AlfaDocs-Idempotency-Key",
142
- n("workflowWebhookAction.headers.idempotency")
143
- ]
144
- ], re = ee(), ae = ee(), se = ee(), E = i(0), Je = () => (E.current += 1, `parameter-${E.current}`), [R, Ge] = u(() => (s == null ? void 0 : s.url) ?? ""), [g, ce] = u(""), [Ye, le] = u(!1), [v, j] = u(
145
- () => Object.entries((s == null ? void 0 : s.parameters) ?? {}).map(([e, t]) => (E.current += 1, {
146
- key: `parameter-${E.current}`,
147
- name: e,
148
- value: Ke(t),
149
- original: { name: e, value: t }
150
- }))
151
- ), [B, Qe] = u(
152
- () => (s == null ? void 0 : s.legalBasisConfirmed) ?? !1
153
- ), [Ze, H] = u(
154
- () => Object.keys((s == null ? void 0 : s.parameters) ?? {}).length > 0 || !!(c != null && c.parameters)
155
- ), [Ve, et] = u({}), [K, tt] = u(!1), [C, ie] = u(() => c ?? {}), [ot, de] = u(""), [nt, rt] = u(
156
- () => Object.values(c ?? {}).some(Boolean)
157
- ), ue = i(c);
158
- I(() => {
159
- c !== ue.current && (ue.current = c, ie(c ?? {}), c != null && c.parameters && H(!0), rt(Object.values(c ?? {}).some(Boolean)), x(Pe(c)));
160
- }, [c]);
161
- const X = (e) => et(
162
- (t) => t[e] ? t : { ...t, [e]: !0 }
163
- ), y = (e) => ie(
164
- (t) => t[e] ? { ...t, [e]: void 0 } : t
165
- ), F = i(null), me = i(null), z = i(null), pe = i(null), fe = i(null), ke = i(null), he = i(null), $ = i(/* @__PURE__ */ new Map()), S = i(/* @__PURE__ */ new Map()), U = i(/* @__PURE__ */ new Set()), J = i(null);
166
- I(() => {
167
- var t;
168
- const e = J.current;
169
- e && (J.current = null, (t = S.current.get(e.key)) == null || t.setSelectionRange(e.position, e.position));
170
- });
171
- const [at, st] = u(!1);
172
- Lt(() => {
173
- const e = F.current;
174
- if (!e) return;
175
- const t = () => st(
176
- e.getBoundingClientRect().width >= zt
177
- );
178
- if (t(), typeof ResizeObserver > "u") return;
179
- const r = new ResizeObserver(t);
180
- return r.observe(e), () => r.disconnect();
181
- }, []);
182
- const G = N === "two-column" && at, ct = Nt(
183
- (e) => {
184
- F.current = e, typeof W == "function" ? W(e) : W && (W.current = e);
185
- },
186
- [W]
187
- ), O = (e) => {
188
- de("");
189
- let t = 0;
190
- const r = () => {
191
- var m;
192
- if (((m = he.current) == null ? void 0 : m.closest('[aria-hidden="true"]')) && t < 60) {
193
- t += 1, window.requestAnimationFrame(r);
194
- return;
195
- }
196
- de(e);
197
- };
198
- window.requestAnimationFrame(r);
199
- }, we = () => {
200
- const e = R.trim();
201
- if (e === "") return n("workflowWebhookAction.urlRequired");
202
- let t;
203
- try {
204
- t = new URL(e);
205
- } catch {
206
- return n("workflowWebhookAction.urlInvalid");
207
- }
208
- if (!e.startsWith(Kt)) return n("workflowWebhookAction.urlHttps");
209
- if (t.hostname === "") return n("workflowWebhookAction.urlInvalid");
210
- if (t.username !== "" || t.password !== "")
211
- return n("workflowWebhookAction.urlCredentials");
212
- }, ge = () => g.trim() === "" && !w ? n("workflowWebhookAction.secretRequired") : void 0, lt = () => {
213
- const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
214
- for (const r of v) {
215
- const l = ne(r) ? r.name : r.name.trim() === "" ? null : r.name;
216
- l !== null && t.set(l, (t.get(l) ?? 0) + 1);
217
- }
218
- for (const r of v)
219
- if (!ne(r)) {
220
- if (r.name.trim() === "") {
221
- r.value !== "" && e.set(
222
- r.key,
223
- n("workflowWebhookAction.parameterNameRequired")
224
- );
225
- continue;
226
- }
227
- (t.get(r.name) ?? 0) > 1 && e.set(
228
- r.key,
229
- n("workflowWebhookAction.parameterNameDuplicate")
230
- );
231
- }
232
- return e;
233
- }, ve = () => B ? void 0 : n("workflowWebhookAction.legalBasisRequired"), Y = (e) => K || Ve[e] === !0, be = lt(), it = C.url ?? (Y("url") ? we() : void 0), dt = C.secret ?? (Y("secret") ? ge() : void 0), L = C.legalBasisConfirmed ?? (K ? ve() : void 0), ut = (e) => Y(`parameter:${e}`) ? be.get(e) : void 0, T = !K && !nt, ye = () => {
234
- if (we()) return { kind: "url" };
235
- if (ge()) return { kind: "secret" };
236
- if (ve()) return { kind: "legal" };
237
- const e = v.find((t) => be.has(t.key));
238
- return e ? { kind: "parameter", key: e.key } : void 0;
239
- }, Ae = i(ye);
240
- Ae.current = ye;
241
- const [D, x] = u(
242
- () => Pe(c)
243
- );
244
- I(() => {
245
- if (!D) return;
246
- const e = (() => {
247
- var t;
248
- switch (D.kind) {
249
- case "url":
250
- return me.current;
251
- case "secret":
252
- return z.current;
253
- case "legal":
254
- return ke.current;
255
- case "copy":
256
- return pe.current;
257
- case "parametersError":
258
- return fe.current;
259
- case "add":
260
- return (t = F.current) == null ? void 0 : t.querySelector(
261
- '[data-slot="parameters"] [data-component="field-array"] > button'
262
- );
263
- case "parameter":
264
- return $.current.get(D.key);
265
- }
266
- })();
267
- e == null || e.focus();
268
- }, [D]), I(() => {
269
- var r;
270
- const e = (r = F.current) == null ? void 0 : r.closest("form");
271
- if (!e) return;
272
- const t = (l) => {
273
- const m = Ae.current();
274
- m && (l.preventDefault(), tt(!0), m.kind === "parameter" && H(!0), x({ ...m }));
275
- };
276
- return e.addEventListener("submit", t), () => e.removeEventListener("submit", t);
277
- }, []);
278
- const A = Jt(v), We = Gt(A), P = i(b);
279
- P.current = b;
280
- const Ce = i(A);
281
- Ce.current = A;
282
- const xe = i(!1);
283
- I(() => {
284
- var e;
285
- if (!xe.current) {
286
- xe.current = !0;
287
- return;
288
- }
289
- (e = P.current) == null || e.call(P, {
290
- url: R,
291
- secret: g,
292
- parameters: Object.fromEntries(Ce.current),
293
- legalBasisConfirmed: B
294
- });
295
- }, [R, g, We, B]);
296
- const {
297
- status: Ie,
298
- copiedValue: mt,
299
- copy: pt,
300
- reset: Ne
301
- } = _e(), Q = Ie === "copied" && mt === g, Ee = Ie === "error", ft = () => {
302
- Ne(), ce(Yt()), le(!0), y("secret"), O(n("workflowWebhookAction.secretGenerated")), x({ kind: "copy" });
303
- }, kt = async () => {
304
- var t;
305
- const e = await pt(((t = z.current) == null ? void 0 : t.value) ?? g);
306
- O(n(e ? "copyField.copySuccess" : "copyField.copyFailed"));
307
- }, Z = (e, t) => {
308
- j(
309
- (r) => r.map((l) => l.key === e ? { ...l, ...t } : l)
310
- ), y("parameters");
311
- }, ht = () => {
312
- const e = Je();
313
- j((t) => [...t, { key: e, name: "", value: "" }]), x({ kind: "parameter", key: e });
314
- }, wt = (e) => {
315
- const t = v.filter((m, V) => V !== e), r = v[e];
316
- r && ($.current.delete(r.key), S.current.delete(r.key), U.current.delete(r.key)), j(t), y("parameters");
317
- const l = t[e] ?? t[e - 1];
318
- x(
319
- l ? { kind: "parameter", key: l.key } : { kind: "add" }
320
- );
321
- }, gt = (e, t) => {
322
- var Be;
323
- const r = S.current.get(e.key), l = r !== void 0 && U.current.has(e.key), m = l ? r.selectionStart ?? e.value.length : e.value.length, V = l ? r.selectionEnd ?? m : m, Wt = e.value.slice(0, m) + t + e.value.slice(V);
324
- J.current = { key: e.key, position: m + t.length }, Z(e.key, { value: Wt });
325
- const Ct = (Be = f == null ? void 0 : f.find((xt) => xt.value === t)) == null ? void 0 : Be.label;
326
- O(
327
- n("workflowWebhookAction.placeholderInserted", {
328
- detail: Ct ?? t
329
- })
330
- );
331
- }, vt = (e) => O(n(e ? "copyField.copySuccess" : "copyField.copyFailed")), Re = (e, t) => /* @__PURE__ */ o(
332
- "dl",
333
- {
334
- "aria-labelledby": e,
335
- className: _t({ twoColumns: G }),
336
- children: t.map(([r, l]) => /* @__PURE__ */ o(
337
- Qt,
338
- {
339
- name: r,
340
- description: l,
341
- onCopied: vt
342
- },
343
- r
344
- ))
345
- }
346
- ), bt = JSON.stringify(
347
- { ...$t, parameters: Object.fromEntries(A) },
348
- null,
349
- 2
350
- ), yt = /* @__PURE__ */ d(
351
- "div",
352
- {
353
- "data-columns": G ? 2 : 1,
354
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xl)]",
355
- children: [
356
- /* @__PURE__ */ d("div", { className: Te(), children: [
357
- /* @__PURE__ */ o("h4", { id: ae, className: De(), children: n("workflowWebhookAction.bodyHeading") }),
358
- /* @__PURE__ */ o("p", { className: q(), children: n("workflowWebhookAction.sentDescription") }),
359
- /* @__PURE__ */ o(
360
- Fe,
361
- {
362
- language: "json",
363
- code: bt,
364
- copyLabel: n("workflowWebhookAction.copyBody")
365
- }
366
- ),
367
- Re(ae, $e)
368
- ] }),
369
- /* @__PURE__ */ d("div", { className: Te(), children: [
370
- /* @__PURE__ */ o("h4", { id: se, className: De(), children: n("workflowWebhookAction.headersHeading") }),
371
- /* @__PURE__ */ o("p", { className: q(), children: n("workflowWebhookAction.headersDescription") }),
372
- /* @__PURE__ */ o(
373
- Fe,
374
- {
375
- language: "http",
376
- code: Ut,
377
- copyLabel: n("workflowWebhookAction.copyHeaders")
378
- }
379
- ),
380
- Re(se, Ue)
381
- ] })
382
- ]
383
- }
384
- ), M = p !== void 0, At = n(Ye ? "workflowWebhookAction.generatedNotice" : w ? "workflowWebhookAction.secretSavedDescription" : "workflowWebhookAction.secretDescription");
385
- return /* @__PURE__ */ d(
386
- "div",
387
- {
388
- ref: ct,
389
- ...ze,
390
- "data-component": "workflow-webhook-action",
391
- "data-layout": G ? "two-column" : "one-column",
392
- className: Mt({ className: Xe }),
393
- children: [
394
- a ? /* @__PURE__ */ o(
395
- "div",
396
- {
397
- "data-slot": "host-content",
398
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
399
- children: a
400
- }
401
- ) : null,
402
- /* @__PURE__ */ o("p", { className: q(), children: n("workflowWebhookAction.intro") }),
403
- /* @__PURE__ */ o(
404
- _,
405
- {
406
- label: n("workflowWebhookAction.url"),
407
- description: n("workflowWebhookAction.urlDescription"),
408
- required: !0,
409
- error: it,
410
- announceError: T,
411
- "data-field": "url",
412
- children: /* @__PURE__ */ o(
413
- te,
414
- {
415
- ref: me,
416
- name: M ? p.url : void 0,
417
- dir: "ltr",
418
- inputMode: "url",
419
- autoComplete: "off",
420
- spellCheck: !1,
421
- maxLength: Xt,
422
- placeholder: "https://",
423
- value: R,
424
- onChange: (e) => {
425
- Ge(e.target.value), y("url");
426
- },
427
- onBlur: (e) => {
428
- e.target.value !== "" && X("url");
429
- }
430
- }
431
- )
432
- }
433
- ),
434
- /* @__PURE__ */ d(
435
- "div",
436
- {
437
- "data-field": "secret",
438
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
439
- children: [
440
- /* @__PURE__ */ o(
441
- _,
442
- {
443
- label: n("workflowWebhookAction.secret"),
444
- description: At,
445
- ...w ? { optional: !0 } : { required: !0 },
446
- error: dt,
447
- announceError: T,
448
- children: /* @__PURE__ */ o(
449
- St,
450
- {
451
- ref: z,
452
- name: M ? p.secret : "",
453
- dir: "ltr",
454
- autoComplete: "new-password",
455
- spellCheck: !1,
456
- value: g,
457
- onChange: (e) => {
458
- ce(e.target.value), le(!1), Ne(), y("secret");
459
- },
460
- onBlur: (e) => {
461
- e.target.value !== "" && X("secret");
462
- }
463
- }
464
- )
465
- }
466
- ),
467
- /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: [
468
- /* @__PURE__ */ o(
469
- Oe,
470
- {
471
- type: "button",
472
- intent: "outline",
473
- size: "sm",
474
- startIcon: /* @__PURE__ */ o(Pt, {}),
475
- "data-action": "generate-secret",
476
- onClick: ft,
477
- children: n("workflowWebhookAction.generate")
478
- }
479
- ),
480
- /* @__PURE__ */ o(
481
- Oe,
482
- {
483
- ref: pe,
484
- type: "button",
485
- intent: "outline",
486
- size: "sm",
487
- disabled: g === "",
488
- startIcon: Q ? /* @__PURE__ */ o(qe, {}) : Ee ? /* @__PURE__ */ o(oe, {}) : /* @__PURE__ */ o(je, {}),
489
- "data-action": "copy-secret",
490
- "data-copied": Q ? "true" : void 0,
491
- onClick: () => void kt(),
492
- children: n(Q ? "copyField.copied" : Ee ? "copyField.copyFailed" : "workflowWebhookAction.copySecret")
493
- }
494
- )
495
- ] })
496
- ]
497
- }
498
- ),
499
- /* @__PURE__ */ d(
500
- "div",
501
- {
502
- "data-field": "legalBasisConfirmed",
503
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
504
- children: [
505
- /* @__PURE__ */ o(
506
- Bt,
507
- {
508
- ref: ke,
509
- name: M ? p.legalBasisConfirmed : void 0,
510
- value: "1",
511
- checked: B,
512
- onCheckedChange: (e) => {
513
- Qe(e === !0), y("legalBasisConfirmed");
514
- },
515
- "aria-required": "true",
516
- "aria-invalid": L ? !0 : void 0,
517
- "aria-describedby": L ? re : void 0,
518
- label: n("workflowWebhookAction.legalBasis")
519
- }
520
- ),
521
- L ? /* @__PURE__ */ d(
522
- "p",
523
- {
524
- id: re,
525
- role: T ? "alert" : void 0,
526
- "data-slot": "error",
527
- className: jt(),
528
- children: [
529
- /* @__PURE__ */ o(
530
- oe,
531
- {
532
- "aria-hidden": "true",
533
- className: "ds:size-4 ds:shrink-0"
534
- }
535
- ),
536
- /* @__PURE__ */ o("span", { children: L })
537
- ]
538
- }
539
- ) : null
540
- ]
541
- }
542
- ),
543
- M ? /* @__PURE__ */ o(
544
- "input",
545
- {
546
- type: "hidden",
547
- name: p.parameters,
548
- value: We
549
- }
550
- ) : null,
551
- /* @__PURE__ */ o("div", { "data-field": "parameters", "data-slot": "parameters", children: /* @__PURE__ */ o(Le, { variant: "elevated", children: /* @__PURE__ */ o(
552
- k,
553
- {
554
- type: "single",
555
- collapsible: !0,
556
- value: Ze ? "advanced" : "",
557
- onValueChange: (e) => H(e === "advanced"),
558
- children: /* @__PURE__ */ d(k.Item, { value: "advanced", children: [
559
- /* @__PURE__ */ o(k.Trigger, { "data-action": "toggle-advanced", children: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
560
- /* @__PURE__ */ o("span", { children: n("workflowWebhookAction.advanced") }),
561
- A.length > 0 ? /* @__PURE__ */ o(Et, { variant: "neutral", size: "md", children: n("workflowWebhookAction.parameterCount", {
562
- total: A.length
563
- }) }) : null
564
- ] }) }),
565
- /* @__PURE__ */ o(k.Content, { children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
566
- /* @__PURE__ */ o("p", { className: q(), children: n("workflowWebhookAction.advancedDescription") }),
567
- C.parameters ? /* @__PURE__ */ o(
568
- "div",
569
- {
570
- ref: fe,
571
- tabIndex: -1,
572
- "data-slot": "error",
573
- className: "ds:outline-none",
574
- children: /* @__PURE__ */ o(Se, { variant: "error", announce: "off", children: /* @__PURE__ */ o(Se.Description, { children: C.parameters }) })
575
- }
576
- ) : null,
577
- /* @__PURE__ */ o(
578
- Ft,
579
- {
580
- legend: n("workflowWebhookAction.parametersLegend"),
581
- items: v,
582
- addLabel: n("workflowWebhookAction.addParameter"),
583
- removeItemLabel: (e) => n("workflowWebhookAction.removeParameter", {
584
- number: e + 1
585
- }),
586
- onAdd: ht,
587
- onRemove: wt,
588
- renderItem: (e, t) => /* @__PURE__ */ d(
589
- "div",
590
- {
591
- "data-parameter-id": e.key,
592
- className: Ht(),
593
- children: [
594
- /* @__PURE__ */ o(
595
- _,
596
- {
597
- label: n("workflowWebhookAction.parameterName"),
598
- error: ut(e.key),
599
- announceError: T,
600
- children: /* @__PURE__ */ o(
601
- te,
602
- {
603
- ref: (r) => {
604
- r && $.current.set(e.key, r);
605
- },
606
- "aria-label": n(
607
- "workflowWebhookAction.parameterNameOf",
608
- { number: t + 1 }
609
- ),
610
- dir: "auto",
611
- autoComplete: "off",
612
- spellCheck: !1,
613
- value: e.name,
614
- onChange: (r) => Z(e.key, { name: r.target.value }),
615
- onBlur: () => X(`parameter:${e.key}`)
616
- }
617
- )
618
- }
619
- ),
620
- /* @__PURE__ */ o(
621
- _,
622
- {
623
- label: n("workflowWebhookAction.parameterValue"),
624
- children: /* @__PURE__ */ o(
625
- te,
626
- {
627
- ref: (r) => {
628
- r && S.current.set(e.key, r);
629
- },
630
- "aria-label": n(
631
- "workflowWebhookAction.parameterValueOf",
632
- { number: t + 1 }
633
- ),
634
- dir: "auto",
635
- autoComplete: "off",
636
- value: e.value,
637
- onChange: (r) => Z(e.key, {
638
- value: r.target.value
639
- }),
640
- onFocus: () => U.current.add(e.key)
641
- }
642
- )
643
- }
644
- ),
645
- f && f.length > 0 ? /* @__PURE__ */ o("div", { className: "ds:sm:col-span-2", children: /* @__PURE__ */ o(
646
- Ot,
647
- {
648
- tokens: f.map((r) => ({
649
- value: r.value,
650
- label: r.label
651
- })),
652
- triggerLabel: n(
653
- "workflowWebhookAction.insertDetail"
654
- ),
655
- onInsert: (r) => gt(e, r)
656
- }
657
- ) }) : null
658
- ]
659
- }
660
- )
661
- }
662
- )
663
- ] }) })
664
- ] })
665
- }
666
- ) }) }),
667
- /* @__PURE__ */ o("div", { "data-slot": "reference", children: /* @__PURE__ */ o(Le, { variant: "elevated", children: /* @__PURE__ */ o(k, { type: "single", collapsible: !0, children: /* @__PURE__ */ d(k.Item, { value: "reference", children: [
668
- /* @__PURE__ */ o(k.Trigger, { "data-action": "toggle-reference", children: /* @__PURE__ */ o("span", { children: n("workflowWebhookAction.sentHeading") }) }),
669
- /* @__PURE__ */ o(k.Content, { children: yt })
670
- ] }) }) }) }),
671
- /* @__PURE__ */ o(
672
- "span",
673
- {
674
- ref: he,
675
- role: "status",
676
- "aria-live": "polite",
677
- className: "ds:sr-only",
678
- children: ot
679
- }
680
- )
681
- ]
682
- }
683
- );
684
- }
685
- );
686
- Zt.displayName = "WorkflowWebhookAction";
687
- export {
688
- Wo as W,
689
- Zt as a
690
- };
691
- //# sourceMappingURL=workflow-webhook-action-Ct8tFYi7.js.map