bpmn-js 13.0.8 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bpmn-modeler.development.js +20 -12
- package/dist/bpmn-modeler.production.min.js +2 -2
- package/dist/bpmn-navigated-viewer.development.js +20 -12
- package/dist/bpmn-navigated-viewer.production.min.js +2 -2
- package/dist/bpmn-viewer.development.js +20 -12
- package/dist/bpmn-viewer.production.min.js +2 -2
- package/lib/draw/BpmnRenderer.d.ts +7 -7
- package/lib/draw/BpmnRenderer.js +18 -10
- package/lib/icons/dist/append.svg +1 -0
- package/lib/icons/dist/connect-context-pad.svg +1 -0
- package/lib/icons/dist/connect-palette.svg +1 -0
- package/lib/icons/dist/create.svg +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-modeler v13.0
|
|
2
|
+
* bpmn-js - bpmn-modeler v13.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, camunda Services GmbH
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Source Code: https://github.com/bpmn-io/bpmn-js
|
|
10
10
|
*
|
|
11
|
-
* Date: 2023-05-
|
|
11
|
+
* Date: 2023-05-24
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -18753,8 +18753,8 @@
|
|
|
18753
18753
|
}
|
|
18754
18754
|
|
|
18755
18755
|
function as(type) {
|
|
18756
|
-
return function(parentGfx, element) {
|
|
18757
|
-
return renderer(type)(parentGfx, element);
|
|
18756
|
+
return function(parentGfx, element, options) {
|
|
18757
|
+
return renderer(type)(parentGfx, element, options);
|
|
18758
18758
|
};
|
|
18759
18759
|
}
|
|
18760
18760
|
|
|
@@ -18893,7 +18893,7 @@
|
|
|
18893
18893
|
|
|
18894
18894
|
return drawCircle(parentGfx, element.width, element.height, attrs);
|
|
18895
18895
|
},
|
|
18896
|
-
'bpmn:StartEvent': function(parentGfx, element) {
|
|
18896
|
+
'bpmn:StartEvent': function(parentGfx, element, options) {
|
|
18897
18897
|
var attrs = {
|
|
18898
18898
|
fill: getFillColor(element, defaultFillColor),
|
|
18899
18899
|
stroke: getStrokeColor$1(element, defaultStrokeColor)
|
|
@@ -18911,7 +18911,9 @@
|
|
|
18911
18911
|
|
|
18912
18912
|
var circle = renderer('bpmn:Event')(parentGfx, element, attrs);
|
|
18913
18913
|
|
|
18914
|
-
|
|
18914
|
+
if (!options || options.renderIcon !== false) {
|
|
18915
|
+
renderEventContent(element, parentGfx);
|
|
18916
|
+
}
|
|
18915
18917
|
|
|
18916
18918
|
return circle;
|
|
18917
18919
|
},
|
|
@@ -19164,14 +19166,16 @@
|
|
|
19164
19166
|
stroke: getStrokeColor$1(event, defaultStrokeColor)
|
|
19165
19167
|
});
|
|
19166
19168
|
},
|
|
19167
|
-
'bpmn:EndEvent': function(parentGfx, element) {
|
|
19169
|
+
'bpmn:EndEvent': function(parentGfx, element, options) {
|
|
19168
19170
|
var circle = renderer('bpmn:Event')(parentGfx, element, {
|
|
19169
19171
|
strokeWidth: 4,
|
|
19170
19172
|
fill: getFillColor(element, defaultFillColor),
|
|
19171
19173
|
stroke: getStrokeColor$1(element, defaultStrokeColor)
|
|
19172
19174
|
});
|
|
19173
19175
|
|
|
19174
|
-
|
|
19176
|
+
if (!options || options.renderIcon !== false) {
|
|
19177
|
+
renderEventContent(element, parentGfx);
|
|
19178
|
+
}
|
|
19175
19179
|
|
|
19176
19180
|
return circle;
|
|
19177
19181
|
},
|
|
@@ -19184,7 +19188,7 @@
|
|
|
19184
19188
|
|
|
19185
19189
|
return circle;
|
|
19186
19190
|
},
|
|
19187
|
-
'bpmn:IntermediateEvent': function(parentGfx, element) {
|
|
19191
|
+
'bpmn:IntermediateEvent': function(parentGfx, element, options) {
|
|
19188
19192
|
var outer = renderer('bpmn:Event')(parentGfx, element, {
|
|
19189
19193
|
strokeWidth: 1.5,
|
|
19190
19194
|
fill: getFillColor(element, defaultFillColor),
|
|
@@ -19198,7 +19202,9 @@
|
|
|
19198
19202
|
stroke: getStrokeColor$1(element, defaultStrokeColor)
|
|
19199
19203
|
});
|
|
19200
19204
|
|
|
19201
|
-
|
|
19205
|
+
if (!options || options.renderIcon !== false) {
|
|
19206
|
+
renderEventContent(element, parentGfx);
|
|
19207
|
+
}
|
|
19202
19208
|
|
|
19203
19209
|
return outer;
|
|
19204
19210
|
},
|
|
@@ -19916,7 +19922,7 @@
|
|
|
19916
19922
|
|
|
19917
19923
|
return elementStore;
|
|
19918
19924
|
},
|
|
19919
|
-
'bpmn:BoundaryEvent': function(parentGfx, element) {
|
|
19925
|
+
'bpmn:BoundaryEvent': function(parentGfx, element, options) {
|
|
19920
19926
|
|
|
19921
19927
|
var semantic = getBusinessObject(element),
|
|
19922
19928
|
cancel = semantic.cancelActivity;
|
|
@@ -19947,7 +19953,9 @@
|
|
|
19947
19953
|
|
|
19948
19954
|
/* inner path */ drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, innerAttrs);
|
|
19949
19955
|
|
|
19950
|
-
|
|
19956
|
+
if (!options || options.renderIcon !== false) {
|
|
19957
|
+
renderEventContent(element, parentGfx);
|
|
19958
|
+
}
|
|
19951
19959
|
|
|
19952
19960
|
return outer;
|
|
19953
19961
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! bpmn-js - bpmn-modeler v13.0
|
|
1
|
+
/*! bpmn-js - bpmn-modeler v13.1.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
|
|
2
2
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnJS=t()}(this,(function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var t=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var c=parseInt(a,n);return c!==1/0&&c>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function n(e){if(!(this instanceof n))return new n(e);e=e||[128,36,1],this._seed=e.length?t.rack(e[0],e[1],e[2]):e}function i(e){return Array.prototype.concat.apply([],e)}n.prototype.next=function(e){return this._seed(e||!0)},n.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},n.prototype.claim=function(e,t){this._seed.set(e,t||!0)},n.prototype.assigned=function(e){return this._seed.get(e)||!1},n.prototype.unclaim=function(e){delete this._seed.hats[e]},n.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;function a(e){return void 0===e}function s(e){return void 0!==e}function c(e){return null==e}function p(e){return"[object Array]"===r.call(e)}function l(e){return"[object Object]"===r.call(e)}function u(e){return"[object Number]"===r.call(e)}function h(e){const t=r.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function d(e){return"[object String]"===r.call(e)}function f(e,t){return o.call(e,t)}function m(e,t){const n=M(t);let i;return g(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function v(e,t){const n=M(t);let i=p(e)?-1:void 0;return g(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function y(e,t){const n=M(t);let i=[];return g(e,(function(e,t){n(e,t)&&i.push(e)})),i}function g(e,t){let n,i;if(a(e))return;const r=p(e)?N:B;for(let o in e)if(f(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function b(e,t){if(a(e))return[];!function(e){if(!p(e))throw new Error("must supply array")}(e);const n=M(t);return e.filter((function(e,t){return!n(e,t)}))}function x(e,t,n){return g(e,(function(e,i){n=t(n,e,i)})),n}function _(e,t){return!!x(e,(function(e,n,i){return e&&t(n,i)}),!0)}function E(e,t){return!!m(e,t)}function w(e,t){let n=[];return g(e,(function(e,i){n.push(t(e,i))})),n}function S(e){return e&&Object.keys(e)||[]}function C(e){return w(e,(e=>e))}function A(e,t,n={}){return t=D(t),g(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function R(e,...t){e=D(e);let n={};return g(t,(t=>A(t,e,n))),w(n,(function(e,t){return e[0]}))}const P=R;function T(e,t){t=D(t);let n=[];return g(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var a=0;a<n.length;a++){let{d:e}=n[a];if(r<e)return void n.splice(a,0,o)}n.push(o)})),w(n,(e=>e.v))}function k(e){return function(t){return _(e,(function(e,n){return t[n]===e}))}}function D(e){return h(e)?e:t=>t[e]}function M(e){return h(e)?e:t=>t===e}function B(e){return e}function N(e){return Number(e)}function O(e,t){let n,i,r,o;function a(n){let a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(r,i),c()}function s(e){n=setTimeout(a,e)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function p(...e){o=Date.now(),i=e,r=this,n||s(t)}return p.flush=function(){n&&a(!0),c()},p.cancel=c,p}function j(e,t){return e.bind(t)}function L(e,...t){return Object.assign(e,...t)}function I(e,t){let n={},i=Object(e);return g(t,(function(t){t in i&&(n[t]=e[t])})),n}function F(e,t){let n={};return g(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}function $(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const z=Object.prototype.toString,H=Object.prototype.hasOwnProperty;function V(e,t){return H.call(e,t)}function G(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===z.call(e)}(e)?U:W;for(let o in e)if(V(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function W(e){return e}function U(e){return Number(e)}function q(e,...t){const n=e.style;return G(t,(function(e){e&&G(e,(function(e,t){n[t]=e}))})),e}function K(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const Y=Object.prototype.toString;function X(e){return new Z(e)}function Z(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Q(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function J(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function ee(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(J(i,t))return i;i=i.parentNode}return J(i,t)?i:null}Z.prototype.add=function(e){return this.list.add(e),this},Z.prototype.remove=function(e){return"[object RegExp]"==Y.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Z.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Z.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Z.prototype.array=function(){return Array.from(this.list)},Z.prototype.has=Z.prototype.contains=function(e){return this.list.contains(e)};var te,ne,ie,re={};function oe(){te=window.addEventListener?"addEventListener":"attachEvent",ne=window.removeEventListener?"removeEventListener":"detachEvent",ie="addEventListener"!==te?"on":""}var ae=$({__proto__:null,bind:re.bind=function(e,t,n,i){return te||oe(),e[te](ie+t,n,i||!1),n},unbind:re.unbind=function(e,t,n,i){return ne||oe(),e[ne](ie+t,n,i||!1),n},default:re},[re]),se=["focus","blur"];var ce,pe={bind:function(e,t,n,i,r){return-1!==se.indexOf(n)&&(r=!0),ae.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=ee(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==se.indexOf(t)&&(i=!0),ae.unbind(e,t,n,i)}},le=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild)}var r,o=Object.prototype.hasOwnProperty.call(he,i)?he[i]:he._default,a=o[0],s=o[1],c=o[2];(r=t.createElement("div")).innerHTML=s+e+c;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var p=t.createDocumentFragment();for(;r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p},ue=!1;"undefined"!=typeof document&&((ce=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',ue=!ce.getElementsByTagName("link").length,ce=void 0);var he={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:ue?[1,"X<div>","</div>"]:[0,"",""]};he.td=he.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],he.option=he.optgroup=[1,'<select multiple="multiple">',"</select>"],he.thead=he.tbody=he.colgroup=he.caption=he.tfoot=[1,"<table>","</table>"],he.polyline=he.ellipse=he.polygon=he.circle=he.text=he.line=he.path=he.rect=he.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var de=le;function fe(e,t){return(t=t||document).querySelector(e)}function me(e,t){return(t=t||document).querySelectorAll(e)}function ve(e){e.parentNode&&e.parentNode.removeChild(e)}function ye(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function ge(e,t){return ye(t,e),e}var be={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function xe(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=be[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function _e(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return be[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);xe(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)xe(e,i,t[i])}(e,t);return e}const Ee=Object.prototype.toString;function we(e){return new Se(e)}function Se(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ce(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Ae(e){for(var t;t=e.firstChild;)Ce(t);return e}function Re(e){return e.cloneNode(!0)}Se.prototype.add=function(e){return this.list.add(e),this},Se.prototype.remove=function(e){return"[object RegExp]"==Ee.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Se.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Se.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Se.prototype.array=function(){return Array.from(this.list)},Se.prototype.has=Se.prototype.contains=function(e){return this.list.contains(e)};var Pe="http://www.w3.org/2000/svg",Te='<svg xmlns="'+Pe+'"';function ke(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Pe)&&(e=Te+e.substring(4)):(e=Te+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function De(e,t){var n;return"<"===e.charAt(0)?(n=ke(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Pe,e),t&&_e(n,t),n}var Me=null;function Be(){return null===Me&&(Me=De("svg")),Me}function Ne(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Oe(e){return e?Be().createSVGTransformFromMatrix(e):Be().createSVGTransform()}var je=/([&<>]{1})/g,Le=/([\n\r"]{1})/g,Ie={"&":"&","<":"<",">":">",'"':"'"};function Fe(e,t){return e.replace(t,(function(e,t){return Ie[t]||t}))}function $e(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Fe(e.textContent,je));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Fe(o.value,Le),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)$e(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Fe(e.nodeValue,je),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ze(e,t){var n=ke(t);if(Ae(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)ye(r[o],e)}}function He(e,t){if(void 0!==t){try{ze(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)$e(t,n),t=t.nextSibling;return n.join("")}(e)}function Ve(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ge(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(Ve(e,i))}(n,t)),n.consolidate()}const We=/^class[ {]/;function Ue(e){return Array.isArray(e)}function qe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ke(...e){1===e.length&&Ue(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Ye=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Xe=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Ze=/\/\*([^*]*)\*\//m;function Qe(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return We.test(e.toString())}(e)?Ye:Xe);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(Ze);return(t&&t[1]||e).trim()}))||[]}function Je(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}};const n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){const t=n.join(" -> ");return n.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){const t=e.split(".");let n=s(t.shift());for(;t.length;)n=n[t.shift()];return n}if(qe(r,e))return r[e];if(qe(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Ue(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Ke(e.slice())}return{fn:e,dependencies:(e.$inject||Qe(e)).map((e=>qe(t,e)?t[e]:s(e)))}}function p(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.apply(t,[null].concat(n)))}function l(e,t,n){const{fn:i,dependencies:r}=c(e,n);return i.apply(t,r)}function u(e){return Ke((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],a=[],s=[];let c,p,l,h;for(let e in i)c=i[e],-1!==t.indexOf(e)&&("private"===c[2]?(p=o.indexOf(c[3]),-1===p?(l=c[3].createChild([],t),h=u(l),o.push(c[3]),a.push(l),s.push(h),n[e]=[h,e,"private",l]):n[e]=[s[p],e,"private",a[p]]):n[e]=[c[2],c[1]],r[e]=!0),"factory"!==c[2]&&"type"!==c[2]||!c[1].$scope||t.forEach((t=>{-1!==c[1].$scope.indexOf(t)&&(n[e]=[c[2],c[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new Je(e,o)}const d={factory:l,type:p,value:function(e){return e}};function f(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function m(e){const t=e.__exports__;if(t){const n=e.__modules__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(r)),a=Ke((function(e){return o.get(e)}));t.forEach((function(e){i[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),f(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;if("private"===e[t][2])return void(i[t]=e[t]);const n=e[t][0],r=e[t][1];i[t]=[d[n],et(n,r),n]})),f(e,o)}function v(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(v,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=l,this.instantiate=p,this.createChild=h,this.init=function(e){const t=e.reduce(v,[]).map(m);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function et(e,t){return"value"!==e&&Ue(t)&&(t=Ke(t.slice())),t}function tt(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function nt(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function it(e){return["L",e.x,e.y]}function rt(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let r=1;r<n;r++){const n=e[r-1],c=e[r],p=e[r+1];if(!p||!t){i.push(it(c));continue}const l=Math.min(t,at(c.x-n.x,c.y-n.y),at(p.x-c.x,p.y-c.y));if(!l){i.push(it(c));continue}const u=ot(c,n,l),h=ot(c,n,.5*l),d=ot(c,p,l),f=ot(c,p,.5*l);i.push(it(u)),i.push((a=f,s=d,["C",(o=h).x,o.y,a.x,a.y,s.x,s.y]))}return i}function ot(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/at(i,r);return{x:e.x+i*o,y:e.y+r*o}}function at(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function st(e,t,n){u(t)&&(n=t,t=null),t||(t={});const i=De("path",t);return u(n)&&(i.dataset.cornerRadius=String(n)),ct(i,e)}function ct(e,t){return _e(e,{d:nt(rt(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function pt(e){return y(e,(function(t){return!m(e,(function(e){return e!==t&<(t,e)}))}))}function lt(e,t){if(t){if(e===t)return t;if(e.parent)return lt(e.parent,t)}}function ut(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function ht(e,t,n){n=n||0,p(e)||(e=[e]),g(e,(function(e,i){var r=t(e,i,n);p(r)&&r.length&&ht(r,t,n+1)}))}function dt(e,t){return function(e,t,n){var i=[],r=[];return ht(e,(function(e,o,a){ut(i,e,t);var s=e.children;if((-1===n||a<n)&&s&&ut(r,s,t))return s})),i}(e,!t,-1)}function ft(e,t){var n,i,r,o;return t=!!t,p(e)||(e=[e]),g(e,(function(e){var a=e;e.waypoints&&!t&&(a=ft(e.waypoints,!0));var s=a.x,c=a.y,p=a.height||0,l=a.width||0;(s<n||void 0===n)&&(n=s),(c<i||void 0===i)&&(i=c),(s+l>r||void 0===r)&&(r=s+l),(c+p>o||void 0===o)&&(o=c+p)})),{x:n,y:i,height:o-i,width:r-n}}function mt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function vt(e){return!(!e||!e.isFrame)}function yt(e,t){return L({},e||{},t||{})}tt.prototype.canRender=function(e){},tt.prototype.drawShape=function(e,t){},tt.prototype.drawConnection=function(e,t){},tt.prototype.getShapePath=function(e){},tt.prototype.getConnectionPath=function(e){};function gt(e,t){tt.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(gt,tt),gt.prototype.canRender=function(){return!0},gt.prototype.drawShape=function(e,t,n){var i=De("rect");return _e(i,{x:0,y:0,width:t.width||0,height:t.height||0}),vt(t)?_e(i,L({},this.FRAME_STYLE,n||{})):_e(i,L({},this.SHAPE_STYLE,n||{})),ge(e,i),i},gt.prototype.drawConnection=function(e,t,n){var i=st(t.waypoints,L({},this.CONNECTION_STYLE,n||{}));return ge(e,i),i},gt.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return nt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},gt.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return nt(r)},gt.$inject=["eventBus","styles"];var bt={__init__:["defaultRenderer"],defaultRenderer:["type",gt],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return L(this.style(t,n),{class:e})},this.style=function(t,n){p(t)||n||(n=t,t=[]);var i=x(t,(function(t,n){return L(t,e[n]||{})}),{});return n?L(i,n):i},this.computeStyle=function(e,n,i){return p(n)||(i=n,n=[]),t.style(n||[],L({},i,e||{}))}}]};function xt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function _t(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Et(e,t){return e&&t?e.indexOf(t):-1}function wt(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function St(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=wt(e,t);return Math.abs(r/o)<=i}function Ct(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(At(e,n))return t;return!1}function At(e,t){const n=t[0];return _(t,(function(t){return Math.abs(n[e]-t[e])<=2}))}function Rt(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Pt(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}
|
|
3
3
|
/**
|
|
4
4
|
* This file contains source code adapted from Snap.svg (licensed Apache-2.0).
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @param {Element} container
|
|
26
26
|
*/
|
|
27
|
-
function(e){const t=de('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Nr+"</a>");q(fe("svg",t),Or),q(t,jr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),ae.bind(t,"click",(function(e){$r(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function Hr(e,t){return e.warnings=t,e}e(zr,ai),zr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let r;e=this._emit("import.parse.start",{xml:e})||e;try{r=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let o=r.rootElement;const a=r.references,s=r.warnings,c=r.elementsById;i=i.concat(s),o=this._emit("import.parse.complete",function(e){const t=n.get("eventBus").createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}({error:null,definitions:o,elementsById:c,references:a,warnings:i}))||o;const p=await this.importDefinitions(o,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Hr(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}},zr.prototype.importXML=wr(zr.prototype.importXML),zr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},zr.prototype.importDefinitions=wr(zr.prototype.importDefinitions),zr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Hr(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return m(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Hr(t,[]),t}try{this.clear()}catch(e){throw Hr(e,[]),e}const{warnings:i}=await Dr(this,t,n);return{warnings:i}},zr.prototype.open=wr(zr.prototype.open),zr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},zr.prototype.saveXML=wr(zr.prototype.saveXML),zr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=fe("defs",t._svg),r=He(n),o=i?"<defs>"+He(i)+"</defs>":"",a=n.getBBox();e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a.width+'" height="'+a.height+'" viewBox="'+a.x+" "+a.y+" "+a.width+" "+a.height+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},zr.prototype.saveSVG=wr(zr.prototype.saveSVG),zr.prototype._setDefinitions=function(e){this._definitions=e},zr.prototype.getModules=function(){return this._modules},zr.prototype.clear=function(){this.getDefinitions()&&ai.prototype.clear.call(this)},zr.prototype.destroy=function(){ai.prototype.destroy.call(this),ve(this._container)},zr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},zr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},zr.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=fe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},zr.prototype.getDefinitions=function(){return this._definitions},zr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},zr.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=L(F(n,["additionalModules"]),{canvas:L({},n.canvas,{container:e}),modules:o});ai.call(this,a),n&&n.container&&this.attachTo(n.container)},zr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},zr.prototype._createContainer=function(e){const t=de('<div class="bjs-container"></div>');return q(t,{width:Gr(e.width),height:Gr(e.height),position:e.position}),t},zr.prototype._createModdle=function(e){return new _r(L({},this._moddleExtensions,e.moddleExtensions))},zr.prototype._modules=[];const Vr={width:"100%",height:"100%",position:"relative"};function Gr(e){return e+(u(e)?"px":"")}function Wr(e){zr.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function Ur(e,t){return!Rr(e,"bpmn:CallActivity")&&(Rr(e,"bpmn:SubProcess")?!(!(t=t||kr(e))||!Rr(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!Rr(e,"bpmn:Participant")||!!Tr(e).processRef)}function qr(e){return e&&!!Tr(e).triggeredByEvent}function Kr(e,t){return E(Tr(e).eventDefinitions,(function(e){return Rr(e,t)}))}e(Wr,zr),Wr.prototype._createModdle=function(e){var t=zr.prototype._createModdle.call(this,e);return t.ids=new n([32,36,1]),t},Wr.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Yr={width:90,height:20};function Xr(e){return Rr(e,"bpmn:Event")||Rr(e,"bpmn:Gateway")||Rr(e,"bpmn:DataStoreReference")||Rr(e,"bpmn:DataObjectReference")||Rr(e,"bpmn:DataInput")||Rr(e,"bpmn:DataOutput")||Rr(e,"bpmn:SequenceFlow")||Rr(e,"bpmn:MessageFlow")||Rr(e,"bpmn:Group")}function Zr(e){return dn(e.label)}function Qr(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=15:a+=15,{x:a,y:s}}function Jr(e){return e.waypoints?Qr(e.waypoints):Rr(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Yr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Yr.height/2}}function eo(e){return Rr(e,"bpmn:FlowElement")||Rr(e,"bpmn:Participant")||Rr(e,"bpmn:Lane")||Rr(e,"bpmn:SequenceFlow")||Rr(e,"bpmn:MessageFlow")||Rr(e,"bpmn:DataInput")||Rr(e,"bpmn:DataOutput")?"name":Rr(e,"bpmn:TextAnnotation")?"text":Rr(e,"bpmn:Group")?"categoryValueRef":void 0}function to(e){var t=e.businessObject,n=eo(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}var no="hsl(225, 10%, 15%)";function io(e,t){return E(e.eventDefinitions,(function(e){return e.$type===t}))}function ro(e,t){var n=kr(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function oo(e,t){var n=kr(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||no}function ao(e,t,n){var i=kr(e).get("label");return i&&i.get("color:color")||t||oo(e,n)}var so=new n,co=.95;function po(e,t,n,i,r,o,a){tt.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,p=e&&e.defaultLabelColor,u=so.next(),h={};function d(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:no,strokeWidth:2,fill:"white"})}function f(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:no,strokeWidth:2})}function m(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o}=t,a=De("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ge(a,o);var s=fe("defs",r._svg);s||(s=De("defs"),ge(r._svg,s)),ge(s,a),h[e]=a}function v(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function y(e,t,n){var i=e+"-"+v(t)+"-"+v(n)+"-"+u;return h[i]||function(e,t,n,i){if("sequenceflow-end"===t){m(e,{element:De("path",{d:"M 1 5 L 11 10 L 1 15 Z",...d({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5})}if("messageflow-start"===t){m(e,{element:De("circle",{cx:6,cy:6,r:3.5,...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6}})}if("messageflow-end"===t){m(e,{element:De("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5}})}if("association-start"===t){m(e,{element:De("path",{d:"M 11 5 L 1 10 L 11 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5})}if("association-end"===t){m(e,{element:De("path",{d:"M 1 5 L 11 10 L 1 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5})}if("conditional-flow-marker"===t){m(e,{element:De("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...d({fill:n,stroke:i})}),ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){m(e,{element:De("path",{d:"M 6 4 L 10 16",...d({stroke:i})}),ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function b(e,t,n,i,r){l(i)&&(r=i,i=0),i=i||0,"none"===(r=d(r)).fill&&delete r.fillOpacity;var o=De("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return ge(e,o),o}function x(e,t,n,i,r,o){l(r)&&(o=r,r=0),r=r||0,o=d(o);var a=De("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return ge(e,a),a}function _(e,t,n,i){var r=st(t,n=f(n),i);return ge(e,r),r}function E(e,t,n){return _(e,t,n,5)}function w(e,t,n){n=f(n);var i=De("path",{...n,d:t});return ge(e,i),i}function S(e,t,n,i){return w(t,n,L({"data-marker":e},i))}function C(e){return D[e]}function A(e){return function(t,n){return C(e)(t,n)}}function R(e,t){var n=Tr(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?C("bpmn:ParallelMultipleEventDefinition")(t,e,i):C("bpmn:MultipleEventDefinition")(t,e,i):io(n,"bpmn:MessageEventDefinition")?C("bpmn:MessageEventDefinition")(t,e,i):io(n,"bpmn:TimerEventDefinition")?C("bpmn:TimerEventDefinition")(t,e,i):io(n,"bpmn:ConditionalEventDefinition")?C("bpmn:ConditionalEventDefinition")(t,e):io(n,"bpmn:SignalEventDefinition")?C("bpmn:SignalEventDefinition")(t,e,i):io(n,"bpmn:EscalationEventDefinition")?C("bpmn:EscalationEventDefinition")(t,e,i):io(n,"bpmn:LinkEventDefinition")?C("bpmn:LinkEventDefinition")(t,e,i):io(n,"bpmn:ErrorEventDefinition")?C("bpmn:ErrorEventDefinition")(t,e,i):io(n,"bpmn:CancelEventDefinition")?C("bpmn:CancelEventDefinition")(t,e,i):io(n,"bpmn:CompensateEventDefinition")?C("bpmn:CompensateEventDefinition")(t,e,i):io(n,"bpmn:TerminateEventDefinition")?C("bpmn:TerminateEventDefinition")(t,e,i):null}function P(e,t,n){n=L({size:{width:100}},n);var i=o.createText(t||"",n);return we(i).add("djs-label"),ge(e,i),i}function T(e,t,n){return P(e,Tr(t).name,{box:t,align:n,padding:7,style:{fill:ao(t,p,c)}})}function k(e,t,n){Jn(P(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ao(n,p,c)}}),0,-(-1*n.height),270)}var D=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=co),b(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:ro(t,s),stroke:oo(t,c)};Tr(t).isInterrupting||(n={strokeDasharray:"6",fill:ro(t,s),stroke:oo(t,c)});var i=C("bpmn:Event")(e,t,n);return R(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?oo(t,c):ro(t,s),stroke:n?ro(t,s):oo(t,c)})},"bpmn:TimerEventDefinition":function(e,t){var n=b(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:ro(t,s),stroke:oo(t,c)});w(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,stroke:oo(t,c)});for(var r=0;r<12;r++){var o=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),a=t.width/2;w(e,o,{strokeWidth:1,transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:oo(t,c)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:ConditionalEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:oo(t,c)})},"bpmn:LinkEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:ErrorEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=w(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)});return ti(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:SignalEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:MultipleEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?oo(t,c):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)})},"bpmn:EndEvent":function(e,t){var n=C("bpmn:Event")(e,t,{strokeWidth:4,fill:ro(t,s),stroke:oo(t,c)});return R(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return b(e,t.width,t.height,8,{strokeWidth:4,fill:oo(t,c),stroke:oo(t,c)})},"bpmn:IntermediateEvent":function(e,t){var n=C("bpmn:Event")(e,t,{strokeWidth:1.5,fill:ro(t,s),stroke:oo(t,c)});return b(e,t.width,t.height,3,{strokeWidth:1.5,fill:ro(t,"none"),stroke:oo(t,c)}),R(t,e),n},"bpmn:IntermediateCatchEvent":A("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":A("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=co),x(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:ro(t,s),stroke:oo(t,c)},i=C("bpmn:Activity")(e,t,n);return T(e,t,"center-middle"),M(e,t),i},"bpmn:ServiceTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:ro(t,s)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),n},"bpmn:UserTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ro(t,s),stroke:oo(t,c)}),w(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ro(t,s),stroke:oo(t,c)}),w(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:ManualTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:ro(t,s),stroke:oo(t,c)}),n},"bpmn:SendTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:oo(t,c),stroke:ro(t,s)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=Tr(t),o=C("bpmn:Task")(e,t);return r.instantiate?(b(e,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,n,{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),o},"bpmn:ScriptTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:oo(t,c)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=C("bpmn:Task")(e,t);return _e(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:ro(t,"#aaaaaa"),stroke:oo(t,c)}),_e(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:oo(t,c)}),n},"bpmn:SubProcess":function(e,t,n){n={fill:ro(t,s),stroke:oo(t,c),...n};var i=C("bpmn:Activity")(e,t,n),r=Ur(t);return qr(t)&&_e(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),T(e,t,r?"center-top":"center-middle"),r?M(e,t):M(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return C("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=C("bpmn:SubProcess")(e,t,{strokeWidth:1.5}),r=n.style(["no-fill","no-events"],{stroke:oo(t,c),strokeWidth:1.5});return x(e,t.width,t.height,7,3,r),i},"bpmn:CallActivity":function(e,t){return C("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:co,fill:ro(t,s),stroke:oo(t,c),strokeWidth:1.5},i=C("bpmn:Lane")(e,t,n);Ur(t)?(_(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:oo(t,c),strokeWidth:1.5}),k(e,Tr(t).name,t)):P(e,Tr(t).name,{box:t,align:"center-middle",style:{fill:ao(t,p,c)}});return!!Tr(t).participantMultiplicity&&C("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=x(e,t.width,t.height,0,{fill:ro(t,s),fillOpacity:.35,stroke:oo(t,c),strokeWidth:1.5,...n}),r=Tr(t);"bpmn:Lane"===r.$type&&k(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=C("bpmn:Gateway")(e,t);return b(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:ro(t,s),stroke:oo(t,c)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=C("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return kr(t).isMarkerVisible&&w(e,r,{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:ComplexGateway":function(e,t){var n=C("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:ParallelGateway":function(e,t){var n=C("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:EventBasedGateway":function(e,t){var n=Tr(t),r=C("bpmn:Gateway")(e,t);b(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:oo(t,c)});var o=n.eventGatewayType,a=!!n.instantiate;if("Parallel"===o){var s=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});w(e,s,{strokeWidth:1,fill:"none"})}else"Exclusive"===o&&(a||b(e,t.width,t.height,.26*t.height,{strokeWidth:1,fill:"none",stroke:oo(t,c)}),function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});w(e,n,{strokeWidth:2,fill:ro(t,"none"),stroke:oo(t,c)})}());return r},"bpmn:Gateway":function(e,t){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=d(i);var s=De("polygon",{...i,points:a});return ge(e,s),s}(e,t.width,t.height,{fill:ro(t,s),fillOpacity:co,stroke:oo(t,c)})},"bpmn:SequenceFlow":function(e,t){var n,i=ro(t,s),r=oo(t,c),o=E(e,t.waypoints,{markerEnd:y("sequenceflow-end",i,r),stroke:oo(t,c)}),a=Tr(t);return t.source&&(n=t.source.businessObject,a.conditionExpression&&n.$instanceOf("bpmn:Activity")&&_e(o,{markerStart:y("conditional-flow-marker",i,r)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===a&&_e(o,{markerStart:y("conditional-default-flow-marker",i,r)})),o},"bpmn:Association":function(e,t,n){var i=Tr(t),r=ro(t,s),o=oo(t,c);return n={strokeDasharray:"0, 5",stroke:oo(t,c),...n},"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=y("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=y("association-start",r,o)),E(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=ro(t,s),i=oo(t,c);return C("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=ro(t,s),i=oo(t,c);return C("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=Tr(t),r=kr(t),o=ro(t,s),a=oo(t,c),l=E(e,t.waypoints,{markerEnd:y("messageflow-end",o,a),markerStart:y("messageflow-start",o,a),strokeDasharray:"10, 11",strokeWidth:1.5,stroke:oo(t,c)});if(n.messageRef){var u=l.getPointAtLength(l.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),d={strokeWidth:1};"initiating"===r.messageVisibleKind?(d.fill="white",d.stroke=no):(d.fill="#888",d.stroke="white");var f=w(e,h,d),m=P(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:oo(t,p)}}),v=f.getBBox(),g=m.getBBox();Jn(m,u.x-g.width/2,u.y+v.height/2+10,0)}return l},"bpmn:DataObject":function(e,t){var n=w(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:ro(t,s),fillOpacity:co,stroke:oo(t,c)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(Tr(t))&&function(e,t){var n=(t.height-18)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:n}});w(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":A("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=C("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=C("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1,fill:no}),r},"bpmn:DataStoreReference":function(e,t){return w(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:ro(t,s),fillOpacity:co,stroke:oo(t,c)})},"bpmn:BoundaryEvent":function(e,t){var n=Tr(t).cancelActivity,i={strokeWidth:1.5,fill:ro(t,s),stroke:oo(t,c)};n||(i.strokeDasharray="6");var r={...i,fillOpacity:1},o={...i,fill:"none"},a=C("bpmn:Event")(e,t,r);return b(e,t.width,t.height,3,o),R(t,e),a},"bpmn:Group":function(e,t){return x(e,t.width,t.height,10,{stroke:oo(t,c),strokeWidth:1.5,strokeDasharray:"10,6,0,6",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return P(e,to(t),{box:n,fitBox:!0,style:L({},o.getExternalStyle(),{fill:ao(t,p,c)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=x(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return w(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:oo(t,c)}),P(e,Tr(t).text||"",{box:t,align:"left-top",padding:7,style:{fill:ao(t,p,c)}}),n},ParticipantMultiplicityMarker:function(e,t){S("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}),{strokeWidth:2,fill:ro(t,s),stroke:oo(t,c)})},SubProcessMarker:function(e,t){ei(x(e,14,14,0,{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),t.width/2-7.5,t.height-20),S("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:ro(t,s),stroke:oo(t,c)})},ParallelMarker:function(e,t,n){S("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}),{fill:ro(t,s),stroke:oo(t,c)})},SequentialMarker:function(e,t,n){S("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:ro(t,s),stroke:oo(t,c)})},CompensationMarker:function(e,t,n){S("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)})},LoopMarker:function(e,t,n){S("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1.5,fill:ro(t,s),stroke:oo(t,c),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){S("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)})}};function M(e,t,n){var i,r=Tr(t),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},g(n,(function(n){C(n)(e,t,i)})),r.isForCompensation&&C("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&C("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&C("LoopMarker")(e,t,i),!1===s&&C("ParallelMarker")(e,t,i),!0===s&&C("SequentialMarker")(e,t,i))}this._drawPath=w,this._renderer=C}e(po,tt),po.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],po.prototype.canRender=function(e){return Rr(e,"bpmn:BaseElement")},po.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},po.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},po.prototype.getShapePath=function(e){return Rr(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,nt([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):Rr(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return nt([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):Rr(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return nt([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return nt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var lo={width:150,height:50};function uo(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function ho(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=uo(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return fo(e,o,r,i);o=mo(o,i.width,t)}}function fo(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}function mo(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&""!==n||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&""===a&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function vo(e){this._config=L({},{size:lo,padding:0,style:{},align:"center-top"},e||{})}vo.prototype.createText=function(e,t){return this.layoutText(e,t).element},vo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},vo.prototype.layoutText=function(e,t){var n=L({},this._config.size,t.box),i=L({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return l(e)?L({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),c=e.split(/\u00AD?\r?\n/),p=[],u=n.width-o.left-o.right,h=De("text");for(_e(h,{x:0,y:0}),_e(h,i),ge(function(){var e=document.getElementById("helper-svg");return e||(_e(e=De("svg"),{id:"helper-svg"}),q(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),h);c.length;)p.push(ho(c,u,h));"middle"===r.vertical&&(o.top=o.bottom=0);var d=x(p,(function(e,t,n){return e+(s||t.height)}),0)+o.top+o.bottom,f=x(p,(function(e,t,n){return t.width>e?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-d)/2),m-=(s||p[0].height)/4;var v=De("text");return _e(v,i),g(p,(function(e){var t;switch(m+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?f:u)-o.right-e.width;break;default:t=Math.max(((a?f:u)-e.width)/2+o.left,0)}var n=De("tspan");_e(n,{x:t,y:m}),n.textContent=e.text,ge(v,n)})),Ce(h),{dimensions:{width:f,height:d},element:v}};function yo(e){var t=L({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=L({},t,{fontSize:n},e&&e.externalStyle||{}),r=new vo({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}yo.$inject=["config.textRenderer"];var go=/\{([^{}]+)\}/g,bo=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var xo={__init__:["bpmnRenderer"],bpmnRenderer:["type",po],textRenderer:["type",yo],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)o["y"+c]=r.heightElements[c]*a;for(var p=0;p<r.widthElements.length;p++)o["x"+p]=r.widthElements[p]*s}var l,u,h=(l=r.d,u={mx:n,my:i,e:o},String(l).replace(go,(function(e,t){return function(e,t,n){var i=n;return t.replace(bo,(function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?e:i)+""}(e,t,u)})));return h}}]};var _o={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function Eo(e,t,n){return L({id:e.id,type:e.$type,businessObject:e,di:t},n)}function wo(e,t,n){var i=e.waypoint;return!i||i.length<2?[bn(t),bn(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function So(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Er(n),referenced:Er(t),property:i}))}function Co(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Co.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Co.prototype.add=function(e,t,n){var i,r,o,a=this._translate;if(Rr(t,"bpmndi:BPMNPlane")){var s=Rr(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Eo(e,t,s)),this._canvas.addRootElement(i)}else if(Rr(t,"bpmndi:BPMNShape")){var c=!Ur(e,t),p=function(e){return Rr(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(Eo(e,t,{collapsed:c,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:p})),Rr(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),Rr(e,"bpmn:Lane")&&(o=0),Rr(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,bn(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!Rr(t,"bpmndi:BPMNEdge"))throw new Error(a("unknown di {di} for element {semantic}",{di:Er(t),semantic:Er(e)}));var u=this._getSource(e),h=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Eo(e,t,{hidden:r,source:u,target:h,waypoints:wo(t,u,h)})),Rr(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Xr(e)&&to(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Co.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Er(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw So(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Co.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Yr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Jr(t),i=Yr),L({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=to(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Eo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!to(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Co.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?So(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Er(e),side:t}))},Co.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Co.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Co.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Ao={__depends__:[xo,{__depends__:[_o],bpmnImporter:["type",Co]}]};function Ro(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Po(e){return e.originalEvent||e.srcEvent}function To(e){Ro(e),Ro(Po(e))}function ko(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Do(e,t){return(Po(e)||e).button===t}function Mo(e){return Do(e,0)}function Bo(e){var t=Po(e)||e;return!!Mo(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function No(e){var t=Po(e)||e;return Mo(e)&&t.shiftKey}function Oo(e){return!0}function jo(e){return Mo(e)||function(e){return Do(e,1)}(e)}function Lo(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(c[e]||Mo)(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":Oo,"element.mousedown":jo,"element.mouseup":jo,"element.click":jo,"element.dblclick":jo};function p(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(c[n]=i),a.$delegate=pe.bind(e,"svg, .djs-element",t,a)}function l(e,t,n){var i=a(n);i&&pe.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,g(s,(function(e,n){l(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,g(s,(function(e,n){p(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var u=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),d={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=L({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return _e(e,n),e}function v(e,t){ge(e,t)}this.removeHits=function(e){g(me(".djs-hit",e),Ce)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=st(t);return m(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=L({x:0,y:0},n);var i=De("rect");return m(i,t),_e(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=fe(".djs-hit",t);if(n)return e.waypoints?ct(n,e.waypoints):_e(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=l}Lo.$inject=["eventBus","elementRegistry","styles"];var Io={__init__:["interactionEvents"],interactionEvents:["type",Lo]};function Fo(e,t){this.offset=6;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e,t){var i=De("rect");return _e(i,L({x:10,y:10,rx:4,width:100,height:100},n)),ge(e,i),i}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=fe(".djs-outline",n);o||(o=r(n)),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=fe(".djs-outline",n);o||(o=r(n)),i.updateConnectionOutline(o,t)}))}Fo.prototype.updateShapeOutline=function(e,t){_e(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Fo.prototype.updateConnectionOutline=function(e,t){var n=ft(t);_e(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Fo.$inject=["eventBus","styles","elementRegistry"];var $o={__init__:["outline"],outline:["type",Fo]};function zo(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}zo.$inject=["eventBus","canvas"],zo.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},zo.prototype.get=function(){return this._selectedElements},zo.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},zo.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();p(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?g(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Ho="hover",Vo="selected";function Go(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Ho)})),t.on("element.out",(function(e){o(e.element,Ho)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;g(t,(function(e){-1===n.indexOf(e)&&function(e){o(e,Vo)}(e)})),g(n,(function(e){-1===t.indexOf(e)&&function(e){r(e,Vo)}(e)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Wo(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;p(o)?t.select(o):t.select(r.filter(Uo))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);m(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Mo(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=Bo(e)||No(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function Uo(e){return!e.hidden}Go.$inject=["canvas","eventBus","selection"],Go.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Ae(t);var n=e.length>1;if(we(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(ft(e)),r=De("rect");_e(r,L({rx:3},i)),we(r).add("djs-selection-outline"),ge(t,r)}},Wo.$inject=["eventBus","selection","canvas","elementRegistry"];var qo={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Io,$o],selection:["type",zo],selectionVisuals:["type",Go],selectionBehavior:["type",Wo]};function Ko(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Ko.prototype.next=function(){return this._prefix+ ++this._counter};var Yo=new Ko("ov");function Xo(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Yo,this._overlayDefaults=L({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),q(o=de('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Zo(e,t,n){q(e,{left:t+"px",top:n+"px"})}function Qo(e,t){e.style.display=!1===t?"none":""}function Jo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Xo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Xo.prototype.get=function(e){if(d(e)&&(e={id:e}),d(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?y(t.overlays,k({type:e.type})):t.overlays.slice():[]}return e.type?y(this._overlays,k({type:e.type})):e.id?this._overlays[e.id]:null},Xo.prototype.add=function(e,t,n){if(l(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=L({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Xo.prototype.remove=function(e){var t=this.get(e)||[];p(t)||(t=[t]);var n=this;g(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(ve(e.html),ve(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}}))},Xo.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Xo.prototype.show=function(){Qo(this._overlayRoot)},Xo.prototype.hide=function(){Qo(this._overlayRoot,!1)},Xo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Q(this._overlayRoot)},Xo.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=ft(t);i=o.x,r=o.y}Zo(n,i,r),K(e.html,"data-container-id",t.id)},Xo.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;void 0!==i.right&&(t=o.waypoints?ft(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?ft(o).height:o.height,s=-1*i.bottom+n);Zo(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Xo.prototype._createOverlayContainer=function(e){var t=de('<div class="djs-overlays" />');q(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Xo.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Jo(this._overlayRoot,n)},Xo.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Xo.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),d(o)&&(o=de(o)),n=this._getOverlayContainer(r),q(t=de('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&X(t).add("djs-overlay-"+e.type),Qo(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Xo.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,c=!0;(i!==this._canvas.getRootElement()||n&&(s(r)&&r>t.scale||s(o)&&o<t.scale))&&(c=!1),Qo(a,c),this._updateOverlayScale(e,t)},Xo.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,c="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),s(n)&&t.scale<n&&(r=(1/t.scale||1)*n),s(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),s(r)&&(c="scale("+r+","+r+")"),Jo(a,c)},Xo.prototype._updateOverlaysVisibilty=function(e){var t=this;g(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Xo.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element;g(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){ve(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}})),e.on("element.changed",500,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(g(i.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(i))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&X(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var ea={__init__:["overlays"],overlays:["type",Xo]};function ta(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(mt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}ta.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var na={__init__:["changeSupport"],changeSupport:["type",ta]};function ia(e){this._eventBus=e}function ra(e){return function(t,n,i,r,o){(h(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function oa(e,t){t.invoke(ia,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}ia.$inject=["eventBus"],ia.prototype.on=function(e,t,n,i,r,o){if((h(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),h(n)&&(o=r,r=i,i=n,n=1e3),l(r)&&(o=r,r=!1),!h(i))throw new Error("handlerFn must be a function");p(e)||(e=[e]);var a=this._eventBus;g(e,(function(e){var s=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))},ia.prototype.canExecute=ra("canExecute"),ia.prototype.preExecute=ra("preExecute"),ia.prototype.preExecuted=ra("preExecuted"),ia.prototype.execute=ra("execute"),ia.prototype.executed=ra("executed"),ia.prototype.postExecute=ra("postExecute"),ia.prototype.postExecuted=ra("postExecuted"),ia.prototype.revert=ra("revert"),ia.prototype.reverted=ra("reverted"),e(oa,ia),oa.$inject=["canvas","injector"];var aa={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",oa]};function sa(e){return CSS.escape(e)}var ca={"&":"&","<":"<",">":">",'"':""","'":"'"};function pa(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return ca[e]}))}var la="_plane";function ua(e){return function(e){return e.replace(new RegExp("_plane$"),"")}(e.id)}function ha(e){var t=e.id;return Rr(e,"bpmn:SubProcess")?ma(t):t}function da(e){return ma(e)}function fa(e){return Rr(kr(e),"bpmndi:BPMNPlane")}function ma(e){return e+la}function va(e,t,n){var i=de('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=X(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=Tr(e),n=[],i=t;i;i=i.$parent)(Rr(i,"bpmn:SubProcess")||Rr(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.map((function(e){var i=pa(e.name||e.id),r=de('<li><span class="bjs-crumb"><a title="'+i+'">'+i+"</a></span></li>"),o=n.findRoot(ha(e))||n.findRoot(e.id);if(!o&&Rr(e,"bpmn:Process")){var a=t.find((function(t){var n=Tr(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(a.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=Tr(e.element);m(a,(function(e){return e===t}))&&s()})),e.on("root.set",(function(e){s(e.element)}))}function ya(e,t){var n=null,i=new ga;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!Rr(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,c=(o.y-a.y)*o.scale;0===s&&0===c||t.scroll({dx:s,dy:c}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function ga(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}va.$inject=["eventBus","elementRegistry","canvas"],ya.$inject=["eventBus","canvas"];var ba=180,xa=160;function _a(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n._handleImport(t.definitions)}))}function Ea(e){return Rr(e,"bpmndi:BPMNDiagram")?e:Ea(e.$parent)}_a.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},_a.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;Rr(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!Rr(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(Pr(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}})),r},_a.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=vn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),yn(t)}(e),i=n.x-ba,r=n.y-xa;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},_a.prototype._moveToDiPlane=function(e,t){var n=Ea(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},_a.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},_a.$inject=["eventBus","moddle"];var wa=250;function Sa(e,t,n,i){ia.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",wa,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",wa,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],wa,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],wa,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r._canDrillDown(e)})).map((function(e){r._addOverlay(e)}))}))}e(Sa,ia),Sa.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Sa.prototype._canDrillDown=function(e){var t=this._canvas;return Rr(e,"bpmn:SubProcess")&&t.findRoot(ha(e))},Sa.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Tr(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;X(i.html).toggle("bjs-drilldown-empty",!r)}},Sa.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=de('<button class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(ha(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Sa.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Sa.$inject=["canvas","eventBus","elementRegistry","overlays"];var Ca={__depends__:[ea,na,aa],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",va],drilldownCentering:["type",ya],drilldownOverlayBehavior:["type",Sa],subprocessCompatibility:["type",_a]};function Aa(e){zr.call(this,e)}e(Aa,zr),Aa.prototype._modules=[Ao,_o,qo,ea,Ca],Aa.prototype._moddleExtensions={};var Ra=["c","C"],Pa=["v","V"],Ta=["y","Y"],ka=["z","Z"];function Da(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Ma(e,t){return-1!==(e=p(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Ba(e){return e.shiftKey}var Na="keyboard.keydown",Oa="input-handle-modified-keys";function ja(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}ja.$inject=["config.keyboard","eventBus"],ja.prototype._keydownHandler=function(e){this._keyHandler(e,Na)},ja.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},ja.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Na,n)&&e.preventDefault()}},ja.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||(t=e.target)&&(J(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},ja.prototype._isModifiedKeyIgnored=function(e){return!Da(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},ja.prototype._getAllowedModifiers=function(e){var t=ee(e,"[input-handle-modified-keys]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Oa).split(",")},ja.prototype.bind=function(e){this.unbind(),this._node=e,ae.bind(e,"keydown",this._keydownHandler),ae.bind(e,"keyup",this._keyupHandler),this._fire("bind")},ja.prototype.getBinding=function(){return this._node},ja.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ae.unbind(e,"keydown",this._keydownHandler),ae.unbind(e,"keyup",this._keyupHandler)),this._node=null},ja.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},ja.prototype.addListener=function(e,t,n){h(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Na,e,t)},ja.prototype.removeListener=function(e,t){this._eventBus.off(t||Na,e)},ja.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},ja.prototype.isCmd=Da,ja.prototype.isShift=Ba,ja.prototype.isKey=Ma;function La(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}La.$inject=["eventBus","keyboard"],La.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(function(e){return Da(e)&&!Ba(e)&&Ma(ka,e)}(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(function(e){return Da(e)&&(Ma(Ta,e)||Ma(ka,e)&&Ba(e))}(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return Da(e)&&Ma(Ra,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return Da(e)&&Ma(Pa,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ma(["+","Add","="],n)&&Da(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ma(["-","Subtract"],n)&&Da(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Ma("0",n)&&Da(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Ma(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Ia={__init__:["keyboard","keyboardBindings"],keyboard:["type",ja],keyboardBindings:["type",La]},Fa={moveSpeed:50,moveSpeedAccelerated:200};function $a(e,t,n){var i=this;this._config=L({},Fa,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}$a.$inject=["config.keyboardMove","keyboard","canvas"];var za={__depends__:[Ia],__init__:["keyboardMove"],keyboardMove:["type",$a]},Ha=/^djs-cursor-.*$/;function Va(e){var t=X(document.body);t.removeMatching(Ha),e&&t.add("djs-cursor-"+e)}function Ga(){Va(null)}function Wa(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function Ua(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function qa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ka(e,t){var n;function i(i){var r,o=n.start,a=n.button,s=ko(i),c=qa(s,o);(!n.dragging&&(r=c,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&Wa(e),Va("grab")),n.dragging)&&(c=qa(s,n.last||n.start),t.scroll({dx:c.x,dy:c.y}),n.last=s);i.preventDefault()}function r(e){ae.unbind(document,"mousemove",i),ae.unbind(document,"mouseup",r),n=null,Ga()}e.on("element.mousedown",500,(function(e){return function(e){if(ee(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:ko(e)},ae.bind(document,"mousemove",i),ae.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Ka.$inject=["eventBus","canvas"];var Ya={__init__:["moveCanvas"],moveCanvas:["type",Ka]};function Xa(e){return Math.log(e)/Math.log(10)}function Za(e,t){var n=Xa(e.min),i=Xa(e.max);return(Math.abs(n)+Math.abs(i))/t}var Qa=Math.sign||function(e){return e>=0?1:-1},Ja={min:.2,max:4};function es(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=j(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}es.$inject=["config.zoomScroll","eventBus","canvas"],es.prototype.scroll=function(e){this._canvas.scroll(e)},es.prototype.reset=function(){this._canvas.zoom("fit-viewport")},es.prototype.zoom=function(e,t){var n=Za(Ja,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},es.prototype._handleWheel=function(e){if(!ee(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Qa(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},es.prototype.stepZoom=function(e,t){var n=Za(Ja,10);this._zoom(e,t,n)},es.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Xa(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,c,p=Math.pow(10,a);i.zoom((s=Ja,c=p,Math.max(s.min,Math.min(s.max,c))),t)},es.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&ae[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},es.prototype._init=function(e){this.toggle(e)};var ts={__init__:["zoomScroll"],zoomScroll:["type",es]};function ns(e){Aa.call(this,e)}e(ns,Aa),ns.prototype._navigationModules=[za,Ya,ts],ns.prototype._modules=[].concat(Aa.prototype._modules,ns.prototype._navigationModules);var is={exports:{}};
|
|
27
|
+
function(e){const t=de('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Nr+"</a>");q(fe("svg",t),Or),q(t,jr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),ae.bind(t,"click",(function(e){$r(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function Hr(e,t){return e.warnings=t,e}e(zr,ai),zr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let r;e=this._emit("import.parse.start",{xml:e})||e;try{r=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let o=r.rootElement;const a=r.references,s=r.warnings,c=r.elementsById;i=i.concat(s),o=this._emit("import.parse.complete",function(e){const t=n.get("eventBus").createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}({error:null,definitions:o,elementsById:c,references:a,warnings:i}))||o;const p=await this.importDefinitions(o,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Hr(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}},zr.prototype.importXML=wr(zr.prototype.importXML),zr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},zr.prototype.importDefinitions=wr(zr.prototype.importDefinitions),zr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Hr(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return m(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Hr(t,[]),t}try{this.clear()}catch(e){throw Hr(e,[]),e}const{warnings:i}=await Dr(this,t,n);return{warnings:i}},zr.prototype.open=wr(zr.prototype.open),zr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},zr.prototype.saveXML=wr(zr.prototype.saveXML),zr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=fe("defs",t._svg),r=He(n),o=i?"<defs>"+He(i)+"</defs>":"",a=n.getBBox();e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a.width+'" height="'+a.height+'" viewBox="'+a.x+" "+a.y+" "+a.width+" "+a.height+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},zr.prototype.saveSVG=wr(zr.prototype.saveSVG),zr.prototype._setDefinitions=function(e){this._definitions=e},zr.prototype.getModules=function(){return this._modules},zr.prototype.clear=function(){this.getDefinitions()&&ai.prototype.clear.call(this)},zr.prototype.destroy=function(){ai.prototype.destroy.call(this),ve(this._container)},zr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},zr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},zr.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=fe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},zr.prototype.getDefinitions=function(){return this._definitions},zr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},zr.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=L(F(n,["additionalModules"]),{canvas:L({},n.canvas,{container:e}),modules:o});ai.call(this,a),n&&n.container&&this.attachTo(n.container)},zr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},zr.prototype._createContainer=function(e){const t=de('<div class="bjs-container"></div>');return q(t,{width:Gr(e.width),height:Gr(e.height),position:e.position}),t},zr.prototype._createModdle=function(e){return new _r(L({},this._moddleExtensions,e.moddleExtensions))},zr.prototype._modules=[];const Vr={width:"100%",height:"100%",position:"relative"};function Gr(e){return e+(u(e)?"px":"")}function Wr(e){zr.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function Ur(e,t){return!Rr(e,"bpmn:CallActivity")&&(Rr(e,"bpmn:SubProcess")?!(!(t=t||kr(e))||!Rr(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!Rr(e,"bpmn:Participant")||!!Tr(e).processRef)}function qr(e){return e&&!!Tr(e).triggeredByEvent}function Kr(e,t){return E(Tr(e).eventDefinitions,(function(e){return Rr(e,t)}))}e(Wr,zr),Wr.prototype._createModdle=function(e){var t=zr.prototype._createModdle.call(this,e);return t.ids=new n([32,36,1]),t},Wr.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Yr={width:90,height:20};function Xr(e){return Rr(e,"bpmn:Event")||Rr(e,"bpmn:Gateway")||Rr(e,"bpmn:DataStoreReference")||Rr(e,"bpmn:DataObjectReference")||Rr(e,"bpmn:DataInput")||Rr(e,"bpmn:DataOutput")||Rr(e,"bpmn:SequenceFlow")||Rr(e,"bpmn:MessageFlow")||Rr(e,"bpmn:Group")}function Zr(e){return dn(e.label)}function Qr(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=15:a+=15,{x:a,y:s}}function Jr(e){return e.waypoints?Qr(e.waypoints):Rr(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Yr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Yr.height/2}}function eo(e){return Rr(e,"bpmn:FlowElement")||Rr(e,"bpmn:Participant")||Rr(e,"bpmn:Lane")||Rr(e,"bpmn:SequenceFlow")||Rr(e,"bpmn:MessageFlow")||Rr(e,"bpmn:DataInput")||Rr(e,"bpmn:DataOutput")?"name":Rr(e,"bpmn:TextAnnotation")?"text":Rr(e,"bpmn:Group")?"categoryValueRef":void 0}function to(e){var t=e.businessObject,n=eo(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}var no="hsl(225, 10%, 15%)";function io(e,t){return E(e.eventDefinitions,(function(e){return e.$type===t}))}function ro(e,t){var n=kr(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function oo(e,t){var n=kr(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||no}function ao(e,t,n){var i=kr(e).get("label");return i&&i.get("color:color")||t||oo(e,n)}var so=new n,co=.95;function po(e,t,n,i,r,o,a){tt.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,p=e&&e.defaultLabelColor,u=so.next(),h={};function d(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:no,strokeWidth:2,fill:"white"})}function f(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:no,strokeWidth:2})}function m(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o}=t,a=De("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ge(a,o);var s=fe("defs",r._svg);s||(s=De("defs"),ge(r._svg,s)),ge(s,a),h[e]=a}function v(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function y(e,t,n){var i=e+"-"+v(t)+"-"+v(n)+"-"+u;return h[i]||function(e,t,n,i){if("sequenceflow-end"===t){m(e,{element:De("path",{d:"M 1 5 L 11 10 L 1 15 Z",...d({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5})}if("messageflow-start"===t){m(e,{element:De("circle",{cx:6,cy:6,r:3.5,...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6}})}if("messageflow-end"===t){m(e,{element:De("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5}})}if("association-start"===t){m(e,{element:De("path",{d:"M 11 5 L 1 10 L 11 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5})}if("association-end"===t){m(e,{element:De("path",{d:"M 1 5 L 11 10 L 1 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5})}if("conditional-flow-marker"===t){m(e,{element:De("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...d({fill:n,stroke:i})}),ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){m(e,{element:De("path",{d:"M 6 4 L 10 16",...d({stroke:i})}),ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function b(e,t,n,i,r){l(i)&&(r=i,i=0),i=i||0,"none"===(r=d(r)).fill&&delete r.fillOpacity;var o=De("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return ge(e,o),o}function x(e,t,n,i,r,o){l(r)&&(o=r,r=0),r=r||0,o=d(o);var a=De("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return ge(e,a),a}function _(e,t,n,i){var r=st(t,n=f(n),i);return ge(e,r),r}function E(e,t,n){return _(e,t,n,5)}function w(e,t,n){n=f(n);var i=De("path",{...n,d:t});return ge(e,i),i}function S(e,t,n,i){return w(t,n,L({"data-marker":e},i))}function C(e){return D[e]}function A(e){return function(t,n,i){return C(e)(t,n,i)}}function R(e,t){var n=Tr(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?C("bpmn:ParallelMultipleEventDefinition")(t,e,i):C("bpmn:MultipleEventDefinition")(t,e,i):io(n,"bpmn:MessageEventDefinition")?C("bpmn:MessageEventDefinition")(t,e,i):io(n,"bpmn:TimerEventDefinition")?C("bpmn:TimerEventDefinition")(t,e,i):io(n,"bpmn:ConditionalEventDefinition")?C("bpmn:ConditionalEventDefinition")(t,e):io(n,"bpmn:SignalEventDefinition")?C("bpmn:SignalEventDefinition")(t,e,i):io(n,"bpmn:EscalationEventDefinition")?C("bpmn:EscalationEventDefinition")(t,e,i):io(n,"bpmn:LinkEventDefinition")?C("bpmn:LinkEventDefinition")(t,e,i):io(n,"bpmn:ErrorEventDefinition")?C("bpmn:ErrorEventDefinition")(t,e,i):io(n,"bpmn:CancelEventDefinition")?C("bpmn:CancelEventDefinition")(t,e,i):io(n,"bpmn:CompensateEventDefinition")?C("bpmn:CompensateEventDefinition")(t,e,i):io(n,"bpmn:TerminateEventDefinition")?C("bpmn:TerminateEventDefinition")(t,e,i):null}function P(e,t,n){n=L({size:{width:100}},n);var i=o.createText(t||"",n);return we(i).add("djs-label"),ge(e,i),i}function T(e,t,n){return P(e,Tr(t).name,{box:t,align:n,padding:7,style:{fill:ao(t,p,c)}})}function k(e,t,n){Jn(P(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ao(n,p,c)}}),0,-(-1*n.height),270)}var D=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=co),b(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t,n){var i={fill:ro(t,s),stroke:oo(t,c)};Tr(t).isInterrupting||(i={strokeDasharray:"6",fill:ro(t,s),stroke:oo(t,c)});var r=C("bpmn:Event")(e,t,i);return n&&!1===n.renderIcon||R(t,e),r},"bpmn:MessageEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?oo(t,c):ro(t,s),stroke:n?ro(t,s):oo(t,c)})},"bpmn:TimerEventDefinition":function(e,t){var n=b(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:ro(t,s),stroke:oo(t,c)});w(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,stroke:oo(t,c)});for(var r=0;r<12;r++){var o=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),a=t.width/2;w(e,o,{strokeWidth:1,transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:oo(t,c)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:ConditionalEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:oo(t,c)})},"bpmn:LinkEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:ErrorEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=w(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)});return ti(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:SignalEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?oo(t,c):"none",stroke:oo(t,c)})},"bpmn:MultipleEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?oo(t,c):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)})},"bpmn:EndEvent":function(e,t,n){var i=C("bpmn:Event")(e,t,{strokeWidth:4,fill:ro(t,s),stroke:oo(t,c)});return n&&!1===n.renderIcon||R(t,e),i},"bpmn:TerminateEventDefinition":function(e,t){return b(e,t.width,t.height,8,{strokeWidth:4,fill:oo(t,c),stroke:oo(t,c)})},"bpmn:IntermediateEvent":function(e,t,n){var i=C("bpmn:Event")(e,t,{strokeWidth:1.5,fill:ro(t,s),stroke:oo(t,c)});return b(e,t.width,t.height,3,{strokeWidth:1.5,fill:ro(t,"none"),stroke:oo(t,c)}),n&&!1===n.renderIcon||R(t,e),i},"bpmn:IntermediateCatchEvent":A("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":A("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=co),x(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:ro(t,s),stroke:oo(t,c)},i=C("bpmn:Activity")(e,t,n);return T(e,t,"center-middle"),M(e,t),i},"bpmn:ServiceTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:ro(t,s)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),n},"bpmn:UserTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ro(t,s),stroke:oo(t,c)}),w(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ro(t,s),stroke:oo(t,c)}),w(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:ManualTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:ro(t,s),stroke:oo(t,c)}),n},"bpmn:SendTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:oo(t,c),stroke:ro(t,s)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=Tr(t),o=C("bpmn:Task")(e,t);return r.instantiate?(b(e,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,n,{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),o},"bpmn:ScriptTask":function(e,t){var n=C("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:oo(t,c)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=C("bpmn:Task")(e,t);return _e(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:ro(t,"#aaaaaa"),stroke:oo(t,c)}),_e(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:oo(t,c)}),n},"bpmn:SubProcess":function(e,t,n){n={fill:ro(t,s),stroke:oo(t,c),...n};var i=C("bpmn:Activity")(e,t,n),r=Ur(t);return qr(t)&&_e(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),T(e,t,r?"center-top":"center-middle"),r?M(e,t):M(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return C("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=C("bpmn:SubProcess")(e,t,{strokeWidth:1.5}),r=n.style(["no-fill","no-events"],{stroke:oo(t,c),strokeWidth:1.5});return x(e,t.width,t.height,7,3,r),i},"bpmn:CallActivity":function(e,t){return C("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:co,fill:ro(t,s),stroke:oo(t,c),strokeWidth:1.5},i=C("bpmn:Lane")(e,t,n);Ur(t)?(_(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:oo(t,c),strokeWidth:1.5}),k(e,Tr(t).name,t)):P(e,Tr(t).name,{box:t,align:"center-middle",style:{fill:ao(t,p,c)}});return!!Tr(t).participantMultiplicity&&C("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=x(e,t.width,t.height,0,{fill:ro(t,s),fillOpacity:.35,stroke:oo(t,c),strokeWidth:1.5,...n}),r=Tr(t);"bpmn:Lane"===r.$type&&k(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=C("bpmn:Gateway")(e,t);return b(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:ro(t,s),stroke:oo(t,c)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=C("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return kr(t).isMarkerVisible&&w(e,r,{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:ComplexGateway":function(e,t){var n=C("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:ParallelGateway":function(e,t){var n=C("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)}),n},"bpmn:EventBasedGateway":function(e,t){var n=Tr(t),r=C("bpmn:Gateway")(e,t);b(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:oo(t,c)});var o=n.eventGatewayType,a=!!n.instantiate;if("Parallel"===o){var s=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});w(e,s,{strokeWidth:1,fill:"none"})}else"Exclusive"===o&&(a||b(e,t.width,t.height,.26*t.height,{strokeWidth:1,fill:"none",stroke:oo(t,c)}),function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});w(e,n,{strokeWidth:2,fill:ro(t,"none"),stroke:oo(t,c)})}());return r},"bpmn:Gateway":function(e,t){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=d(i);var s=De("polygon",{...i,points:a});return ge(e,s),s}(e,t.width,t.height,{fill:ro(t,s),fillOpacity:co,stroke:oo(t,c)})},"bpmn:SequenceFlow":function(e,t){var n,i=ro(t,s),r=oo(t,c),o=E(e,t.waypoints,{markerEnd:y("sequenceflow-end",i,r),stroke:oo(t,c)}),a=Tr(t);return t.source&&(n=t.source.businessObject,a.conditionExpression&&n.$instanceOf("bpmn:Activity")&&_e(o,{markerStart:y("conditional-flow-marker",i,r)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===a&&_e(o,{markerStart:y("conditional-default-flow-marker",i,r)})),o},"bpmn:Association":function(e,t,n){var i=Tr(t),r=ro(t,s),o=oo(t,c);return n={strokeDasharray:"0, 5",stroke:oo(t,c),...n},"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=y("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=y("association-start",r,o)),E(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=ro(t,s),i=oo(t,c);return C("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=ro(t,s),i=oo(t,c);return C("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=Tr(t),r=kr(t),o=ro(t,s),a=oo(t,c),l=E(e,t.waypoints,{markerEnd:y("messageflow-end",o,a),markerStart:y("messageflow-start",o,a),strokeDasharray:"10, 11",strokeWidth:1.5,stroke:oo(t,c)});if(n.messageRef){var u=l.getPointAtLength(l.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),d={strokeWidth:1};"initiating"===r.messageVisibleKind?(d.fill="white",d.stroke=no):(d.fill="#888",d.stroke="white");var f=w(e,h,d),m=P(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:oo(t,p)}}),v=f.getBBox(),g=m.getBBox();Jn(m,u.x-g.width/2,u.y+v.height/2+10,0)}return l},"bpmn:DataObject":function(e,t){var n=w(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:ro(t,s),fillOpacity:co,stroke:oo(t,c)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(Tr(t))&&function(e,t){var n=(t.height-18)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:n}});w(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":A("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=C("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=C("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1,fill:no}),r},"bpmn:DataStoreReference":function(e,t){return w(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:ro(t,s),fillOpacity:co,stroke:oo(t,c)})},"bpmn:BoundaryEvent":function(e,t,n){var i=Tr(t).cancelActivity,r={strokeWidth:1.5,fill:ro(t,s),stroke:oo(t,c)};i||(r.strokeDasharray="6");var o={...r,fillOpacity:1},a={...r,fill:"none"},p=C("bpmn:Event")(e,t,o);return b(e,t.width,t.height,3,a),n&&!1===n.renderIcon||R(t,e),p},"bpmn:Group":function(e,t){return x(e,t.width,t.height,10,{stroke:oo(t,c),strokeWidth:1.5,strokeDasharray:"10,6,0,6",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return P(e,to(t),{box:n,fitBox:!0,style:L({},o.getExternalStyle(),{fill:ao(t,p,c)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=x(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return w(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:oo(t,c)}),P(e,Tr(t).text||"",{box:t,align:"left-top",padding:7,style:{fill:ao(t,p,c)}}),n},ParticipantMultiplicityMarker:function(e,t){S("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}),{strokeWidth:2,fill:ro(t,s),stroke:oo(t,c)})},SubProcessMarker:function(e,t){ei(x(e,14,14,0,{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)}),t.width/2-7.5,t.height-20),S("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:ro(t,s),stroke:oo(t,c)})},ParallelMarker:function(e,t,n){S("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}),{fill:ro(t,s),stroke:oo(t,c)})},SequentialMarker:function(e,t,n){S("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:ro(t,s),stroke:oo(t,c)})},CompensationMarker:function(e,t,n){S("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:ro(t,s),stroke:oo(t,c)})},LoopMarker:function(e,t,n){S("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1.5,fill:ro(t,s),stroke:oo(t,c),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){S("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:oo(t,c),stroke:oo(t,c)})}};function M(e,t,n){var i,r=Tr(t),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},g(n,(function(n){C(n)(e,t,i)})),r.isForCompensation&&C("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&C("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&C("LoopMarker")(e,t,i),!1===s&&C("ParallelMarker")(e,t,i),!0===s&&C("SequentialMarker")(e,t,i))}this._drawPath=w,this._renderer=C}e(po,tt),po.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],po.prototype.canRender=function(e){return Rr(e,"bpmn:BaseElement")},po.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},po.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},po.prototype.getShapePath=function(e){return Rr(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,nt([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):Rr(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return nt([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):Rr(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return nt([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return nt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var lo={width:150,height:50};function uo(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function ho(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=uo(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return fo(e,o,r,i);o=mo(o,i.width,t)}}function fo(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}function mo(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&""!==n||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&""===a&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function vo(e){this._config=L({},{size:lo,padding:0,style:{},align:"center-top"},e||{})}vo.prototype.createText=function(e,t){return this.layoutText(e,t).element},vo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},vo.prototype.layoutText=function(e,t){var n=L({},this._config.size,t.box),i=L({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return l(e)?L({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),c=e.split(/\u00AD?\r?\n/),p=[],u=n.width-o.left-o.right,h=De("text");for(_e(h,{x:0,y:0}),_e(h,i),ge(function(){var e=document.getElementById("helper-svg");return e||(_e(e=De("svg"),{id:"helper-svg"}),q(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),h);c.length;)p.push(ho(c,u,h));"middle"===r.vertical&&(o.top=o.bottom=0);var d=x(p,(function(e,t,n){return e+(s||t.height)}),0)+o.top+o.bottom,f=x(p,(function(e,t,n){return t.width>e?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-d)/2),m-=(s||p[0].height)/4;var v=De("text");return _e(v,i),g(p,(function(e){var t;switch(m+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?f:u)-o.right-e.width;break;default:t=Math.max(((a?f:u)-e.width)/2+o.left,0)}var n=De("tspan");_e(n,{x:t,y:m}),n.textContent=e.text,ge(v,n)})),Ce(h),{dimensions:{width:f,height:d},element:v}};function yo(e){var t=L({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=L({},t,{fontSize:n},e&&e.externalStyle||{}),r=new vo({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}yo.$inject=["config.textRenderer"];var go=/\{([^{}]+)\}/g,bo=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var xo={__init__:["bpmnRenderer"],bpmnRenderer:["type",po],textRenderer:["type",yo],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)o["y"+c]=r.heightElements[c]*a;for(var p=0;p<r.widthElements.length;p++)o["x"+p]=r.widthElements[p]*s}var l,u,h=(l=r.d,u={mx:n,my:i,e:o},String(l).replace(go,(function(e,t){return function(e,t,n){var i=n;return t.replace(bo,(function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?e:i)+""}(e,t,u)})));return h}}]};var _o={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function Eo(e,t,n){return L({id:e.id,type:e.$type,businessObject:e,di:t},n)}function wo(e,t,n){var i=e.waypoint;return!i||i.length<2?[bn(t),bn(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function So(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Er(n),referenced:Er(t),property:i}))}function Co(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Co.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Co.prototype.add=function(e,t,n){var i,r,o,a=this._translate;if(Rr(t,"bpmndi:BPMNPlane")){var s=Rr(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Eo(e,t,s)),this._canvas.addRootElement(i)}else if(Rr(t,"bpmndi:BPMNShape")){var c=!Ur(e,t),p=function(e){return Rr(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(Eo(e,t,{collapsed:c,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:p})),Rr(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),Rr(e,"bpmn:Lane")&&(o=0),Rr(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,bn(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!Rr(t,"bpmndi:BPMNEdge"))throw new Error(a("unknown di {di} for element {semantic}",{di:Er(t),semantic:Er(e)}));var u=this._getSource(e),h=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Eo(e,t,{hidden:r,source:u,target:h,waypoints:wo(t,u,h)})),Rr(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Xr(e)&&to(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Co.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Er(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw So(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Co.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Yr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Jr(t),i=Yr),L({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=to(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Eo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!to(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Co.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?So(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Er(e),side:t}))},Co.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Co.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Co.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Ao={__depends__:[xo,{__depends__:[_o],bpmnImporter:["type",Co]}]};function Ro(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Po(e){return e.originalEvent||e.srcEvent}function To(e){Ro(e),Ro(Po(e))}function ko(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Do(e,t){return(Po(e)||e).button===t}function Mo(e){return Do(e,0)}function Bo(e){var t=Po(e)||e;return!!Mo(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function No(e){var t=Po(e)||e;return Mo(e)&&t.shiftKey}function Oo(e){return!0}function jo(e){return Mo(e)||function(e){return Do(e,1)}(e)}function Lo(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(c[e]||Mo)(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":Oo,"element.mousedown":jo,"element.mouseup":jo,"element.click":jo,"element.dblclick":jo};function p(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(c[n]=i),a.$delegate=pe.bind(e,"svg, .djs-element",t,a)}function l(e,t,n){var i=a(n);i&&pe.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,g(s,(function(e,n){l(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,g(s,(function(e,n){p(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var u=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),d={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=L({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return _e(e,n),e}function v(e,t){ge(e,t)}this.removeHits=function(e){g(me(".djs-hit",e),Ce)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=st(t);return m(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=L({x:0,y:0},n);var i=De("rect");return m(i,t),_e(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=fe(".djs-hit",t);if(n)return e.waypoints?ct(n,e.waypoints):_e(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=l}Lo.$inject=["eventBus","elementRegistry","styles"];var Io={__init__:["interactionEvents"],interactionEvents:["type",Lo]};function Fo(e,t){this.offset=6;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e,t){var i=De("rect");return _e(i,L({x:10,y:10,rx:4,width:100,height:100},n)),ge(e,i),i}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=fe(".djs-outline",n);o||(o=r(n)),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=fe(".djs-outline",n);o||(o=r(n)),i.updateConnectionOutline(o,t)}))}Fo.prototype.updateShapeOutline=function(e,t){_e(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Fo.prototype.updateConnectionOutline=function(e,t){var n=ft(t);_e(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Fo.$inject=["eventBus","styles","elementRegistry"];var $o={__init__:["outline"],outline:["type",Fo]};function zo(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}zo.$inject=["eventBus","canvas"],zo.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},zo.prototype.get=function(){return this._selectedElements},zo.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},zo.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();p(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?g(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Ho="hover",Vo="selected";function Go(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Ho)})),t.on("element.out",(function(e){o(e.element,Ho)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;g(t,(function(e){-1===n.indexOf(e)&&function(e){o(e,Vo)}(e)})),g(n,(function(e){-1===t.indexOf(e)&&function(e){r(e,Vo)}(e)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Wo(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;p(o)?t.select(o):t.select(r.filter(Uo))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);m(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Mo(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=Bo(e)||No(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function Uo(e){return!e.hidden}Go.$inject=["canvas","eventBus","selection"],Go.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Ae(t);var n=e.length>1;if(we(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(ft(e)),r=De("rect");_e(r,L({rx:3},i)),we(r).add("djs-selection-outline"),ge(t,r)}},Wo.$inject=["eventBus","selection","canvas","elementRegistry"];var qo={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Io,$o],selection:["type",zo],selectionVisuals:["type",Go],selectionBehavior:["type",Wo]};function Ko(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Ko.prototype.next=function(){return this._prefix+ ++this._counter};var Yo=new Ko("ov");function Xo(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Yo,this._overlayDefaults=L({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),q(o=de('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Zo(e,t,n){q(e,{left:t+"px",top:n+"px"})}function Qo(e,t){e.style.display=!1===t?"none":""}function Jo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Xo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Xo.prototype.get=function(e){if(d(e)&&(e={id:e}),d(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?y(t.overlays,k({type:e.type})):t.overlays.slice():[]}return e.type?y(this._overlays,k({type:e.type})):e.id?this._overlays[e.id]:null},Xo.prototype.add=function(e,t,n){if(l(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=L({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Xo.prototype.remove=function(e){var t=this.get(e)||[];p(t)||(t=[t]);var n=this;g(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(ve(e.html),ve(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}}))},Xo.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Xo.prototype.show=function(){Qo(this._overlayRoot)},Xo.prototype.hide=function(){Qo(this._overlayRoot,!1)},Xo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Q(this._overlayRoot)},Xo.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=ft(t);i=o.x,r=o.y}Zo(n,i,r),K(e.html,"data-container-id",t.id)},Xo.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;void 0!==i.right&&(t=o.waypoints?ft(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?ft(o).height:o.height,s=-1*i.bottom+n);Zo(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Xo.prototype._createOverlayContainer=function(e){var t=de('<div class="djs-overlays" />');q(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Xo.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Jo(this._overlayRoot,n)},Xo.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Xo.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),d(o)&&(o=de(o)),n=this._getOverlayContainer(r),q(t=de('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&X(t).add("djs-overlay-"+e.type),Qo(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Xo.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,c=!0;(i!==this._canvas.getRootElement()||n&&(s(r)&&r>t.scale||s(o)&&o<t.scale))&&(c=!1),Qo(a,c),this._updateOverlayScale(e,t)},Xo.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,c="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),s(n)&&t.scale<n&&(r=(1/t.scale||1)*n),s(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),s(r)&&(c="scale("+r+","+r+")"),Jo(a,c)},Xo.prototype._updateOverlaysVisibilty=function(e){var t=this;g(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Xo.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element;g(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){ve(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}})),e.on("element.changed",500,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(g(i.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(i))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&X(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var ea={__init__:["overlays"],overlays:["type",Xo]};function ta(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(mt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}ta.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var na={__init__:["changeSupport"],changeSupport:["type",ta]};function ia(e){this._eventBus=e}function ra(e){return function(t,n,i,r,o){(h(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function oa(e,t){t.invoke(ia,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}ia.$inject=["eventBus"],ia.prototype.on=function(e,t,n,i,r,o){if((h(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),h(n)&&(o=r,r=i,i=n,n=1e3),l(r)&&(o=r,r=!1),!h(i))throw new Error("handlerFn must be a function");p(e)||(e=[e]);var a=this._eventBus;g(e,(function(e){var s=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))},ia.prototype.canExecute=ra("canExecute"),ia.prototype.preExecute=ra("preExecute"),ia.prototype.preExecuted=ra("preExecuted"),ia.prototype.execute=ra("execute"),ia.prototype.executed=ra("executed"),ia.prototype.postExecute=ra("postExecute"),ia.prototype.postExecuted=ra("postExecuted"),ia.prototype.revert=ra("revert"),ia.prototype.reverted=ra("reverted"),e(oa,ia),oa.$inject=["canvas","injector"];var aa={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",oa]};function sa(e){return CSS.escape(e)}var ca={"&":"&","<":"<",">":">",'"':""","'":"'"};function pa(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return ca[e]}))}var la="_plane";function ua(e){return function(e){return e.replace(new RegExp("_plane$"),"")}(e.id)}function ha(e){var t=e.id;return Rr(e,"bpmn:SubProcess")?ma(t):t}function da(e){return ma(e)}function fa(e){return Rr(kr(e),"bpmndi:BPMNPlane")}function ma(e){return e+la}function va(e,t,n){var i=de('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=X(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=Tr(e),n=[],i=t;i;i=i.$parent)(Rr(i,"bpmn:SubProcess")||Rr(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.map((function(e){var i=pa(e.name||e.id),r=de('<li><span class="bjs-crumb"><a title="'+i+'">'+i+"</a></span></li>"),o=n.findRoot(ha(e))||n.findRoot(e.id);if(!o&&Rr(e,"bpmn:Process")){var a=t.find((function(t){var n=Tr(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(a.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=Tr(e.element);m(a,(function(e){return e===t}))&&s()})),e.on("root.set",(function(e){s(e.element)}))}function ya(e,t){var n=null,i=new ga;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!Rr(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,c=(o.y-a.y)*o.scale;0===s&&0===c||t.scroll({dx:s,dy:c}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function ga(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}va.$inject=["eventBus","elementRegistry","canvas"],ya.$inject=["eventBus","canvas"];var ba=180,xa=160;function _a(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n._handleImport(t.definitions)}))}function Ea(e){return Rr(e,"bpmndi:BPMNDiagram")?e:Ea(e.$parent)}_a.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},_a.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;Rr(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!Rr(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(Pr(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}})),r},_a.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=vn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),yn(t)}(e),i=n.x-ba,r=n.y-xa;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},_a.prototype._moveToDiPlane=function(e,t){var n=Ea(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},_a.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},_a.$inject=["eventBus","moddle"];var wa=250;function Sa(e,t,n,i){ia.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",wa,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",wa,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],wa,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],wa,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r._canDrillDown(e)})).map((function(e){r._addOverlay(e)}))}))}e(Sa,ia),Sa.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Sa.prototype._canDrillDown=function(e){var t=this._canvas;return Rr(e,"bpmn:SubProcess")&&t.findRoot(ha(e))},Sa.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Tr(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;X(i.html).toggle("bjs-drilldown-empty",!r)}},Sa.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=de('<button class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(ha(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Sa.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Sa.$inject=["canvas","eventBus","elementRegistry","overlays"];var Ca={__depends__:[ea,na,aa],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",va],drilldownCentering:["type",ya],drilldownOverlayBehavior:["type",Sa],subprocessCompatibility:["type",_a]};function Aa(e){zr.call(this,e)}e(Aa,zr),Aa.prototype._modules=[Ao,_o,qo,ea,Ca],Aa.prototype._moddleExtensions={};var Ra=["c","C"],Pa=["v","V"],Ta=["y","Y"],ka=["z","Z"];function Da(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Ma(e,t){return-1!==(e=p(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Ba(e){return e.shiftKey}var Na="keyboard.keydown",Oa="input-handle-modified-keys";function ja(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}ja.$inject=["config.keyboard","eventBus"],ja.prototype._keydownHandler=function(e){this._keyHandler(e,Na)},ja.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},ja.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Na,n)&&e.preventDefault()}},ja.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||(t=e.target)&&(J(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},ja.prototype._isModifiedKeyIgnored=function(e){return!Da(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},ja.prototype._getAllowedModifiers=function(e){var t=ee(e,"[input-handle-modified-keys]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Oa).split(",")},ja.prototype.bind=function(e){this.unbind(),this._node=e,ae.bind(e,"keydown",this._keydownHandler),ae.bind(e,"keyup",this._keyupHandler),this._fire("bind")},ja.prototype.getBinding=function(){return this._node},ja.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ae.unbind(e,"keydown",this._keydownHandler),ae.unbind(e,"keyup",this._keyupHandler)),this._node=null},ja.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},ja.prototype.addListener=function(e,t,n){h(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Na,e,t)},ja.prototype.removeListener=function(e,t){this._eventBus.off(t||Na,e)},ja.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},ja.prototype.isCmd=Da,ja.prototype.isShift=Ba,ja.prototype.isKey=Ma;function La(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}La.$inject=["eventBus","keyboard"],La.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(function(e){return Da(e)&&!Ba(e)&&Ma(ka,e)}(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(function(e){return Da(e)&&(Ma(Ta,e)||Ma(ka,e)&&Ba(e))}(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return Da(e)&&Ma(Ra,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return Da(e)&&Ma(Pa,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ma(["+","Add","="],n)&&Da(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ma(["-","Subtract"],n)&&Da(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Ma("0",n)&&Da(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Ma(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Ia={__init__:["keyboard","keyboardBindings"],keyboard:["type",ja],keyboardBindings:["type",La]},Fa={moveSpeed:50,moveSpeedAccelerated:200};function $a(e,t,n){var i=this;this._config=L({},Fa,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}$a.$inject=["config.keyboardMove","keyboard","canvas"];var za={__depends__:[Ia],__init__:["keyboardMove"],keyboardMove:["type",$a]},Ha=/^djs-cursor-.*$/;function Va(e){var t=X(document.body);t.removeMatching(Ha),e&&t.add("djs-cursor-"+e)}function Ga(){Va(null)}function Wa(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function Ua(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function qa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ka(e,t){var n;function i(i){var r,o=n.start,a=n.button,s=ko(i),c=qa(s,o);(!n.dragging&&(r=c,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&Wa(e),Va("grab")),n.dragging)&&(c=qa(s,n.last||n.start),t.scroll({dx:c.x,dy:c.y}),n.last=s);i.preventDefault()}function r(e){ae.unbind(document,"mousemove",i),ae.unbind(document,"mouseup",r),n=null,Ga()}e.on("element.mousedown",500,(function(e){return function(e){if(ee(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:ko(e)},ae.bind(document,"mousemove",i),ae.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Ka.$inject=["eventBus","canvas"];var Ya={__init__:["moveCanvas"],moveCanvas:["type",Ka]};function Xa(e){return Math.log(e)/Math.log(10)}function Za(e,t){var n=Xa(e.min),i=Xa(e.max);return(Math.abs(n)+Math.abs(i))/t}var Qa=Math.sign||function(e){return e>=0?1:-1},Ja={min:.2,max:4};function es(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=j(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}es.$inject=["config.zoomScroll","eventBus","canvas"],es.prototype.scroll=function(e){this._canvas.scroll(e)},es.prototype.reset=function(){this._canvas.zoom("fit-viewport")},es.prototype.zoom=function(e,t){var n=Za(Ja,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},es.prototype._handleWheel=function(e){if(!ee(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Qa(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},es.prototype.stepZoom=function(e,t){var n=Za(Ja,10);this._zoom(e,t,n)},es.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Xa(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,c,p=Math.pow(10,a);i.zoom((s=Ja,c=p,Math.max(s.min,Math.min(s.max,c))),t)},es.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&ae[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},es.prototype._init=function(e){this.toggle(e)};var ts={__init__:["zoomScroll"],zoomScroll:["type",es]};function ns(e){Aa.call(this,e)}e(ns,Aa),ns.prototype._navigationModules=[za,Ya,ts],ns.prototype._modules=[].concat(Aa.prototype._modules,ns.prototype._navigationModules);var is={exports:{}};
|
|
28
28
|
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
29
29
|
* http://hammerjs.github.io/
|
|
30
30
|
*
|