camunda-bpmn-js 5.6.1 → 5.7.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 (79) hide show
  1. package/dist/base-modeler.development.js +302 -149
  2. package/dist/base-modeler.production.min.js +3 -3
  3. package/dist/base-navigated-viewer.development.js +92 -41
  4. package/dist/base-navigated-viewer.production.min.js +1 -1
  5. package/dist/base-viewer.development.js +92 -41
  6. package/dist/base-viewer.production.min.js +1 -1
  7. package/dist/camunda-cloud-modeler.development.js +1585 -405
  8. package/dist/camunda-cloud-modeler.production.min.js +7 -7
  9. package/dist/camunda-cloud-navigated-viewer.development.js +92 -41
  10. package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
  11. package/dist/camunda-cloud-viewer.development.js +92 -41
  12. package/dist/camunda-cloud-viewer.production.min.js +1 -1
  13. package/dist/camunda-platform-modeler.development.js +302 -149
  14. package/dist/camunda-platform-modeler.production.min.js +5 -5
  15. package/dist/camunda-platform-navigated-viewer.development.js +92 -41
  16. package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
  17. package/dist/camunda-platform-viewer.development.js +92 -41
  18. package/dist/camunda-platform-viewer.production.min.js +1 -1
  19. package/lib/camunda-cloud/Modeler.js +4 -1
  20. package/lib/camunda-cloud/features/external-resources/README.md +14 -0
  21. package/lib/camunda-cloud/features/external-resources/ResourceLoader.d.ts +6 -0
  22. package/lib/camunda-cloud/features/external-resources/ResourceLoader.js +24 -0
  23. package/lib/camunda-cloud/features/external-resources/Resources.d.ts +7 -0
  24. package/lib/camunda-cloud/features/external-resources/Resources.js +19 -0
  25. package/lib/camunda-cloud/features/external-resources/cmd/ComposedCommandHandler.d.ts +12 -0
  26. package/lib/camunda-cloud/features/external-resources/cmd/ComposedCommandHandler.js +16 -0
  27. package/lib/camunda-cloud/features/external-resources/cmd/index.d.ts +4 -0
  28. package/lib/camunda-cloud/features/external-resources/cmd/index.js +21 -0
  29. package/lib/camunda-cloud/features/external-resources/handlers/decision/AppendMenuProvider.d.ts +5 -0
  30. package/lib/camunda-cloud/features/external-resources/handlers/decision/AppendMenuProvider.js +19 -0
  31. package/lib/camunda-cloud/features/external-resources/handlers/decision/CreateMenuProvider.d.ts +5 -0
  32. package/lib/camunda-cloud/features/external-resources/handlers/decision/CreateMenuProvider.js +19 -0
  33. package/lib/camunda-cloud/features/external-resources/handlers/decision/ReplaceMenuProvider.d.ts +5 -0
  34. package/lib/camunda-cloud/features/external-resources/handlers/decision/ReplaceMenuProvider.js +19 -0
  35. package/lib/camunda-cloud/features/external-resources/handlers/decision/createElement.d.ts +13 -0
  36. package/lib/camunda-cloud/features/external-resources/handlers/decision/createElement.js +35 -0
  37. package/lib/camunda-cloud/features/external-resources/handlers/decision/index.d.ts +8 -0
  38. package/lib/camunda-cloud/features/external-resources/handlers/decision/index.js +14 -0
  39. package/lib/camunda-cloud/features/external-resources/handlers/decision/replaceElement.d.ts +15 -0
  40. package/lib/camunda-cloud/features/external-resources/handlers/decision/replaceElement.js +77 -0
  41. package/lib/camunda-cloud/features/external-resources/handlers/decision/searchTerms.d.ts +1 -0
  42. package/lib/camunda-cloud/features/external-resources/handlers/decision/searchTerms.js +6 -0
  43. package/lib/camunda-cloud/features/external-resources/handlers/form/AppendMenuProvider.d.ts +5 -0
  44. package/lib/camunda-cloud/features/external-resources/handlers/form/AppendMenuProvider.js +19 -0
  45. package/lib/camunda-cloud/features/external-resources/handlers/form/CreateMenuProvider.d.ts +5 -0
  46. package/lib/camunda-cloud/features/external-resources/handlers/form/CreateMenuProvider.js +19 -0
  47. package/lib/camunda-cloud/features/external-resources/handlers/form/ReplaceMenuProvider.d.ts +5 -0
  48. package/lib/camunda-cloud/features/external-resources/handlers/form/ReplaceMenuProvider.js +19 -0
  49. package/lib/camunda-cloud/features/external-resources/handlers/form/createElement.d.ts +9 -0
  50. package/lib/camunda-cloud/features/external-resources/handlers/form/createElement.js +39 -0
  51. package/lib/camunda-cloud/features/external-resources/handlers/form/index.d.ts +8 -0
  52. package/lib/camunda-cloud/features/external-resources/handlers/form/index.js +14 -0
  53. package/lib/camunda-cloud/features/external-resources/handlers/form/replaceElement.d.ts +15 -0
  54. package/lib/camunda-cloud/features/external-resources/handlers/form/replaceElement.js +82 -0
  55. package/lib/camunda-cloud/features/external-resources/handlers/form/searchTerms.d.ts +1 -0
  56. package/lib/camunda-cloud/features/external-resources/handlers/form/searchTerms.js +6 -0
  57. package/lib/camunda-cloud/features/external-resources/handlers/process/AppendMenuProvider.d.ts +5 -0
  58. package/lib/camunda-cloud/features/external-resources/handlers/process/AppendMenuProvider.js +19 -0
  59. package/lib/camunda-cloud/features/external-resources/handlers/process/CreateMenuProvider.d.ts +5 -0
  60. package/lib/camunda-cloud/features/external-resources/handlers/process/CreateMenuProvider.js +19 -0
  61. package/lib/camunda-cloud/features/external-resources/handlers/process/ReplaceMenuProvider.d.ts +5 -0
  62. package/lib/camunda-cloud/features/external-resources/handlers/process/ReplaceMenuProvider.js +19 -0
  63. package/lib/camunda-cloud/features/external-resources/handlers/process/createElement.d.ts +14 -0
  64. package/lib/camunda-cloud/features/external-resources/handlers/process/createElement.js +36 -0
  65. package/lib/camunda-cloud/features/external-resources/handlers/process/index.d.ts +8 -0
  66. package/lib/camunda-cloud/features/external-resources/handlers/process/index.js +14 -0
  67. package/lib/camunda-cloud/features/external-resources/handlers/process/replaceElement.d.ts +16 -0
  68. package/lib/camunda-cloud/features/external-resources/handlers/process/replaceElement.js +78 -0
  69. package/lib/camunda-cloud/features/external-resources/handlers/process/searchTerms.d.ts +1 -0
  70. package/lib/camunda-cloud/features/external-resources/handlers/process/searchTerms.js +6 -0
  71. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseAppendMenuProvider.d.ts +18 -0
  72. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseAppendMenuProvider.js +103 -0
  73. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseCreateMenuProvider.d.ts +17 -0
  74. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseCreateMenuProvider.js +84 -0
  75. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseReplaceMenuProvider.d.ts +22 -0
  76. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseReplaceMenuProvider.js +81 -0
  77. package/lib/camunda-cloud/features/external-resources/index.d.ts +23 -0
  78. package/lib/camunda-cloud/features/external-resources/index.js +27 -0
  79. package/package.json +5 -5
@@ -19001,8 +19001,8 @@
19001
19001
  var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
19002
19002
  xScaleFactor: 0.9,
19003
19003
  yScaleFactor: 0.9,
19004
- containerWidth: element.width,
19005
- containerHeight: element.height,
19004
+ containerWidth: attrs.width || element.width,
19005
+ containerHeight: attrs.height || element.height,
19006
19006
  position: {
19007
19007
  mx: 0.235,
19008
19008
  my: 0.315
@@ -19026,17 +19026,23 @@
19026
19026
  return messagePath;
19027
19027
  },
19028
19028
  'bpmn:TimerEventDefinition': function(parentGfx, element, attrs = {}) {
19029
- var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, {
19029
+ var baseWidth = attrs.width || element.width;
19030
+ var baseHeight = attrs.height || element.height;
19031
+
19032
+ // use a lighter stroke for event suprocess icons
19033
+ var strokeWidth = attrs.width ? 1 : 2;
19034
+
19035
+ var circle = drawCircle(parentGfx, baseWidth, baseHeight, 0.2 * baseHeight, {
19030
19036
  fill: getFillColor(element, defaultFillColor, attrs.fill),
19031
19037
  stroke: getStrokeColor$1(element, defaultStrokeColor, attrs.stroke),
19032
- strokeWidth: 2
19038
+ strokeWidth: strokeWidth
19033
19039
  });
19034
19040
 
19035
19041
  var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
19036
19042
  xScaleFactor: 0.75,
19037
19043
  yScaleFactor: 0.75,
19038
- containerWidth: element.width,
19039
- containerHeight: element.height,
19044
+ containerWidth: baseWidth,
19045
+ containerHeight: baseHeight,
19040
19046
  position: {
19041
19047
  mx: 0.5,
19042
19048
  my: 0.5
@@ -19045,23 +19051,23 @@
19045
19051
 
19046
19052
  drawPath(parentGfx, pathData, {
19047
19053
  stroke: getStrokeColor$1(element, defaultStrokeColor, attrs.stroke),
19048
- strokeWidth: 2
19054
+ strokeWidth: strokeWidth
19049
19055
  });
19050
19056
 
19051
19057
  for (var i = 0; i < 12; i++) {
19052
19058
  var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
19053
19059
  xScaleFactor: 0.75,
19054
19060
  yScaleFactor: 0.75,
19055
- containerWidth: element.width,
19056
- containerHeight: element.height,
19061
+ containerWidth: baseWidth,
19062
+ containerHeight: baseHeight,
19057
19063
  position: {
19058
19064
  mx: 0.5,
19059
19065
  my: 0.5
19060
19066
  }
19061
19067
  });
19062
19068
 
19063
- var width = element.width / 2,
19064
- height = element.height / 2;
19069
+ var width = baseWidth / 2,
19070
+ height = baseHeight / 2;
19065
19071
 
19066
19072
  drawPath(parentGfx, linePathData, {
19067
19073
  strokeWidth: 1,
@@ -19076,8 +19082,8 @@
19076
19082
  var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
19077
19083
  xScaleFactor: 1,
19078
19084
  yScaleFactor: 1,
19079
- containerWidth: event.width,
19080
- containerHeight: event.height,
19085
+ containerWidth: attrs.width || event.width,
19086
+ containerHeight: attrs.height || event.height,
19081
19087
  position: {
19082
19088
  mx: 0.5,
19083
19089
  my: 0.2
@@ -19098,8 +19104,8 @@
19098
19104
  var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
19099
19105
  xScaleFactor: 1,
19100
19106
  yScaleFactor: 1,
19101
- containerWidth: event.width,
19102
- containerHeight: event.height,
19107
+ containerWidth: attrs.width || event.width,
19108
+ containerHeight: attrs.height || event.height,
19103
19109
  position: {
19104
19110
  mx: 0.5,
19105
19111
  my: 0.222
@@ -19138,8 +19144,8 @@
19138
19144
  var pathData = pathMap.getScaledPath('EVENT_ERROR', {
19139
19145
  xScaleFactor: 1.1,
19140
19146
  yScaleFactor: 1.1,
19141
- containerWidth: event.width,
19142
- containerHeight: event.height,
19147
+ containerWidth: attrs.width || event.width,
19148
+ containerHeight: attrs.height || event.height,
19143
19149
  position: {
19144
19150
  mx: 0.2,
19145
19151
  my: 0.722
@@ -19184,8 +19190,8 @@
19184
19190
  var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
19185
19191
  xScaleFactor: 1,
19186
19192
  yScaleFactor: 1,
19187
- containerWidth: event.width,
19188
- containerHeight: event.height,
19193
+ containerWidth: attrs.width || event.width,
19194
+ containerHeight: attrs.height || event.height,
19189
19195
  position: {
19190
19196
  mx: 0.22,
19191
19197
  my: 0.5
@@ -19206,8 +19212,8 @@
19206
19212
  var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
19207
19213
  xScaleFactor: 0.9,
19208
19214
  yScaleFactor: 0.9,
19209
- containerWidth: event.width,
19210
- containerHeight: event.height,
19215
+ containerWidth: attrs.width || event.width,
19216
+ containerHeight: attrs.height || event.height,
19211
19217
  position: {
19212
19218
  mx: 0.5,
19213
19219
  my: 0.2
@@ -19228,10 +19234,10 @@
19228
19234
  var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
19229
19235
  xScaleFactor: 1.1,
19230
19236
  yScaleFactor: 1.1,
19231
- containerWidth: event.width,
19232
- containerHeight: event.height,
19237
+ containerWidth: attrs.width || event.width,
19238
+ containerHeight: attrs.height || event.height,
19233
19239
  position: {
19234
- mx: 0.222,
19240
+ mx: 0.211,
19235
19241
  my: 0.36
19236
19242
  }
19237
19243
  });
@@ -19242,6 +19248,7 @@
19242
19248
 
19243
19249
  return drawPath(parentGfx, pathData, {
19244
19250
  fill,
19251
+ stroke: getStrokeColor$1(event, defaultStrokeColor, attrs.stroke),
19245
19252
  strokeWidth: 1
19246
19253
  });
19247
19254
  },
@@ -19249,8 +19256,8 @@
19249
19256
  var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
19250
19257
  xScaleFactor: 1.2,
19251
19258
  yScaleFactor: 1.2,
19252
- containerWidth: event.width,
19253
- containerHeight: event.height,
19259
+ containerWidth: attrs.width || event.width,
19260
+ containerHeight: attrs.height || event.height,
19254
19261
  position: {
19255
19262
  mx: 0.458,
19256
19263
  my: 0.194
@@ -19274,57 +19281,59 @@
19274
19281
  }
19275
19282
  };
19276
19283
 
19277
- function renderEventIcon(element, parentGfx, attrs = {}) {
19284
+ function renderEventIcon(element, parentGfx, attrs = {}, proxyElement) {
19278
19285
  var semantic = getBusinessObject$2(element),
19279
19286
  isThrowing = isThrowEvent(semantic);
19280
19287
 
19288
+ var nodeElement = proxyElement || element;
19289
+
19281
19290
  if (semantic.get('eventDefinitions') && semantic.get('eventDefinitions').length > 1) {
19282
19291
  if (semantic.get('parallelMultiple')) {
19283
- return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
19292
+ return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19284
19293
  }
19285
19294
  else {
19286
- return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
19295
+ return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19287
19296
  }
19288
19297
  }
19289
19298
 
19290
19299
  if (isTypedEvent(semantic, 'bpmn:MessageEventDefinition')) {
19291
- return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, element, attrs, isThrowing);
19300
+ return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19292
19301
  }
19293
19302
 
19294
19303
  if (isTypedEvent(semantic, 'bpmn:TimerEventDefinition')) {
19295
- return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, element, attrs, isThrowing);
19304
+ return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19296
19305
  }
19297
19306
 
19298
19307
  if (isTypedEvent(semantic, 'bpmn:ConditionalEventDefinition')) {
19299
- return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, element, attrs, isThrowing);
19308
+ return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19300
19309
  }
19301
19310
 
19302
19311
  if (isTypedEvent(semantic, 'bpmn:SignalEventDefinition')) {
19303
- return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, element, attrs, isThrowing);
19312
+ return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19304
19313
  }
19305
19314
 
19306
19315
  if (isTypedEvent(semantic, 'bpmn:EscalationEventDefinition')) {
19307
- return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, element, attrs, isThrowing);
19316
+ return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19308
19317
  }
19309
19318
 
19310
19319
  if (isTypedEvent(semantic, 'bpmn:LinkEventDefinition')) {
19311
- return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, element, attrs, isThrowing);
19320
+ return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19312
19321
  }
19313
19322
 
19314
19323
  if (isTypedEvent(semantic, 'bpmn:ErrorEventDefinition')) {
19315
- return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, element, attrs, isThrowing);
19324
+ return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19316
19325
  }
19317
19326
 
19318
19327
  if (isTypedEvent(semantic, 'bpmn:CancelEventDefinition')) {
19319
- return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, element, attrs, isThrowing);
19328
+ return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19320
19329
  }
19321
19330
 
19322
19331
  if (isTypedEvent(semantic, 'bpmn:CompensateEventDefinition')) {
19323
- return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, element, attrs, isThrowing);
19332
+ return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19324
19333
  }
19325
19334
 
19326
19335
  if (isTypedEvent(semantic, 'bpmn:TerminateEventDefinition')) {
19327
- return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, element, attrs, isThrowing);
19336
+ return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19328
19337
  }
19329
19338
 
19330
19339
  return null;
@@ -19746,14 +19755,23 @@
19746
19755
  function renderSubProcess(parentGfx, element, attrs = {}) {
19747
19756
  var activity = renderActivity(parentGfx, element, attrs);
19748
19757
 
19758
+ var expanded = isExpanded$1(element);
19759
+
19749
19760
  if (isEventSubProcess(element)) {
19750
19761
  attr(activity, {
19751
19762
  strokeDasharray: '0, 5.5',
19752
19763
  strokeWidth: 2.5
19753
19764
  });
19754
- }
19755
19765
 
19756
- var expanded = isExpanded$1(element);
19766
+ if (!expanded) {
19767
+ var flowElements = getBusinessObject$2(element).flowElements || [];
19768
+ var startEvents = flowElements.filter(e => is$5(e, 'bpmn:StartEvent'));
19769
+
19770
+ if (startEvents.length === 1) {
19771
+ renderEventSubProcessIcon(startEvents[0], parentGfx, attrs, element);
19772
+ }
19773
+ }
19774
+ }
19757
19775
 
19758
19776
  renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle', attrs);
19759
19777
 
@@ -19766,6 +19784,39 @@
19766
19784
  return activity;
19767
19785
  }
19768
19786
 
19787
+ function renderEventSubProcessIcon(startEvent, parentGfx, attrs, proxyElement) {
19788
+ var iconSize = 22;
19789
+
19790
+ // match the colors of the enclosing subprocess
19791
+ var proxyAttrs = {
19792
+ fill: getFillColor(proxyElement, defaultFillColor, attrs.fill),
19793
+ stroke: getStrokeColor$1(proxyElement, defaultStrokeColor, attrs.stroke),
19794
+ width: iconSize,
19795
+ height: iconSize
19796
+ };
19797
+
19798
+ var interrupting = getBusinessObject$2(startEvent).isInterrupting;
19799
+ var strokeDasharray = interrupting ? 0 : 3;
19800
+
19801
+ // better visibility for non-interrupting events
19802
+ var strokeWidth = interrupting ? 1 : 1.2;
19803
+
19804
+ // make the icon look larger by drawing a smaller circle
19805
+ var circleSize = 20;
19806
+ var shift = (iconSize - circleSize) / 2;
19807
+ var transform = 'translate(' + shift + ',' + shift + ')';
19808
+
19809
+ drawCircle(parentGfx, circleSize, circleSize, {
19810
+ fill: proxyAttrs.fill,
19811
+ stroke: proxyAttrs.stroke,
19812
+ strokeWidth,
19813
+ strokeDasharray,
19814
+ transform
19815
+ });
19816
+
19817
+ renderEventIcon(startEvent, parentGfx, proxyAttrs, proxyElement);
19818
+ }
19819
+
19769
19820
  function renderTask(parentGfx, element, attrs = {}) {
19770
19821
  var activity = renderActivity(parentGfx, element, attrs);
19771
19822
 
@@ -40735,6 +40786,7 @@
40735
40786
 
40736
40787
  if (
40737
40788
  !is$5(newShape, 'bpmn:SubProcess') ||
40789
+ is$5(newShape,'bpmn:AdHocSubProcess') ||
40738
40790
  ! (is$5(oldShape, 'bpmn:Task') || is$5(oldShape, 'bpmn:CallActivity')) ||
40739
40791
  !isExpanded$1(newShape)
40740
40792
  ) {
@@ -56607,7 +56659,7 @@
56607
56659
  * @param {Translate} translate
56608
56660
  * @param {ModdleCopy} moddleCopy
56609
56661
  */
56610
- function ReplaceMenuProvider(
56662
+ function ReplaceMenuProvider$3(
56611
56663
  bpmnFactory, popupMenu, modeling, moddle,
56612
56664
  bpmnReplace, rules, translate, moddleCopy) {
56613
56665
 
@@ -56623,7 +56675,7 @@
56623
56675
  this._register();
56624
56676
  }
56625
56677
 
56626
- ReplaceMenuProvider.$inject = [
56678
+ ReplaceMenuProvider$3.$inject = [
56627
56679
  'bpmnFactory',
56628
56680
  'popupMenu',
56629
56681
  'modeling',
@@ -56634,7 +56686,7 @@
56634
56686
  'moddleCopy'
56635
56687
  ];
56636
56688
 
56637
- ReplaceMenuProvider.prototype._register = function() {
56689
+ ReplaceMenuProvider$3.prototype._register = function() {
56638
56690
  this._popupMenu.registerProvider('bpmn-replace', this);
56639
56691
  };
56640
56692
 
@@ -56643,7 +56695,7 @@
56643
56695
  *
56644
56696
  * @return {PopupMenuEntries}
56645
56697
  */
56646
- ReplaceMenuProvider.prototype.getPopupMenuEntries = function(target) {
56698
+ ReplaceMenuProvider$3.prototype.getPopupMenuEntries = function(target) {
56647
56699
 
56648
56700
  var businessObject = target.businessObject;
56649
56701
 
@@ -56858,7 +56910,7 @@
56858
56910
  *
56859
56911
  * @return {PopupMenuHeaderEntries}
56860
56912
  */
56861
- ReplaceMenuProvider.prototype.getPopupMenuHeaderEntries = function(target) {
56913
+ ReplaceMenuProvider$3.prototype.getPopupMenuHeaderEntries = function(target) {
56862
56914
 
56863
56915
  var headerEntries = {};
56864
56916
 
@@ -56902,7 +56954,7 @@
56902
56954
  *
56903
56955
  * @return {PopupMenuEntries}
56904
56956
  */
56905
- ReplaceMenuProvider.prototype._createEntries = function(target, replaceOptions) {
56957
+ ReplaceMenuProvider$3.prototype._createEntries = function(target, replaceOptions) {
56906
56958
  var entries = {};
56907
56959
 
56908
56960
  var self = this;
@@ -56922,7 +56974,7 @@
56922
56974
  *
56923
56975
  * @return {PopupMenuEntries}
56924
56976
  */
56925
- ReplaceMenuProvider.prototype._createSequenceFlowEntries = function(target, replaceOptions) {
56977
+ ReplaceMenuProvider$3.prototype._createSequenceFlowEntries = function(target, replaceOptions) {
56926
56978
 
56927
56979
  var businessObject = getBusinessObject$2(target);
56928
56980
 
@@ -57004,7 +57056,7 @@
57004
57056
  *
57005
57057
  * @return {PopupMenuEntry}
57006
57058
  */
57007
- ReplaceMenuProvider.prototype._createEntry = function(replaceOption, target, action) {
57059
+ ReplaceMenuProvider$3.prototype._createEntry = function(replaceOption, target, action) {
57008
57060
  var translate = this._translate;
57009
57061
  var replaceElement = this._bpmnReplace.replaceElement;
57010
57062
 
@@ -57033,7 +57085,7 @@
57033
57085
  *
57034
57086
  * @return {PopupMenuHeaderEntries}
57035
57087
  */
57036
- ReplaceMenuProvider.prototype._getLoopCharacteristicsHeaderEntries = function(target) {
57088
+ ReplaceMenuProvider$3.prototype._getLoopCharacteristicsHeaderEntries = function(target) {
57037
57089
 
57038
57090
  var self = this;
57039
57091
  var translate = this._translate;
@@ -57112,7 +57164,7 @@
57112
57164
  *
57113
57165
  * @return {PopupMenuHeaderEntries}
57114
57166
  */
57115
- ReplaceMenuProvider.prototype._getCollectionHeaderEntries = function(target) {
57167
+ ReplaceMenuProvider$3.prototype._getCollectionHeaderEntries = function(target) {
57116
57168
 
57117
57169
  var self = this;
57118
57170
  var translate = this._translate;
@@ -57149,7 +57201,7 @@
57149
57201
  *
57150
57202
  * @return {PopupMenuHeaderEntries}
57151
57203
  */
57152
- ReplaceMenuProvider.prototype._getParticipantMultiplicityHeaderEntries = function(target) {
57204
+ ReplaceMenuProvider$3.prototype._getParticipantMultiplicityHeaderEntries = function(target) {
57153
57205
 
57154
57206
  var self = this;
57155
57207
  var bpmnFactory = this._bpmnFactory;
@@ -57180,7 +57232,7 @@
57180
57232
  };
57181
57233
  };
57182
57234
 
57183
- ReplaceMenuProvider.prototype._getNonInterruptingHeaderEntries = function(element) {
57235
+ ReplaceMenuProvider$3.prototype._getNonInterruptingHeaderEntries = function(element) {
57184
57236
  const translate = this._translate;
57185
57237
  const businessObject = getBusinessObject$2(element);
57186
57238
  const self = this;
@@ -57214,7 +57266,7 @@
57214
57266
  __init__: [
57215
57267
  'replaceMenuProvider'
57216
57268
  ],
57217
- replaceMenuProvider: [ 'type', ReplaceMenuProvider ]
57269
+ replaceMenuProvider: [ 'type', ReplaceMenuProvider$3 ]
57218
57270
  };
57219
57271
 
57220
57272
  /**
@@ -61651,6 +61703,7 @@
61651
61703
  */
61652
61704
 
61653
61705
  var COLLAB_ERR_MSG = 'flow elements must be children of pools/participants';
61706
+ var DATA_OBJECT_ERR_MSG = 'Data object must be placed within a pool/participant.';
61654
61707
 
61655
61708
  /**
61656
61709
  * @param {EventBus} eventBus
@@ -61676,8 +61729,12 @@
61676
61729
  shape = context.shape,
61677
61730
  target = context.target;
61678
61731
 
61679
- if (is$5(target, 'bpmn:Collaboration') && is$5(shape, 'bpmn:FlowNode')) {
61680
- showError(event, translate(COLLAB_ERR_MSG));
61732
+ if (is$5(target, 'bpmn:Collaboration')) {
61733
+ if (is$5(shape, 'bpmn:FlowNode')) {
61734
+ showError(event, translate(COLLAB_ERR_MSG));
61735
+ } else if (is$5(shape, 'bpmn:DataObjectReference')) {
61736
+ showError(event, translate(DATA_OBJECT_ERR_MSG));
61737
+ }
61681
61738
  }
61682
61739
  });
61683
61740
 
@@ -115608,19 +115665,19 @@
115608
115665
  };
115609
115666
  MultiCommandHandler$1.$inject = ['commandStack'];
115610
115667
 
115611
- const HANDLERS = {
115668
+ const HANDLERS$1 = {
115612
115669
  'properties-panel.multi-command-executor': MultiCommandHandler$1
115613
115670
  };
115614
- function CommandInitializer(eventBus, commandStack) {
115671
+ function CommandInitializer$1(eventBus, commandStack) {
115615
115672
  eventBus.on('diagram.init', function () {
115616
- forEach$2(HANDLERS, function (handler, id) {
115673
+ forEach$2(HANDLERS$1, function (handler, id) {
115617
115674
  commandStack.registerHandler(id, handler);
115618
115675
  });
115619
115676
  });
115620
115677
  }
115621
- CommandInitializer.$inject = ['eventBus', 'commandStack'];
115678
+ CommandInitializer$1.$inject = ['eventBus', 'commandStack'];
115622
115679
  var Commands = {
115623
- __init__: [CommandInitializer]
115680
+ __init__: [CommandInitializer$1]
115624
115681
  };
115625
115682
 
115626
115683
  var index$3$1 = {
@@ -115629,6 +115686,188 @@
115629
115686
  propertiesPanel: ['type', BpmnPropertiesPanelRenderer]
115630
115687
  };
115631
115688
 
115689
+ /**
115690
+ * Create a new element and (optionally) set its parent.
115691
+ *
115692
+ * @param {string} type
115693
+ * @param {Object} properties
115694
+ * @param {import('bpmn-js/lib/model/Types').ModdleElement} parent
115695
+ * @param {import('bpmn-js/lib/features/modeling/BpmnFactory').default} bpmnFactory
115696
+ *
115697
+ * @returns {import('bpmn-js/lib/model/Types').ModdleElement}
115698
+ */
115699
+ function createElement$6(type, properties, parent, bpmnFactory) {
115700
+ const element = bpmnFactory.create(type, properties);
115701
+ if (parent) {
115702
+ element.$parent = parent;
115703
+ }
115704
+ return element;
115705
+ }
115706
+
115707
+ /**
115708
+ * generate a semantic id with given prefix
115709
+ */
115710
+ function nextId$1(prefix) {
115711
+ const ids = new Ids$1([32, 32, 1]);
115712
+ return ids.nextPrefixed(prefix);
115713
+ }
115714
+ function getRoot$1(businessObject) {
115715
+ let parent = businessObject;
115716
+ while (parent.$parent) {
115717
+ parent = parent.$parent;
115718
+ }
115719
+ return parent;
115720
+ }
115721
+ function filterElementsByType$1(objectList, type) {
115722
+ const list = objectList || [];
115723
+ return list.filter(element => is$5(element, type));
115724
+ }
115725
+ function findRootElementsByType$1(businessObject, referencedType) {
115726
+ const root = getRoot$1(businessObject);
115727
+ return filterElementsByType$1(root.get('rootElements'), referencedType);
115728
+ }
115729
+ function findRootElementById$1(businessObject, type, id) {
115730
+ const elements = findRootElementsByType$1(businessObject, type);
115731
+ return elements.find(element => element.id === id);
115732
+ }
115733
+
115734
+ /**
115735
+ * createOrUpdateFormalExpression - upserts a specific formal expression
115736
+ *
115737
+ * If the value is falsy, the formal expression is removed.
115738
+ *
115739
+ * @param {djs.model.Base} element
115740
+ * @param {ModdleElement} moddleElement
115741
+ * @param {string} propertyName
115742
+ * @param {string} newValue
115743
+ * @param {BpmnFactory} bpmnFactory
115744
+ * @param {CommandStack} commandStack
115745
+ */
115746
+ function createOrUpdateFormalExpression(element, moddleElement, propertyName, newValue, bpmnFactory, commandStack) {
115747
+ return commandStack.execute('element.updateModdleProperties', createOrUpdateFormalExpressionCommand(element, moddleElement, propertyName, newValue, bpmnFactory));
115748
+ }
115749
+
115750
+ /**
115751
+ * createOrUpdateFormalExpressionCommand - creates a command to upsert a specific formal expression
115752
+ *
115753
+ * If the value is falsy, the formal expression is removed.
115754
+ *
115755
+ * @param {djs.model.Base} element
115756
+ * @param {ModdleElement} moddleElement
115757
+ * @param {string} propertyName
115758
+ * @param {string} newValue
115759
+ * @param {BpmnFactory} bpmnFactory
115760
+ */
115761
+ function createOrUpdateFormalExpressionCommand(element, moddleElement, propertyName, newValue, bpmnFactory) {
115762
+ const expressionProps = {};
115763
+ if (!newValue) {
115764
+ // remove formal expression
115765
+ expressionProps[propertyName] = undefined;
115766
+ return {
115767
+ element,
115768
+ moddleElement,
115769
+ properties: expressionProps
115770
+ };
115771
+ }
115772
+ const existingExpression = moddleElement.get(propertyName);
115773
+ if (existingExpression) {
115774
+ // edit existing formal expression
115775
+ return {
115776
+ element,
115777
+ moddleElement: existingExpression,
115778
+ properties: {
115779
+ body: newValue
115780
+ }
115781
+ };
115782
+ }
115783
+
115784
+ // add formal expression
115785
+ expressionProps[propertyName] = createElement$6('bpmn:FormalExpression', {
115786
+ body: newValue
115787
+ }, moddleElement, bpmnFactory);
115788
+ return {
115789
+ element,
115790
+ moddleElement,
115791
+ properties: expressionProps
115792
+ };
115793
+ }
115794
+
115795
+ /**
115796
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
115797
+ */
115798
+
115799
+ /**
115800
+ * @returns {Array<Entry>} entries
115801
+ */
115802
+ function AdHocCompletionProps$1(props) {
115803
+ const {
115804
+ element
115805
+ } = props;
115806
+ if (!is$5(element, 'bpmn:AdHocSubProcess')) {
115807
+ return [];
115808
+ }
115809
+ return [{
115810
+ id: 'completionCondition',
115811
+ component: CompletionCondition$3,
115812
+ isEdited: isEdited
115813
+ }, {
115814
+ id: 'cancelRemainingInstances',
115815
+ component: CancelRemainingInstances,
115816
+ isEdited: node => node && !node.checked // the default value is true
115817
+ }];
115818
+ }
115819
+ function CompletionCondition$3(props) {
115820
+ const {
115821
+ element
115822
+ } = props;
115823
+ const bpmnFactory = useService$1('bpmnFactory');
115824
+ const debounce = useService$1('debounceInput');
115825
+ const commandStack = useService$1('commandStack');
115826
+ const translate = useService$1('translate');
115827
+ const getValue = () => {
115828
+ const expression = getBusinessObject$2(element).get('completionCondition');
115829
+ return expression && expression.get('body');
115830
+ };
115831
+ const setValue = value => {
115832
+ return createOrUpdateFormalExpression(element, getBusinessObject$2(element), 'completionCondition', value, bpmnFactory, commandStack);
115833
+ };
115834
+ return TextfieldEntry({
115835
+ element,
115836
+ id: 'completionCondition',
115837
+ label: translate('Completion condition'),
115838
+ getValue,
115839
+ setValue,
115840
+ debounce
115841
+ });
115842
+ }
115843
+ function CancelRemainingInstances(props) {
115844
+ const {
115845
+ element
115846
+ } = props;
115847
+ const commandStack = useService$1('commandStack');
115848
+ const translate = useService$1('translate');
115849
+ const businessObject = getBusinessObject$2(element);
115850
+ const getValue = () => {
115851
+ return businessObject.get('cancelRemainingInstances');
115852
+ };
115853
+ const setValue = value => {
115854
+ commandStack.execute('element.updateModdleProperties', {
115855
+ element,
115856
+ moddleElement: businessObject,
115857
+ properties: {
115858
+ cancelRemainingInstances: value
115859
+ }
115860
+ });
115861
+ };
115862
+ return CheckboxEntry({
115863
+ element,
115864
+ id: 'cancelRemainingInstances',
115865
+ label: translate('Cancel remaining instances'),
115866
+ getValue,
115867
+ setValue
115868
+ });
115869
+ }
115870
+
115632
115871
  function ReferenceSelectEntry$1(props) {
115633
115872
  const {
115634
115873
  autoFocusEntry,
@@ -116057,51 +116296,6 @@
116057
116296
  };
116058
116297
  }
116059
116298
 
116060
- /**
116061
- * Create a new element and (optionally) set its parent.
116062
- *
116063
- * @param {string} type
116064
- * @param {Object} properties
116065
- * @param {import('bpmn-js/lib/model/Types').ModdleElement} parent
116066
- * @param {import('bpmn-js/lib/features/modeling/BpmnFactory').default} bpmnFactory
116067
- *
116068
- * @returns {import('bpmn-js/lib/model/Types').ModdleElement}
116069
- */
116070
- function createElement$3(type, properties, parent, bpmnFactory) {
116071
- const element = bpmnFactory.create(type, properties);
116072
- if (parent) {
116073
- element.$parent = parent;
116074
- }
116075
- return element;
116076
- }
116077
-
116078
- /**
116079
- * generate a semantic id with given prefix
116080
- */
116081
- function nextId$1(prefix) {
116082
- const ids = new Ids$1([32, 32, 1]);
116083
- return ids.nextPrefixed(prefix);
116084
- }
116085
- function getRoot$1(businessObject) {
116086
- let parent = businessObject;
116087
- while (parent.$parent) {
116088
- parent = parent.$parent;
116089
- }
116090
- return parent;
116091
- }
116092
- function filterElementsByType$1(objectList, type) {
116093
- const list = objectList || [];
116094
- return list.filter(element => is$5(element, type));
116095
- }
116096
- function findRootElementsByType$1(businessObject, referencedType) {
116097
- const root = getRoot$1(businessObject);
116098
- return filterElementsByType$1(root.get('rootElements'), referencedType);
116099
- }
116100
- function findRootElementById$1(businessObject, type, id) {
116101
- const elements = findRootElementsByType$1(businessObject, type);
116102
- return elements.find(element => element.id === id);
116103
- }
116104
-
116105
116299
  const EMPTY_OPTION$4 = '';
116106
116300
  const CREATE_NEW_OPTION$4 = 'create-new';
116107
116301
 
@@ -116160,7 +116354,7 @@
116160
116354
 
116161
116355
  // (1) create new error
116162
116356
  if (value === CREATE_NEW_OPTION$4) {
116163
- error = createElement$3('bpmn:Error', {
116357
+ error = createElement$6('bpmn:Error', {
116164
116358
  name: nextId$1('Error_')
116165
116359
  }, root, bpmnFactory);
116166
116360
  value = error.get('id');
@@ -116339,7 +116533,7 @@
116339
116533
  // (1) create new escalation
116340
116534
  if (value === CREATE_NEW_OPTION$3) {
116341
116535
  const id = nextId$1('Escalation_');
116342
- escalation = createElement$3('bpmn:Escalation', {
116536
+ escalation = createElement$6('bpmn:Escalation', {
116343
116537
  id,
116344
116538
  name: id
116345
116539
  }, root, bpmnFactory);
@@ -116727,7 +116921,7 @@
116727
116921
  // (1) create new message
116728
116922
  if (value === CREATE_NEW_OPTION$2) {
116729
116923
  const id = nextId$1('Message_');
116730
- message = createElement$3('bpmn:Message', {
116924
+ message = createElement$6('bpmn:Message', {
116731
116925
  id,
116732
116926
  name: id
116733
116927
  }, root, bpmnFactory);
@@ -116843,7 +117037,7 @@
116843
117037
  isEdited: isEdited
116844
117038
  }, {
116845
117039
  id: 'completionCondition',
116846
- component: CompletionCondition$1,
117040
+ component: CompletionCondition$2,
116847
117041
  isEdited: isEdited
116848
117042
  }];
116849
117043
  return entries;
@@ -116860,7 +117054,7 @@
116860
117054
  return getLoopCardinalityValue(element);
116861
117055
  };
116862
117056
  const setValue = value => {
116863
- return commandStack.execute('element.updateModdleProperties', updateFormalExpression(element, 'loopCardinality', value, bpmnFactory));
117057
+ return createOrUpdateFormalExpression(element, getLoopCharacteristics$2(element), 'loopCardinality', value, bpmnFactory, commandStack);
116864
117058
  };
116865
117059
  return TextfieldEntry({
116866
117060
  element,
@@ -116871,7 +117065,7 @@
116871
117065
  debounce
116872
117066
  });
116873
117067
  }
116874
- function CompletionCondition$1(props) {
117068
+ function CompletionCondition$2(props) {
116875
117069
  const {
116876
117070
  element
116877
117071
  } = props;
@@ -116883,7 +117077,7 @@
116883
117077
  return getCompletionConditionValue(element);
116884
117078
  };
116885
117079
  const setValue = value => {
116886
- return commandStack.execute('element.updateModdleProperties', updateFormalExpression(element, 'completionCondition', value, bpmnFactory));
117080
+ return createOrUpdateFormalExpression(element, getLoopCharacteristics$2(element), 'completionCondition', value, bpmnFactory, commandStack);
116887
117081
  };
116888
117082
  return TextfieldEntry({
116889
117083
  element,
@@ -116944,62 +117138,6 @@
116944
117138
  return bo.loopCharacteristics;
116945
117139
  }
116946
117140
 
116947
- /**
116948
- * createFormalExpression - creates a 'bpmn:FormalExpression' element.
116949
- *
116950
- * @param {ModdleElement} parent
116951
- * @param {string} body
116952
- * @param {BpmnFactory} bpmnFactory
116953
- *
116954
- * @result {ModdleElement<bpmn:FormalExpression>} a formal expression
116955
- */
116956
- function createFormalExpression$1(parent, body, bpmnFactory) {
116957
- return createElement$3('bpmn:FormalExpression', {
116958
- body: body
116959
- }, parent, bpmnFactory);
116960
- }
116961
-
116962
- /**
116963
- * updateFormalExpression - updates a specific formal expression of the loop characteristics.
116964
- *
116965
- * @param {djs.model.Base} element
116966
- * @param {string} propertyName
116967
- * @param {string} newValue
116968
- * @param {BpmnFactory} bpmnFactory
116969
- */
116970
- function updateFormalExpression(element, propertyName, newValue, bpmnFactory) {
116971
- const loopCharacteristics = getLoopCharacteristics$2(element);
116972
- const expressionProps = {};
116973
- if (!newValue) {
116974
- // remove formal expression
116975
- expressionProps[propertyName] = undefined;
116976
- return {
116977
- element,
116978
- moddleElement: loopCharacteristics,
116979
- properties: expressionProps
116980
- };
116981
- }
116982
- const existingExpression = loopCharacteristics.get(propertyName);
116983
- if (!existingExpression) {
116984
- // add formal expression
116985
- expressionProps[propertyName] = createFormalExpression$1(loopCharacteristics, newValue, bpmnFactory);
116986
- return {
116987
- element,
116988
- moddleElement: loopCharacteristics,
116989
- properties: expressionProps
116990
- };
116991
- }
116992
-
116993
- // edit existing formal expression
116994
- return {
116995
- element,
116996
- moddleElement: existingExpression,
116997
- properties: {
116998
- body: newValue
116999
- }
117000
- };
117001
- }
117002
-
117003
117141
  // loopCardinality
117004
117142
 
117005
117143
  /**
@@ -117310,7 +117448,7 @@
117310
117448
  // (1) create new signal
117311
117449
  if (value === CREATE_NEW_OPTION$1) {
117312
117450
  const id = nextId$1('Signal_');
117313
- signal = createElement$3('bpmn:Signal', {
117451
+ signal = createElement$6('bpmn:Signal', {
117314
117452
  id,
117315
117453
  name: id
117316
117454
  }, root, bpmnFactory);
@@ -117840,8 +117978,23 @@
117840
117978
  }
117841
117979
  return null;
117842
117980
  }
117981
+ function AdHocCompletionGroup(element, injector) {
117982
+ const translate = injector.get('translate');
117983
+ const group = {
117984
+ label: translate('Completion'),
117985
+ id: 'adHocCompletion',
117986
+ component: Group$1,
117987
+ entries: [...AdHocCompletionProps$1({
117988
+ element
117989
+ })]
117990
+ };
117991
+ if (group.entries.length) {
117992
+ return group;
117993
+ }
117994
+ return null;
117995
+ }
117843
117996
  function getGroups(element, injector) {
117844
- const groups = [GeneralGroup(element, injector), DocumentationGroup(element, injector), CompensationGroup(element, injector), ErrorGroup(element, injector), LinkGroup(element, injector), MessageGroup(element, injector), MultiInstanceGroup(element, injector), SignalGroup(element, injector), EscalationGroup(element, injector), TimerGroup(element, injector)];
117997
+ const groups = [GeneralGroup(element, injector), DocumentationGroup(element, injector), CompensationGroup(element, injector), ErrorGroup(element, injector), LinkGroup(element, injector), MessageGroup(element, injector), MultiInstanceGroup(element, injector), AdHocCompletionGroup(element, injector), SignalGroup(element, injector), EscalationGroup(element, injector), TimerGroup(element, injector)];
117845
117998
 
117846
117999
  // contract: if a group returns null, it should not be displayed at all
117847
118000
  return groups.filter(group => group !== null);
@@ -117978,7 +118131,7 @@
117978
118131
 
117979
118132
  // (1) create bpmn:ExtensionElements if it doesn't exist
117980
118133
  if (!extensionElements) {
117981
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118134
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
117982
118135
  values: []
117983
118136
  }, businessObject, bpmnFactory);
117984
118137
  commands.push({
@@ -118077,7 +118230,7 @@
118077
118230
  const extensionElement = getExtensionElement(element);
118078
118231
  if (!extensionElement) {
118079
118232
  // (1) create extension element
118080
- const adHoc = createElement$3('zeebe:AdHoc', {
118233
+ const adHoc = createElement$6('zeebe:AdHoc', {
118081
118234
  activeElementsCollection: value
118082
118235
  }, undefined, bpmnFactory);
118083
118236
  const businessObject = getBusinessObject$2(element);
@@ -118099,6 +118252,52 @@
118099
118252
  return extensions[0];
118100
118253
  }
118101
118254
 
118255
+ /**
118256
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
118257
+ */
118258
+
118259
+ /**
118260
+ * @returns {Array<Entry>} entries
118261
+ */
118262
+ function AdHocCompletionProps(props) {
118263
+ const {
118264
+ element
118265
+ } = props;
118266
+ if (!is$5(element, 'bpmn:AdHocSubProcess')) {
118267
+ return [];
118268
+ }
118269
+ return [{
118270
+ id: 'completionCondition',
118271
+ component: CompletionCondition$1,
118272
+ isEdited: isEdited$6
118273
+ }];
118274
+ }
118275
+ function CompletionCondition$1(props) {
118276
+ const {
118277
+ element
118278
+ } = props;
118279
+ const bpmnFactory = useService$1('bpmnFactory');
118280
+ const debounce = useService$1('debounceInput');
118281
+ const commandStack = useService$1('commandStack');
118282
+ const translate = useService$1('translate');
118283
+ const getValue = () => {
118284
+ const expression = getBusinessObject$2(element).get('completionCondition');
118285
+ return expression && expression.get('body');
118286
+ };
118287
+ const setValue = value => {
118288
+ return createOrUpdateFormalExpression(element, getBusinessObject$2(element), 'completionCondition', value, bpmnFactory, commandStack);
118289
+ };
118290
+ return FeelEntryWithVariableContext$1({
118291
+ element,
118292
+ id: 'completionCondition',
118293
+ label: translate('Completion condition'),
118294
+ feel: 'required',
118295
+ getValue,
118296
+ setValue,
118297
+ debounce
118298
+ });
118299
+ }
118300
+
118102
118301
  function AssignmentDefinitionProps(props) {
118103
118302
  const {
118104
118303
  element
@@ -118138,7 +118337,7 @@
118138
118337
 
118139
118338
  // (1) ensure extension elements
118140
118339
  if (!extensionElements) {
118141
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118340
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118142
118341
  values: []
118143
118342
  }, businessObject, bpmnFactory);
118144
118343
  commands.push({
@@ -118156,7 +118355,7 @@
118156
118355
  // (2) ensure AssignmentDefinition
118157
118356
  let assignmentDefinition = getAssignmentDefinition(element);
118158
118357
  if (!assignmentDefinition) {
118159
- assignmentDefinition = createElement$3('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory);
118358
+ assignmentDefinition = createElement$6('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory);
118160
118359
  commands.push({
118161
118360
  cmd: 'element.updateModdleProperties',
118162
118361
  context: {
@@ -118212,7 +118411,7 @@
118212
118411
 
118213
118412
  // (1) ensure extension elements
118214
118413
  if (!extensionElements) {
118215
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118414
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118216
118415
  values: []
118217
118416
  }, businessObject, bpmnFactory);
118218
118417
  commands.push({
@@ -118230,7 +118429,7 @@
118230
118429
  // (2) ensure assignmentDefinition
118231
118430
  let assignmentDefinition = getAssignmentDefinition(element);
118232
118431
  if (!assignmentDefinition) {
118233
- assignmentDefinition = createElement$3('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory);
118432
+ assignmentDefinition = createElement$6('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory);
118234
118433
  commands.push({
118235
118434
  cmd: 'element.updateModdleProperties',
118236
118435
  context: {
@@ -118284,7 +118483,7 @@
118284
118483
 
118285
118484
  // (1) ensure extension elements
118286
118485
  if (!extensionElements) {
118287
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118486
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118288
118487
  values: []
118289
118488
  }, businessObject, bpmnFactory);
118290
118489
  commands.push({
@@ -118302,7 +118501,7 @@
118302
118501
  // (2) ensure assignmentDefinition
118303
118502
  let assignmentDefinition = getAssignmentDefinition(element);
118304
118503
  if (!assignmentDefinition) {
118305
- assignmentDefinition = createElement$3('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory);
118504
+ assignmentDefinition = createElement$6('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory);
118306
118505
  commands.push({
118307
118506
  cmd: 'element.updateModdleProperties',
118308
118507
  context: {
@@ -118426,7 +118625,7 @@
118426
118625
  const bpmnFactory = useService$1('bpmnFactory');
118427
118626
  const translate = useService$1('translate');
118428
118627
  const getValue = () => {
118429
- if (getCalledDecision$1(element)) {
118628
+ if (getCalledDecision$1$1(element)) {
118430
118629
  return DMN_IMPLEMENTATION_OPTION;
118431
118630
  }
118432
118631
  if (getTaskDefinition$2(element)) {
@@ -118443,7 +118642,7 @@
118443
118642
  const setValue = value => {
118444
118643
  let extensionElement, extensionElementType;
118445
118644
  if (value === DMN_IMPLEMENTATION_OPTION) {
118446
- extensionElement = getCalledDecision$1(element);
118645
+ extensionElement = getCalledDecision$1$1(element);
118447
118646
  extensionElementType = 'zeebe:CalledDecision';
118448
118647
  } else if (value === JOB_WORKER_IMPLEMENTATION_OPTION$2) {
118449
118648
  extensionElement = getTaskDefinition$2(element);
@@ -118452,7 +118651,7 @@
118452
118651
  resetElement$1(element, commandStack);
118453
118652
  }
118454
118653
  if (!extensionElement && extensionElementType) {
118455
- extensionElement = createElement$3(extensionElementType, {}, null, bpmnFactory);
118654
+ extensionElement = createElement$6(extensionElementType, {}, null, bpmnFactory);
118456
118655
  updateExtensionElements$1(element, extensionElement, bpmnFactory, commandStack);
118457
118656
  }
118458
118657
  };
@@ -118485,16 +118684,16 @@
118485
118684
  const businessObject = getBusinessObject$2(element);
118486
118685
  return getExtensionElementsList$2(businessObject, 'zeebe:TaskDefinition')[0];
118487
118686
  }
118488
- function getCalledDecision$1(element) {
118687
+ function getCalledDecision$1$1(element) {
118489
118688
  const businessObject = getBusinessObject$2(element);
118490
118689
  return getExtensionElementsList$2(businessObject, 'zeebe:CalledDecision')[0];
118491
118690
  }
118492
118691
  function isBusinessRuleImplementationEdited(element) {
118493
- return getTaskDefinition$2(element) || getCalledDecision$1(element);
118692
+ return getTaskDefinition$2(element) || getCalledDecision$1$1(element);
118494
118693
  }
118495
118694
  function resetElement$1(element, commandStack) {
118496
118695
  const businessObject = getBusinessObject$2(element);
118497
- const toRemove = [getTaskDefinition$2(element), getTaskHeaders$1(element), getCalledDecision$1(element)].filter(Boolean);
118696
+ const toRemove = [getTaskDefinition$2(element), getTaskHeaders$1(element), getCalledDecision$1$1(element)].filter(Boolean);
118498
118697
  removeExtensionElements$1(element, businessObject, toRemove, commandStack);
118499
118698
  }
118500
118699
  function updateExtensionElements$1(element, extensionElementToAdd, bpmnFactory, commandStack) {
@@ -118505,7 +118704,7 @@
118505
118704
 
118506
118705
  // (1) create bpmn:ExtensionElements if it doesn't exist
118507
118706
  if (!extensionElements) {
118508
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118707
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118509
118708
  values: []
118510
118709
  }, businessObject, bpmnFactory);
118511
118710
  commands.push({
@@ -118523,7 +118722,7 @@
118523
118722
 
118524
118723
  // (2) remove old exension element from extensionElements
118525
118724
  if (is$5(extensionElementToAdd, 'zeebe:TaskDefinition')) {
118526
- extensionElementValues = without(extensionElements.get('values'), getCalledDecision$1(element));
118725
+ extensionElementValues = without(extensionElements.get('values'), getCalledDecision$1$1(element));
118527
118726
  } else if (is$5(extensionElementToAdd, 'zeebe:CalledDecision')) {
118528
118727
  extensionElementValues = without(extensionElements.get('values'), getTaskDefinition$2(element));
118529
118728
  }
@@ -118558,7 +118757,7 @@
118558
118757
  // (1) ensure extension elements
118559
118758
  let extensionElements = businessObject.get('extensionElements');
118560
118759
  if (!extensionElements) {
118561
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118760
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118562
118761
  values: []
118563
118762
  }, businessObject, bpmnFactory);
118564
118763
  commands.push({
@@ -118576,7 +118775,7 @@
118576
118775
  // (2) ensure extension element
118577
118776
  let extensionElement = getExtensionElementsList$2(businessObject, type)[0];
118578
118777
  if (!extensionElement) {
118579
- extensionElement = createElement$3(type, {}, extensionElements, bpmnFactory);
118778
+ extensionElement = createElement$6(type, {}, extensionElements, bpmnFactory);
118580
118779
  commands.push({
118581
118780
  cmd: 'element.updateModdleProperties',
118582
118781
  context: {
@@ -118649,7 +118848,7 @@
118649
118848
  // (1) ensure extension elements
118650
118849
  let extensionElements = businessObject.get('extensionElements');
118651
118850
  if (!extensionElements) {
118652
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118851
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118653
118852
  values: []
118654
118853
  }, businessObject, bpmnFactory);
118655
118854
  commands.push({
@@ -118667,7 +118866,7 @@
118667
118866
  // (2) ensure extension element
118668
118867
  let extensionElement = getExtensionElementsList$2(businessObject, type)[0];
118669
118868
  if (!extensionElement) {
118670
- extensionElement = createElement$3(type, {}, extensionElements, bpmnFactory);
118869
+ extensionElement = createElement$6(type, {}, extensionElements, bpmnFactory);
118671
118870
  commands.push({
118672
118871
  cmd: 'element.updateModdleProperties',
118673
118872
  context: {
@@ -118768,7 +118967,7 @@
118768
118967
 
118769
118968
  // (1) ensure extension elements
118770
118969
  if (!extensionElements) {
118771
- extensionElements = createElement$3('bpmn:ExtensionElements', {
118970
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118772
118971
  values: []
118773
118972
  }, businessObject, bpmnFactory);
118774
118973
  commands.push({
@@ -118786,7 +118985,7 @@
118786
118985
  // (2) ensure calledDecision
118787
118986
  let calledDecision = getCalledDecision$2(element);
118788
118987
  if (!calledDecision) {
118789
- calledDecision = createElement$3('zeebe:CalledDecision', {}, extensionElements, bpmnFactory);
118988
+ calledDecision = createElement$6('zeebe:CalledDecision', {}, extensionElements, bpmnFactory);
118790
118989
  commands.push({
118791
118990
  cmd: 'element.updateModdleProperties',
118792
118991
  context: {
@@ -118843,7 +119042,7 @@
118843
119042
 
118844
119043
  // (1) ensure extension elements
118845
119044
  if (!extensionElements) {
118846
- extensionElements = createElement$3('bpmn:ExtensionElements', {
119045
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
118847
119046
  values: []
118848
119047
  }, businessObject, bpmnFactory);
118849
119048
  commands.push({
@@ -118861,7 +119060,7 @@
118861
119060
  // (2) ensure calledDecision
118862
119061
  let calledDecision = getCalledDecision$2(element);
118863
119062
  if (!calledDecision) {
118864
- calledDecision = createElement$3('zeebe:CalledDecision', {}, extensionElements, bpmnFactory);
119063
+ calledDecision = createElement$6('zeebe:CalledDecision', {}, extensionElements, bpmnFactory);
118865
119064
  commands.push({
118866
119065
  cmd: 'element.updateModdleProperties',
118867
119066
  context: {
@@ -118955,7 +119154,7 @@
118955
119154
 
118956
119155
  // (2) Create and set formalExpression element containing the conditionExpression,
118957
119156
  // unless the provided value is empty
118958
- const formalExpressionElement = value && value != '' ? createElement$3('bpmn:FormalExpression', {
119157
+ const formalExpressionElement = value && value != '' ? createElement$6('bpmn:FormalExpression', {
118959
119158
  body: value
118960
119159
  }, businessObject, bpmnFactory) : undefined;
118961
119160
  commands.push({
@@ -119319,7 +119518,7 @@
119319
119518
 
119320
119519
  // (1) ensure extension elements
119321
119520
  if (!extensionElements) {
119322
- extensionElements = createElement$3('bpmn:ExtensionElements', {
119521
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
119323
119522
  values: []
119324
119523
  }, businessObject, bpmnFactory);
119325
119524
  commands.push({
@@ -119338,7 +119537,7 @@
119338
119537
  let executionListeners = getExecutionListenersContainer$1(businessObject);
119339
119538
  if (!executionListeners) {
119340
119539
  const parent = extensionElements;
119341
- executionListeners = createElement$3('zeebe:ExecutionListeners', {
119540
+ executionListeners = createElement$6('zeebe:ExecutionListeners', {
119342
119541
  listeners: []
119343
119542
  }, parent, bpmnFactory);
119344
119543
  commands.push({
@@ -119354,7 +119553,7 @@
119354
119553
  }
119355
119554
 
119356
119555
  // (3) create zeebe:ExecutionListener
119357
- const executionListener = createElement$3('zeebe:ExecutionListener', getDefaultListenerProps$1(element), executionListeners, bpmnFactory);
119556
+ const executionListener = createElement$6('zeebe:ExecutionListener', getDefaultListenerProps$1(element), executionListeners, bpmnFactory);
119358
119557
 
119359
119558
  // (4) add executionListener to list
119360
119559
  commands.push({
@@ -119418,14 +119617,14 @@
119418
119617
  CUSTOM_FORM: 'custom-form',
119419
119618
  EXTERNAL_REFERENCE: 'external-reference'
119420
119619
  };
119421
- function getFormDefinition$1(element) {
119620
+ function getFormDefinition$2(element) {
119422
119621
  const businessObject = getBusinessObject$2(element);
119423
119622
  const formDefinitions = getExtensionElementsList$2(businessObject, 'zeebe:FormDefinition');
119424
119623
  return formDefinitions[0];
119425
119624
  }
119426
119625
  function getUserTaskForm$1(element, rootElement) {
119427
119626
  rootElement = rootElement || getRootElement$1$1(element);
119428
- const formDefinition = getFormDefinition$1(element);
119627
+ const formDefinition = getFormDefinition$2(element);
119429
119628
  if (!formDefinition) {
119430
119629
  return;
119431
119630
  }
@@ -119450,7 +119649,7 @@
119450
119649
  return parent;
119451
119650
  }
119452
119651
  function getFormType$1(element) {
119453
- const formDefinition = getFormDefinition$1(element);
119652
+ const formDefinition = getFormDefinition$2(element);
119454
119653
  if (!formDefinition) {
119455
119654
  return;
119456
119655
  }
@@ -119631,7 +119830,7 @@
119631
119830
  injector = useService$1('injector'),
119632
119831
  translate = useService$1('translate');
119633
119832
  const getValue = () => {
119634
- return getFormDefinition$1(element).get('formId');
119833
+ return getFormDefinition$2(element).get('formId');
119635
119834
  };
119636
119835
  const setValue = value => {
119637
119836
  setFormId(injector, element, isUndefined$5(value) ? '' : value);
@@ -119653,7 +119852,7 @@
119653
119852
  injector = useService$1('injector'),
119654
119853
  translate = useService$1('translate');
119655
119854
  const getValue = () => {
119656
- const formDefinition = getFormDefinition$1(element);
119855
+ const formDefinition = getFormDefinition$2(element);
119657
119856
  return formDefinition.get('formKey');
119658
119857
  };
119659
119858
  const setValue = value => {
@@ -119676,7 +119875,7 @@
119676
119875
  injector = useService$1('injector'),
119677
119876
  translate = useService$1('translate');
119678
119877
  const getValue = () => {
119679
- const formDefinition = getFormDefinition$1(element);
119878
+ const formDefinition = getFormDefinition$2(element);
119680
119879
  return formDefinition.get('externalReference');
119681
119880
  };
119682
119881
  const setValue = value => {
@@ -119724,7 +119923,7 @@
119724
119923
  };
119725
119924
  }
119726
119925
  const bpmnFactory = injector.get('bpmnFactory');
119727
- extensionElements = createElement$3('bpmn:ExtensionElements', {
119926
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
119728
119927
  values: []
119729
119928
  }, businessObject, bpmnFactory);
119730
119929
  return {
@@ -119745,7 +119944,7 @@
119745
119944
  * } }
119746
119945
  */
119747
119946
  function getOrCreateFormDefintition(injector, element) {
119748
- let formDefinition = getFormDefinition$1(element);
119947
+ let formDefinition = getFormDefinition$2(element);
119749
119948
  if (formDefinition) {
119750
119949
  return {
119751
119950
  commands: [],
@@ -119756,7 +119955,7 @@
119756
119955
  extensionElements,
119757
119956
  commands
119758
119957
  } = getOrCreateExtensionElements(injector, element);
119759
- formDefinition = createFormDefinition(injector, {}, extensionElements);
119958
+ formDefinition = createFormDefinition$2(injector, {}, extensionElements);
119760
119959
  return {
119761
119960
  commands: [...commands, createUpdateModdlePropertiesCommand(element, extensionElements, {
119762
119961
  values: [...extensionElements.get('values'), formDefinition]
@@ -119780,7 +119979,7 @@
119780
119979
  if (userTaskForm) {
119781
119980
  return {
119782
119981
  commands: [],
119783
- formDefinition: getFormDefinition$1(element),
119982
+ formDefinition: getFormDefinition$2(element),
119784
119983
  userTaskForm
119785
119984
  };
119786
119985
  }
@@ -119848,7 +120047,7 @@
119848
120047
  })]);
119849
120048
  }
119850
120049
  function removeFormDefinition(injector, element) {
119851
- const formDefinition = getFormDefinition$1(element);
120050
+ const formDefinition = getFormDefinition$2(element);
119852
120051
 
119853
120052
  /**
119854
120053
  * @type {import('bpmn-js/lib/features/modeling/Modeling').default}
@@ -119870,9 +120069,9 @@
119870
120069
  *
119871
120070
  * @returns {ModdleElement}
119872
120071
  */
119873
- function createFormDefinition(injector, properties, parent) {
120072
+ function createFormDefinition$2(injector, properties, parent) {
119874
120073
  const bpmnFactory = injector.get('bpmnFactory');
119875
- return createElement$3('zeebe:FormDefinition', properties, parent, bpmnFactory);
120074
+ return createElement$6('zeebe:FormDefinition', properties, parent, bpmnFactory);
119876
120075
  }
119877
120076
 
119878
120077
  /**
@@ -119884,7 +120083,7 @@
119884
120083
  */
119885
120084
  function createUserTaskForm(injector, properties, parent) {
119886
120085
  const bpmnFactory = injector.get('bpmnFactory');
119887
- return createElement$3('zeebe:UserTaskForm', properties, parent, bpmnFactory);
120086
+ return createElement$6('zeebe:UserTaskForm', properties, parent, bpmnFactory);
119888
120087
  }
119889
120088
 
119890
120089
  /**
@@ -120077,7 +120276,7 @@
120077
120276
 
120078
120277
  // (1) ensure extension elements
120079
120278
  if (!extensionElements) {
120080
- extensionElements = createElement$3('bpmn:ExtensionElements', {
120279
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
120081
120280
  values: []
120082
120281
  }, businessObject, bpmnFactory);
120083
120282
  commands.push({
@@ -120096,7 +120295,7 @@
120096
120295
  let taskHeaders = getTaskHeaders$1(element);
120097
120296
  if (!taskHeaders) {
120098
120297
  const parent = extensionElements;
120099
- taskHeaders = createElement$3('zeebe:TaskHeaders', {
120298
+ taskHeaders = createElement$6('zeebe:TaskHeaders', {
120100
120299
  values: []
120101
120300
  }, parent, bpmnFactory);
120102
120301
  commands.push({
@@ -120112,7 +120311,7 @@
120112
120311
  }
120113
120312
 
120114
120313
  // (3) create header
120115
- const header = createElement$3('zeebe:Header', {}, taskHeaders, bpmnFactory);
120314
+ const header = createElement$6('zeebe:Header', {}, taskHeaders, bpmnFactory);
120116
120315
 
120117
120316
  // (4) add header to list
120118
120317
  commands.push({
@@ -120130,10 +120329,10 @@
120130
120329
  }
120131
120330
 
120132
120331
  function getProcessId(element) {
120133
- const calledElement = getCalledElement$1(element);
120332
+ const calledElement = getCalledElement$2(element);
120134
120333
  return calledElement ? calledElement.get('processId') : '';
120135
120334
  }
120136
- function getCalledElement$1(element) {
120335
+ function getCalledElement$2(element) {
120137
120336
  const calledElements = getCalledElements$1(element);
120138
120337
  return calledElements[0];
120139
120338
  }
@@ -120174,7 +120373,7 @@
120174
120373
  // (1) ensure extension elements
120175
120374
  let extensionElements = businessObject.get('extensionElements');
120176
120375
  if (!extensionElements) {
120177
- extensionElements = createElement$3('bpmn:ExtensionElements', {
120376
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
120178
120377
  values: []
120179
120378
  }, businessObject, bpmnFactory);
120180
120379
  commands.push({
@@ -120190,9 +120389,9 @@
120190
120389
  }
120191
120390
 
120192
120391
  // (2) ensure zeebe:calledElement
120193
- let calledElement = getCalledElement$1(businessObject);
120392
+ let calledElement = getCalledElement$2(businessObject);
120194
120393
  if (!calledElement) {
120195
- calledElement = createElement$3('zeebe:CalledElement', {}, extensionElements, bpmnFactory);
120394
+ calledElement = createElement$6('zeebe:CalledElement', {}, extensionElements, bpmnFactory);
120196
120395
  commands.push({
120197
120396
  cmd: 'element.updateModdleProperties',
120198
120397
  context: {
@@ -120249,7 +120448,7 @@
120249
120448
  return undefined;
120250
120449
  }
120251
120450
  const bo = getBusinessObject$2(element),
120252
- calledElement = getCalledElement$1(bo);
120451
+ calledElement = getCalledElement$2(bo);
120253
120452
  return calledElement && has$2(calledElement, 'propagateAllParentVariables') ? calledElement.get('propagateAllParentVariables') : /* default value */true;
120254
120453
  }
120255
120454
 
@@ -120391,7 +120590,7 @@
120391
120590
  return getEventDefinition$1(element, 'bpmn:TerminateEventDefinition');
120392
120591
  }
120393
120592
  function createIOMapping(properties, parent, bpmnFactory) {
120394
- return createElement$3('zeebe:IoMapping', properties, parent, bpmnFactory);
120593
+ return createElement$6('zeebe:IoMapping', properties, parent, bpmnFactory);
120395
120594
  }
120396
120595
  function isSignalThrowEvent(element) {
120397
120596
  if (!isAny$1(element, ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'])) {
@@ -120493,7 +120692,7 @@
120493
120692
 
120494
120693
  // (1) ensure extension elements
120495
120694
  if (!extensionElements) {
120496
- extensionElements = createElement$3('bpmn:ExtensionElements', {
120695
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
120497
120696
  values: []
120498
120697
  }, businessObject, bpmnFactory);
120499
120698
  commands.push({
@@ -120528,7 +120727,7 @@
120528
120727
  }
120529
120728
 
120530
120729
  // (3) create parameter
120531
- const newParameter = createElement$3('zeebe:Input', {
120730
+ const newParameter = createElement$6('zeebe:Input', {
120532
120731
  target: nextId$1('InputVariable_')
120533
120732
  }, ioMapping, bpmnFactory);
120534
120733
 
@@ -120620,7 +120819,7 @@
120620
120819
 
120621
120820
  // (1) ensure extension elements
120622
120821
  if (!extensionElements) {
120623
- extensionElements = createElement$3('bpmn:ExtensionElements', {
120822
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
120624
120823
  values: []
120625
120824
  }, message, bpmnFactory);
120626
120825
  commands.push({
@@ -120638,7 +120837,7 @@
120638
120837
 
120639
120838
  // (2a) add subscription with correlation key
120640
120839
  if (!subscription) {
120641
- subscription = createElement$3('zeebe:Subscription', properties, extensionElements, bpmnFactory);
120840
+ subscription = createElement$6('zeebe:Subscription', properties, extensionElements, bpmnFactory);
120642
120841
  commands.push({
120643
120842
  cmd: 'element.updateModdleProperties',
120644
120843
  context: {
@@ -120844,15 +121043,7 @@
120844
121043
  return completionCondition && completionCondition.get('body');
120845
121044
  };
120846
121045
  const setValue = value => {
120847
- if (value && value !== '') {
120848
- const loopCharacteristics = getLoopCharacteristics$1(element);
120849
- const completionCondition = createElement$3('bpmn:FormalExpression', {
120850
- body: value
120851
- }, loopCharacteristics, bpmnFactory);
120852
- setCompletionCondition(element, commandStack, completionCondition);
120853
- } else {
120854
- setCompletionCondition(element, commandStack, undefined);
120855
- }
121046
+ return createOrUpdateFormalExpression(element, getLoopCharacteristics$1(element), 'completionCondition', value, bpmnFactory, commandStack);
120856
121047
  };
120857
121048
  return FeelEntryWithVariableContext$1({
120858
121049
  element,
@@ -120881,15 +121072,6 @@
120881
121072
  function getCompletionCondition(element) {
120882
121073
  return getLoopCharacteristics$1(element).get('completionCondition');
120883
121074
  }
120884
- function setCompletionCondition(element, commandStack, completionCondition = undefined) {
120885
- commandStack.execute('element.updateModdleProperties', {
120886
- element,
120887
- moddleElement: getLoopCharacteristics$1(element),
120888
- properties: {
120889
- completionCondition
120890
- }
120891
- });
120892
- }
120893
121075
  function getProperty$1(element, propertyName) {
120894
121076
  const loopCharacteristics = getLoopCharacteristics$1(element),
120895
121077
  zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
@@ -120902,7 +121084,7 @@
120902
121084
  // (1) ensure extension elements
120903
121085
  let extensionElements = loopCharacteristics.get('extensionElements');
120904
121086
  if (!extensionElements) {
120905
- extensionElements = createElement$3('bpmn:ExtensionElements', {
121087
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
120906
121088
  values: []
120907
121089
  }, loopCharacteristics, bpmnFactory);
120908
121090
  commands.push({
@@ -120920,7 +121102,7 @@
120920
121102
  // (2) ensure zeebe loop characteristics
120921
121103
  let zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
120922
121104
  if (!zeebeLoopCharacteristics) {
120923
- zeebeLoopCharacteristics = createElement$3('zeebe:LoopCharacteristics', {}, extensionElements, bpmnFactory);
121105
+ zeebeLoopCharacteristics = createElement$6('zeebe:LoopCharacteristics', {}, extensionElements, bpmnFactory);
120924
121106
  commands.push({
120925
121107
  cmd: 'element.updateModdleProperties',
120926
121108
  context: {
@@ -120980,7 +121162,7 @@
120980
121162
  // (1) ensure extension elements
120981
121163
  let extensionElements = businessObject.get('extensionElements');
120982
121164
  if (!extensionElements) {
120983
- extensionElements = createElement$3('bpmn:ExtensionElements', {
121165
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
120984
121166
  values: []
120985
121167
  }, businessObject, bpmnFactory);
120986
121168
  commands.push({
@@ -120996,9 +121178,9 @@
120996
121178
  }
120997
121179
 
120998
121180
  // (2) ensure zeebe:calledElement
120999
- let calledElement = getCalledElement$1(businessObject);
121181
+ let calledElement = getCalledElement$2(businessObject);
121000
121182
  if (!calledElement) {
121001
- calledElement = createElement$3('zeebe:CalledElement', {}, extensionElements, bpmnFactory);
121183
+ calledElement = createElement$6('zeebe:CalledElement', {}, extensionElements, bpmnFactory);
121002
121184
  commands.push({
121003
121185
  cmd: 'element.updateModdleProperties',
121004
121186
  context: {
@@ -121069,7 +121251,7 @@
121069
121251
  return undefined;
121070
121252
  }
121071
121253
  const bo = getBusinessObject$2(element),
121072
- calledElement = getCalledElement$1(bo);
121254
+ calledElement = getCalledElement$2(bo);
121073
121255
  return calledElement && has$2(calledElement, 'propagateAllChildVariables') ? calledElement.get('propagateAllChildVariables') : determinePropAllChildVariablesDefault(element);
121074
121256
  }
121075
121257
 
@@ -121166,7 +121348,7 @@
121166
121348
 
121167
121349
  // (1) ensure extension elements
121168
121350
  if (!extensionElements) {
121169
- extensionElements = createElement$3('bpmn:ExtensionElements', {
121351
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
121170
121352
  values: []
121171
121353
  }, businessObject, bpmnFactory);
121172
121354
  commands.push({
@@ -121202,7 +121384,7 @@
121202
121384
  }
121203
121385
 
121204
121386
  // (3) create parameter
121205
- const newParameter = createElement$3('zeebe:Output', {
121387
+ const newParameter = createElement$6('zeebe:Output', {
121206
121388
  target: nextId$1('OutputVariable_')
121207
121389
  }, ioMapping, bpmnFactory);
121208
121390
 
@@ -121279,7 +121461,7 @@
121279
121461
  });
121280
121462
  } else if (!priorityDefinition && !isNullValue) {
121281
121463
  // (2c) create priority definition if it does not exist
121282
- priorityDefinition = createElement$3('zeebe:PriorityDefinition', {
121464
+ priorityDefinition = createElement$6('zeebe:PriorityDefinition', {
121283
121465
  priority: value
121284
121466
  }, extensionElements, bpmnFactory);
121285
121467
  commands.push({
@@ -121370,7 +121552,7 @@
121370
121552
  resetElement(element, commandStack);
121371
121553
  }
121372
121554
  if (!extensionElement && extensionElementType) {
121373
- extensionElement = createElement$3(extensionElementType, {}, null, bpmnFactory);
121555
+ extensionElement = createElement$6(extensionElementType, {}, null, bpmnFactory);
121374
121556
  updateExtensionElements(element, extensionElement, bpmnFactory, commandStack);
121375
121557
  }
121376
121558
  };
@@ -121436,7 +121618,7 @@
121436
121618
 
121437
121619
  // (1) create bpmn:ExtensionElements if it doesn't exist
121438
121620
  if (!extensionElements) {
121439
- extensionElements = createElement$3('bpmn:ExtensionElements', {
121621
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
121440
121622
  values: []
121441
121623
  }, businessObject, bpmnFactory);
121442
121624
  commands.push({
@@ -121510,7 +121692,7 @@
121510
121692
 
121511
121693
  // (1) ensure extension elements
121512
121694
  if (!extensionElements) {
121513
- extensionElements = createElement$3('bpmn:ExtensionElements', {
121695
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
121514
121696
  values: []
121515
121697
  }, businessObject, bpmnFactory);
121516
121698
  commands.push({
@@ -121528,7 +121710,7 @@
121528
121710
  // (2) ensure script
121529
121711
  let script = getScript(element);
121530
121712
  if (!script) {
121531
- script = createElement$3('zeebe:Script', {}, extensionElements, bpmnFactory);
121713
+ script = createElement$6('zeebe:Script', {}, extensionElements, bpmnFactory);
121532
121714
  commands.push({
121533
121715
  cmd: 'element.updateModdleProperties',
121534
121716
  context: {
@@ -121585,7 +121767,7 @@
121585
121767
 
121586
121768
  // (1) ensure extension elements
121587
121769
  if (!extensionElements) {
121588
- extensionElements = createElement$3('bpmn:ExtensionElements', {
121770
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
121589
121771
  values: []
121590
121772
  }, businessObject, bpmnFactory);
121591
121773
  commands.push({
@@ -121603,7 +121785,7 @@
121603
121785
  // (2) ensure script
121604
121786
  let script = getScript(element);
121605
121787
  if (!script) {
121606
- script = createElement$3('zeebe:Script', {}, extensionElements, bpmnFactory);
121788
+ script = createElement$6('zeebe:Script', {}, extensionElements, bpmnFactory);
121607
121789
  commands.push({
121608
121790
  cmd: 'element.updateModdleProperties',
121609
121791
  context: {
@@ -121750,7 +121932,7 @@
121750
121932
  // (1) ensure extension elements
121751
121933
  let extensionElements = businessObject.get('extensionElements');
121752
121934
  if (!extensionElements) {
121753
- extensionElements = createElement$3('bpmn:ExtensionElements', {
121935
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
121754
121936
  values: []
121755
121937
  }, businessObject, bpmnFactory);
121756
121938
  commands.push({
@@ -121766,9 +121948,9 @@
121766
121948
  }
121767
121949
 
121768
121950
  // (2) ensure zeebe:calledElement
121769
- let calledElement = getCalledElement$1(businessObject);
121951
+ let calledElement = getCalledElement$2(businessObject);
121770
121952
  if (!calledElement) {
121771
- calledElement = createElement$3('zeebe:CalledElement', {}, extensionElements, bpmnFactory);
121953
+ calledElement = createElement$6('zeebe:CalledElement', {}, extensionElements, bpmnFactory);
121772
121954
  commands.push({
121773
121955
  cmd: 'element.updateModdleProperties',
121774
121956
  context: {
@@ -121843,7 +122025,7 @@
121843
122025
 
121844
122026
  // (1) ensure extension elements
121845
122027
  if (!extensionElements) {
121846
- extensionElements = createElement$3('bpmn:ExtensionElements', {
122028
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
121847
122029
  values: []
121848
122030
  }, businessObject, bpmnFactory);
121849
122031
  commands.push({
@@ -121861,7 +122043,7 @@
121861
122043
  // (2) ensure task definition
121862
122044
  let taskDefinition = getTaskDefinition$4(element);
121863
122045
  if (!taskDefinition) {
121864
- taskDefinition = createElement$3('zeebe:TaskDefinition', {}, extensionElements, bpmnFactory);
122046
+ taskDefinition = createElement$6('zeebe:TaskDefinition', {}, extensionElements, bpmnFactory);
121865
122047
  commands.push({
121866
122048
  cmd: 'element.updateModdleProperties',
121867
122049
  context: {
@@ -121918,7 +122100,7 @@
121918
122100
 
121919
122101
  // (1) ensure extension elements
121920
122102
  if (!extensionElements) {
121921
- extensionElements = createElement$3('bpmn:ExtensionElements', {
122103
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
121922
122104
  values: []
121923
122105
  }, businessObject, bpmnFactory);
121924
122106
  commands.push({
@@ -121936,7 +122118,7 @@
121936
122118
  // (2) ensure task definition
121937
122119
  let taskDefinition = getTaskDefinition$4(element);
121938
122120
  if (!taskDefinition) {
121939
- taskDefinition = createElement$3('zeebe:TaskDefinition', {}, extensionElements, bpmnFactory);
122121
+ taskDefinition = createElement$6('zeebe:TaskDefinition', {}, extensionElements, bpmnFactory);
121940
122122
  commands.push({
121941
122123
  cmd: 'element.updateModdleProperties',
121942
122124
  context: {
@@ -122128,7 +122310,7 @@
122128
122310
 
122129
122311
  // (1) ensure extension elements
122130
122312
  if (!extensionElements) {
122131
- extensionElements = createElement$3('bpmn:ExtensionElements', {
122313
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
122132
122314
  values: []
122133
122315
  }, businessObject, bpmnFactory);
122134
122316
  commands.push({
@@ -122147,7 +122329,7 @@
122147
122329
  let taskListeners = getTaskListenersContainer$1(businessObject);
122148
122330
  if (!taskListeners) {
122149
122331
  const parent = extensionElements;
122150
- taskListeners = createElement$3('zeebe:TaskListeners', {
122332
+ taskListeners = createElement$6('zeebe:TaskListeners', {
122151
122333
  listeners: []
122152
122334
  }, parent, bpmnFactory);
122153
122335
  commands.push({
@@ -122163,7 +122345,7 @@
122163
122345
  }
122164
122346
 
122165
122347
  // (3) create zeebe:TaskListener
122166
- const TaskListener = createElement$3('zeebe:TaskListener', getDefaultListenerProps(), taskListeners, bpmnFactory);
122348
+ const TaskListener = createElement$6('zeebe:TaskListener', getDefaultListenerProps(), taskListeners, bpmnFactory);
122167
122349
 
122168
122350
  // (4) add TaskListener to list
122169
122351
  commands.push({
@@ -122248,7 +122430,7 @@
122248
122430
 
122249
122431
  // (1) ensure extension elements
122250
122432
  if (!extensionElements) {
122251
- extensionElements = createElement$3('bpmn:ExtensionElements', {
122433
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
122252
122434
  values: []
122253
122435
  }, businessObject, bpmnFactory);
122254
122436
  commands.push({
@@ -122266,7 +122448,7 @@
122266
122448
  // (2) ensure zeebe:TaskSchedule
122267
122449
  let taskSchedule = getTaskSchedule(element);
122268
122450
  if (!taskSchedule) {
122269
- taskSchedule = createElement$3('zeebe:TaskSchedule', {}, extensionElements, bpmnFactory);
122451
+ taskSchedule = createElement$6('zeebe:TaskSchedule', {}, extensionElements, bpmnFactory);
122270
122452
  commands.push({
122271
122453
  cmd: 'element.updateModdleProperties',
122272
122454
  context: {
@@ -122324,7 +122506,7 @@
122324
122506
 
122325
122507
  // (1) ensure extension elements
122326
122508
  if (!extensionElements) {
122327
- extensionElements = createElement$3('bpmn:ExtensionElements', {
122509
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
122328
122510
  values: []
122329
122511
  }, businessObject, bpmnFactory);
122330
122512
  commands.push({
@@ -122342,7 +122524,7 @@
122342
122524
  // (2) ensure zeebe:TaskSchedule
122343
122525
  let taskSchedule = getTaskSchedule(element);
122344
122526
  if (!taskSchedule) {
122345
- taskSchedule = createElement$3('zeebe:TaskSchedule', {}, extensionElements, bpmnFactory);
122527
+ taskSchedule = createElement$6('zeebe:TaskSchedule', {}, extensionElements, bpmnFactory);
122346
122528
  commands.push({
122347
122529
  cmd: 'element.updateModdleProperties',
122348
122530
  context: {
@@ -122733,7 +122915,7 @@
122733
122915
  */
122734
122916
  const setValue = value => {
122735
122917
  if (value === ZEEBE_USER_TASK_IMPLEMENTATION_OPTION) {
122736
- createZeebeUserTask(element, bpmnFactory, commandStack);
122918
+ createZeebeUserTask$2(element, bpmnFactory, commandStack);
122737
122919
  } else if (value === JOB_WORKER_IMPLEMENTATION_OPTION) {
122738
122920
  removeZeebeUserTask(element, commandStack);
122739
122921
  }
@@ -122759,9 +122941,9 @@
122759
122941
  }
122760
122942
 
122761
122943
  // helper ///////////////////////
122762
- function createZeebeUserTask(element, bpmnFactory, commandStack) {
122944
+ function createZeebeUserTask$2(element, bpmnFactory, commandStack) {
122763
122945
  const businessObject = getBusinessObject$2(element);
122764
- const zeebeUserTask = createElement$3('zeebe:UserTask', {}, businessObject, bpmnFactory);
122946
+ const zeebeUserTask = createElement$6('zeebe:UserTask', {}, businessObject, bpmnFactory);
122765
122947
  addExtensionElements(element, businessObject, zeebeUserTask, bpmnFactory, commandStack);
122766
122948
  }
122767
122949
  function removeZeebeUserTask(element, commandStack) {
@@ -122811,7 +122993,7 @@
122811
122993
 
122812
122994
  // (1) ensure extension elements
122813
122995
  if (!extensionElements) {
122814
- extensionElements = createElement$3('bpmn:ExtensionElements', {
122996
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
122815
122997
  values: []
122816
122998
  }, businessObject, bpmnFactory);
122817
122999
  commands.push({
@@ -122829,7 +123011,7 @@
122829
123011
  // (2) ensure version tag
122830
123012
  let versionTag = getVersionTag(element);
122831
123013
  if (!versionTag) {
122832
- versionTag = createElement$3('zeebe:VersionTag', {}, extensionElements, bpmnFactory);
123014
+ versionTag = createElement$6('zeebe:VersionTag', {}, extensionElements, bpmnFactory);
122833
123015
  commands.push({
122834
123016
  cmd: 'element.updateModdleProperties',
122835
123017
  context: {
@@ -123055,7 +123237,7 @@
123055
123237
 
123056
123238
  // (1) ensure extension elements
123057
123239
  if (!extensionElements) {
123058
- extensionElements = createElement$3('bpmn:ExtensionElements', {
123240
+ extensionElements = createElement$6('bpmn:ExtensionElements', {
123059
123241
  values: []
123060
123242
  }, businessObject, bpmnFactory);
123061
123243
  commands.push({
@@ -123075,7 +123257,7 @@
123075
123257
  let properties = getProperties(businessObject, namespace);
123076
123258
  if (!properties) {
123077
123259
  const parent = extensionElements;
123078
- properties = createElement$3(`${namespace}:Properties`, {
123260
+ properties = createElement$6(`${namespace}:Properties`, {
123079
123261
  [propertyName]: []
123080
123262
  }, parent, bpmnFactory);
123081
123263
  commands.push({
@@ -123091,7 +123273,7 @@
123091
123273
  }
123092
123274
 
123093
123275
  // (3) create camunda:Property
123094
- const property = createElement$3(`${namespace}:Property`, {}, properties, bpmnFactory);
123276
+ const property = createElement$6(`${namespace}:Property`, {}, properties, bpmnFactory);
123095
123277
 
123096
123278
  // (4) add property to list
123097
123279
  commands.push({
@@ -123159,6 +123341,7 @@
123159
123341
  updateSignalGroup(groups, element);
123160
123342
  updateTimerGroup$1(groups, element, this._injector);
123161
123343
  updateMultiInstanceGroup$1(groups, element);
123344
+ updateAdHocCompletionGroup(groups, element);
123162
123345
 
123163
123346
  // (3) remove message group when not applicable
123164
123347
  groups = removeMessageGroup(groups, element);
@@ -123494,6 +123677,23 @@
123494
123677
  })];
123495
123678
  }
123496
123679
 
123680
+ // overwrite bpmn generic adHoc completion condition with zeebe-specific one
123681
+ function updateAdHocCompletionGroup(groups, element) {
123682
+ const adHocCompletionGroup = findGroup$1(groups, 'adHocCompletion');
123683
+ if (!adHocCompletionGroup) {
123684
+ return;
123685
+ }
123686
+ adHocCompletionGroup.entries = replaceEntriesPreservingOrder(adHocCompletionGroup.entries, AdHocCompletionProps({
123687
+ element
123688
+ }));
123689
+
123690
+ // reorder groups to move active elements before adHoc completion
123691
+ const activeElementsGroup = findGroup$1(groups, 'activeElements');
123692
+ if (activeElementsGroup) {
123693
+ reorderGroupsIfNecessary(groups, activeElementsGroup, adHocCompletionGroup);
123694
+ }
123695
+ }
123696
+
123497
123697
  // remove message group from Message End Event & Message Throw Event
123498
123698
  function removeMessageGroup(groups, element) {
123499
123699
  const messageGroup = findGroup$1(groups, 'message');
@@ -123509,9 +123709,26 @@
123509
123709
  return groups.find(g => g.id === id);
123510
123710
  }
123511
123711
 
123712
+ /**
123713
+ * Put groups into the defined order if necessary.
123714
+ *
123715
+ * @param {Group[]} groups
123716
+ * @param {Group} firstGroup
123717
+ * @param {Group} secondGroup
123718
+ */
123719
+ function reorderGroupsIfNecessary(groups, firstGroup, secondGroup) {
123720
+ const firstGroupIndex = groups.indexOf(firstGroup);
123721
+ const secondGroupIndex = groups.indexOf(secondGroup);
123722
+ if (firstGroupIndex === -1 || secondGroupIndex === -1 || firstGroupIndex <= secondGroupIndex) {
123723
+ return;
123724
+ }
123725
+ groups[firstGroupIndex] = secondGroup;
123726
+ groups[secondGroupIndex] = firstGroup;
123727
+ }
123728
+
123512
123729
  /**
123513
123730
  * Replace entries with the same ID.
123514
- *s
123731
+ *
123515
123732
  * @param {Entry[]} oldEntries
123516
123733
  * @param {Entry[]} newEntries
123517
123734
  *
@@ -123522,6 +123739,44 @@
123522
123739
  return [...filteredEntries, ...newEntries];
123523
123740
  }
123524
123741
 
123742
+ /**
123743
+ * Replace entries with the same ID, preserving original order and adding new entries at the end.
123744
+ *
123745
+ * @param {Entry[]} oldEntries
123746
+ * @param {Entry[]} newEntries
123747
+ *
123748
+ * @returns {Entry[]} combined entries
123749
+ */
123750
+ function replaceEntriesPreservingOrder(oldEntries, newEntries) {
123751
+ const indexedNewEntries = indexEntriesById(newEntries);
123752
+ const indexedOldEntries = indexEntriesById(oldEntries);
123753
+ const result = [];
123754
+
123755
+ // iterate original entries and replace with new ones if ID matches
123756
+ oldEntries.forEach(oldEntry => {
123757
+ const newEntryIndex = indexedNewEntries[oldEntry.id];
123758
+ if (newEntryIndex !== undefined) {
123759
+ result.push(newEntries[newEntryIndex]);
123760
+ } else {
123761
+ result.push(oldEntry);
123762
+ }
123763
+ });
123764
+
123765
+ // append remaining new entries
123766
+ newEntries.forEach(newEntry => {
123767
+ if (indexedOldEntries[newEntry.id] === undefined) {
123768
+ result.push(newEntry);
123769
+ }
123770
+ });
123771
+ return result;
123772
+ }
123773
+ function indexEntriesById(entries) {
123774
+ return entries.reduce((index, entry, idx) => {
123775
+ index[entry.id] = idx;
123776
+ return index;
123777
+ }, {});
123778
+ }
123779
+
123525
123780
  var index$1$2 = {
123526
123781
  __init__: ['zeebePropertiesProvider'],
123527
123782
  zeebePropertiesProvider: ['type', ZeebePropertiesProvider$1]
@@ -123776,7 +124031,7 @@
123776
124031
  'group-inputs': element => {
123777
124032
  const translate = useService$1('translate');
123778
124033
  return u("div", {
123779
- children: [translate('Create a new local variable in the scope of this task. '), u("a", {
124034
+ children: [translate('Add input mappings to control what is passed to the activity as local variables. '), u("a", {
123780
124035
  href: "https://docs.camunda.io/docs/components/concepts/variables/#input-mappings",
123781
124036
  target: "_blank",
123782
124037
  rel: "noopener noreferrer",
@@ -123788,7 +124043,7 @@
123788
124043
  'group-outputs': element => {
123789
124044
  const translate = useService$1('translate');
123790
124045
  return u("div", {
123791
- children: [translate('Customize how result variables are merged into the global scope of the process instance. '), u("a", {
124046
+ children: [translate('Add output mappings to control which variables are merged back into the process scope. '), u("a", {
123792
124047
  href: "https://docs.camunda.io/docs/components/concepts/variables/#output-mappings",
123793
124048
  target: "_blank",
123794
124049
  rel: "noopener noreferrer",
@@ -123866,6 +124121,18 @@
123866
124121
  })]
123867
124122
  });
123868
124123
  },
124124
+ 'group-adHocCompletion': element => {
124125
+ const translate = useService$1('translate');
124126
+ return u("div", {
124127
+ children: [translate('Define the completion behavior of an ad-hoc subprocess. If no completion condition is set, it will be completed after all active elements have been completed. '), u("a", {
124128
+ href: "https://docs.camunda.io/docs/components/modeler/bpmn/ad-hoc#completion",
124129
+ target: "_blank",
124130
+ rel: "noopener noreferrer",
124131
+ title: translate('Ad-hoc subprocess documentation'),
124132
+ children: translate('Learn more.')
124133
+ })]
124134
+ });
124135
+ },
123869
124136
  'group-activeElements': element => {
123870
124137
  const translate = useService$1('translate');
123871
124138
  return u("div", {
@@ -124030,7 +124297,7 @@
124030
124297
  return;
124031
124298
  }
124032
124299
 
124033
- const calledDecision = getCalledDecision(element),
124300
+ const calledDecision = getCalledDecision$1(element),
124034
124301
  taskDefinition = getTaskDefinition(element);
124035
124302
 
124036
124303
  if (
@@ -124061,7 +124328,7 @@
124061
124328
  return;
124062
124329
  }
124063
124330
 
124064
- const calledDecision = getCalledDecision(element),
124331
+ const calledDecision = getCalledDecision$1(element),
124065
124332
  taskDefinition = getTaskDefinition(element),
124066
124333
  taskHeaders = getTaskHeaders(element);
124067
124334
 
@@ -124086,7 +124353,7 @@
124086
124353
 
124087
124354
  // helpers //////////
124088
124355
 
124089
- function getCalledDecision(element) {
124356
+ function getCalledDecision$1(element) {
124090
124357
  const businessObject = getBusinessObject$2(element);
124091
124358
 
124092
124359
  return getExtensionElementsList$1(businessObject, 'zeebe:CalledDecision')[ 0 ];
@@ -124713,7 +124980,7 @@
124713
124980
  *
124714
124981
  * @returns {djs.model.Base} element which is created
124715
124982
  */
124716
- function createElement$2(elementType, properties, parent, factory) {
124983
+ function createElement$5(elementType, properties, parent, factory) {
124717
124984
  var element = factory.create(elementType, properties);
124718
124985
  element.$parent = parent;
124719
124986
 
@@ -124727,7 +124994,7 @@
124727
124994
  *
124728
124995
  * @returns {ModdleElement}
124729
124996
  */
124730
- function getCalledElement(element) {
124997
+ function getCalledElement$1(element) {
124731
124998
  const calledElements = getCalledElements(element);
124732
124999
 
124733
125000
  return calledElements[ 0 ];
@@ -124762,13 +125029,13 @@
124762
125029
 
124763
125030
  const businessObject = getBusinessObject$2(shape);
124764
125031
 
124765
- let calledElement = getCalledElement(businessObject);
125032
+ let calledElement = getCalledElement$1(businessObject);
124766
125033
 
124767
125034
  if (!calledElement) {
124768
125035
  let extensionElements = businessObject.get('extensionElements');
124769
125036
 
124770
125037
  if (!extensionElements) {
124771
- extensionElements = createElement$2(
125038
+ extensionElements = createElement$5(
124772
125039
  'bpmn:ExtensionElements',
124773
125040
  {
124774
125041
  values: []
@@ -124780,7 +125047,7 @@
124780
125047
  modeling.updateProperties(shape, { extensionElements });
124781
125048
  }
124782
125049
 
124783
- calledElement = createElement$2(
125050
+ calledElement = createElement$5(
124784
125051
  'zeebe:CalledElement',
124785
125052
  {
124786
125053
  propagateAllChildVariables: false
@@ -124845,7 +125112,7 @@
124845
125112
  let extensionElements = businessObject.get('extensionElements');
124846
125113
 
124847
125114
  if (!extensionElements) {
124848
- extensionElements = createElement$2(
125115
+ extensionElements = createElement$5(
124849
125116
  'bpmn:ExtensionElements',
124850
125117
  {
124851
125118
  values: [],
@@ -124857,7 +125124,7 @@
124857
125124
  modeling.updateProperties(shape, { extensionElements });
124858
125125
  }
124859
125126
 
124860
- userTaskElement = createElement$2(
125127
+ userTaskElement = createElement$5(
124861
125128
  'zeebe:UserTask',
124862
125129
  {},
124863
125130
  extensionElements,
@@ -124943,7 +125210,7 @@
124943
125210
  const FORM_KEY_PREFIX = 'camunda-forms:bpmn:',
124944
125211
  USER_TASK_FORM_ID_PREFIX = 'UserTaskForm_';
124945
125212
 
124946
- function getFormDefinition(element) {
125213
+ function getFormDefinition$1(element) {
124947
125214
  const businessObject = getBusinessObject$2(element);
124948
125215
 
124949
125216
  const formDefinitions = getExtensionElementsList$1(businessObject, 'zeebe:FormDefinition');
@@ -124960,7 +125227,7 @@
124960
125227
  rootElement = rootElement || getRootElement$1(element);
124961
125228
 
124962
125229
  if (!formKey) {
124963
- const formDefinition = getFormDefinition(element);
125230
+ const formDefinition = getFormDefinition$1(element);
124964
125231
 
124965
125232
  if (!formDefinition) {
124966
125233
  return;
@@ -125062,7 +125329,7 @@
125062
125329
  return;
125063
125330
  }
125064
125331
 
125065
- const oldFormDefinition = getFormDefinition(shape);
125332
+ const oldFormDefinition = getFormDefinition$1(shape);
125066
125333
 
125067
125334
  if (!oldFormDefinition) {
125068
125335
  return;
@@ -125079,7 +125346,7 @@
125079
125346
  return false;
125080
125347
  }
125081
125348
 
125082
- const formDefinition = getFormDefinition(element);
125349
+ const formDefinition = getFormDefinition$1(element);
125083
125350
 
125084
125351
  return formDefinition
125085
125352
  && formDefinition.get('formKey')
@@ -125096,7 +125363,7 @@
125096
125363
 
125097
125364
  // (1) ensure extension elements exist
125098
125365
  if (!extensionElements) {
125099
- extensionElements = createElement$2('bpmn:ExtensionElements', {
125366
+ extensionElements = createElement$5('bpmn:ExtensionElements', {
125100
125367
  values: []
125101
125368
  }, rootElement, bpmnFactory);
125102
125369
 
@@ -125108,7 +125375,7 @@
125108
125375
  // (2) create new user task form
125109
125376
  const userTaskFormId = createUserTaskFormId();
125110
125377
 
125111
- const userTaskForm = createElement$2('zeebe:UserTaskForm', {
125378
+ const userTaskForm = createElement$5('zeebe:UserTaskForm', {
125112
125379
  id: userTaskFormId,
125113
125380
  body: oldUserTaskForm.get('body')
125114
125381
  }, extensionElements, bpmnFactory);
@@ -125221,7 +125488,7 @@
125221
125488
  return;
125222
125489
  }
125223
125490
 
125224
- const formDefinition = getFormDefinition(element);
125491
+ const formDefinition = getFormDefinition$1(element);
125225
125492
 
125226
125493
  if (!formDefinition) {
125227
125494
  return;
@@ -125251,7 +125518,7 @@
125251
125518
  return;
125252
125519
  }
125253
125520
 
125254
- const formDefinition = getFormDefinition(element);
125521
+ const formDefinition = getFormDefinition$1(element);
125255
125522
 
125256
125523
  if (!formDefinition) {
125257
125524
  return;
@@ -129970,7 +130237,7 @@
129970
130237
  *
129971
130238
  * @returns {djs.model.Base} element which is created
129972
130239
  */
129973
- function createElement$1(elementType, properties, parent, factory) {
130240
+ function createElement$4(elementType, properties, parent, factory) {
129974
130241
  const element = factory.create(elementType, properties);
129975
130242
  if (parent) {
129976
130243
  element.$parent = parent;
@@ -130104,7 +130371,7 @@
130104
130371
  *
130105
130372
  * @return {ModdleElement}
130106
130373
  */
130107
- function createCalledElement(attrs = {}, bpmnFactory) {
130374
+ function createCalledElement$2(attrs = {}, bpmnFactory) {
130108
130375
  return bpmnFactory.create('zeebe:CalledElement', attrs);
130109
130376
  }
130110
130377
 
@@ -130138,7 +130405,7 @@
130138
130405
  const businessObject = getBusinessObject$2(element);
130139
130406
  let extensionElements = businessObject.get('extensionElements');
130140
130407
  if (!extensionElements) {
130141
- extensionElements = createElement$1('bpmn:ExtensionElements', {}, businessObject, bpmnFactory);
130408
+ extensionElements = createElement$4('bpmn:ExtensionElements', {}, businessObject, bpmnFactory);
130142
130409
  businessObject.set('extensionElements', extensionElements);
130143
130410
  }
130144
130411
  let extension = findExtension$1(extensionElements, type);
@@ -130859,7 +131126,7 @@
130859
131126
  this._modeling.updateModdleProperties(element, zeebeSubscription, propertiesToSet);
130860
131127
  } else {
130861
131128
  // create new Subscription
130862
- const newSubscription = createElement$1('zeebe:Subscription', propertiesToSet, message, this._bpmnFactory);
131129
+ const newSubscription = createElement$4('zeebe:Subscription', propertiesToSet, message, this._bpmnFactory);
130863
131130
  this._modeling.updateModdleProperties(element, messageExtensionElements, {
130864
131131
  values: [...messageExtensionElements.get('values'), newSubscription]
130865
131132
  });
@@ -130974,7 +131241,7 @@
130974
131241
  const properties = {
130975
131242
  [propertyName]: newPropertyValue
130976
131243
  };
130977
- calledElement = createCalledElement(properties, bpmnFactory);
131244
+ calledElement = createCalledElement$2(properties, bpmnFactory);
130978
131245
  calledElement.$parent = businessObject;
130979
131246
  commandStack.execute('element.updateModdleProperties', {
130980
131247
  element,
@@ -131100,7 +131367,7 @@
131100
131367
  linkName: newBinding.linkName,
131101
131368
  [newBinding.property]: newPropertyValue
131102
131369
  };
131103
- const newLinkedResource = createElement$1('zeebe:LinkedResource', newProperties, extensionElements, bpmnFactory);
131370
+ const newLinkedResource = createElement$4('zeebe:LinkedResource', newProperties, extensionElements, bpmnFactory);
131104
131371
  commandStack.execute('element.updateModdleProperties', {
131105
131372
  element,
131106
131373
  moddleElement: linkedResources,
@@ -131861,7 +132128,7 @@
131861
132128
  const linkedResources = ensureExtension(element, 'zeebe:LinkedResources', bpmnFactory);
131862
132129
  let linkedResource = linkedResources.get('values').find(linkedResource => linkedResource.get('linkName') === linkName);
131863
132130
  if (!linkedResource) {
131864
- linkedResource = createElement$1('zeebe:LinkedResource', {
132131
+ linkedResource = createElement$4('zeebe:LinkedResource', {
131865
132132
  linkName
131866
132133
  }, bo, bpmnFactory);
131867
132134
  linkedResources.get('values').push(linkedResource);
@@ -132069,7 +132336,7 @@
132069
132336
  if (EXTENSION_BINDING_TYPES$1.includes(type)) {
132070
132337
  extensionElements = businessObject.get('extensionElements');
132071
132338
  if (!extensionElements) {
132072
- extensionElements = createElement$1('bpmn:ExtensionElements', null, businessObject, bpmnFactory);
132339
+ extensionElements = createElement$4('bpmn:ExtensionElements', null, businessObject, bpmnFactory);
132073
132340
  commands.push({
132074
132341
  cmd: 'element.updateModdleProperties',
132075
132342
  context: {
@@ -132166,7 +132433,7 @@
132166
132433
  if (IO_BINDING_TYPES$1.includes(type)) {
132167
132434
  let ioMapping = findExtension$1(extensionElements, 'zeebe:IoMapping');
132168
132435
  if (!ioMapping) {
132169
- ioMapping = createElement$1('zeebe:IoMapping', null, businessObject, bpmnFactory);
132436
+ ioMapping = createElement$4('zeebe:IoMapping', null, businessObject, bpmnFactory);
132170
132437
  commands.push({
132171
132438
  cmd: 'element.updateModdleProperties',
132172
132439
  context: {
@@ -132228,7 +132495,7 @@
132228
132495
  if (type === ZEEBE_TASK_HEADER_TYPE) {
132229
132496
  let taskHeaders = findExtension$1(extensionElements, 'zeebe:TaskHeaders');
132230
132497
  if (!taskHeaders) {
132231
- taskHeaders = createElement$1('zeebe:TaskHeaders', null, businessObject, bpmnFactory);
132498
+ taskHeaders = createElement$4('zeebe:TaskHeaders', null, businessObject, bpmnFactory);
132232
132499
  commands.push({
132233
132500
  cmd: 'element.updateModdleProperties',
132234
132501
  context: {
@@ -132274,7 +132541,7 @@
132274
132541
  if (type === ZEEBE_PROPERTY_TYPE) {
132275
132542
  let zeebeProperties = findExtension$1(extensionElements, 'zeebe:Properties');
132276
132543
  if (!zeebeProperties) {
132277
- zeebeProperties = createElement$1('zeebe:Properties', null, businessObject, bpmnFactory);
132544
+ zeebeProperties = createElement$4('zeebe:Properties', null, businessObject, bpmnFactory);
132278
132545
  commands.push({
132279
132546
  cmd: 'element.updateModdleProperties',
132280
132547
  context: {
@@ -132320,7 +132587,7 @@
132320
132587
  }
132321
132588
  });
132322
132589
  } else {
132323
- subscription = createElement$1('zeebe:Subscription', properties, extensionElements, bpmnFactory);
132590
+ subscription = createElement$4('zeebe:Subscription', properties, extensionElements, bpmnFactory);
132324
132591
  commands.push({
132325
132592
  cmd: 'element.updateModdleProperties',
132326
132593
  context: {
@@ -132351,7 +132618,7 @@
132351
132618
  }
132352
132619
  });
132353
132620
  } else {
132354
- calledElement = createElement$1('zeebe:CalledElement', properties, extensionElements, bpmnFactory);
132621
+ calledElement = createElement$4('zeebe:CalledElement', properties, extensionElements, bpmnFactory);
132355
132622
  commands.push({
132356
132623
  cmd: 'element.updateModdleProperties',
132357
132624
  context: {
@@ -132367,7 +132634,7 @@
132367
132634
  if (type === ZEEBE_LINKED_RESOURCE_PROPERTY) {
132368
132635
  let linkedResources = findExtension$1(businessObject, 'zeebe:LinkedResources');
132369
132636
  if (!linkedResources) {
132370
- linkedResources = createElement$1('zeebe:LinkedResources', null, businessObject, bpmnFactory);
132637
+ linkedResources = createElement$4('zeebe:LinkedResources', null, businessObject, bpmnFactory);
132371
132638
  commands.push({
132372
132639
  cmd: 'element.updateModdleProperties',
132373
132640
  context: {
@@ -132381,7 +132648,7 @@
132381
132648
  }
132382
132649
  let linkedResource = linkedResources.get('values').find(value => value.get('linkName') === linkName);
132383
132650
  if (!linkedResource) {
132384
- linkedResource = createElement$1('zeebe:LinkedResource', {
132651
+ linkedResource = createElement$4('zeebe:LinkedResource', {
132385
132652
  linkName
132386
132653
  }, businessObject, bpmnFactory);
132387
132654
  commands.push({
@@ -134839,7 +135106,7 @@
134839
135106
  // (1) create new message
134840
135107
  if (value === CREATE_NEW_OPTION) {
134841
135108
  const id = nextId('Message_');
134842
- message = createElement$1('bpmn:Message', {
135109
+ message = createElement$4('bpmn:Message', {
134843
135110
  id,
134844
135111
  name: id
134845
135112
  }, root, bpmnFactory);
@@ -144314,7 +144581,7 @@
144314
144581
  return elem.classList.add(className);
144315
144582
  elem.classList.remove(className);
144316
144583
  }
144317
- function createElement(tag, className, content) {
144584
+ function createElement$3(tag, className, content) {
144318
144585
  var e = window.document.createElement(tag);
144319
144586
  className = className || "";
144320
144587
  content = content || "";
@@ -144335,7 +144602,7 @@
144335
144602
  return undefined;
144336
144603
  }
144337
144604
  function createNumberInput(inputClassName, opts) {
144338
- var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown");
144605
+ var wrapper = createElement$3("div", "numInputWrapper"), numInput = createElement$3("input", "numInput " + inputClassName), arrowUp = createElement$3("span", "arrowUp"), arrowDown = createElement$3("span", "arrowDown");
144339
144606
  if (navigator.userAgent.indexOf("MSIE 9.0") === -1) {
144340
144607
  numInput.type = "number";
144341
144608
  }
@@ -144691,7 +144958,7 @@
144691
144958
  self.clear = clear;
144692
144959
  self.close = close;
144693
144960
  self.onMouseOver = onMouseOver;
144694
- self._createElement = createElement;
144961
+ self._createElement = createElement$3;
144695
144962
  self.createDay = createDay;
144696
144963
  self.destroy = destroy;
144697
144964
  self.isEnabled = isEnabled;
@@ -145011,21 +145278,21 @@
145011
145278
  }
145012
145279
  function build() {
145013
145280
  var fragment = window.document.createDocumentFragment();
145014
- self.calendarContainer = createElement("div", "flatpickr-calendar");
145281
+ self.calendarContainer = createElement$3("div", "flatpickr-calendar");
145015
145282
  self.calendarContainer.tabIndex = -1;
145016
145283
  if (!self.config.noCalendar) {
145017
145284
  fragment.appendChild(buildMonthNav());
145018
- self.innerContainer = createElement("div", "flatpickr-innerContainer");
145285
+ self.innerContainer = createElement$3("div", "flatpickr-innerContainer");
145019
145286
  if (self.config.weekNumbers) {
145020
145287
  var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;
145021
145288
  self.innerContainer.appendChild(weekWrapper);
145022
145289
  self.weekNumbers = weekNumbers;
145023
145290
  self.weekWrapper = weekWrapper;
145024
145291
  }
145025
- self.rContainer = createElement("div", "flatpickr-rContainer");
145292
+ self.rContainer = createElement$3("div", "flatpickr-rContainer");
145026
145293
  self.rContainer.appendChild(buildWeekdays());
145027
145294
  if (!self.daysContainer) {
145028
- self.daysContainer = createElement("div", "flatpickr-days");
145295
+ self.daysContainer = createElement$3("div", "flatpickr-days");
145029
145296
  self.daysContainer.tabIndex = -1;
145030
145297
  }
145031
145298
  buildDays();
@@ -145051,7 +145318,7 @@
145051
145318
  self.config.appendTo.appendChild(self.calendarContainer);
145052
145319
  }
145053
145320
  if (self.config.static) {
145054
- var wrapper = createElement("div", "flatpickr-wrapper");
145321
+ var wrapper = createElement$3("div", "flatpickr-wrapper");
145055
145322
  if (self.element.parentNode)
145056
145323
  self.element.parentNode.insertBefore(wrapper, self.element);
145057
145324
  wrapper.appendChild(self.element);
@@ -145066,7 +145333,7 @@
145066
145333
  : window.document.body).appendChild(self.calendarContainer);
145067
145334
  }
145068
145335
  function createDay(className, date, _dayNumber, i) {
145069
- var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", className, date.getDate().toString());
145336
+ var dateIsEnabled = isEnabled(date, true), dayElement = createElement$3("span", className, date.getDate().toString());
145070
145337
  dayElement.dateObj = date;
145071
145338
  dayElement.$i = i;
145072
145339
  dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat));
@@ -145190,7 +145457,7 @@
145190
145457
  (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {
145191
145458
  days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));
145192
145459
  }
145193
- var dayContainer = createElement("div", "dayContainer");
145460
+ var dayContainer = createElement$3("div", "dayContainer");
145194
145461
  dayContainer.appendChild(days);
145195
145462
  return dayContainer;
145196
145463
  }
@@ -145232,7 +145499,7 @@
145232
145499
  for (var i = 0; i < 12; i++) {
145233
145500
  if (!shouldBuildMonth(i))
145234
145501
  continue;
145235
- var month = createElement("option", "flatpickr-monthDropdown-month");
145502
+ var month = createElement$3("option", "flatpickr-monthDropdown-month");
145236
145503
  month.value = new Date(self.currentYear, i).getMonth().toString();
145237
145504
  month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);
145238
145505
  month.tabIndex = -1;
@@ -145243,15 +145510,15 @@
145243
145510
  }
145244
145511
  }
145245
145512
  function buildMonth() {
145246
- var container = createElement("div", "flatpickr-month");
145513
+ var container = createElement$3("div", "flatpickr-month");
145247
145514
  var monthNavFragment = window.document.createDocumentFragment();
145248
145515
  var monthElement;
145249
145516
  if (self.config.showMonths > 1 ||
145250
145517
  self.config.monthSelectorType === "static") {
145251
- monthElement = createElement("span", "cur-month");
145518
+ monthElement = createElement$3("span", "cur-month");
145252
145519
  }
145253
145520
  else {
145254
- self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months");
145521
+ self.monthsDropdownContainer = createElement$3("select", "flatpickr-monthDropdown-months");
145255
145522
  self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel);
145256
145523
  bind(self.monthsDropdownContainer, "change", function (e) {
145257
145524
  var target = getEventTarget(e);
@@ -145274,7 +145541,7 @@
145274
145541
  !!self.config.minDate &&
145275
145542
  self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();
145276
145543
  }
145277
- var currentMonth = createElement("div", "flatpickr-current-month");
145544
+ var currentMonth = createElement$3("div", "flatpickr-current-month");
145278
145545
  currentMonth.appendChild(monthElement);
145279
145546
  currentMonth.appendChild(yearInput);
145280
145547
  monthNavFragment.appendChild(currentMonth);
@@ -145301,12 +145568,12 @@
145301
145568
  self.monthNav.appendChild(self.nextMonthNav);
145302
145569
  }
145303
145570
  function buildMonthNav() {
145304
- self.monthNav = createElement("div", "flatpickr-months");
145571
+ self.monthNav = createElement$3("div", "flatpickr-months");
145305
145572
  self.yearElements = [];
145306
145573
  self.monthElements = [];
145307
- self.prevMonthNav = createElement("span", "flatpickr-prev-month");
145574
+ self.prevMonthNav = createElement$3("span", "flatpickr-prev-month");
145308
145575
  self.prevMonthNav.innerHTML = self.config.prevArrow;
145309
- self.nextMonthNav = createElement("span", "flatpickr-next-month");
145576
+ self.nextMonthNav = createElement$3("span", "flatpickr-next-month");
145310
145577
  self.nextMonthNav.innerHTML = self.config.nextArrow;
145311
145578
  buildMonths();
145312
145579
  Object.defineProperty(self, "_hidePrevMonthArrow", {
@@ -145336,9 +145603,9 @@
145336
145603
  if (self.config.noCalendar)
145337
145604
  self.calendarContainer.classList.add("noCalendar");
145338
145605
  var defaults = getDefaultHours(self.config);
145339
- self.timeContainer = createElement("div", "flatpickr-time");
145606
+ self.timeContainer = createElement$3("div", "flatpickr-time");
145340
145607
  self.timeContainer.tabIndex = -1;
145341
- var separator = createElement("span", "flatpickr-time-separator", ":");
145608
+ var separator = createElement$3("span", "flatpickr-time-separator", ":");
145342
145609
  var hourInput = createNumberInput("flatpickr-hour", {
145343
145610
  "aria-label": self.l10n.hourAriaLabel,
145344
145611
  });
@@ -145380,11 +145647,11 @@
145380
145647
  self.secondElement.setAttribute("min", "0");
145381
145648
  self.secondElement.setAttribute("max", "59");
145382
145649
  self.secondElement.setAttribute("maxlength", "2");
145383
- self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":"));
145650
+ self.timeContainer.appendChild(createElement$3("span", "flatpickr-time-separator", ":"));
145384
145651
  self.timeContainer.appendChild(secondInput);
145385
145652
  }
145386
145653
  if (!self.config.time_24hr) {
145387
- self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj
145654
+ self.amPM = createElement$3("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj
145388
145655
  ? self.hourElement.value
145389
145656
  : self.config.defaultHour) > 11)]);
145390
145657
  self.amPM.title = self.l10n.toggleTitle;
@@ -145395,11 +145662,11 @@
145395
145662
  }
145396
145663
  function buildWeekdays() {
145397
145664
  if (!self.weekdayContainer)
145398
- self.weekdayContainer = createElement("div", "flatpickr-weekdays");
145665
+ self.weekdayContainer = createElement$3("div", "flatpickr-weekdays");
145399
145666
  else
145400
145667
  clearNode(self.weekdayContainer);
145401
145668
  for (var i = self.config.showMonths; i--;) {
145402
- var container = createElement("div", "flatpickr-weekdaycontainer");
145669
+ var container = createElement$3("div", "flatpickr-weekdaycontainer");
145403
145670
  self.weekdayContainer.appendChild(container);
145404
145671
  }
145405
145672
  updateWeekdays();
@@ -145420,9 +145687,9 @@
145420
145687
  }
145421
145688
  function buildWeeks() {
145422
145689
  self.calendarContainer.classList.add("hasWeeks");
145423
- var weekWrapper = createElement("div", "flatpickr-weekwrapper");
145424
- weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation));
145425
- var weekNumbers = createElement("div", "flatpickr-weeks");
145690
+ var weekWrapper = createElement$3("div", "flatpickr-weekwrapper");
145691
+ weekWrapper.appendChild(createElement$3("span", "flatpickr-weekday", self.l10n.weekAbbreviation));
145692
+ var weekNumbers = createElement$3("div", "flatpickr-weeks");
145426
145693
  weekWrapper.appendChild(weekNumbers);
145427
145694
  return {
145428
145695
  weekWrapper: weekWrapper,
@@ -146409,7 +146676,7 @@
146409
146676
  self.input.classList.add("flatpickr-input");
146410
146677
  self._input = self.input;
146411
146678
  if (self.config.altInput) {
146412
- self.altInput = createElement(self.input.nodeName, self.config.altInputClass);
146679
+ self.altInput = createElement$3(self.input.nodeName, self.config.altInputClass);
146413
146680
  self._input = self.altInput;
146414
146681
  self.altInput.placeholder = self.input.placeholder;
146415
146682
  self.altInput.disabled = self.input.disabled;
@@ -146433,7 +146700,7 @@
146433
146700
  ? "time"
146434
146701
  : "datetime-local"
146435
146702
  : "date";
146436
- self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile");
146703
+ self.mobileInput = createElement$3("input", self.input.className + " flatpickr-mobile");
146437
146704
  self.mobileInput.tabIndex = 1;
146438
146705
  self.mobileInput.type = inputType;
146439
146706
  self.mobileInput.disabled = self.input.disabled;
@@ -146692,7 +146959,7 @@
146692
146959
 
146693
146960
  function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w(n){this.props=n;}(w.prototype=new d$3).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var x=l$5.__b;l$5.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),x&&x(n);};var T=l$5.__e;l$5.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r);};var I=l$5.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null;}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){this.u=null,this.o=null;}l$5.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n);},(D.prototype=new d$3).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},D.prototype.componentWillUnmount=function(){this.t=[];},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&h$3(p$4,null,n.fallback);return i&&(i.__h=null),[h$3(p$4,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(V.prototype=new d$3).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=x$4(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,H="undefined"!=typeof document,Z=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};d$3.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(d$3.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var G=l$5.event;function J(){}function K(){return this.cancelBubble}function Q(){return this.defaultPrevented}l$5.event=function(n){return G&&(n=G(n)),n.persist=J,n.isPropagationStopped=K,n.isDefaultPrevented=Q,n.nativeEvent=n};var nn={configurable:!0,get:function(){return this.class}},tn=l$5.vnode;l$5.vnode=function(n){var t=n.type,e=n.props,u=e;if("string"==typeof t){var o=-1===t.indexOf("-");for(var i in u={},e){var l=e[i];H&&"children"===i&&"noscript"===t||"value"===i&&"defaultValue"in e&&null==l||("defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===l?l="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Z(e.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&B.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===l&&(l=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),u[i]&&(i="oninputCapture")),u[i]=l);}"select"==t&&u.multiple&&Array.isArray(u.value)&&(u.value=x$4(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==t&&null!=u.defaultValue&&(u.value=x$4(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),n.props=u,e.class!=e.className&&(nn.enumerable="className"in e,null!=e.className&&(u.class=e.className),Object.defineProperty(u,"className",nn));}n.$$typeof=z,tn&&tn(n);};var en=l$5.__r;l$5.__r=function(n){en&&en(n),n.__c;};
146694
146961
 
146695
- /*! @license DOMPurify 3.2.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.0/LICENSE */
146962
+ /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
146696
146963
 
146697
146964
  const {
146698
146965
  entries,
@@ -146731,8 +146998,10 @@
146731
146998
  };
146732
146999
  }
146733
147000
  const arrayForEach = unapply(Array.prototype.forEach);
147001
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
146734
147002
  const arrayPop = unapply(Array.prototype.pop);
146735
147003
  const arrayPush = unapply(Array.prototype.push);
147004
+ const arraySplice = unapply(Array.prototype.splice);
146736
147005
  const stringToLowerCase = unapply(String.prototype.toLowerCase);
146737
147006
  const stringToString = unapply(String.prototype.toString);
146738
147007
  const stringMatch = unapply(String.prototype.match);
@@ -146867,7 +147136,6 @@
146867
147136
  }
146868
147137
 
146869
147138
  const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
146870
- // SVG
146871
147139
  const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
146872
147140
  const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
146873
147141
  // List of SVG elements that are disallowed by default.
@@ -146889,8 +147157,8 @@
146889
147157
  // eslint-disable-next-line unicorn/better-regex
146890
147158
  const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
146891
147159
  const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
146892
- const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
146893
- const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
147160
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
147161
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
146894
147162
  const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
146895
147163
  const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
146896
147164
  );
@@ -146973,12 +147241,25 @@
146973
147241
  return null;
146974
147242
  }
146975
147243
  };
147244
+ const _createHooksMap = function _createHooksMap() {
147245
+ return {
147246
+ afterSanitizeAttributes: [],
147247
+ afterSanitizeElements: [],
147248
+ afterSanitizeShadowDOM: [],
147249
+ beforeSanitizeAttributes: [],
147250
+ beforeSanitizeElements: [],
147251
+ beforeSanitizeShadowDOM: [],
147252
+ uponSanitizeAttribute: [],
147253
+ uponSanitizeElement: [],
147254
+ uponSanitizeShadowNode: []
147255
+ };
147256
+ };
146976
147257
  function createDOMPurify() {
146977
147258
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
146978
147259
  const DOMPurify = root => createDOMPurify(root);
146979
- DOMPurify.version = '3.2.0';
147260
+ DOMPurify.version = '3.2.4';
146980
147261
  DOMPurify.removed = [];
146981
- if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
147262
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
146982
147263
  // Not running in a browser, provide a factory function
146983
147264
  // so that you can pass your own Window
146984
147265
  DOMPurify.isSupported = false;
@@ -147029,7 +147310,7 @@
147029
147310
  const {
147030
147311
  importNode
147031
147312
  } = originalDocument;
147032
- let hooks = {};
147313
+ let hooks = _createHooksMap();
147033
147314
  /**
147034
147315
  * Expose whether this browser supports running the full DOMPurify.
147035
147316
  */
@@ -147458,8 +147739,8 @@
147458
147739
  });
147459
147740
  }
147460
147741
  element.removeAttribute(name);
147461
- // We void attribute values for unremovable "is"" attributes
147462
- if (name === 'is' && !ALLOWED_ATTR[name]) {
147742
+ // We void attribute values for unremovable "is" attributes
147743
+ if (name === 'is') {
147463
147744
  if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
147464
147745
  try {
147465
147746
  _forceRemove(element);
@@ -147550,11 +147831,8 @@
147550
147831
  const _isNode = function _isNode(value) {
147551
147832
  return typeof Node === 'function' && value instanceof Node;
147552
147833
  };
147553
- function _executeHook(entryPoint, currentNode, data) {
147554
- if (!hooks[entryPoint]) {
147555
- return;
147556
- }
147557
- arrayForEach(hooks[entryPoint], hook => {
147834
+ function _executeHooks(hooks, currentNode, data) {
147835
+ arrayForEach(hooks, hook => {
147558
147836
  hook.call(DOMPurify, currentNode, data, CONFIG);
147559
147837
  });
147560
147838
  }
@@ -147570,7 +147848,7 @@
147570
147848
  const _sanitizeElements = function _sanitizeElements(currentNode) {
147571
147849
  let content = null;
147572
147850
  /* Execute a hook if present */
147573
- _executeHook('beforeSanitizeElements', currentNode, null);
147851
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
147574
147852
  /* Check if element is clobbered or can clobber */
147575
147853
  if (_isClobbered(currentNode)) {
147576
147854
  _forceRemove(currentNode);
@@ -147579,7 +147857,7 @@
147579
147857
  /* Now let's check the element's type and name */
147580
147858
  const tagName = transformCaseFunc(currentNode.nodeName);
147581
147859
  /* Execute a hook if present */
147582
- _executeHook('uponSanitizeElement', currentNode, {
147860
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
147583
147861
  tagName,
147584
147862
  allowedTags: ALLOWED_TAGS
147585
147863
  });
@@ -147650,7 +147928,7 @@
147650
147928
  }
147651
147929
  }
147652
147930
  /* Execute a hook if present */
147653
- _executeHook('afterSanitizeElements', currentNode, null);
147931
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
147654
147932
  return false;
147655
147933
  };
147656
147934
  /**
@@ -147711,12 +147989,12 @@
147711
147989
  */
147712
147990
  const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
147713
147991
  /* Execute a hook if present */
147714
- _executeHook('beforeSanitizeAttributes', currentNode, null);
147992
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
147715
147993
  const {
147716
147994
  attributes
147717
147995
  } = currentNode;
147718
147996
  /* Check if we have attributes; if not we might have a text node */
147719
- if (!attributes) {
147997
+ if (!attributes || _isClobbered(currentNode)) {
147720
147998
  return;
147721
147999
  }
147722
148000
  const hookEvent = {
@@ -147742,7 +148020,7 @@
147742
148020
  hookEvent.attrValue = value;
147743
148021
  hookEvent.keepAttr = true;
147744
148022
  hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
147745
- _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
148023
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
147746
148024
  value = hookEvent.attrValue;
147747
148025
  /* Full DOM Clobbering protection via namespace isolation,
147748
148026
  * Prefix id and name attributes with `user-content-`
@@ -147817,7 +148095,7 @@
147817
148095
  } catch (_) {}
147818
148096
  }
147819
148097
  /* Execute a hook if present */
147820
- _executeHook('afterSanitizeAttributes', currentNode, null);
148098
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
147821
148099
  };
147822
148100
  /**
147823
148101
  * _sanitizeShadowDOM
@@ -147828,23 +148106,21 @@
147828
148106
  let shadowNode = null;
147829
148107
  const shadowIterator = _createNodeIterator(fragment);
147830
148108
  /* Execute a hook if present */
147831
- _executeHook('beforeSanitizeShadowDOM', fragment, null);
148109
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
147832
148110
  while (shadowNode = shadowIterator.nextNode()) {
147833
148111
  /* Execute a hook if present */
147834
- _executeHook('uponSanitizeShadowNode', shadowNode, null);
148112
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
147835
148113
  /* Sanitize tags and elements */
147836
- if (_sanitizeElements(shadowNode)) {
147837
- continue;
147838
- }
148114
+ _sanitizeElements(shadowNode);
148115
+ /* Check attributes next */
148116
+ _sanitizeAttributes(shadowNode);
147839
148117
  /* Deep shadow DOM detected */
147840
148118
  if (shadowNode.content instanceof DocumentFragment) {
147841
148119
  _sanitizeShadowDOM(shadowNode.content);
147842
148120
  }
147843
- /* Check attributes, sanitize if necessary */
147844
- _sanitizeAttributes(shadowNode);
147845
148121
  }
147846
148122
  /* Execute a hook if present */
147847
- _executeHook('afterSanitizeShadowDOM', fragment, null);
148123
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
147848
148124
  };
147849
148125
  // eslint-disable-next-line complexity
147850
148126
  DOMPurify.sanitize = function (dirty) {
@@ -147930,15 +148206,13 @@
147930
148206
  /* Now start iterating over the created document */
147931
148207
  while (currentNode = nodeIterator.nextNode()) {
147932
148208
  /* Sanitize tags and elements */
147933
- if (_sanitizeElements(currentNode)) {
147934
- continue;
147935
- }
148209
+ _sanitizeElements(currentNode);
148210
+ /* Check attributes next */
148211
+ _sanitizeAttributes(currentNode);
147936
148212
  /* Shadow DOM detected, sanitize it */
147937
148213
  if (currentNode.content instanceof DocumentFragment) {
147938
148214
  _sanitizeShadowDOM(currentNode.content);
147939
148215
  }
147940
- /* Check attributes, sanitize if necessary */
147941
- _sanitizeAttributes(currentNode);
147942
148216
  }
147943
148217
  /* If we sanitized `dirty` in-place, return it. */
147944
148218
  if (IN_PLACE) {
@@ -148002,21 +148276,20 @@
148002
148276
  if (typeof hookFunction !== 'function') {
148003
148277
  return;
148004
148278
  }
148005
- hooks[entryPoint] = hooks[entryPoint] || [];
148006
148279
  arrayPush(hooks[entryPoint], hookFunction);
148007
148280
  };
148008
- DOMPurify.removeHook = function (entryPoint) {
148009
- if (hooks[entryPoint]) {
148010
- return arrayPop(hooks[entryPoint]);
148281
+ DOMPurify.removeHook = function (entryPoint, hookFunction) {
148282
+ if (hookFunction !== undefined) {
148283
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
148284
+ return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
148011
148285
  }
148286
+ return arrayPop(hooks[entryPoint]);
148012
148287
  };
148013
148288
  DOMPurify.removeHooks = function (entryPoint) {
148014
- if (hooks[entryPoint]) {
148015
- hooks[entryPoint] = [];
148016
- }
148289
+ hooks[entryPoint] = [];
148017
148290
  };
148018
148291
  DOMPurify.removeAllHooks = function () {
148019
- hooks = {};
148292
+ hooks = _createHooksMap();
148020
148293
  };
148021
148294
  return DOMPurify;
148022
148295
  }
@@ -161654,7 +161927,7 @@
161654
161927
  /**
161655
161928
  * This module is an append menu provider for the popup menu.
161656
161929
  */
161657
- function AppendMenuProvider(
161930
+ function AppendMenuProvider$3(
161658
161931
  elementFactory, popupMenu,
161659
161932
  create, autoPlace, rules,
161660
161933
  mouse, translate
@@ -161672,7 +161945,7 @@
161672
161945
  this.register();
161673
161946
  }
161674
161947
 
161675
- AppendMenuProvider.$inject = [
161948
+ AppendMenuProvider$3.$inject = [
161676
161949
  'elementFactory',
161677
161950
  'popupMenu',
161678
161951
  'create',
@@ -161685,7 +161958,7 @@
161685
161958
  /**
161686
161959
  * Register append menu provider in the popup menu
161687
161960
  */
161688
- AppendMenuProvider.prototype.register = function() {
161961
+ AppendMenuProvider$3.prototype.register = function() {
161689
161962
  this._popupMenu.registerProvider('bpmn-append', this);
161690
161963
  };
161691
161964
 
@@ -161696,7 +161969,7 @@
161696
161969
  *
161697
161970
  * @return {Array<Object>} a list of menu entry items
161698
161971
  */
161699
- AppendMenuProvider.prototype.getPopupMenuEntries = function(element) {
161972
+ AppendMenuProvider$3.prototype.getPopupMenuEntries = function(element) {
161700
161973
  const rules = this._rules;
161701
161974
  const translate = this._translate;
161702
161975
 
@@ -161746,7 +162019,7 @@
161746
162019
  *
161747
162020
  * @return {Array<Object>} filtered entries
161748
162021
  */
161749
- AppendMenuProvider.prototype._filterEntries = function(entries) {
162022
+ AppendMenuProvider$3.prototype._filterEntries = function(entries) {
161750
162023
  return entries.filter(option => {
161751
162024
 
161752
162025
  const target = option.target;
@@ -161778,7 +162051,7 @@
161778
162051
  *
161779
162052
  * @return {Object}
161780
162053
  */
161781
- AppendMenuProvider.prototype._createEntryAction = function(element, target) {
162054
+ AppendMenuProvider$3.prototype._createEntryAction = function(element, target) {
161782
162055
  const elementFactory = this._elementFactory;
161783
162056
  const autoPlace = this._autoPlace;
161784
162057
  const create = this._create;
@@ -161815,7 +162088,7 @@
161815
162088
  *
161816
162089
  * @return {Boolean}
161817
162090
  */
161818
- AppendMenuProvider.prototype._canAutoPlaceElement = (target) => {
162091
+ AppendMenuProvider$3.prototype._canAutoPlaceElement = (target) => {
161819
162092
  const { type } = target;
161820
162093
 
161821
162094
  if (type === 'bpmn:BoundaryEvent') {
@@ -162404,7 +162677,7 @@
162404
162677
  'appendContextPadProvider',
162405
162678
  'appendRules'
162406
162679
  ],
162407
- appendMenuProvider: [ 'type', AppendMenuProvider ],
162680
+ appendMenuProvider: [ 'type', AppendMenuProvider$3 ],
162408
162681
  appendContextPadProvider: [ 'type', AppendContextPadProvider ],
162409
162682
  appendRules: [ 'type', AppendRules ]
162410
162683
  };
@@ -162412,7 +162685,7 @@
162412
162685
  /**
162413
162686
  * This module is a create menu provider for the popup menu.
162414
162687
  */
162415
- function CreateMenuProvider(
162688
+ function CreateMenuProvider$3(
162416
162689
  elementFactory, popupMenu, create,
162417
162690
  autoPlace, mouse, translate
162418
162691
  ) {
@@ -162426,7 +162699,7 @@
162426
162699
  this.register();
162427
162700
  }
162428
162701
 
162429
- CreateMenuProvider.$inject = [
162702
+ CreateMenuProvider$3.$inject = [
162430
162703
  'elementFactory',
162431
162704
  'popupMenu',
162432
162705
  'create',
@@ -162438,7 +162711,7 @@
162438
162711
  /**
162439
162712
  * Register create menu provider in the popup menu
162440
162713
  */
162441
- CreateMenuProvider.prototype.register = function() {
162714
+ CreateMenuProvider$3.prototype.register = function() {
162442
162715
  this._popupMenu.registerProvider('bpmn-create', this);
162443
162716
  };
162444
162717
 
@@ -162449,7 +162722,7 @@
162449
162722
  *
162450
162723
  * @return {Array<Object>} a list of menu entry items
162451
162724
  */
162452
- CreateMenuProvider.prototype.getPopupMenuEntries = function() {
162725
+ CreateMenuProvider$3.prototype.getPopupMenuEntries = function() {
162453
162726
 
162454
162727
  const entries = {};
162455
162728
 
@@ -162494,7 +162767,7 @@
162494
162767
  * @param {Object} target
162495
162768
  * @returns {Object}
162496
162769
  */
162497
- CreateMenuProvider.prototype._createEntryAction = function(target) {
162770
+ CreateMenuProvider$3.prototype._createEntryAction = function(target) {
162498
162771
 
162499
162772
  const create = this._create;
162500
162773
  const mouse = this._mouse;
@@ -162627,7 +162900,7 @@
162627
162900
  'createMenuProvider',
162628
162901
  'createPaletteProvider'
162629
162902
  ],
162630
- createMenuProvider: [ 'type', CreateMenuProvider ],
162903
+ createMenuProvider: [ 'type', CreateMenuProvider$3 ],
162631
162904
  createPaletteProvider: [ 'type', CreatePaletteProvider ]
162632
162905
  };
162633
162906
 
@@ -164889,6 +165162,911 @@
164889
165162
  camundaDetailsPopupMenuProvider: [ 'type', CamundaDetailsPopupMenuProvider ]
164890
165163
  };
164891
165164
 
165165
+ class Resources {
165166
+ static $inject = [ 'config.resources' ];
165167
+
165168
+ constructor(resources) {
165169
+ this._resources = resources || [];
165170
+ }
165171
+
165172
+ set(resources) {
165173
+ this._resources = resources;
165174
+ }
165175
+
165176
+ getAll() {
165177
+ return this._resources;
165178
+ }
165179
+
165180
+ filter(fn) {
165181
+ return this._resources.filter(fn);
165182
+ }
165183
+ }
165184
+
165185
+ class ResourceLoader {
165186
+ static $inject = [ 'eventBus', 'resources' ];
165187
+
165188
+ constructor(eventBus, resources) {
165189
+ this._resources = resources;
165190
+ this._providers = [];
165191
+
165192
+ eventBus.on('diagram.init', () => {
165193
+ this.reload();
165194
+ });
165195
+ }
165196
+
165197
+ register(resourceProvider) {
165198
+ this._providers.push(resourceProvider);
165199
+ }
165200
+
165201
+ reload() {
165202
+ const combined = this._providers.reduce((resources, provider) => {
165203
+ return resources.concat(provider.getResources());
165204
+ }, []);
165205
+
165206
+ this._resources.set(combined);
165207
+ }
165208
+ }
165209
+
165210
+ /**
165211
+ * @typedef {{
165212
+ * type: 'bpmnProcess',
165213
+ * name: string,
165214
+ * processId: string
165215
+ * }} CallActivity
165216
+ */
165217
+
165218
+ /**
165219
+ *
165220
+ * @param {CallActivity} resource
165221
+ * @param {import('bpmn-js/lib/features/modeling/BpmnFactory').default} bpmnFactory
165222
+ */
165223
+ function createElement$2(resource, bpmnFactory) {
165224
+ return createCallActivity(resource, bpmnFactory);
165225
+ }
165226
+
165227
+ function createCallActivity(resource, bpmnFactory) {
165228
+ const calledElement = createCalledElement$1(resource, bpmnFactory);
165229
+ const extensionElements = bpmnFactory.create('bpmn:ExtensionElements', {
165230
+ values: [
165231
+ calledElement
165232
+ ]
165233
+ });
165234
+
165235
+ return bpmnFactory.create('bpmn:CallActivity', {
165236
+ name: resource.name,
165237
+ extensionElements
165238
+ });
165239
+ }
165240
+
165241
+ function createCalledElement$1(resource, bpmnFactory) {
165242
+ return bpmnFactory.create('zeebe:CalledElement', {
165243
+ processId: resource.processId
165244
+ });
165245
+ }
165246
+
165247
+ const searchTerms$2 = [
165248
+ 'resource',
165249
+ 'bpmn',
165250
+ 'call activity',
165251
+ 'child process'
165252
+ ].join(' ');
165253
+
165254
+ /**
165255
+ * @typedef {object} Config
165256
+ * @property {string} resourceType
165257
+ * @property {string} className
165258
+ * @property {string} groupName
165259
+ * @property {Function} createElement
165260
+ * @property {string} [search]
165261
+ */
165262
+
165263
+ class BaseCreateMenuProvider {
165264
+
165265
+ /**
165266
+ *
165267
+ * @param {import('didi').Injector} injector
165268
+ * @param {Config} config
165269
+ */
165270
+ constructor(injector, config) {
165271
+ this._elementFactory = injector.get('elementFactory');
165272
+ this._bpmnFactory = injector.get('bpmnFactory');
165273
+ this._popupMenu = injector.get('popupMenu');
165274
+ this._create = injector.get('create');
165275
+ this._autoPlace = injector.get('autoPlace');
165276
+ this._mouse = injector.get('mouse');
165277
+ this._translate = injector.get('translate');
165278
+ this._resources = injector.get('resources');
165279
+
165280
+ injector.get('popupMenu').registerProvider('bpmn-create', this);
165281
+
165282
+ this._config = config;
165283
+ }
165284
+
165285
+ getPopupMenuEntries() {
165286
+ const {
165287
+ resourceType,
165288
+ className,
165289
+ groupName,
165290
+ createElement,
165291
+ search
165292
+ } = this._config;
165293
+
165294
+ const resources = this._resources.filter(r => r.type === resourceType);
165295
+ const entries = {};
165296
+
165297
+ resources.forEach((resource, index) => {
165298
+ const getTarget = () => createElement(resource, this._bpmnFactory);
165299
+ entries[`resources-create-${resourceType}-${index}`] = {
165300
+ label: resource.name,
165301
+ action: this._createEntryAction(getTarget),
165302
+ group: {
165303
+ id: groupName.toLowerCase(),
165304
+ name: this._translate(groupName)
165305
+ },
165306
+ className,
165307
+ search
165308
+ };
165309
+ });
165310
+
165311
+ return entries;
165312
+ }
165313
+
165314
+ _createEntryAction(getTarget) {
165315
+ const create = this._create;
165316
+ const mouse = this._mouse;
165317
+ const popupMenu = this._popupMenu;
165318
+ const elementFactory = this._elementFactory;
165319
+
165320
+ return (event) => {
165321
+ popupMenu.close();
165322
+
165323
+ const businessObject = getTarget();
165324
+ const element = elementFactory.createShape({
165325
+ type: businessObject.$type,
165326
+ businessObject: businessObject
165327
+ });
165328
+
165329
+ // use last mouse event if triggered via keyboard
165330
+ if (event instanceof KeyboardEvent) {
165331
+ event = mouse.getLastMoveEvent();
165332
+ }
165333
+
165334
+ return create.start(event, element);
165335
+ };
165336
+ }
165337
+ }
165338
+
165339
+ let CreateMenuProvider$2 = class CreateMenuProvider extends BaseCreateMenuProvider {
165340
+ static $inject = [
165341
+ 'injector'
165342
+ ];
165343
+
165344
+ constructor(injector) {
165345
+ super(injector, {
165346
+ resourceType: 'bpmnProcess',
165347
+ groupName: 'Processes',
165348
+ className: 'bpmn-icon-call-activity',
165349
+ createElement: (resource, bpmnFactory) => createElement$2(resource, bpmnFactory),
165350
+ search: searchTerms$2
165351
+ });
165352
+ }
165353
+ };
165354
+
165355
+ /**
165356
+ * @typedef {object} Config
165357
+ * @property {string} resourceType
165358
+ * @property {string} className
165359
+ * @property {string} groupName
165360
+ * @property {Function} createElement
165361
+ * @property {string} [search]
165362
+ */
165363
+
165364
+ class BaseAppendMenuProvider {
165365
+
165366
+ /**
165367
+ *
165368
+ * @param {import('didi').Injector} injector
165369
+ * @param {Config} config
165370
+ */
165371
+ constructor(injector, config) {
165372
+ this._elementFactory = injector.get('elementFactory');
165373
+ this._bpmnFactory = injector.get('bpmnFactory');
165374
+ this._popupMenu = injector.get('popupMenu');
165375
+ this._create = injector.get('create');
165376
+ this._autoPlace = injector.get('autoPlace');
165377
+ this._rules = injector.get('rules');
165378
+ this._translate = injector.get('translate');
165379
+ this._resources = injector.get('resources');
165380
+
165381
+ this._config = config;
165382
+
165383
+ this._register();
165384
+ }
165385
+
165386
+ _register() {
165387
+ this._popupMenu.registerProvider('bpmn-append', this);
165388
+ };
165389
+
165390
+ /** @returns {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').PopupMenuEntries} */
165391
+ getPopupMenuEntries(element) {
165392
+ const rules = this._rules;
165393
+
165394
+ if (!rules.allowed('shape.append', { element: element })) {
165395
+ return [];
165396
+ }
165397
+
165398
+ const {
165399
+ resourceType,
165400
+ className,
165401
+ groupName,
165402
+ createElement,
165403
+ search
165404
+ } = this._config;
165405
+
165406
+ const resources = this._resources.filter(r => r.type === resourceType);
165407
+ const entries = {};
165408
+
165409
+ resources.forEach((resource, index) => {
165410
+ const getTarget = () => createElement(resource, this._bpmnFactory);
165411
+ entries[`resources-append-${resourceType}-${index}`] = {
165412
+ label: resource.name,
165413
+ action: this._createEntryAction(element, getTarget),
165414
+ group: {
165415
+ id: groupName.toLowerCase(),
165416
+ name: this._translate(groupName)
165417
+ },
165418
+ className,
165419
+ search
165420
+ };
165421
+ });
165422
+
165423
+ return entries;
165424
+ };
165425
+
165426
+ _createEntryAction(element, targetFactory) {
165427
+ const elementFactory = this._elementFactory;
165428
+ const autoPlace = this._autoPlace;
165429
+ const create = this._create;
165430
+
165431
+ const createElement = () => {
165432
+ const businessObject = targetFactory();
165433
+
165434
+ return elementFactory.createShape({
165435
+ type: businessObject.$type,
165436
+ businessObject: businessObject
165437
+ });
165438
+ };
165439
+
165440
+ const autoPlaceElement = () => {
165441
+ const newElement = createElement();
165442
+ autoPlace.append(element, newElement);
165443
+ };
165444
+
165445
+ const manualPlaceElement = (event) => {
165446
+ const newElement = createElement();
165447
+ return create.start(event, newElement, {
165448
+ source: element
165449
+ });
165450
+ };
165451
+
165452
+ return {
165453
+ click: autoPlaceElement,
165454
+ dragstart: manualPlaceElement
165455
+ };
165456
+ }
165457
+ }
165458
+
165459
+ let AppendMenuProvider$2 = class AppendMenuProvider extends BaseAppendMenuProvider {
165460
+ static $inject = [
165461
+ 'injector'
165462
+ ];
165463
+
165464
+ constructor(injector) {
165465
+ super(injector, {
165466
+ resourceType: 'bpmnProcess',
165467
+ groupName: 'Processes',
165468
+ className: 'bpmn-icon-call-activity',
165469
+ createElement: (resource, bpmnFactory) => createElement$2(resource, bpmnFactory),
165470
+ search: searchTerms$2
165471
+ });
165472
+ }
165473
+ };
165474
+
165475
+ /**
165476
+ * @typedef {{
165477
+ * type: 'bpmnProcess',
165478
+ * name: string,
165479
+ * processId: string
165480
+ * }} CallActivity
165481
+ */
165482
+
165483
+ /**
165484
+ *
165485
+ * @param {import('diagram-js/lib/model').Element} element
165486
+ * @param {CallActivity} resource
165487
+ * @param {import('didi').Injector} injector
165488
+ */
165489
+ function replaceElement$2(element, resource, injector) {
165490
+ const bpmnFactory = injector.get('bpmnFactory'),
165491
+ bpmnReplace = injector.get('bpmnReplace'),
165492
+ modeling = injector.get('modeling'),
165493
+ commandStack = injector.get('commandStack');
165494
+
165495
+
165496
+ commandStack.execute('external-resources.composed-command', {
165497
+ command: replace
165498
+ });
165499
+
165500
+
165501
+ function replace() {
165502
+ const replacedElement = bpmnReplace.replaceElement(element, { type: 'bpmn:CallActivity' });
165503
+ modeling.updateProperties(replacedElement, {
165504
+ name: resource.name
165505
+ });
165506
+
165507
+ const bo = getBusinessObject$2(replacedElement);
165508
+
165509
+ const extensionElements = bo.get('extensionElements');
165510
+
165511
+ if (!extensionElements) {
165512
+ modeling.updateProperties(replacedElement, {
165513
+ extensionElements: bpmnFactory.create('bpmn:ExtensionElements', {
165514
+ values: [
165515
+ createCalledElement(resource, bpmnFactory)
165516
+ ]
165517
+ })
165518
+ });
165519
+
165520
+ return;
165521
+ }
165522
+
165523
+ const calledElement = getCalledElement(replacedElement);
165524
+
165525
+ if (!calledElement) {
165526
+ modeling.updateModdleProperties(replacedElement, extensionElements, {
165527
+ values: [
165528
+ ...extensionElements.values,
165529
+ createCalledElement(resource, bpmnFactory)
165530
+ ]
165531
+ });
165532
+
165533
+ return;
165534
+ }
165535
+
165536
+ modeling.updateModdleProperties(replacedElement, calledElement, {
165537
+ processId: resource.processId
165538
+ });
165539
+ }
165540
+ }
165541
+
165542
+ function getCalledElement(element) {
165543
+ return element.businessObject?.extensionElements?.values.find(value => is$5(value, 'zeebe:CalledElement'));
165544
+ }
165545
+
165546
+ function createCalledElement(resource, bpmnFactory) {
165547
+ return bpmnFactory.create('zeebe:CalledElement', {
165548
+ processId: resource.processId
165549
+ });
165550
+ }
165551
+
165552
+ /**
165553
+ * @typedef {object} Config
165554
+ * @property {string} resourceType
165555
+ * @property {string} className
165556
+ * @property {string} groupName
165557
+ * @property {Function} replaceElement
165558
+ * @property {string} [search]
165559
+ */
165560
+
165561
+ class BaseReplaceMenuProvider {
165562
+
165563
+ /**
165564
+ *
165565
+ * @param {import('didi').Injector} injector
165566
+ * @param {Config} config
165567
+ */
165568
+ constructor(injector, config) {
165569
+
165570
+ this._injector = injector;
165571
+ this._popupMenu = injector.get('popupMenu');
165572
+ this._rules = injector.get('rules');
165573
+ this._translate = injector.get('translate');
165574
+ this._resources = injector.get('resources');
165575
+
165576
+ this._popupMenu.registerProvider('bpmn-replace', this);
165577
+
165578
+ this._config = config;
165579
+ }
165580
+
165581
+
165582
+ /**
165583
+ * @param {PopupMenuTarget} element
165584
+ *
165585
+ * @return {PopupMenuEntries}
165586
+ */
165587
+ getPopupMenuEntries(element) {
165588
+ const rules = this._rules;
165589
+
165590
+ if (isArray$5(element) || !rules.allowed('shape.replace', { element })) {
165591
+ return {};
165592
+ }
165593
+
165594
+ if (!is$5(element, 'bpmn:Activity')) {
165595
+ return {};
165596
+ }
165597
+
165598
+ const {
165599
+ resourceType,
165600
+ className,
165601
+ groupName,
165602
+ replaceElement,
165603
+ search
165604
+ } = this._config;
165605
+
165606
+ const resources = this._resources.filter(r => r.type === resourceType);
165607
+ const entries = {};
165608
+
165609
+ resources.forEach((resource, index) => {
165610
+ const replace = () => replaceElement(element, resource, this._injector);
165611
+ entries[`resources-replace-${resourceType}-${index}`] = {
165612
+ label: resource.name,
165613
+ action: replace,
165614
+ group: {
165615
+ name: this._translate(groupName)
165616
+ },
165617
+ className,
165618
+ search
165619
+ };
165620
+ });
165621
+
165622
+ return entries;
165623
+ }
165624
+ }
165625
+
165626
+ let ReplaceMenuProvider$2 = class ReplaceMenuProvider extends BaseReplaceMenuProvider {
165627
+ static $inject = [
165628
+ 'injector'
165629
+ ];
165630
+
165631
+ constructor(injector) {
165632
+ super(injector, {
165633
+ resourceType: 'bpmnProcess',
165634
+ groupName: 'Processes',
165635
+ className: 'bpmn-icon-call-activity',
165636
+ replaceElement: (element, resource, injector) => replaceElement$2(element, resource, injector),
165637
+ search: searchTerms$2
165638
+ });
165639
+ }
165640
+ };
165641
+
165642
+ const ProcessHandlerModule = {
165643
+ __init__: [
165644
+ 'resources.processHandler.create',
165645
+ 'resources.processHandler.append',
165646
+ 'resources.processHandler.replace'
165647
+ ],
165648
+ 'resources.processHandler.create': [ 'type', CreateMenuProvider$2 ],
165649
+ 'resources.processHandler.append': [ 'type', AppendMenuProvider$2 ],
165650
+ 'resources.processHandler.replace': [ 'type', ReplaceMenuProvider$2 ]
165651
+ };
165652
+
165653
+ /**
165654
+ * @typedef {{
165655
+ * type: 'dmnDecision',
165656
+ * name: string,
165657
+ * decisionId: string
165658
+ * }} Decision
165659
+ */
165660
+
165661
+ /**
165662
+ * @param {Decision} resource
165663
+ * @param {import('bpmn-js/lib/features/modeling/BpmnFactory').default} bpmnFactory
165664
+ */
165665
+ function createElement$1(resource, bpmnFactory) {
165666
+ return createDecisionTask(resource, bpmnFactory);
165667
+ }
165668
+
165669
+ function createDecisionTask(resource, bpmnFactory) {
165670
+ const calledElement = createCalledDecision$1(resource, bpmnFactory);
165671
+ const extensionElements = bpmnFactory.create('bpmn:ExtensionElements', {
165672
+ values: [
165673
+ calledElement
165674
+ ]
165675
+ });
165676
+
165677
+ return bpmnFactory.create('bpmn:BusinessRuleTask', {
165678
+ name: resource.name,
165679
+ extensionElements
165680
+ });
165681
+ }
165682
+
165683
+ function createCalledDecision$1(resource, bpmnFactory) {
165684
+ return bpmnFactory.create('zeebe:CalledDecision', {
165685
+ decisionId: resource.decisionId
165686
+ });
165687
+ }
165688
+
165689
+ const searchTerms$1 = [
165690
+ 'resource',
165691
+ 'dmn',
165692
+ 'business rule task',
165693
+ 'decision'
165694
+ ].join(' ');
165695
+
165696
+ let CreateMenuProvider$1 = class CreateMenuProvider extends BaseCreateMenuProvider {
165697
+ static $inject = [
165698
+ 'injector'
165699
+ ];
165700
+
165701
+ constructor(injector) {
165702
+ super(injector, {
165703
+ resourceType: 'dmnDecision',
165704
+ groupName: 'Decisions',
165705
+ className: 'bpmn-icon-business-rule-task',
165706
+ createElement: (resource, bpmnFactory) => createElement$1(resource, bpmnFactory),
165707
+ search: searchTerms$1
165708
+ });
165709
+ }
165710
+ };
165711
+
165712
+ let AppendMenuProvider$1 = class AppendMenuProvider extends BaseAppendMenuProvider {
165713
+ static $inject = [
165714
+ 'injector'
165715
+ ];
165716
+
165717
+ constructor(injector) {
165718
+ super(injector, {
165719
+ resourceType: 'dmnDecision',
165720
+ groupName: 'Decisions',
165721
+ className: 'bpmn-icon-business-rule-task',
165722
+ createElement: (resource, bpmnFactory) => createElement$1(resource, bpmnFactory),
165723
+ search: searchTerms$1
165724
+ });
165725
+ }
165726
+ };
165727
+
165728
+ /**
165729
+ * @typedef {{
165730
+ * type: 'dmnDecision',
165731
+ * name: string,
165732
+ * decisionId: string
165733
+ * }} Decision
165734
+ */
165735
+
165736
+ /**
165737
+ * @param {import('diagram-js/lib/model').Element} element
165738
+ * @param {Decision} resource
165739
+ * @param {import('didi').Injector} injector
165740
+ */
165741
+ function replaceElement$1(element, resource, injector) {
165742
+ const bpmnFactory = injector.get('bpmnFactory'),
165743
+ bpmnReplace = injector.get('bpmnReplace'),
165744
+ modeling = injector.get('modeling'),
165745
+ commandStack = injector.get('commandStack');
165746
+
165747
+
165748
+ commandStack.execute('external-resources.composed-command', {
165749
+ command: replace
165750
+ });
165751
+
165752
+
165753
+ function replace() {
165754
+ const replacedElement = bpmnReplace.replaceElement(element, { type: 'bpmn:BusinessRuleTask' });
165755
+ modeling.updateProperties(replacedElement, {
165756
+ name: resource.name
165757
+ });
165758
+
165759
+ const bo = getBusinessObject$2(replacedElement);
165760
+
165761
+ const extensionElements = bo.get('extensionElements');
165762
+
165763
+ if (!extensionElements) {
165764
+ modeling.updateProperties(replacedElement, {
165765
+ extensionElements: bpmnFactory.create('bpmn:ExtensionElements', {
165766
+ values: [
165767
+ createCalledDecision(resource, bpmnFactory)
165768
+ ]
165769
+ })
165770
+ });
165771
+
165772
+ return;
165773
+ }
165774
+
165775
+ const calledDecision = getCalledDecision(replacedElement);
165776
+
165777
+ if (!calledDecision) {
165778
+ modeling.updateModdleProperties(replacedElement, extensionElements, {
165779
+ values: [
165780
+ ...extensionElements.values,
165781
+ createCalledDecision(resource, bpmnFactory)
165782
+ ]
165783
+ });
165784
+
165785
+ return;
165786
+ }
165787
+
165788
+ modeling.updateModdleProperties(replacedElement, calledDecision, {
165789
+ decisionId: resource.decisionId
165790
+ });
165791
+ }
165792
+ }
165793
+
165794
+ function getCalledDecision(element) {
165795
+ return element.businessObject?.extensionElements?.values.find(value => is$5(value, 'zeebe:CalledDecision'));
165796
+ }
165797
+
165798
+ function createCalledDecision(resource, bpmnFactory) {
165799
+ return bpmnFactory.create('zeebe:CalledDecision', {
165800
+ decisionId: resource.decisionId
165801
+ });
165802
+ }
165803
+
165804
+ let ReplaceMenuProvider$1 = class ReplaceMenuProvider extends BaseReplaceMenuProvider {
165805
+ static $inject = [
165806
+ 'injector'
165807
+ ];
165808
+
165809
+ constructor(injector) {
165810
+ super(injector, {
165811
+ resourceType: 'dmnDecision',
165812
+ groupName: 'Decisions',
165813
+ className: 'bpmn-icon-business-rule-task',
165814
+ replaceElement: (element, resource, injector) => replaceElement$1(element, resource, injector),
165815
+ search: searchTerms$1
165816
+ });
165817
+ }
165818
+ };
165819
+
165820
+ const DecisionHandlerModule = {
165821
+ __init__: [
165822
+ 'resources.decisionHandler.create',
165823
+ 'resources.decisionHandler.append',
165824
+ 'resources.decisionHandler.replace'
165825
+ ],
165826
+ 'resources.decisionHandler.create': [ 'type', CreateMenuProvider$1 ],
165827
+ 'resources.decisionHandler.append': [ 'type', AppendMenuProvider$1 ],
165828
+ 'resources.decisionHandler.replace': [ 'type', ReplaceMenuProvider$1 ]
165829
+ };
165830
+
165831
+ /**
165832
+ * @typedef {{
165833
+ * type: 'form',
165834
+ * name: string,
165835
+ * formId: string
165836
+ * }} Form
165837
+ */
165838
+
165839
+ /**
165840
+ * @param {Form} resource
165841
+ */
165842
+ function createElement(resource, bpmnFactory) {
165843
+ return createFormTask(resource, bpmnFactory);
165844
+ }
165845
+
165846
+ function createFormTask(resource, bpmnFactory) {
165847
+ const formDefinition = createFormDefinition$1(resource, bpmnFactory);
165848
+ const extensionElements = bpmnFactory.create('bpmn:ExtensionElements', {
165849
+ values: [
165850
+ createZeebeUserTask$1(bpmnFactory),
165851
+ formDefinition
165852
+ ]
165853
+ });
165854
+
165855
+ return bpmnFactory.create('bpmn:UserTask', {
165856
+ name: resource.name,
165857
+ extensionElements
165858
+ });
165859
+ }
165860
+
165861
+ function createFormDefinition$1(resource, bpmnFactory) {
165862
+ return bpmnFactory.create('zeebe:FormDefinition', {
165863
+ formId: resource.formId
165864
+ });
165865
+ }
165866
+
165867
+ function createZeebeUserTask$1(bpmnFactory) {
165868
+ return bpmnFactory.create('zeebe:UserTask');
165869
+ }
165870
+
165871
+ const searchTerms = [
165872
+ 'resource',
165873
+ 'form',
165874
+ 'user task',
165875
+ 'human'
165876
+ ].join(' ');
165877
+
165878
+ class CreateMenuProvider extends BaseCreateMenuProvider {
165879
+ static $inject = [
165880
+ 'injector'
165881
+ ];
165882
+
165883
+ constructor(injector) {
165884
+ super(injector, {
165885
+ resourceType: 'form',
165886
+ groupName: 'Forms',
165887
+ className: 'bpmn-icon-user-task',
165888
+ createElement: (resource, bpmnFactory) => createElement(resource, bpmnFactory),
165889
+ search: searchTerms
165890
+ });
165891
+ }
165892
+ }
165893
+
165894
+ class AppendMenuProvider extends BaseAppendMenuProvider {
165895
+ static $inject = [
165896
+ 'injector'
165897
+ ];
165898
+
165899
+ constructor(injector) {
165900
+ super(injector, {
165901
+ resourceType: 'form',
165902
+ groupName: 'Forms',
165903
+ className: 'bpmn-icon-user-task',
165904
+ createElement: (resource, bpmnFactory) => createElement(resource, bpmnFactory),
165905
+ search: searchTerms
165906
+ });
165907
+ }
165908
+ }
165909
+
165910
+ /**
165911
+ * @typedef {{
165912
+ * type: 'form',
165913
+ * name: string,
165914
+ * formId: string
165915
+ * }} Form
165916
+ */
165917
+
165918
+ /**
165919
+ * @param {import('diagram-js/lib/model').Element} element
165920
+ * @param {Form} resource
165921
+ * @param {import('didi').Injector} injector
165922
+ */
165923
+ function replaceElement(element, resource, injector) {
165924
+ const bpmnFactory = injector.get('bpmnFactory'),
165925
+ bpmnReplace = injector.get('bpmnReplace'),
165926
+ modeling = injector.get('modeling'),
165927
+ commandStack = injector.get('commandStack');
165928
+
165929
+
165930
+ commandStack.execute('external-resources.composed-command', {
165931
+ command: replace
165932
+ });
165933
+
165934
+
165935
+ function replace() {
165936
+ const replacedElement = bpmnReplace.replaceElement(element, { type: 'bpmn:UserTask' });
165937
+ modeling.updateProperties(replacedElement, {
165938
+ name: resource.name
165939
+ });
165940
+
165941
+ const bo = getBusinessObject$2(replacedElement);
165942
+
165943
+ const extensionElements = bo.get('extensionElements');
165944
+
165945
+ if (!extensionElements) {
165946
+ modeling.updateProperties(replacedElement, {
165947
+ extensionElements: bpmnFactory.create('bpmn:ExtensionElements', {
165948
+ values: [
165949
+ createZeebeUserTask(bpmnFactory),
165950
+ createFormDefinition(resource, bpmnFactory)
165951
+ ]
165952
+ })
165953
+ });
165954
+
165955
+ return;
165956
+ }
165957
+
165958
+ const formDefinition = getFormDefinition(replacedElement);
165959
+
165960
+ if (!formDefinition) {
165961
+ modeling.updateModdleProperties(replacedElement, extensionElements, {
165962
+ values: [
165963
+ ...extensionElements.values,
165964
+ createFormDefinition(resource, bpmnFactory)
165965
+ ]
165966
+ });
165967
+
165968
+ return;
165969
+ }
165970
+
165971
+ modeling.updateModdleProperties(replacedElement, formDefinition, {
165972
+ formId: resource.formId
165973
+ });
165974
+ }
165975
+ }
165976
+
165977
+ function getFormDefinition(element) {
165978
+ return element.businessObject?.extensionElements?.values.find(value => is$5(value, 'zeebe:FormDefinition'));
165979
+ }
165980
+
165981
+ function createFormDefinition(resource, bpmnFactory) {
165982
+ return bpmnFactory.create('zeebe:FormDefinition', {
165983
+ formId: resource.formId
165984
+ });
165985
+ }
165986
+
165987
+ function createZeebeUserTask(bpmnFactory) {
165988
+ return bpmnFactory.create('zeebe:UserTask');
165989
+ }
165990
+
165991
+ class ReplaceMenuProvider extends BaseReplaceMenuProvider {
165992
+ static $inject = [
165993
+ 'injector'
165994
+ ];
165995
+
165996
+ constructor(injector) {
165997
+ super(injector, {
165998
+ resourceType: 'form',
165999
+ groupName: 'Forms',
166000
+ className: 'bpmn-icon-user-task',
166001
+ replaceElement: (element, resource, injector) => replaceElement(element, resource, injector),
166002
+ search: searchTerms
166003
+ });
166004
+ }
166005
+ }
166006
+
166007
+ const FormHandlerModule = {
166008
+ __init__: [
166009
+ 'resources.formHandler.create',
166010
+ 'resources.formHandler.append',
166011
+ 'resources.formHandler.replace'
166012
+ ],
166013
+ 'resources.formHandler.create': [ 'type', CreateMenuProvider ],
166014
+ 'resources.formHandler.append': [ 'type', AppendMenuProvider ],
166015
+ 'resources.formHandler.replace': [ 'type', ReplaceMenuProvider ]
166016
+ };
166017
+
166018
+ /**
166019
+ * Command handler to compose multiple commands into a single command.
166020
+ * It allows to use facades like `BpmnReplace` and `Modeling` while retaining
166021
+ * single undo/redo feature.
166022
+ */
166023
+ class ComposedCommandHandler {
166024
+ constructor(commandStack) {
166025
+ this._commandStack = commandStack;
166026
+ }
166027
+
166028
+ preExecute(context) {
166029
+ context.command();
166030
+ }
166031
+ }
166032
+
166033
+ ComposedCommandHandler.$inject = [ 'commandStack' ];
166034
+
166035
+ const HANDLERS = {
166036
+ 'external-resources.composed-command': ComposedCommandHandler
166037
+ };
166038
+
166039
+
166040
+ function CommandInitializer(eventBus, commandStack) {
166041
+
166042
+ eventBus.on('diagram.init', function() {
166043
+ forEach$2(HANDLERS, function(handler, id) {
166044
+ commandStack.registerHandler(id, handler);
166045
+ });
166046
+ });
166047
+ }
166048
+
166049
+ CommandInitializer.$inject = [ 'eventBus', 'commandStack' ];
166050
+
166051
+ const ResourcesModule = {
166052
+ __init__: [
166053
+ 'resources.resourceLoader',
166054
+ ],
166055
+ 'resources.resourceLoader': [ 'type', ResourceLoader ],
166056
+ 'resources': [ 'type', Resources ],
166057
+ };
166058
+
166059
+ const DefaultHandlersModule = {
166060
+ __init__: [
166061
+ CommandInitializer
166062
+ ],
166063
+ __depends__: [
166064
+ DecisionHandlerModule,
166065
+ FormHandlerModule,
166066
+ ProcessHandlerModule
166067
+ ]
166068
+ };
166069
+
164892
166070
  /**
164893
166071
  * @typedef {import('bpmn-js/lib/BaseViewer').BaseViewerOptions} BaseViewerOptions
164894
166072
  */
@@ -164957,7 +166135,9 @@
164957
166135
  ZeebeVariableResolverModule,
164958
166136
  exampleDataPropertiesProviderModule,
164959
166137
  index$3,
164960
- camundaDetailsPopupMenuModule
166138
+ camundaDetailsPopupMenuModule,
166139
+ DefaultHandlersModule,
166140
+ ResourcesModule
164961
166141
  ];
164962
166142
 
164963
166143
  Modeler.prototype._modules = [].concat(