@nice2dev/ui 1.3.16 → 1.3.18

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 (38) hide show
  1. package/CHANGELOG.md +138 -0
  2. package/README.md +2 -2
  3. package/dist/{NiceDataGrid-aNPAHsWy.cjs → NiceDataGrid-CFibAGHt.cjs} +1 -1
  4. package/dist/NiceEventOrchestrator.doc-Dwtq2s_L.cjs +6 -0
  5. package/dist/NiceForm-ChRj4r3f.cjs +1 -0
  6. package/dist/{NiceMention-CMqAGvO0.cjs → NiceMention-DNx3d9L7.cjs} +1 -1
  7. package/dist/NiceModuleLifecyclePanel-D8Q081R6.cjs +1 -0
  8. package/dist/{NiceSavedQueryPanel-JHrSlHAV.cjs → NiceSavedQueryPanel-BuRAgrBk.cjs} +1 -1
  9. package/dist/{NiceScheduler-2TwOZq-y.cjs → NiceScheduler-DAoo1eyo.cjs} +1 -1
  10. package/dist/{core-lazy-Cda-D35m.cjs → core-lazy-DohJQ33c.cjs} +1 -1
  11. package/dist/data/treeDragSession.mjs +52 -46
  12. package/dist/data.cjs +1 -1
  13. package/dist/docs/NiceEventOrchestrator.doc.json.mjs +19 -19
  14. package/dist/editors/inputs/NiceAutocomplete.mjs +44 -46
  15. package/dist/editors/pickers/NiceDateTimePicker.mjs +1 -1
  16. package/dist/editors.cjs +1 -1
  17. package/dist/index.cjs +216 -216
  18. package/dist/index.d.ts +192 -69
  19. package/dist/index.mjs +933 -926
  20. package/dist/navigation/NiceIconRail.mjs +74 -53
  21. package/dist/navigation/NiceNavShell.mjs +855 -807
  22. package/dist/navigation/NiceSetupWizard.mjs +287 -278
  23. package/dist/navigation/NiceSidebarNav.mjs +1487 -1144
  24. package/dist/navigation/navItemDrag.mjs +42 -0
  25. package/dist/navigation/navShellPane.mjs +16 -11
  26. package/dist/navigation/sidebarNavTypes.mjs +1 -0
  27. package/dist/navigation/sidebarSearch.mjs +28 -0
  28. package/dist/navigation.cjs +1 -1
  29. package/dist/navigation.d.ts +63 -21
  30. package/dist/style.css +2 -2
  31. package/dist/tools/NiceThemeDesigner.mjs +1359 -900
  32. package/dist/tools/NiceThemePreview.mjs +18 -18
  33. package/dist/tools/themeCatalog.mjs +50 -0
  34. package/dist/workflow/NiceWorkflowDesigner.mjs +452 -898
  35. package/package.json +4 -4
  36. package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +0 -6
  37. package/dist/NiceForm-BtRBLffD.cjs +0 -1
  38. package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +0 -1
@@ -1,137 +1,68 @@
1
- import { jsx as t, jsxs as a, Fragment as V } from "react/jsx-runtime";
2
- import { useRovingFocus as fe, useNiceTranslation as we, NiceIcon as p, NiceTutorialButton as Ye, resolveTutorial as Ke } from "@nice2dev/ui-core";
3
- import { useRef as Z, useState as S, useMemo as ce, useCallback as F, useEffect as We } from "react";
4
- import { NiceAppShell as Pe } from "../navigation/NiceAppShell.mjs";
1
+ import { jsx as n, jsxs as a, Fragment as M } from "react/jsx-runtime";
2
+ import { useRovingFocus as ie, useNiceTranslation as he, NiceIcon as p } from "@nice2dev/ui-core";
3
+ import { useRef as L, useState as E, useMemo as K, useCallback as y } from "react";
4
+ import { NiceAppShell as Ye } from "../navigation/NiceAppShell.mjs";
5
5
  /* empty css */
6
- const Xe = [
7
- {
8
- target: ".nice-workflow-designer",
9
- titleKey: "tutorial.workflowDesigner.intro.title",
10
- title: "Workflow designer",
11
- contentKey: "tutorial.workflowDesigner.intro.content",
12
- content: "Add states and transitions on the canvas, validate the flow, simulate it, then test or publish your workflow.",
13
- placement: "auto"
14
- },
15
- {
16
- target: ".nice-workflow-designer__toolbar",
17
- titleKey: "tutorial.workflowDesigner.toolbar.title",
18
- title: "Toolbar",
19
- contentKey: "tutorial.workflowDesigner.toolbar.content",
20
- content: "Add states and approvals, run a simulation, then test or publish the workflow.",
21
- placement: "bottom"
22
- },
23
- {
24
- target: ".nice-workflow-designer__canvas",
25
- titleKey: "tutorial.workflowDesigner.canvas.title",
26
- title: "Canvas",
27
- contentKey: "tutorial.workflowDesigner.canvas.content",
28
- content: "Drag to arrange states, click one to edit it, and connect them into transitions.",
29
- placement: "auto"
30
- },
31
- {
32
- target: ".nice-workflow-designer__minimap",
33
- titleKey: "tutorial.workflowDesigner.minimap.title",
34
- title: "Minimap",
35
- contentKey: "tutorial.workflowDesigner.minimap.content",
36
- content: "A bird’s-eye overview of the whole flow for quick navigation.",
37
- placement: "left"
38
- }
39
- ];
40
- function je(i, c) {
41
- const b = [], H = i.states.filter((d) => d.type === "initial"), m = i.states.filter((d) => d.type === "final");
42
- H.length === 0 && b.push({
43
- type: "error",
44
- message: c("workflowDesigner.val.noInitial", "No initial state")
45
- }), H.length > 1 && b.push({
46
- type: "warning",
47
- message: c("workflowDesigner.val.multiInitial", "More than one initial state")
48
- }), m.length === 0 && b.push({ type: "error", message: c("workflowDesigner.val.noFinal", "No final state") });
49
- for (const d of i.states) {
50
- const D = i.transitions.some((N) => N.fromStateId === d.id), P = i.transitions.some((N) => N.toStateId === d.id);
51
- !D && d.type !== "final" && d.type !== "error" && b.push({
52
- type: "warning",
53
- message: c(
54
- "workflowDesigner.val.deadEnd",
55
- 'State "{name}" has no outgoing transitions (dead-end)'
56
- ).replace("{name}", d.name),
57
- elementId: d.id
58
- }), !P && d.type !== "initial" && b.push({
59
- type: "warning",
60
- message: c(
61
- "workflowDesigner.val.orphan",
62
- 'State "{name}" is unreachable (orphan)'
63
- ).replace("{name}", d.name),
64
- elementId: d.id
65
- });
66
- }
67
- return b;
68
- }
69
- function Ue(i, c) {
70
- const b = [];
71
- i.elements.filter(
6
+ function He(t, l) {
7
+ const f = [];
8
+ t.elements.filter(
72
9
  (d) => d.elementType === "event" && d.eventType === "startEvent"
73
- ).length === 0 && b.push({
10
+ ).length === 0 && f.push({
74
11
  type: "error",
75
- message: c("workflowDesigner.val.bpmnNoStart", "Process must have at least one start event")
76
- }), i.elements.filter(
12
+ message: l("workflowDesigner.val.bpmnNoStart", "Process must have at least one start event")
13
+ }), t.elements.filter(
77
14
  (d) => d.elementType === "event" && d.eventType === "endEvent"
78
- ).length === 0 && b.push({
15
+ ).length === 0 && f.push({
79
16
  type: "error",
80
- message: c("workflowDesigner.val.bpmnNoEnd", "Process must have at least one end event")
17
+ message: l("workflowDesigner.val.bpmnNoEnd", "Process must have at least one end event")
81
18
  });
82
- for (const d of i.elements) {
83
- const D = d.id, P = i.sequenceFlows.some((K) => K.targetRef === D), N = i.sequenceFlows.some((K) => K.sourceRef === D);
84
- d.elementType === "event" ? (d.eventType === "startEvent" && !N && b.push({
19
+ for (const d of t.elements) {
20
+ const w = d.id, F = t.sequenceFlows.some((A) => A.targetRef === w), N = t.sequenceFlows.some((A) => A.sourceRef === w);
21
+ d.elementType === "event" ? (d.eventType === "startEvent" && !N && f.push({
85
22
  type: "warning",
86
- message: c(
23
+ message: l(
87
24
  "workflowDesigner.val.startNoOut",
88
25
  'Start event "{name}" has no outgoing flow'
89
26
  ).replace("{name}", d.name),
90
- elementId: D
91
- }), d.eventType === "endEvent" && !P && b.push({
27
+ elementId: w
28
+ }), d.eventType === "endEvent" && !F && f.push({
92
29
  type: "warning",
93
- message: c(
30
+ message: l(
94
31
  "workflowDesigner.val.endNoIn",
95
32
  'End event "{name}" has no incoming flow'
96
33
  ).replace("{name}", d.name),
97
- elementId: D
98
- })) : (d.elementType === "task" || d.elementType === "gateway") && (P || b.push({
34
+ elementId: w
35
+ })) : (d.elementType === "task" || d.elementType === "gateway") && (F || f.push({
99
36
  type: "warning",
100
- message: c(
37
+ message: l(
101
38
  "workflowDesigner.val.unreachable",
102
39
  'Element "{name}" is unreachable'
103
- ).replace("{name}", d.name || D),
104
- elementId: D
105
- }), N || b.push({
40
+ ).replace("{name}", d.name || w),
41
+ elementId: w
42
+ }), N || f.push({
106
43
  type: "warning",
107
- message: c(
44
+ message: l(
108
45
  "workflowDesigner.val.elemNoOut",
109
46
  'Element "{name}" has no outgoing flow'
110
- ).replace("{name}", d.name || D),
111
- elementId: D
47
+ ).replace("{name}", d.name || w),
48
+ elementId: w
112
49
  }));
113
50
  }
114
- for (const d of i.elements)
51
+ for (const d of t.elements)
115
52
  if (d.elementType === "gateway" && d.gatewayType === "exclusiveGateway") {
116
- const D = i.sequenceFlows.filter((N) => N.sourceRef === d.id), P = D.filter((N) => N.conditionExpression || N.isDefault);
117
- D.length > 1 && P.length < D.length - 1 && b.push({
53
+ const w = t.sequenceFlows.filter((N) => N.sourceRef === d.id), F = w.filter((N) => N.conditionExpression || N.isDefault);
54
+ w.length > 1 && F.length < w.length - 1 && f.push({
118
55
  type: "warning",
119
- message: c(
56
+ message: l(
120
57
  "workflowDesigner.val.xorNoConditions",
121
58
  'Exclusive gateway "{name}" should have conditions on its flows'
122
59
  ).replace("{name}", d.name || d.id),
123
60
  elementId: d.id
124
61
  });
125
62
  }
126
- return b;
63
+ return f;
127
64
  }
128
- const Ne = {
129
- initial: "var(--nice-color-success, #22c55e)",
130
- intermediate: "var(--nice-color-primary, #3b82f6)",
131
- approval: "var(--nice-color-warning, #f59e0b)",
132
- final: "var(--nice-text-muted, #6b7280)",
133
- error: "var(--nice-color-error, #ef4444)"
134
- }, Ve = {
65
+ const Xe = {
135
66
  none: "circle",
136
67
  message: "mail",
137
68
  timer: "clock",
@@ -142,7 +73,7 @@ const Ne = {
142
73
  signal: "target",
143
74
  terminate: "circle",
144
75
  link: "arrow-right"
145
- }, Ze = {
76
+ }, Le = {
146
77
  task: "check-square",
147
78
  userTask: "user",
148
79
  serviceTask: "settings",
@@ -152,25 +83,25 @@ const Ne = {
152
83
  receiveTask: "download",
153
84
  manualTask: "cursor",
154
85
  callActivity: "arrow-right"
155
- }, Je = {
86
+ }, Ke = {
156
87
  events: "circle",
157
88
  tasks: "square",
158
89
  gateways: "diamond",
159
90
  subprocesses: "layers",
160
91
  artifacts: "file"
161
- }, Ee = {
92
+ }, ve = {
162
93
  events: "Events",
163
94
  tasks: "Tasks",
164
95
  gateways: "Gateways",
165
96
  subprocesses: "Subprocesses",
166
97
  artifacts: "Artifacts"
167
- }, Oe = {
98
+ }, je = {
168
99
  exclusiveGateway: "close",
169
100
  parallelGateway: "plus",
170
101
  inclusiveGateway: "circle",
171
102
  eventBasedGateway: "target",
172
103
  complexGateway: "star"
173
- }, Qe = [
104
+ }, Ve = [
174
105
  // Events
175
106
  {
176
107
  id: "startEvent",
@@ -346,236 +277,236 @@ const Ne = {
346
277
  elementType: "dataObject"
347
278
  }
348
279
  ];
349
- function ve(i) {
350
- return `${i}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
280
+ function ae(t) {
281
+ return `${t}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
351
282
  }
352
- function Se(i, c) {
353
- const b = ve(i.elementType);
354
- return i.category === "events" ? {
355
- id: b,
356
- name: i.label,
283
+ function ke(t, l) {
284
+ const f = ae(t.elementType);
285
+ return t.category === "events" ? {
286
+ id: f,
287
+ name: t.label,
357
288
  elementType: "event",
358
- eventType: i.elementType,
359
- eventDefinition: i.eventDefinition || "none",
360
- position: c
361
- } : i.category === "tasks" ? {
362
- id: b,
363
- name: i.label,
289
+ eventType: t.elementType,
290
+ eventDefinition: t.eventDefinition || "none",
291
+ position: l
292
+ } : t.category === "tasks" ? {
293
+ id: f,
294
+ name: t.label,
364
295
  elementType: "task",
365
- taskType: i.elementType,
366
- position: c,
296
+ taskType: t.elementType,
297
+ position: l,
367
298
  size: { width: 100, height: 80 }
368
- } : i.category === "gateways" ? {
369
- id: b,
299
+ } : t.category === "gateways" ? {
300
+ id: f,
370
301
  name: "",
371
302
  elementType: "gateway",
372
- gatewayType: i.elementType,
373
- position: c
374
- } : i.category === "subprocesses" ? {
375
- id: b,
376
- name: i.label,
303
+ gatewayType: t.elementType,
304
+ position: l
305
+ } : t.category === "subprocesses" ? {
306
+ id: f,
307
+ name: t.label,
377
308
  elementType: "subprocess",
378
- position: c,
309
+ position: l,
379
310
  size: { width: 300, height: 200 },
380
311
  isExpanded: !0,
381
312
  elements: [],
382
313
  sequenceFlows: []
383
314
  } : null;
384
315
  }
385
- function ge(i, c) {
386
- return Math.round(i / c) * c;
316
+ function j(t, l) {
317
+ return Math.round(t / l) * l;
387
318
  }
388
- const ot = ({
389
- process: i,
390
- onChange: c,
391
- availableUsers: b = [],
392
- availableRoles: H = [],
393
- readOnly: m = !1,
319
+ const Qe = ({
320
+ process: t,
321
+ onChange: l,
322
+ availableUsers: f = [],
323
+ availableRoles: _e = [],
324
+ readOnly: o = !1,
394
325
  showMinimap: d = !0,
395
- showToolbar: D = !0,
396
- showValidation: P = !0,
326
+ showToolbar: w = !0,
327
+ showValidation: F = !0,
397
328
  showPalette: N = !0,
398
- showProperties: K = !0,
399
- showVariables: de = !1,
400
- gridSize: R = 20,
401
- snapToGrid: J = !0,
402
- onTest: me,
403
- onPublish: ae,
404
- onExportBPMN: h,
405
- onImportBPMN: oe,
406
- className: y,
407
- style: se,
408
- "data-testid": B
329
+ showProperties: A = !0,
330
+ showVariables: se = !1,
331
+ gridSize: C = 20,
332
+ snapToGrid: I = !0,
333
+ onTest: le,
334
+ onPublish: re,
335
+ onExportBPMN: oe,
336
+ onImportBPMN: ce,
337
+ className: Te,
338
+ style: De,
339
+ "data-testid": xe
409
340
  }) => {
410
- const W = Z(null);
411
- fe(W, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
412
- const { t: O } = we(), { t: o } = we(), [L, G] = S(null), [I, Q] = S(null), [j, U] = S(null), [E, le] = S(null), [x, ee] = S({ x: 0, y: 0 }), [z, te] = S(1), [re, pe] = S(!1), ne = Z(null), [ie, ue] = S("tasks"), [X, n] = S(!1), [s, r] = S(null), k = ce(
413
- () => P ? Ue(i, o) : [],
414
- [i, P, o]
415
- ), w = k.filter((e) => e.type === "error"), $ = k.filter((e) => e.type === "warning"), g = ce(
416
- () => i.elements.find((e) => e.id === L),
417
- [i.elements, L]
418
- ), C = ce(
419
- () => i.sequenceFlows.find((e) => e.id === I),
420
- [i.sequenceFlows, I]
421
- ), Ce = ce(
422
- () => Qe.filter((e) => e.category === ie).map((e) => ({
341
+ const de = L(null);
342
+ ie(de, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
343
+ const { t: me } = he(), { t: i } = he(), [S, z] = E(null), [R, B] = E(null), [V, W] = E(null), [_, Z] = E(null), [h, U] = E({ x: 0, y: 0 }), [T, G] = E(1), [J, pe] = E(!1), Y = L(null), [H, Ee] = E("tasks"), [$, ue] = E(!1), [X, O] = E(null), q = K(
344
+ () => F ? He(t, i) : [],
345
+ [t, F, i]
346
+ ), Q = q.filter((e) => e.type === "error"), Ne = q.filter((e) => e.type === "warning"), m = K(
347
+ () => t.elements.find((e) => e.id === S),
348
+ [t.elements, S]
349
+ ), k = K(
350
+ () => t.sequenceFlows.find((e) => e.id === R),
351
+ [t.sequenceFlows, R]
352
+ ), Pe = K(
353
+ () => Ve.filter((e) => e.category === H).map((e) => ({
423
354
  ...e,
424
- label: o(`workflowDesigner.palette.${e.id}`, e.label)
355
+ label: i(`workflowDesigner.palette.${e.id}`, e.label)
425
356
  })),
426
- [ie, o]
427
- ), Fe = F(
357
+ [H, i]
358
+ ), Fe = y(
428
359
  (e) => {
429
- if (m || !j)
360
+ if (o || !V)
430
361
  return;
431
- const l = e.currentTarget.getBoundingClientRect();
432
- let u = (e.clientX - l.left - x.x) / z, v = (e.clientY - l.top - x.y) / z;
433
- J && (u = ge(u, R), v = ge(v, R));
434
- const T = Se(j, { x: u, y: v });
435
- T && (c?.({
436
- ...i,
437
- elements: [...i.elements, T]
438
- }), G(T.id)), U(null);
362
+ const s = e.currentTarget.getBoundingClientRect();
363
+ let r = (e.clientX - s.left - h.x) / T, u = (e.clientY - s.top - h.y) / T;
364
+ I && (r = j(r, C), u = j(u, C));
365
+ const b = ke(V, { x: r, y: u });
366
+ b && (l?.({
367
+ ...t,
368
+ elements: [...t.elements, b]
369
+ }), z(b.id)), W(null);
439
370
  },
440
371
  [
441
- m,
442
- j,
443
- x,
444
- z,
445
- J,
446
- R,
447
- i,
448
- c
372
+ o,
373
+ V,
374
+ h,
375
+ T,
376
+ I,
377
+ C,
378
+ t,
379
+ l
449
380
  ]
450
- ), Ie = F(
381
+ ), Ce = y(
451
382
  (e) => {
452
- if (m)
383
+ if (o)
453
384
  return;
454
- const l = i.elements.length % 8 * 30;
455
- let u = (40 - x.x) / z + l, v = (40 - x.y) / z + l;
456
- J && (u = ge(u, R), v = ge(v, R));
457
- const T = Se(e, { x: u, y: v });
458
- T && (c?.({ ...i, elements: [...i.elements, T] }), G(T.id));
385
+ const s = t.elements.length % 8 * 30;
386
+ let r = (40 - h.x) / T + s, u = (40 - h.y) / T + s;
387
+ I && (r = j(r, C), u = j(u, C));
388
+ const b = ke(e, { x: r, y: u });
389
+ b && (l?.({ ...t, elements: [...t.elements, b] }), z(b.id));
459
390
  },
460
- [m, x, z, J, R, i, c]
461
- ), ke = Z(null), _e = Z(null);
462
- fe(ke, { orientation: "vertical", typeahead: !0 }), fe(_e, { orientation: "horizontal", itemSelector: "button" });
463
- const be = F(
391
+ [o, h, T, I, C, t, l]
392
+ ), ge = L(null), be = L(null);
393
+ ie(ge, { orientation: "vertical", typeahead: !0 }), ie(be, { orientation: "horizontal", itemSelector: "button" });
394
+ const ee = y(
464
395
  (e) => {
465
- if (E) {
466
- const l = {
467
- id: ve("flow"),
468
- sourceRef: E.fromId,
396
+ if (_) {
397
+ const s = {
398
+ id: ae("flow"),
399
+ sourceRef: _.fromId,
469
400
  targetRef: e
470
401
  };
471
- c?.({
472
- ...i,
473
- sequenceFlows: [...i.sequenceFlows, l]
474
- }), le(null);
402
+ l?.({
403
+ ...t,
404
+ sequenceFlows: [...t.sequenceFlows, s]
405
+ }), Z(null);
475
406
  } else
476
- G(e), Q(null);
407
+ z(e), B(null);
477
408
  },
478
- [E, i, c]
479
- ), De = F(
409
+ [_, t, l]
410
+ ), fe = y(
480
411
  (e) => {
481
- m || le({ fromId: e });
412
+ o || Z({ fromId: e });
482
413
  },
483
- [m]
484
- ), he = F(
414
+ [o]
415
+ ), ne = y(
485
416
  (e) => {
486
- m || (c?.({
487
- ...i,
488
- elements: i.elements.filter((l) => l.id !== e),
489
- sequenceFlows: i.sequenceFlows.filter(
490
- (l) => l.sourceRef !== e && l.targetRef !== e
417
+ o || (l?.({
418
+ ...t,
419
+ elements: t.elements.filter((s) => s.id !== e),
420
+ sequenceFlows: t.sequenceFlows.filter(
421
+ (s) => s.sourceRef !== e && s.targetRef !== e
491
422
  )
492
- }), L === e && G(null));
423
+ }), S === e && z(null));
493
424
  },
494
- [m, i, c, L]
495
- ), ze = F(
425
+ [o, t, l, S]
426
+ ), Se = y(
496
427
  (e) => {
497
- m || (c?.({
498
- ...i,
499
- sequenceFlows: i.sequenceFlows.filter((l) => l.id !== e)
500
- }), I === e && Q(null));
428
+ o || (l?.({
429
+ ...t,
430
+ sequenceFlows: t.sequenceFlows.filter((s) => s.id !== e)
431
+ }), R === e && B(null));
501
432
  },
502
- [m, i, c, I]
503
- ), Y = F(
504
- (e, l) => {
505
- m || c?.({
506
- ...i,
507
- elements: i.elements.map(
508
- (u) => u.id === e ? { ...u, ...l } : u
433
+ [o, t, l, R]
434
+ ), P = y(
435
+ (e, s) => {
436
+ o || l?.({
437
+ ...t,
438
+ elements: t.elements.map(
439
+ (r) => r.id === e ? { ...r, ...s } : r
509
440
  )
510
441
  });
511
442
  },
512
- [m, i, c]
513
- ), ye = F(
514
- (e, l) => {
515
- m || c?.({
516
- ...i,
517
- sequenceFlows: i.sequenceFlows.map(
518
- (u) => u.id === e ? { ...u, ...l } : u
443
+ [o, t, l]
444
+ ), te = y(
445
+ (e, s) => {
446
+ o || l?.({
447
+ ...t,
448
+ sequenceFlows: t.sequenceFlows.map(
449
+ (r) => r.id === e ? { ...r, ...s } : r
519
450
  )
520
451
  });
521
452
  },
522
- [m, i, c]
523
- ), Me = F(() => {
524
- if (m)
453
+ [o, t, l]
454
+ ), ze = y(() => {
455
+ if (o)
525
456
  return;
526
457
  const e = {
527
- id: ve("var"),
458
+ id: ae("var"),
528
459
  name: "newVariable",
529
460
  type: "string"
530
461
  };
531
- c?.({
532
- ...i,
533
- variables: [...i.variables || [], e]
462
+ l?.({
463
+ ...t,
464
+ variables: [...t.variables || [], e]
534
465
  });
535
- }, [m, i, c]), Re = F(() => {
536
- const e = i.elements.find(
537
- (l) => l.elementType === "event" && l.eventType === "startEvent"
466
+ }, [o, t, l]), Re = y(() => {
467
+ const e = t.elements.find(
468
+ (s) => s.elementType === "event" && s.eventType === "startEvent"
538
469
  );
539
- e && (r(e.id), n(!0));
540
- }, [i.elements]), Te = F(
470
+ e && (O(e.id), ue(!0));
471
+ }, [t.elements]), we = y(
541
472
  (e) => {
542
- const l = i.sequenceFlows.find((u) => u.id === e);
543
- l && r(l.targetRef);
473
+ const s = t.sequenceFlows.find((r) => r.id === e);
474
+ s && O(s.targetRef);
544
475
  },
545
- [i.sequenceFlows]
546
- ), $e = F(
476
+ [t.sequenceFlows]
477
+ ), $e = y(
547
478
  (e) => {
548
- const l = L === e.id, u = X && s === e.id, v = k.some((f) => f.elementId === e.id), T = X ? i.sequenceFlows.filter((f) => f.sourceRef === e.id) : [];
549
- let A, _ = "nice-bpmn-element", q = {
479
+ const s = S === e.id, r = $ && X === e.id, u = q.some((c) => c.elementId === e.id), b = $ ? t.sequenceFlows.filter((c) => c.sourceRef === e.id) : [];
480
+ let D, g = "nice-bpmn-element", x = {
550
481
  left: e.position.x,
551
482
  top: e.position.y
552
483
  };
553
484
  if (e.elementType === "event") {
554
- const f = Ve[e.eventDefinition], M = e.eventType === "startEvent", Le = e.eventType === "endEvent", Ge = e.eventType === "boundaryEvent";
555
- _ += " nice-bpmn-event", _ += M ? " nice-bpmn-event--start" : "", _ += Le ? " nice-bpmn-event--end" : "", _ += Ge ? " nice-bpmn-event--boundary" : "", A = /* @__PURE__ */ t("div", { className: "nice-bpmn-event__icon", title: e.name, children: /* @__PURE__ */ t(p, { name: f, size: 16 }) });
485
+ const c = Xe[e.eventDefinition], v = e.eventType === "startEvent", Be = e.eventType === "endEvent", Ge = e.eventType === "boundaryEvent";
486
+ g += " nice-bpmn-event", g += v ? " nice-bpmn-event--start" : "", g += Be ? " nice-bpmn-event--end" : "", g += Ge ? " nice-bpmn-event--boundary" : "", D = /* @__PURE__ */ n("div", { className: "nice-bpmn-event__icon", title: e.name, children: /* @__PURE__ */ n(p, { name: c, size: 16 }) });
556
487
  } else if (e.elementType === "task") {
557
- const f = Ze[e.taskType];
558
- _ += " nice-bpmn-task", _ += ` nice-bpmn-task--${e.taskType}`, q = {
559
- ...q,
488
+ const c = Le[e.taskType];
489
+ g += " nice-bpmn-task", g += ` nice-bpmn-task--${e.taskType}`, x = {
490
+ ...x,
560
491
  width: e.size?.width || 100,
561
492
  height: e.size?.height || 80
562
- }, A = /* @__PURE__ */ a(V, { children: [
563
- /* @__PURE__ */ t("span", { className: "nice-bpmn-task__icon", children: /* @__PURE__ */ t(p, { name: f, size: 16 }) }),
564
- /* @__PURE__ */ t("span", { className: "nice-bpmn-task__name", children: e.name }),
493
+ }, D = /* @__PURE__ */ a(M, { children: [
494
+ /* @__PURE__ */ n("span", { className: "nice-bpmn-task__icon", children: /* @__PURE__ */ n(p, { name: c, size: 16 }) }),
495
+ /* @__PURE__ */ n("span", { className: "nice-bpmn-task__name", children: e.name }),
565
496
  e.assignee && /* @__PURE__ */ a("span", { className: "nice-bpmn-task__assignee", children: [
566
- /* @__PURE__ */ t(p, { name: "user", size: 14 }),
497
+ /* @__PURE__ */ n(p, { name: "user", size: 14 }),
567
498
  " ",
568
499
  e.assignee
569
500
  ] }),
570
- e.sla && /* @__PURE__ */ t(
501
+ e.sla && /* @__PURE__ */ n(
571
502
  "span",
572
503
  {
573
504
  className: "nice-bpmn-task__sla",
574
- title: O("workflowDesigner.slaHH", "SLA: {warningHours}h / {criticalHours}h").replace("{warningHours}", String(e.sla.warningHours)).replace("{criticalHours}", String(e.sla.criticalHours)),
575
- children: /* @__PURE__ */ t(p, { name: "clock", size: 14 })
505
+ title: me("workflowDesigner.slaHH", "SLA: {warningHours}h / {criticalHours}h").replace("{warningHours}", String(e.sla.warningHours)).replace("{criticalHours}", String(e.sla.criticalHours)),
506
+ children: /* @__PURE__ */ n(p, { name: "clock", size: 14 })
576
507
  }
577
508
  ),
578
- e.loopCharacteristics && /* @__PURE__ */ t("span", { className: "nice-bpmn-task__loop", children: /* @__PURE__ */ t(
509
+ e.loopCharacteristics && /* @__PURE__ */ n("span", { className: "nice-bpmn-task__loop", children: /* @__PURE__ */ n(
579
510
  p,
580
511
  {
581
512
  name: e.loopCharacteristics.type === "multiInstanceParallel" ? "bars-vertical" : e.loopCharacteristics.type === "multiInstanceSequential" ? "menu" : "refresh",
@@ -584,89 +515,89 @@ const ot = ({
584
515
  ) })
585
516
  ] });
586
517
  } else if (e.elementType === "gateway") {
587
- const f = Oe[e.gatewayType];
588
- _ += " nice-bpmn-gateway", _ += ` nice-bpmn-gateway--${e.gatewayType}`, A = /* @__PURE__ */ t("div", { className: "nice-bpmn-gateway__diamond", children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(p, { name: f, size: 16 }) }) });
589
- } else e.elementType === "subprocess" && (_ += " nice-bpmn-subprocess", _ += e.isExpanded ? " nice-bpmn-subprocess--expanded" : "", q = {
590
- ...q,
518
+ const c = je[e.gatewayType];
519
+ g += " nice-bpmn-gateway", g += ` nice-bpmn-gateway--${e.gatewayType}`, D = /* @__PURE__ */ n("div", { className: "nice-bpmn-gateway__diamond", children: /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(p, { name: c, size: 16 }) }) });
520
+ } else e.elementType === "subprocess" && (g += " nice-bpmn-subprocess", g += e.isExpanded ? " nice-bpmn-subprocess--expanded" : "", x = {
521
+ ...x,
591
522
  width: e.size.width,
592
523
  height: e.size.height
593
- }, A = /* @__PURE__ */ a(V, { children: [
524
+ }, D = /* @__PURE__ */ a(M, { children: [
594
525
  /* @__PURE__ */ a("div", { className: "nice-bpmn-subprocess__header", children: [
595
- /* @__PURE__ */ t("span", { children: e.name }),
596
- /* @__PURE__ */ t(
526
+ /* @__PURE__ */ n("span", { children: e.name }),
527
+ /* @__PURE__ */ n(
597
528
  "button",
598
529
  {
599
530
  type: "button",
600
- onClick: (f) => {
601
- f.stopPropagation(), Y(e.id, {
531
+ onClick: (c) => {
532
+ c.stopPropagation(), P(e.id, {
602
533
  isExpanded: !e.isExpanded
603
534
  });
604
535
  },
605
- "aria-label": e.isExpanded ? o("workflowDesigner.collapse", "Collapse") : o("workflowDesigner.expand", "Expand"),
536
+ "aria-label": e.isExpanded ? i("workflowDesigner.collapse", "Collapse") : i("workflowDesigner.expand", "Expand"),
606
537
  children: e.isExpanded ? "−" : "+"
607
538
  }
608
539
  )
609
540
  ] }),
610
- e.isExpanded && /* @__PURE__ */ t("div", { className: "nice-bpmn-subprocess__content" })
541
+ e.isExpanded && /* @__PURE__ */ n("div", { className: "nice-bpmn-subprocess__content" })
611
542
  ] }));
612
- return l && (_ += " nice-bpmn-element--selected"), u && (_ += " nice-bpmn-element--active"), v && (_ += " nice-bpmn-element--has-issue"), /* @__PURE__ */ a(
543
+ return s && (g += " nice-bpmn-element--selected"), r && (g += " nice-bpmn-element--active"), u && (g += " nice-bpmn-element--has-issue"), /* @__PURE__ */ a(
613
544
  "div",
614
545
  {
615
- className: _,
616
- style: q,
617
- onClick: (f) => {
618
- f.stopPropagation(), be(e.id);
546
+ className: g,
547
+ style: x,
548
+ onClick: (c) => {
549
+ c.stopPropagation(), ee(e.id);
619
550
  },
620
551
  role: "button",
621
552
  tabIndex: 0,
622
553
  "aria-label": `${e.elementType}: ${e.name || e.id}`,
623
- onKeyDown: (f) => {
624
- f.key === "Enter" && be(e.id), f.key === "Delete" && !m && he(e.id);
554
+ onKeyDown: (c) => {
555
+ c.key === "Enter" && ee(e.id), c.key === "Delete" && !o && ne(e.id);
625
556
  },
626
557
  children: [
627
- A,
628
- !m && l && /* @__PURE__ */ a("div", { className: "nice-bpmn-element__actions", children: [
629
- /* @__PURE__ */ t(
558
+ D,
559
+ !o && s && /* @__PURE__ */ a("div", { className: "nice-bpmn-element__actions", children: [
560
+ /* @__PURE__ */ n(
630
561
  "button",
631
562
  {
632
563
  type: "button",
633
564
  className: "nice-bpmn-element__action nice-bpmn-element__action--connect",
634
- onClick: (f) => {
635
- f.stopPropagation(), De(e.id);
565
+ onClick: (c) => {
566
+ c.stopPropagation(), fe(e.id);
636
567
  },
637
- title: o("workflowDesigner.connect", "Connect"),
638
- "aria-label": o("workflowDesigner.startConnect", "Start connection"),
639
- children: /* @__PURE__ */ t(p, { name: "arrow-right", size: 14 })
568
+ title: i("workflowDesigner.connect", "Connect"),
569
+ "aria-label": i("workflowDesigner.startConnect", "Start connection"),
570
+ children: /* @__PURE__ */ n(p, { name: "arrow-right", size: 14 })
640
571
  }
641
572
  ),
642
- /* @__PURE__ */ t(
573
+ /* @__PURE__ */ n(
643
574
  "button",
644
575
  {
645
576
  type: "button",
646
577
  className: "nice-bpmn-element__action nice-bpmn-element__action--delete",
647
- onClick: (f) => {
648
- f.stopPropagation(), he(e.id);
578
+ onClick: (c) => {
579
+ c.stopPropagation(), ne(e.id);
649
580
  },
650
- title: o("workflowDesigner.delete", "Delete"),
651
- "aria-label": o("workflowDesigner.deleteElement", "Delete element"),
652
- children: /* @__PURE__ */ t(p, { name: "close", size: 12 })
581
+ title: i("workflowDesigner.delete", "Delete"),
582
+ "aria-label": i("workflowDesigner.deleteElement", "Delete element"),
583
+ children: /* @__PURE__ */ n(p, { name: "close", size: 12 })
653
584
  }
654
585
  )
655
586
  ] }),
656
- u && T.map((f) => /* @__PURE__ */ a(
587
+ r && b.map((c) => /* @__PURE__ */ a(
657
588
  "button",
658
589
  {
659
590
  type: "button",
660
591
  className: "nice-bpmn-element__sim-action",
661
- onClick: (M) => {
662
- M.stopPropagation(), Te(f.id);
592
+ onClick: (v) => {
593
+ v.stopPropagation(), we(c.id);
663
594
  },
664
595
  children: [
665
- /* @__PURE__ */ t(p, { name: "arrow-right", size: 12 }),
666
- f.name || i.elements.find((M) => M.id === f.targetRef)?.name || o("workflowDesigner.next", "Next")
596
+ /* @__PURE__ */ n(p, { name: "arrow-right", size: 12 }),
597
+ c.name || t.elements.find((v) => v.id === c.targetRef)?.name || i("workflowDesigner.next", "Next")
667
598
  ]
668
599
  },
669
- f.id
600
+ c.id
670
601
  ))
671
602
  ]
672
603
  },
@@ -674,29 +605,29 @@ const ot = ({
674
605
  );
675
606
  },
676
607
  [
677
- L,
608
+ S,
609
+ $,
678
610
  X,
679
- s,
680
- k,
681
- i.sequenceFlows,
682
- i.elements,
683
- m,
684
- be,
685
- De,
686
- he,
687
- Y,
688
- Te,
611
+ q,
612
+ t.sequenceFlows,
613
+ t.elements,
689
614
  o,
690
- O
615
+ ee,
616
+ fe,
617
+ ne,
618
+ P,
619
+ we,
620
+ i,
621
+ me
691
622
  ]
692
- ), Ae = F(() => /* @__PURE__ */ a(
623
+ ), Me = y(() => /* @__PURE__ */ a(
693
624
  "svg",
694
625
  {
695
626
  className: "nice-bpmn-flows",
696
627
  style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "visible" },
697
628
  children: [
698
629
  /* @__PURE__ */ a("defs", { children: [
699
- /* @__PURE__ */ t(
630
+ /* @__PURE__ */ n(
700
631
  "marker",
701
632
  {
702
633
  id: "arrowhead",
@@ -705,10 +636,10 @@ const ot = ({
705
636
  refX: "9",
706
637
  refY: "3.5",
707
638
  orient: "auto",
708
- children: /* @__PURE__ */ t("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--nice-text-secondary, #64748b)" })
639
+ children: /* @__PURE__ */ n("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--nice-text-secondary, #64748b)" })
709
640
  }
710
641
  ),
711
- /* @__PURE__ */ t(
642
+ /* @__PURE__ */ n(
712
643
  "marker",
713
644
  {
714
645
  id: "arrowhead-selected",
@@ -717,36 +648,36 @@ const ot = ({
717
648
  refX: "9",
718
649
  refY: "3.5",
719
650
  orient: "auto",
720
- children: /* @__PURE__ */ t("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--nice-color-primary, #3b82f6)" })
651
+ children: /* @__PURE__ */ n("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--nice-color-primary, #3b82f6)" })
721
652
  }
722
653
  )
723
654
  ] }),
724
- i.sequenceFlows.map((e) => {
725
- const l = i.elements.find((M) => M.id === e.sourceRef), u = i.elements.find((M) => M.id === e.targetRef);
726
- if (!l || !u)
655
+ t.sequenceFlows.map((e) => {
656
+ const s = t.elements.find((v) => v.id === e.sourceRef), r = t.elements.find((v) => v.id === e.targetRef);
657
+ if (!s || !r)
727
658
  return null;
728
- const v = I === e.id, T = l.position.x + (l.elementType === "task" ? l.size?.width || 100 : l.elementType === "gateway" ? 25 : 15), A = l.position.y + (l.elementType === "task" ? (l.size?.height || 80) / 2 : l.elementType === "gateway" ? 25 : 15), _ = u.position.x, q = u.position.y + (u.elementType === "task" ? (u.size?.height || 80) / 2 : u.elementType === "gateway" ? 25 : 15), f = e.waypoints && e.waypoints.length > 0 ? `M ${T} ${A} ${e.waypoints.map((M) => `L ${M.x} ${M.y}`).join(" ")} L ${_} ${q}` : `M ${T} ${A} L ${_} ${q}`;
659
+ const u = R === e.id, b = s.position.x + (s.elementType === "task" ? s.size?.width || 100 : s.elementType === "gateway" ? 25 : 15), D = s.position.y + (s.elementType === "task" ? (s.size?.height || 80) / 2 : s.elementType === "gateway" ? 25 : 15), g = r.position.x, x = r.position.y + (r.elementType === "task" ? (r.size?.height || 80) / 2 : r.elementType === "gateway" ? 25 : 15), c = e.waypoints && e.waypoints.length > 0 ? `M ${b} ${D} ${e.waypoints.map((v) => `L ${v.x} ${v.y}`).join(" ")} L ${g} ${x}` : `M ${b} ${D} L ${g} ${x}`;
729
660
  return /* @__PURE__ */ a("g", { children: [
730
- /* @__PURE__ */ t(
661
+ /* @__PURE__ */ n(
731
662
  "path",
732
663
  {
733
- d: f,
664
+ d: c,
734
665
  fill: "none",
735
- stroke: v ? "var(--nice-color-primary, #3b82f6)" : "var(--nice-text-muted, #64748b)",
736
- strokeWidth: v ? 3 : 2,
666
+ stroke: u ? "var(--nice-color-primary, #3b82f6)" : "var(--nice-text-muted, #64748b)",
667
+ strokeWidth: u ? 3 : 2,
737
668
  strokeDasharray: e.isDefault ? "5,5" : void 0,
738
- markerEnd: v ? "url(#arrowhead-selected)" : "url(#arrowhead)",
669
+ markerEnd: u ? "url(#arrowhead-selected)" : "url(#arrowhead)",
739
670
  style: { pointerEvents: "stroke", cursor: "pointer" },
740
671
  onClick: () => {
741
- Q(e.id), G(null);
672
+ B(e.id), z(null);
742
673
  }
743
674
  }
744
675
  ),
745
- e.name && /* @__PURE__ */ t(
676
+ e.name && /* @__PURE__ */ n(
746
677
  "text",
747
678
  {
748
- x: (T + _) / 2,
749
- y: (A + q) / 2 - 5,
679
+ x: (b + g) / 2,
680
+ y: (D + x) / 2 - 5,
750
681
  textAnchor: "middle",
751
682
  fontSize: "11",
752
683
  fill: "var(--nice-text-secondary, #64748b)",
@@ -756,8 +687,8 @@ const ot = ({
756
687
  e.conditionExpression && /* @__PURE__ */ a(
757
688
  "text",
758
689
  {
759
- x: (T + _) / 2,
760
- y: (A + q) / 2 + 10,
690
+ x: (b + g) / 2,
691
+ y: (D + x) / 2 + 10,
761
692
  textAnchor: "middle",
762
693
  fontSize: "10",
763
694
  fill: "var(--nice-text-muted, #94a3b8)",
@@ -771,13 +702,13 @@ const ot = ({
771
702
  )
772
703
  ] }, e.id);
773
704
  }),
774
- E && /* @__PURE__ */ t(
705
+ _ && /* @__PURE__ */ n(
775
706
  "line",
776
707
  {
777
- x1: i.elements.find((e) => e.id === E.fromId)?.position.x || 0,
778
- y1: i.elements.find((e) => e.id === E.fromId)?.position.y || 0,
779
- x2: i.elements.find((e) => e.id === E.fromId)?.position.x || 0,
780
- y2: i.elements.find((e) => e.id === E.fromId)?.position.y || 0,
708
+ x1: t.elements.find((e) => e.id === _.fromId)?.position.x || 0,
709
+ y1: t.elements.find((e) => e.id === _.fromId)?.position.y || 0,
710
+ x2: t.elements.find((e) => e.id === _.fromId)?.position.x || 0,
711
+ y2: t.elements.find((e) => e.id === _.fromId)?.position.y || 0,
781
712
  stroke: "var(--nice-color-primary, #3b82f6)",
782
713
  strokeWidth: "2",
783
714
  strokeDasharray: "5,5"
@@ -785,182 +716,182 @@ const ot = ({
785
716
  )
786
717
  ]
787
718
  }
788
- ), [i.sequenceFlows, i.elements, I, E]), qe = D ? /* @__PURE__ */ a(
719
+ ), [t.sequenceFlows, t.elements, R, _]), Ae = w ? /* @__PURE__ */ a(
789
720
  "div",
790
721
  {
791
- ref: _e,
722
+ ref: be,
792
723
  className: "nice-bpmn-designer__toolbar",
793
724
  role: "toolbar",
794
- "aria-label": o("workflowDesigner.bpmnToolbar", "BPMN designer toolbar"),
725
+ "aria-label": i("workflowDesigner.bpmnToolbar", "BPMN designer toolbar"),
795
726
  children: [
796
727
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__toolbar-group", children: [
797
- /* @__PURE__ */ t(
728
+ /* @__PURE__ */ n(
798
729
  "button",
799
730
  {
800
731
  type: "button",
801
- onClick: () => te((e) => Math.min(e + 0.1, 2)),
802
- title: o("workflowDesigner.zoomIn", "Zoom in"),
803
- "aria-label": o("workflowDesigner.zoomIn", "Zoom in"),
804
- children: /* @__PURE__ */ t(p, { name: "plus", size: 14 })
732
+ onClick: () => G((e) => Math.min(e + 0.1, 2)),
733
+ title: i("workflowDesigner.zoomIn", "Zoom in"),
734
+ "aria-label": i("workflowDesigner.zoomIn", "Zoom in"),
735
+ children: /* @__PURE__ */ n(p, { name: "plus", size: 14 })
805
736
  }
806
737
  ),
807
738
  /* @__PURE__ */ a("span", { className: "nice-bpmn-designer__zoom-label", children: [
808
- Math.round(z * 100),
739
+ Math.round(T * 100),
809
740
  "%"
810
741
  ] }),
811
- /* @__PURE__ */ t(
742
+ /* @__PURE__ */ n(
812
743
  "button",
813
744
  {
814
745
  type: "button",
815
- onClick: () => te((e) => Math.max(e - 0.1, 0.5)),
816
- title: o("workflowDesigner.zoomOut", "Zoom out"),
817
- "aria-label": o("workflowDesigner.zoomOut", "Zoom out"),
818
- children: /* @__PURE__ */ t(p, { name: "minus", size: 14 })
746
+ onClick: () => G((e) => Math.max(e - 0.1, 0.5)),
747
+ title: i("workflowDesigner.zoomOut", "Zoom out"),
748
+ "aria-label": i("workflowDesigner.zoomOut", "Zoom out"),
749
+ children: /* @__PURE__ */ n(p, { name: "minus", size: 14 })
819
750
  }
820
751
  ),
821
- /* @__PURE__ */ t(
752
+ /* @__PURE__ */ n(
822
753
  "button",
823
754
  {
824
755
  type: "button",
825
756
  onClick: () => {
826
- te(1), ee({ x: 0, y: 0 });
757
+ G(1), U({ x: 0, y: 0 });
827
758
  },
828
- title: o("workflowDesigner.resetView", "Reset view"),
829
- "aria-label": o("workflowDesigner.resetView", "Reset view"),
830
- children: /* @__PURE__ */ t(p, { name: "refresh", size: 14 })
759
+ title: i("workflowDesigner.resetView", "Reset view"),
760
+ "aria-label": i("workflowDesigner.resetView", "Reset view"),
761
+ children: /* @__PURE__ */ n(p, { name: "refresh", size: 14 })
831
762
  }
832
763
  )
833
764
  ] }),
834
765
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__toolbar-group", children: [
835
- !m && /* @__PURE__ */ a(V, { children: [
766
+ !o && /* @__PURE__ */ a(M, { children: [
836
767
  /* @__PURE__ */ a(
837
768
  "button",
838
769
  {
839
770
  type: "button",
840
771
  onClick: Re,
841
- disabled: w.length > 0 || X,
842
- title: o("workflowDesigner.simulateFlow", "Simulate flow"),
772
+ disabled: Q.length > 0 || $,
773
+ title: i("workflowDesigner.simulateFlow", "Simulate flow"),
843
774
  children: [
844
- /* @__PURE__ */ t(p, { name: "play", size: 14 }),
775
+ /* @__PURE__ */ n(p, { name: "play", size: 14 }),
845
776
  " ",
846
- o("workflowDesigner.simulate", "Simulate")
777
+ i("workflowDesigner.simulate", "Simulate")
847
778
  ]
848
779
  }
849
780
  ),
850
- X && /* @__PURE__ */ a(
781
+ $ && /* @__PURE__ */ a(
851
782
  "button",
852
783
  {
853
784
  type: "button",
854
785
  onClick: () => {
855
- n(!1), r(null);
786
+ ue(!1), O(null);
856
787
  },
857
788
  children: [
858
- /* @__PURE__ */ t(p, { name: "stop", size: 14 }),
789
+ /* @__PURE__ */ n(p, { name: "stop", size: 14 }),
859
790
  " ",
860
- o("workflowDesigner.stop", "Stop")
791
+ i("workflowDesigner.stop", "Stop")
861
792
  ]
862
793
  }
863
794
  )
864
795
  ] }),
865
- me && /* @__PURE__ */ a(
796
+ le && /* @__PURE__ */ a(
866
797
  "button",
867
798
  {
868
799
  type: "button",
869
- onClick: () => me(i),
870
- title: o("workflowDesigner.testProcess", "Test process"),
800
+ onClick: () => le(t),
801
+ title: i("workflowDesigner.testProcess", "Test process"),
871
802
  children: [
872
- /* @__PURE__ */ t(p, { name: "flask", size: 14 }),
803
+ /* @__PURE__ */ n(p, { name: "flask", size: 14 }),
873
804
  " ",
874
- o("workflowDesigner.test", "Test")
805
+ i("workflowDesigner.test", "Test")
875
806
  ]
876
807
  }
877
808
  ),
878
- ae && !m && /* @__PURE__ */ a(
809
+ re && !o && /* @__PURE__ */ a(
879
810
  "button",
880
811
  {
881
812
  type: "button",
882
- onClick: () => ae(i),
883
- disabled: w.length > 0,
884
- title: o("workflowDesigner.publishProcess", "Publish process"),
813
+ onClick: () => re(t),
814
+ disabled: Q.length > 0,
815
+ title: i("workflowDesigner.publishProcess", "Publish process"),
885
816
  children: [
886
- /* @__PURE__ */ t(p, { name: "rocket", size: 14 }),
817
+ /* @__PURE__ */ n(p, { name: "rocket", size: 14 }),
887
818
  " ",
888
- o("workflowDesigner.publish", "Publish")
819
+ i("workflowDesigner.publish", "Publish")
889
820
  ]
890
821
  }
891
822
  ),
892
- h && /* @__PURE__ */ a(
823
+ oe && /* @__PURE__ */ a(
893
824
  "button",
894
825
  {
895
826
  type: "button",
896
- onClick: () => h("<bpmn>"),
897
- title: o("workflowDesigner.exportBpmn", "Export BPMN XML"),
827
+ onClick: () => oe("<bpmn>"),
828
+ title: i("workflowDesigner.exportBpmn", "Export BPMN XML"),
898
829
  children: [
899
- /* @__PURE__ */ t(p, { name: "upload", size: 14 }),
830
+ /* @__PURE__ */ n(p, { name: "upload", size: 14 }),
900
831
  " ",
901
- o("workflowDesigner.export", "Export")
832
+ i("workflowDesigner.export", "Export")
902
833
  ]
903
834
  }
904
835
  ),
905
- oe && !m && /* @__PURE__ */ a(
836
+ ce && !o && /* @__PURE__ */ a(
906
837
  "button",
907
838
  {
908
839
  type: "button",
909
- onClick: oe,
910
- title: o("workflowDesigner.importBpmn", "Import BPMN XML"),
840
+ onClick: ce,
841
+ title: i("workflowDesigner.importBpmn", "Import BPMN XML"),
911
842
  children: [
912
- /* @__PURE__ */ t(p, { name: "download", size: 14 }),
843
+ /* @__PURE__ */ n(p, { name: "download", size: 14 }),
913
844
  " ",
914
- o("workflowDesigner.import", "Import")
845
+ i("workflowDesigner.import", "Import")
915
846
  ]
916
847
  }
917
848
  )
918
849
  ] })
919
850
  ]
920
851
  }
921
- ) : void 0, He = N && !m ? /* @__PURE__ */ a(
852
+ ) : void 0, qe = N && !o ? /* @__PURE__ */ a(
922
853
  "aside",
923
854
  {
924
855
  className: "nice-bpmn-designer__palette",
925
- "aria-label": o("workflowDesigner.palette", "BPMN element palette"),
856
+ "aria-label": i("workflowDesigner.palette", "BPMN element palette"),
926
857
  children: [
927
- /* @__PURE__ */ t("div", { className: "nice-bpmn-designer__palette-tabs", ref: W, role: "tablist", children: ["events", "tasks", "gateways", "subprocesses", "artifacts"].map((e) => /* @__PURE__ */ t(
858
+ /* @__PURE__ */ n("div", { className: "nice-bpmn-designer__palette-tabs", ref: de, role: "tablist", children: ["events", "tasks", "gateways", "subprocesses", "artifacts"].map((e) => /* @__PURE__ */ n(
928
859
  "button",
929
860
  {
930
861
  type: "button",
931
862
  role: "tab",
932
- "aria-selected": ie === e,
933
- className: `nice-bpmn-designer__palette-tab${ie === e ? " nice-bpmn-designer__palette-tab--active" : ""}`,
934
- onClick: () => ue(e),
935
- "aria-label": o(`workflowDesigner.cat.${e}`, Ee[e]),
936
- title: o(`workflowDesigner.cat.${e}`, Ee[e]),
937
- children: /* @__PURE__ */ t(p, { name: Je[e], size: 16 })
863
+ "aria-selected": H === e,
864
+ className: `nice-bpmn-designer__palette-tab${H === e ? " nice-bpmn-designer__palette-tab--active" : ""}`,
865
+ onClick: () => Ee(e),
866
+ "aria-label": i(`workflowDesigner.cat.${e}`, ve[e]),
867
+ title: i(`workflowDesigner.cat.${e}`, ve[e]),
868
+ children: /* @__PURE__ */ n(p, { name: Ke[e], size: 16 })
938
869
  },
939
870
  e
940
871
  )) }),
941
- /* @__PURE__ */ t(
872
+ /* @__PURE__ */ n(
942
873
  "div",
943
874
  {
944
- ref: ke,
875
+ ref: ge,
945
876
  className: "nice-bpmn-designer__palette-items",
946
877
  role: "listbox",
947
- "aria-label": o("workflowDesigner.palette", "BPMN element palette"),
948
- children: Ce.map((e) => /* @__PURE__ */ a(
878
+ "aria-label": i("workflowDesigner.palette", "BPMN element palette"),
879
+ children: Pe.map((e) => /* @__PURE__ */ a(
949
880
  "div",
950
881
  {
951
882
  className: "nice-bpmn-designer__palette-item",
952
883
  draggable: !0,
953
- onDragStart: () => U(e),
954
- onDragEnd: () => U(null),
955
- onKeyDown: (l) => {
956
- (l.key === "Enter" || l.key === " ") && (l.preventDefault(), Ie(e));
884
+ onDragStart: () => W(e),
885
+ onDragEnd: () => W(null),
886
+ onKeyDown: (s) => {
887
+ (s.key === "Enter" || s.key === " ") && (s.preventDefault(), Ce(e));
957
888
  },
958
889
  role: "option",
959
890
  "aria-selected": !1,
960
891
  "aria-label": e.label,
961
892
  children: [
962
- /* @__PURE__ */ t("span", { className: "nice-bpmn-designer__palette-icon", children: /* @__PURE__ */ t(p, { name: e.icon, size: 16 }) }),
963
- /* @__PURE__ */ t("span", { className: "nice-bpmn-designer__palette-label", children: e.label })
893
+ /* @__PURE__ */ n("span", { className: "nice-bpmn-designer__palette-icon", children: /* @__PURE__ */ n(p, { name: e.icon, size: 16 }) }),
894
+ /* @__PURE__ */ n("span", { className: "nice-bpmn-designer__palette-label", children: e.label })
964
895
  ]
965
896
  },
966
897
  e.id
@@ -969,89 +900,89 @@ const ot = ({
969
900
  )
970
901
  ]
971
902
  }
972
- ) : void 0, xe = K && (g || C) && !m, Be = xe || de ? /* @__PURE__ */ a("div", { style: { display: "flex", height: "100%", minHeight: 0 }, children: [
973
- xe && /* @__PURE__ */ a(
903
+ ) : void 0, ye = A && (m || k) && !o, Ie = ye || se ? /* @__PURE__ */ a("div", { style: { display: "flex", height: "100%", minHeight: 0 }, children: [
904
+ ye && /* @__PURE__ */ a(
974
905
  "aside",
975
906
  {
976
907
  className: "nice-bpmn-designer__properties",
977
- "aria-label": o("workflowDesigner.properties", "Properties"),
908
+ "aria-label": i("workflowDesigner.properties", "Properties"),
978
909
  children: [
979
- g && /* @__PURE__ */ a(V, { children: [
980
- /* @__PURE__ */ t("h3", { children: o("workflowDesigner.propertiesOf", "Properties: {name}").replace(
910
+ m && /* @__PURE__ */ a(M, { children: [
911
+ /* @__PURE__ */ n("h3", { children: i("workflowDesigner.propertiesOf", "Properties: {name}").replace(
981
912
  "{name}",
982
- g.name || g.id
913
+ m.name || m.id
983
914
  ) }),
984
915
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
985
- /* @__PURE__ */ t("label", { htmlFor: "prop-name", children: o("workflowDesigner.name", "Name") }),
986
- /* @__PURE__ */ t(
916
+ /* @__PURE__ */ n("label", { htmlFor: "prop-name", children: i("workflowDesigner.name", "Name") }),
917
+ /* @__PURE__ */ n(
987
918
  "input",
988
919
  {
989
920
  id: "prop-name",
990
921
  type: "text",
991
- value: g.name || "",
992
- onChange: (e) => Y(g.id, {
922
+ value: m.name || "",
923
+ onChange: (e) => P(m.id, {
993
924
  name: e.target.value
994
925
  })
995
926
  }
996
927
  )
997
928
  ] }),
998
- g.elementType === "task" && /* @__PURE__ */ a(V, { children: [
929
+ m.elementType === "task" && /* @__PURE__ */ a(M, { children: [
999
930
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1000
- /* @__PURE__ */ t("label", { htmlFor: "prop-assignee", children: o("workflowDesigner.assignee", "Assigned to") }),
931
+ /* @__PURE__ */ n("label", { htmlFor: "prop-assignee", children: i("workflowDesigner.assignee", "Assigned to") }),
1001
932
  /* @__PURE__ */ a(
1002
933
  "select",
1003
934
  {
1004
935
  id: "prop-assignee",
1005
- value: g.assignee || "",
1006
- onChange: (e) => Y(g.id, {
936
+ value: m.assignee || "",
937
+ onChange: (e) => P(m.id, {
1007
938
  assignee: e.target.value
1008
939
  }),
1009
940
  children: [
1010
- /* @__PURE__ */ t("option", { value: "", children: o("workflowDesigner.select", "— Select —") }),
1011
- b.map((e) => /* @__PURE__ */ t("option", { value: e.id, children: e.name }, e.id))
941
+ /* @__PURE__ */ n("option", { value: "", children: i("workflowDesigner.select", "— Select —") }),
942
+ f.map((e) => /* @__PURE__ */ n("option", { value: e.id, children: e.name }, e.id))
1012
943
  ]
1013
944
  }
1014
945
  )
1015
946
  ] }),
1016
947
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1017
- /* @__PURE__ */ t("label", { htmlFor: "prop-dueDate", children: o("workflowDesigner.dueDate", "Due date") }),
1018
- /* @__PURE__ */ t(
948
+ /* @__PURE__ */ n("label", { htmlFor: "prop-dueDate", children: i("workflowDesigner.dueDate", "Due date") }),
949
+ /* @__PURE__ */ n(
1019
950
  "input",
1020
951
  {
1021
952
  id: "prop-dueDate",
1022
953
  type: "text",
1023
- placeholder: o("workflowDesigner.dueDatePlaceholder", "P3D (3 days)"),
1024
- value: g.dueDate || "",
1025
- onChange: (e) => Y(g.id, {
954
+ placeholder: i("workflowDesigner.dueDatePlaceholder", "P3D (3 days)"),
955
+ value: m.dueDate || "",
956
+ onChange: (e) => P(m.id, {
1026
957
  dueDate: e.target.value
1027
958
  })
1028
959
  }
1029
960
  )
1030
961
  ] }),
1031
962
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1032
- /* @__PURE__ */ t("label", { htmlFor: "prop-priority", children: o("workflowDesigner.priority", "Priority") }),
1033
- /* @__PURE__ */ t(
963
+ /* @__PURE__ */ n("label", { htmlFor: "prop-priority", children: i("workflowDesigner.priority", "Priority") }),
964
+ /* @__PURE__ */ n(
1034
965
  "input",
1035
966
  {
1036
967
  id: "prop-priority",
1037
968
  type: "number",
1038
969
  min: "0",
1039
970
  max: "100",
1040
- value: g.priority || 50,
1041
- onChange: (e) => Y(g.id, {
971
+ value: m.priority || 50,
972
+ onChange: (e) => P(m.id, {
1042
973
  priority: parseInt(e.target.value)
1043
974
  })
1044
975
  }
1045
976
  )
1046
977
  ] }),
1047
978
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1048
- /* @__PURE__ */ t("label", { htmlFor: "prop-documentation", children: o("workflowDesigner.documentation", "Documentation") }),
1049
- /* @__PURE__ */ t(
979
+ /* @__PURE__ */ n("label", { htmlFor: "prop-documentation", children: i("workflowDesigner.documentation", "Documentation") }),
980
+ /* @__PURE__ */ n(
1050
981
  "textarea",
1051
982
  {
1052
983
  id: "prop-documentation",
1053
- value: g.documentation || "",
1054
- onChange: (e) => Y(g.id, {
984
+ value: m.documentation || "",
985
+ onChange: (e) => P(m.id, {
1055
986
  documentation: e.target.value
1056
987
  }),
1057
988
  rows: 3
@@ -1059,93 +990,93 @@ const ot = ({
1059
990
  )
1060
991
  ] })
1061
992
  ] }),
1062
- g.elementType === "event" && g.eventDefinition === "timer" && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1063
- /* @__PURE__ */ t("label", { htmlFor: "prop-timer", children: o("workflowDesigner.timer", "Timer (ISO 8601)") }),
1064
- /* @__PURE__ */ t(
993
+ m.elementType === "event" && m.eventDefinition === "timer" && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
994
+ /* @__PURE__ */ n("label", { htmlFor: "prop-timer", children: i("workflowDesigner.timer", "Timer (ISO 8601)") }),
995
+ /* @__PURE__ */ n(
1065
996
  "input",
1066
997
  {
1067
998
  id: "prop-timer",
1068
999
  type: "text",
1069
- placeholder: o(
1000
+ placeholder: i(
1070
1001
  "workflowDesigner.timerPlaceholder",
1071
1002
  "PT1H (1 hour) or R3/PT1H (3 repetitions)"
1072
1003
  ),
1073
- value: g.timerDefinition?.expression || "",
1074
- onChange: (e) => Y(g.id, {
1004
+ value: m.timerDefinition?.expression || "",
1005
+ onChange: (e) => P(m.id, {
1075
1006
  timerDefinition: { type: "duration", expression: e.target.value }
1076
1007
  })
1077
1008
  }
1078
1009
  )
1079
1010
  ] }),
1080
- g.elementType === "gateway" && g.gatewayType === "exclusiveGateway" && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1081
- /* @__PURE__ */ t("label", { htmlFor: "prop-default", children: o("workflowDesigner.defaultFlow", "Default flow") }),
1011
+ m.elementType === "gateway" && m.gatewayType === "exclusiveGateway" && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1012
+ /* @__PURE__ */ n("label", { htmlFor: "prop-default", children: i("workflowDesigner.defaultFlow", "Default flow") }),
1082
1013
  /* @__PURE__ */ a(
1083
1014
  "select",
1084
1015
  {
1085
1016
  id: "prop-default",
1086
- value: g.defaultFlow || "",
1087
- onChange: (e) => Y(g.id, {
1017
+ value: m.defaultFlow || "",
1018
+ onChange: (e) => P(m.id, {
1088
1019
  defaultFlow: e.target.value
1089
1020
  }),
1090
1021
  children: [
1091
- /* @__PURE__ */ t("option", { value: "", children: o("workflowDesigner.select", "— Select —") }),
1092
- i.sequenceFlows.filter((e) => e.sourceRef === g.id).map((e) => /* @__PURE__ */ t("option", { value: e.id, children: e.name || e.id }, e.id))
1022
+ /* @__PURE__ */ n("option", { value: "", children: i("workflowDesigner.select", "— Select —") }),
1023
+ t.sequenceFlows.filter((e) => e.sourceRef === m.id).map((e) => /* @__PURE__ */ n("option", { value: e.id, children: e.name || e.id }, e.id))
1093
1024
  ]
1094
1025
  }
1095
1026
  )
1096
1027
  ] })
1097
1028
  ] }),
1098
- C && /* @__PURE__ */ a(V, { children: [
1099
- /* @__PURE__ */ t("h3", { children: o("workflowDesigner.flowOf", "Flow: {name}").replace(
1029
+ k && /* @__PURE__ */ a(M, { children: [
1030
+ /* @__PURE__ */ n("h3", { children: i("workflowDesigner.flowOf", "Flow: {name}").replace(
1100
1031
  "{name}",
1101
- C.name || C.id
1032
+ k.name || k.id
1102
1033
  ) }),
1103
1034
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1104
- /* @__PURE__ */ t("label", { htmlFor: "flow-name", children: o("workflowDesigner.name", "Name") }),
1105
- /* @__PURE__ */ t(
1035
+ /* @__PURE__ */ n("label", { htmlFor: "flow-name", children: i("workflowDesigner.name", "Name") }),
1036
+ /* @__PURE__ */ n(
1106
1037
  "input",
1107
1038
  {
1108
1039
  id: "flow-name",
1109
1040
  type: "text",
1110
- value: C.name || "",
1111
- onChange: (e) => ye(C.id, { name: e.target.value })
1041
+ value: k.name || "",
1042
+ onChange: (e) => te(k.id, { name: e.target.value })
1112
1043
  }
1113
1044
  )
1114
1045
  ] }),
1115
1046
  /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
1116
- /* @__PURE__ */ t("label", { htmlFor: "flow-condition", children: o("workflowDesigner.condition", "Condition") }),
1117
- /* @__PURE__ */ t(
1047
+ /* @__PURE__ */ n("label", { htmlFor: "flow-condition", children: i("workflowDesigner.condition", "Condition") }),
1048
+ /* @__PURE__ */ n(
1118
1049
  "input",
1119
1050
  {
1120
1051
  id: "flow-condition",
1121
1052
  type: "text",
1122
1053
  placeholder: "${amount > 1000}",
1123
- value: C.conditionExpression || "",
1124
- onChange: (e) => ye(C.id, { conditionExpression: e.target.value })
1054
+ value: k.conditionExpression || "",
1055
+ onChange: (e) => te(k.id, { conditionExpression: e.target.value })
1125
1056
  }
1126
1057
  )
1127
1058
  ] }),
1128
- /* @__PURE__ */ t("div", { className: "nice-bpmn-designer__property", children: /* @__PURE__ */ a("label", { children: [
1129
- /* @__PURE__ */ t(
1059
+ /* @__PURE__ */ n("div", { className: "nice-bpmn-designer__property", children: /* @__PURE__ */ a("label", { children: [
1060
+ /* @__PURE__ */ n(
1130
1061
  "input",
1131
1062
  {
1132
1063
  type: "checkbox",
1133
- checked: C.isDefault || !1,
1134
- onChange: (e) => ye(C.id, { isDefault: e.target.checked })
1064
+ checked: k.isDefault || !1,
1065
+ onChange: (e) => te(k.id, { isDefault: e.target.checked })
1135
1066
  }
1136
1067
  ),
1137
- o("workflowDesigner.defaultFlow", "Default flow")
1068
+ i("workflowDesigner.defaultFlow", "Default flow")
1138
1069
  ] }) }),
1139
1070
  /* @__PURE__ */ a(
1140
1071
  "button",
1141
1072
  {
1142
1073
  type: "button",
1143
1074
  className: "nice-bpmn-designer__delete-flow",
1144
- onClick: () => ze(C.id),
1075
+ onClick: () => Se(k.id),
1145
1076
  children: [
1146
- /* @__PURE__ */ t(p, { name: "trash", size: 14 }),
1077
+ /* @__PURE__ */ n(p, { name: "trash", size: 14 }),
1147
1078
  " ",
1148
- o("workflowDesigner.deleteFlow", "Delete flow")
1079
+ i("workflowDesigner.deleteFlow", "Delete flow")
1149
1080
  ]
1150
1081
  }
1151
1082
  )
@@ -1153,83 +1084,83 @@ const ot = ({
1153
1084
  ]
1154
1085
  }
1155
1086
  ),
1156
- de && /* @__PURE__ */ a(
1087
+ se && /* @__PURE__ */ a(
1157
1088
  "aside",
1158
1089
  {
1159
1090
  className: "nice-bpmn-designer__variables",
1160
- "aria-label": o("workflowDesigner.variables", "Process variables"),
1091
+ "aria-label": i("workflowDesigner.variables", "Process variables"),
1161
1092
  children: [
1162
- /* @__PURE__ */ t("h3", { children: o("workflowDesigner.variables", "Process variables") }),
1163
- /* @__PURE__ */ t("ul", { className: "nice-bpmn-designer__variable-list", children: (i.variables || []).map((e) => /* @__PURE__ */ a("li", { className: "nice-bpmn-designer__variable-item", children: [
1164
- /* @__PURE__ */ t("span", { className: "nice-bpmn-designer__variable-name", children: e.name }),
1165
- /* @__PURE__ */ t("span", { className: "nice-bpmn-designer__variable-type", children: e.type })
1093
+ /* @__PURE__ */ n("h3", { children: i("workflowDesigner.variables", "Process variables") }),
1094
+ /* @__PURE__ */ n("ul", { className: "nice-bpmn-designer__variable-list", children: (t.variables || []).map((e) => /* @__PURE__ */ a("li", { className: "nice-bpmn-designer__variable-item", children: [
1095
+ /* @__PURE__ */ n("span", { className: "nice-bpmn-designer__variable-name", children: e.name }),
1096
+ /* @__PURE__ */ n("span", { className: "nice-bpmn-designer__variable-type", children: e.type })
1166
1097
  ] }, e.id)) }),
1167
- !m && /* @__PURE__ */ a("button", { type: "button", onClick: Me, children: [
1098
+ !o && /* @__PURE__ */ a("button", { type: "button", onClick: ze, children: [
1168
1099
  "+ ",
1169
- o("workflowDesigner.addVariable", "Add variable")
1100
+ i("workflowDesigner.addVariable", "Add variable")
1170
1101
  ] })
1171
1102
  ]
1172
1103
  }
1173
1104
  )
1174
1105
  ] }) : void 0;
1175
- return /* @__PURE__ */ t(
1176
- Pe,
1106
+ return /* @__PURE__ */ n(
1107
+ Ye,
1177
1108
  {
1178
1109
  flush: !0,
1179
- className: `nice-bpmn-designer${m ? " nice-bpmn-designer--readonly" : ""} ${y ?? ""}`,
1180
- style: se,
1181
- "data-testid": B,
1182
- toolbar: qe,
1183
- sidebar: He,
1184
- rightSidebar: Be,
1185
- bottomPanel: X ? /* @__PURE__ */ t("div", { className: "nice-bpmn-designer__simulation-bar", children: /* @__PURE__ */ a("span", { children: [
1186
- /* @__PURE__ */ t(p, { name: "video", size: 14 }),
1187
- o("workflowDesigner.simActiveElement", "Simulation active — current element:"),
1110
+ className: `nice-bpmn-designer${o ? " nice-bpmn-designer--readonly" : ""} ${Te ?? ""}`,
1111
+ style: De,
1112
+ "data-testid": xe,
1113
+ toolbar: Ae,
1114
+ sidebar: qe,
1115
+ rightSidebar: Ie,
1116
+ bottomPanel: $ ? /* @__PURE__ */ n("div", { className: "nice-bpmn-designer__simulation-bar", children: /* @__PURE__ */ a("span", { children: [
1117
+ /* @__PURE__ */ n(p, { name: "video", size: 14 }),
1118
+ i("workflowDesigner.simActiveElement", "Simulation active — current element:"),
1188
1119
  " ",
1189
- /* @__PURE__ */ t("strong", { children: i.elements.find((e) => e.id === s)?.name || s })
1120
+ /* @__PURE__ */ n("strong", { children: t.elements.find((e) => e.id === X)?.name || X })
1190
1121
  ] }) }) : void 0,
1191
1122
  children: /* @__PURE__ */ a("div", { style: { position: "relative", height: "100%", overflow: "hidden" }, children: [
1192
1123
  /* @__PURE__ */ a(
1193
1124
  "div",
1194
1125
  {
1195
- className: `nice-bpmn-designer__canvas${re ? " nice-bpmn-designer__canvas--panning" : ""}`,
1126
+ className: `nice-bpmn-designer__canvas${J ? " nice-bpmn-designer__canvas--panning" : ""}`,
1196
1127
  onDragOver: (e) => e.preventDefault(),
1197
1128
  onDrop: Fe,
1198
1129
  onClick: () => {
1199
- G(null), Q(null), le(null);
1130
+ z(null), B(null), Z(null);
1200
1131
  },
1201
1132
  onWheel: (e) => {
1202
1133
  if (e.ctrlKey || e.metaKey) {
1203
1134
  e.preventDefault();
1204
- const v = -e.deltaY * 15e-4;
1205
- te((T) => Math.max(0.25, Math.min(3, T + v)));
1135
+ const u = -e.deltaY * 15e-4;
1136
+ G((b) => Math.max(0.25, Math.min(3, b + u)));
1206
1137
  return;
1207
1138
  }
1208
- const l = e.shiftKey ? e.deltaY : e.deltaX, u = e.shiftKey ? 0 : e.deltaY;
1209
- ee((v) => ({ x: v.x - l, y: v.y - u }));
1139
+ const s = e.shiftKey ? e.deltaY : e.deltaX, r = e.shiftKey ? 0 : e.deltaY;
1140
+ U((u) => ({ x: u.x - s, y: u.y - r }));
1210
1141
  },
1211
1142
  onPointerDown: (e) => {
1212
- (e.button === 1 || e.button === 0 && e.altKey) && (e.preventDefault(), pe(!0), ne.current = {
1143
+ (e.button === 1 || e.button === 0 && e.altKey) && (e.preventDefault(), pe(!0), Y.current = {
1213
1144
  x: e.clientX,
1214
1145
  y: e.clientY,
1215
- offX: x.x,
1216
- offY: x.y
1146
+ offX: h.x,
1147
+ offY: h.y
1217
1148
  }, e.currentTarget.setPointerCapture(e.pointerId));
1218
1149
  },
1219
1150
  onPointerMove: (e) => {
1220
- if (!re || !ne.current)
1151
+ if (!J || !Y.current)
1221
1152
  return;
1222
- const { x: l, y: u, offX: v, offY: T } = ne.current;
1223
- ee({ x: v + (e.clientX - l), y: T + (e.clientY - u) });
1153
+ const { x: s, y: r, offX: u, offY: b } = Y.current;
1154
+ U({ x: u + (e.clientX - s), y: b + (e.clientY - r) });
1224
1155
  },
1225
1156
  onPointerUp: (e) => {
1226
- re && (pe(!1), ne.current = null, e.currentTarget.releasePointerCapture(e.pointerId));
1157
+ J && (pe(!1), Y.current = null, e.currentTarget.releasePointerCapture(e.pointerId));
1227
1158
  },
1228
1159
  role: "application",
1229
- "aria-label": o("workflowDesigner.bpmnCanvas", "BPMN canvas"),
1160
+ "aria-label": i("workflowDesigner.bpmnCanvas", "BPMN canvas"),
1230
1161
  style: {
1231
- backgroundSize: `${R * z}px ${R * z}px`,
1232
- backgroundPosition: `${x.x}px ${x.y}px`
1162
+ backgroundSize: `${C * T}px ${C * T}px`,
1163
+ backgroundPosition: `${h.x}px ${h.y}px`
1233
1164
  },
1234
1165
  children: [
1235
1166
  /* @__PURE__ */ a(
@@ -1237,29 +1168,29 @@ const ot = ({
1237
1168
  {
1238
1169
  className: "nice-bpmn-designer__canvas-content",
1239
1170
  style: {
1240
- transform: `translate(${x.x}px, ${x.y}px) scale(${z})`,
1171
+ transform: `translate(${h.x}px, ${h.y}px) scale(${T})`,
1241
1172
  transformOrigin: "0 0"
1242
1173
  },
1243
1174
  children: [
1244
- Ae(),
1245
- i.elements.map($e)
1175
+ Me(),
1176
+ t.elements.map($e)
1246
1177
  ]
1247
1178
  }
1248
1179
  ),
1249
- E && /* @__PURE__ */ t("div", { className: "nice-bpmn-designer__connect-hint", children: o(
1180
+ _ && /* @__PURE__ */ n("div", { className: "nice-bpmn-designer__connect-hint", children: i(
1250
1181
  "workflowDesigner.connectHint",
1251
1182
  "Click a target element to connect, or click empty space to cancel"
1252
1183
  ) })
1253
1184
  ]
1254
1185
  }
1255
1186
  ),
1256
- d && /* @__PURE__ */ t(
1187
+ d && /* @__PURE__ */ n(
1257
1188
  "div",
1258
1189
  {
1259
1190
  className: "nice-bpmn-designer__minimap",
1260
- "aria-label": o("workflowDesigner.minimap", "Minimap"),
1191
+ "aria-label": i("workflowDesigner.minimap", "Minimap"),
1261
1192
  "aria-hidden": "true",
1262
- children: i.elements.map((e) => /* @__PURE__ */ t(
1193
+ children: t.elements.map((e) => /* @__PURE__ */ n(
1263
1194
  "div",
1264
1195
  {
1265
1196
  className: `nice-bpmn-designer__minimap-dot nice-bpmn-designer__minimap-dot--${e.elementType}`,
@@ -1272,399 +1203,22 @@ const ot = ({
1272
1203
  ))
1273
1204
  }
1274
1205
  ),
1275
- P && k.length > 0 && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__validation", role: "status", "aria-live": "polite", children: [
1276
- w.map((e, l) => /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__issue nice-bpmn-designer__issue--error", children: [
1277
- /* @__PURE__ */ t(p, { name: "error", size: 14 }),
1206
+ F && q.length > 0 && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__validation", role: "status", "aria-live": "polite", children: [
1207
+ Q.map((e, s) => /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__issue nice-bpmn-designer__issue--error", children: [
1208
+ /* @__PURE__ */ n(p, { name: "error", size: 14 }),
1278
1209
  " ",
1279
1210
  e.message
1280
- ] }, l)),
1281
- $.map((e, l) => /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__issue nice-bpmn-designer__issue--warning", children: [
1282
- /* @__PURE__ */ t(p, { name: "warning", size: 14 }),
1211
+ ] }, s)),
1212
+ Ne.map((e, s) => /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__issue nice-bpmn-designer__issue--warning", children: [
1213
+ /* @__PURE__ */ n(p, { name: "warning", size: 14 }),
1283
1214
  " ",
1284
1215
  e.message
1285
- ] }, l))
1216
+ ] }, s))
1286
1217
  ] })
1287
1218
  ] })
1288
1219
  }
1289
1220
  );
1290
- }, st = ({
1291
- workflow: i,
1292
- nodes: c,
1293
- edges: b,
1294
- onChange: H,
1295
- readOnly: m = !1,
1296
- showMinimap: d = !0,
1297
- showToolbar: D = !0,
1298
- showValidation: P = !0,
1299
- onTest: N,
1300
- onPublish: K,
1301
- tutorial: de,
1302
- className: R,
1303
- style: J,
1304
- "data-testid": me
1305
- }) => {
1306
- const { t: ae } = we(), { t: h } = we(), oe = Z(null);
1307
- fe(oe, { orientation: "horizontal", itemSelector: "button" });
1308
- const y = ce(() => {
1309
- if (i)
1310
- return i;
1311
- const n = (c ?? []).map((r) => ({
1312
- id: r.id,
1313
- name: r.name ?? r.label ?? r.id,
1314
- type: r.type === "start" ? "initial" : r.type === "end" ? "final" : r.type ?? "intermediate",
1315
- position: { x: r.x ?? 0, y: r.y ?? 0 }
1316
- })), s = (b ?? []).map((r, k) => ({
1317
- id: r.id ?? `t${k}`,
1318
- fromStateId: r.fromStateId ?? r.from ?? r.source,
1319
- toStateId: r.toStateId ?? r.to ?? r.target,
1320
- name: r.name ?? r.label ?? ""
1321
- }));
1322
- return {
1323
- id: "workflow",
1324
- name: "Workflow",
1325
- entityType: "generic",
1326
- version: 1,
1327
- states: n,
1328
- transitions: s
1329
- };
1330
- }, [i, c, b]), [se, B] = S(null), [W, O] = S(null), [o, L] = S(!1), G = Z(null), I = Z(
1331
- null
1332
- ), [Q, j] = S(!1);
1333
- We(() => {
1334
- const n = G.current, s = o && W ? [...n?.querySelectorAll("[data-state-id]") ?? []].find(
1335
- (C) => C.dataset.stateId === W
1336
- ) : null;
1337
- if (!n || !s)
1338
- return;
1339
- const r = 24, { offsetLeft: k, offsetTop: w, offsetWidth: $, offsetHeight: g } = s;
1340
- k - r < n.scrollLeft ? n.scrollLeft = k - r : k + $ + r > n.scrollLeft + n.clientWidth && (n.scrollLeft = k + $ + r - n.clientWidth), w - r < n.scrollTop ? n.scrollTop = w - r : w + g + r > n.scrollTop + n.clientHeight && (n.scrollTop = w + g + r - n.clientHeight);
1341
- }, [o, W]);
1342
- const U = P ? je(y, h) : [], E = U.filter((n) => n.type === "error"), le = U.filter((n) => n.type === "warning"), x = y.states.find((n) => n.id === se), ee = (n) => {
1343
- if (m)
1344
- return;
1345
- const s = `state-${Date.now()}`, r = {
1346
- id: s,
1347
- name: h("workflowDesigner.newState", "New state"),
1348
- type: n,
1349
- position: { x: 200, y: 200 }
1350
- };
1351
- H?.({ ...y, states: [...y.states, r] }), B(s);
1352
- }, z = (n) => {
1353
- m || (H?.({
1354
- ...y,
1355
- states: y.states.filter((s) => s.id !== n),
1356
- transitions: y.transitions.filter((s) => s.fromStateId !== n && s.toStateId !== n)
1357
- }), se === n && B(null));
1358
- }, te = (n, s) => {
1359
- H?.({
1360
- ...y,
1361
- states: y.states.map((r) => r.id === n ? { ...r, name: s } : r)
1362
- });
1363
- }, re = () => {
1364
- const n = y.states.find((s) => s.type === "initial");
1365
- n && (B(null), O(n.id), L(!0));
1366
- }, pe = (n) => {
1367
- const s = y.transitions.find((r) => r.id === n);
1368
- s && O(s.toStateId);
1369
- }, ne = D && !m ? /* @__PURE__ */ a(
1370
- "div",
1371
- {
1372
- ref: oe,
1373
- className: "nice-workflow-designer__toolbar",
1374
- role: "toolbar",
1375
- "aria-label": h("workflowDesigner.toolbar", "Workflow toolbar"),
1376
- children: [
1377
- /* @__PURE__ */ a("button", { onClick: () => ee("intermediate"), type: "button", children: [
1378
- /* @__PURE__ */ t(p, { name: "plus", size: 14 }),
1379
- " ",
1380
- h("workflowDesigner.addState", "State")
1381
- ] }),
1382
- /* @__PURE__ */ a("button", { onClick: () => ee("approval"), type: "button", children: [
1383
- /* @__PURE__ */ t(p, { name: "plus", size: 14 }),
1384
- " ",
1385
- h("workflowDesigner.addApproval", "Approval")
1386
- ] }),
1387
- /* @__PURE__ */ a("button", { onClick: re, type: "button", disabled: E.length > 0, children: [
1388
- /* @__PURE__ */ t(p, { name: "play", size: 14 }),
1389
- " ",
1390
- h("workflowDesigner.simulate", "Simulate")
1391
- ] }),
1392
- N && /* @__PURE__ */ t("button", { onClick: () => N(y), type: "button", children: h("workflowDesigner.test", "Test") }),
1393
- K && /* @__PURE__ */ t("button", { onClick: () => K(y), type: "button", disabled: E.length > 0, children: h("workflowDesigner.publish", "Publish") })
1394
- ]
1395
- }
1396
- ) : void 0, ie = x && !m && !o ? /* @__PURE__ */ a(
1397
- "aside",
1398
- {
1399
- className: "nice-workflow-designer__props",
1400
- "aria-label": h("workflowDesigner.stateProps", "State properties"),
1401
- children: [
1402
- /* @__PURE__ */ a("div", { className: "nice-workflow-designer__props-header", children: [
1403
- /* @__PURE__ */ t("h3", { children: x.name }),
1404
- /* @__PURE__ */ t(
1405
- "button",
1406
- {
1407
- type: "button",
1408
- className: "nice-workflow-designer__props-close",
1409
- onClick: () => B(null),
1410
- "aria-label": h("workflowDesigner.closeProps", "Close properties"),
1411
- title: h("workflowDesigner.closeProps", "Close properties"),
1412
- children: /* @__PURE__ */ t(p, { name: "close", size: 12 })
1413
- }
1414
- )
1415
- ] }),
1416
- /* @__PURE__ */ a("label", { children: [
1417
- h("workflowDesigner.type", "Type"),
1418
- ":",
1419
- /* @__PURE__ */ t(
1420
- "select",
1421
- {
1422
- value: x.type,
1423
- onChange: (n) => H?.({
1424
- ...y,
1425
- states: y.states.map(
1426
- (s) => s.id === x.id ? { ...s, type: n.target.value } : s
1427
- )
1428
- }),
1429
- "aria-label": h("workflowDesigner.stateType", "State type"),
1430
- children: ["initial", "intermediate", "approval", "final", "error"].map((n) => /* @__PURE__ */ t("option", { value: n, children: n }, n))
1431
- }
1432
- )
1433
- ] })
1434
- ]
1435
- }
1436
- ) : void 0, ue = P && U.length > 0, X = ue || o ? /* @__PURE__ */ a(V, { children: [
1437
- ue && /* @__PURE__ */ a("div", { className: "nice-workflow-designer__validation", role: "status", "aria-live": "polite", children: [
1438
- E.map((n, s) => /* @__PURE__ */ a(
1439
- "div",
1440
- {
1441
- className: "nice-workflow-designer__issue nice-workflow-designer__issue--error",
1442
- children: [
1443
- /* @__PURE__ */ t(p, { name: "error", size: 14 }),
1444
- " ",
1445
- n.message
1446
- ]
1447
- },
1448
- s
1449
- )),
1450
- le.map((n, s) => /* @__PURE__ */ a(
1451
- "div",
1452
- {
1453
- className: "nice-workflow-designer__issue nice-workflow-designer__issue--warning",
1454
- children: [
1455
- /* @__PURE__ */ t(p, { name: "warning", size: 14 }),
1456
- " ",
1457
- n.message
1458
- ]
1459
- },
1460
- s
1461
- ))
1462
- ] }),
1463
- o && /* @__PURE__ */ a("div", { className: "nice-workflow-designer__sim-toolbar", children: [
1464
- /* @__PURE__ */ a("span", { children: [
1465
- h("workflowDesigner.simActiveState", "Simulation active — current state:"),
1466
- " ",
1467
- /* @__PURE__ */ t("strong", { children: y.states.find((n) => n.id === W)?.name })
1468
- ] }),
1469
- /* @__PURE__ */ t(
1470
- "button",
1471
- {
1472
- onClick: () => {
1473
- L(!1), O(null);
1474
- },
1475
- type: "button",
1476
- children: h("workflowDesigner.endSimulation", "End simulation")
1477
- }
1478
- )
1479
- ] })
1480
- ] }) : void 0;
1481
- return /* @__PURE__ */ t(
1482
- Pe,
1483
- {
1484
- flush: !0,
1485
- className: `nice-workflow-designer${m ? " nice-workflow-designer--readonly" : ""} ${R ?? ""}`,
1486
- style: J,
1487
- "data-testid": me,
1488
- toolbar: ne,
1489
- rightSidebar: ie,
1490
- bottomPanel: X,
1491
- children: /* @__PURE__ */ a(
1492
- "div",
1493
- {
1494
- style: {
1495
- position: "relative",
1496
- height: "100%",
1497
- overflow: "hidden",
1498
- display: "flex",
1499
- flexDirection: "column"
1500
- },
1501
- children: [
1502
- /* @__PURE__ */ t("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ t(Ye, { steps: Ke(de, Xe) }) }),
1503
- /* @__PURE__ */ t(
1504
- "div",
1505
- {
1506
- ref: G,
1507
- className: `nice-workflow-designer__canvas${Q ? " nice-workflow-designer__canvas--panning" : ""}`,
1508
- role: "application",
1509
- "aria-label": h("workflowDesigner.canvas", "Workflow canvas"),
1510
- onPointerDown: (n) => {
1511
- if (n.button !== 0 || n.target.closest(".nice-workflow-designer__state-node"))
1512
- return;
1513
- const s = n.currentTarget;
1514
- I.current = {
1515
- x: n.clientX,
1516
- y: n.clientY,
1517
- left: s.scrollLeft,
1518
- top: s.scrollTop,
1519
- moved: !1
1520
- }, s.setPointerCapture?.(n.pointerId);
1521
- },
1522
- onPointerMove: (n) => {
1523
- const s = I.current;
1524
- if (!s)
1525
- return;
1526
- const r = n.clientX - s.x, k = n.clientY - s.y;
1527
- !s.moved && Math.abs(r) + Math.abs(k) < 4 || (s.moved || (s.moved = !0, j(!0)), n.currentTarget.scrollLeft = s.left - r, n.currentTarget.scrollTop = s.top - k);
1528
- },
1529
- onPointerUp: () => {
1530
- const n = I.current;
1531
- I.current = null, j(!1), n && !n.moved && B(null);
1532
- },
1533
- onPointerCancel: () => {
1534
- I.current = null, j(!1);
1535
- },
1536
- children: /* @__PURE__ */ t(
1537
- "div",
1538
- {
1539
- className: "nice-workflow-designer__canvas-content",
1540
- style: (() => {
1541
- const r = y.states.reduce(
1542
- (w, $) => Math.max(w, ($.position.x ?? 0) + 200),
1543
- 800
1544
- ), k = y.states.reduce(
1545
- (w, $) => Math.max(w, ($.position.y ?? 0) + 120),
1546
- 800 / 2
1547
- );
1548
- return {
1549
- position: "relative",
1550
- width: r + 240,
1551
- height: k + 240,
1552
- minWidth: "100%",
1553
- minHeight: "100%"
1554
- };
1555
- })(),
1556
- children: y.states.map((n) => {
1557
- const s = o && W === n.id, r = se === n.id, k = o ? y.transitions.filter((w) => w.fromStateId === n.id) : [];
1558
- return /* @__PURE__ */ a(
1559
- "div",
1560
- {
1561
- "data-state-id": n.id,
1562
- className: `nice-workflow-designer__state-node nice-workflow-designer__state-node--${n.type}${r ? " nice-workflow-designer__state-node--selected" : ""}${s ? " nice-workflow-designer__state-node--active" : ""}`,
1563
- style: {
1564
- left: n.position.x,
1565
- top: n.position.y,
1566
- borderColor: Ne[n.type]
1567
- },
1568
- onClick: () => B(n.id),
1569
- role: "button",
1570
- tabIndex: 0,
1571
- "aria-label": h("workflowDesigner.stateLabel", "State: {name}").replace(
1572
- "{name}",
1573
- n.name
1574
- ),
1575
- onKeyDown: (w) => w.key === "Enter" && B(n.id),
1576
- children: [
1577
- /* @__PURE__ */ t("span", { className: "nice-workflow-designer__state-type", children: n.type }),
1578
- m ? /* @__PURE__ */ t("span", { className: "nice-workflow-designer__state-name", children: n.name }) : /* @__PURE__ */ t(
1579
- "input",
1580
- {
1581
- type: "text",
1582
- value: n.name,
1583
- onChange: (w) => te(n.id, w.target.value),
1584
- className: "nice-workflow-designer__state-name-input",
1585
- "aria-label": h("workflowDesigner.stateName", "State name"),
1586
- onClick: (w) => w.stopPropagation()
1587
- }
1588
- ),
1589
- n.sla && /* @__PURE__ */ a(
1590
- "span",
1591
- {
1592
- className: "nice-workflow-designer__sla-badge",
1593
- title: ae("workflowDesigner.slaHH", "SLA: {warningHours}h / {criticalHours}h").replace("{warningHours}", String(n.sla.warningHours)).replace("{criticalHours}", String(n.sla.criticalHours)),
1594
- children: [
1595
- /* @__PURE__ */ t(p, { name: "clock", size: 10 }),
1596
- " ",
1597
- ae("workflowDesigner.sla", "SLA")
1598
- ]
1599
- }
1600
- ),
1601
- s && k.map((w) => /* @__PURE__ */ a(
1602
- "button",
1603
- {
1604
- className: "nice-workflow-designer__sim-btn",
1605
- onClick: ($) => {
1606
- $.stopPropagation(), pe(w.id);
1607
- },
1608
- type: "button",
1609
- children: [
1610
- /* @__PURE__ */ t(p, { name: "arrow-right", size: 12 }),
1611
- " ",
1612
- w.name
1613
- ]
1614
- },
1615
- w.id
1616
- )),
1617
- !m && /* @__PURE__ */ t(
1618
- "button",
1619
- {
1620
- className: "nice-workflow-designer__delete-btn",
1621
- onClick: (w) => {
1622
- w.stopPropagation(), z(n.id);
1623
- },
1624
- type: "button",
1625
- "aria-label": h("workflowDesigner.deleteState", "Delete state {name}").replace(
1626
- "{name}",
1627
- n.name
1628
- ),
1629
- children: /* @__PURE__ */ t(p, { name: "close", size: 10 })
1630
- }
1631
- )
1632
- ]
1633
- },
1634
- n.id
1635
- );
1636
- })
1637
- }
1638
- )
1639
- }
1640
- ),
1641
- d && /* @__PURE__ */ t(
1642
- "div",
1643
- {
1644
- className: "nice-workflow-designer__minimap",
1645
- "aria-label": h("workflowDesigner.minimap", "Minimap"),
1646
- "aria-hidden": "true",
1647
- children: y.states.map((n) => /* @__PURE__ */ t(
1648
- "div",
1649
- {
1650
- className: "nice-workflow-designer__minimap-dot",
1651
- style: {
1652
- left: n.position.x / 10,
1653
- top: n.position.y / 10,
1654
- background: Ne[n.type]
1655
- }
1656
- },
1657
- n.id
1658
- ))
1659
- }
1660
- )
1661
- ]
1662
- }
1663
- )
1664
- }
1665
- );
1666
1221
  };
1667
1222
  export {
1668
- ot as NiceBPMNDesigner,
1669
- st as NiceWorkflowDesigner
1223
+ Qe as NiceBPMNDesigner
1670
1224
  };