camunda-bpmn-js 0.16.1 → 0.17.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.
@@ -108,6 +108,26 @@
108
108
  });
109
109
  return match;
110
110
  }
111
+ /**
112
+ * Find element index in collection.
113
+ *
114
+ * @param {Array|Object} collection
115
+ * @param {Function} matcher
116
+ *
117
+ * @return {Object}
118
+ */
119
+
120
+ function findIndex(collection, matcher) {
121
+ matcher = toMatcher(matcher);
122
+ var idx = isArray(collection) ? -1 : undefined;
123
+ forEach(collection, function (val, key) {
124
+ if (matcher(val, key)) {
125
+ idx = key;
126
+ return false;
127
+ }
128
+ });
129
+ return idx;
130
+ }
111
131
  /**
112
132
  * Find element in collection.
113
133
  *
@@ -1170,149 +1190,6 @@
1170
1190
  }
1171
1191
  }
1172
1192
 
1173
- /**
1174
- * Serialization util
1175
- */
1176
-
1177
- var TEXT_ENTITIES = /([&<>]{1})/g;
1178
- var ATTR_ENTITIES = /([\n\r"]{1})/g;
1179
-
1180
- var ENTITY_REPLACEMENT = {
1181
- '&': '&amp;',
1182
- '<': '&lt;',
1183
- '>': '&gt;',
1184
- '"': '\''
1185
- };
1186
-
1187
- function escape(str, pattern) {
1188
-
1189
- function replaceFn(match, entity) {
1190
- return ENTITY_REPLACEMENT[entity] || entity;
1191
- }
1192
-
1193
- return str.replace(pattern, replaceFn);
1194
- }
1195
-
1196
- function serialize(node, output) {
1197
-
1198
- var i, len, attrMap, attrNode, childNodes;
1199
-
1200
- switch (node.nodeType) {
1201
- // TEXT
1202
- case 3:
1203
- // replace special XML characters
1204
- output.push(escape(node.textContent, TEXT_ENTITIES));
1205
- break;
1206
-
1207
- // ELEMENT
1208
- case 1:
1209
- output.push('<', node.tagName);
1210
-
1211
- if (node.hasAttributes()) {
1212
- attrMap = node.attributes;
1213
- for (i = 0, len = attrMap.length; i < len; ++i) {
1214
- attrNode = attrMap.item(i);
1215
- output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
1216
- }
1217
- }
1218
-
1219
- if (node.hasChildNodes()) {
1220
- output.push('>');
1221
- childNodes = node.childNodes;
1222
- for (i = 0, len = childNodes.length; i < len; ++i) {
1223
- serialize(childNodes.item(i), output);
1224
- }
1225
- output.push('</', node.tagName, '>');
1226
- } else {
1227
- output.push('/>');
1228
- }
1229
- break;
1230
-
1231
- // COMMENT
1232
- case 8:
1233
- output.push('<!--', escape(node.nodeValue, TEXT_ENTITIES), '-->');
1234
- break;
1235
-
1236
- // CDATA
1237
- case 4:
1238
- output.push('<![CDATA[', node.nodeValue, ']]>');
1239
- break;
1240
-
1241
- default:
1242
- throw new Error('unable to handle node ' + node.nodeType);
1243
- }
1244
-
1245
- return output;
1246
- }
1247
-
1248
- /**
1249
- * innerHTML like functionality for SVG elements.
1250
- * based on innerSVG (https://code.google.com/p/innersvg)
1251
- */
1252
-
1253
-
1254
- function set(element, svg) {
1255
-
1256
- var parsed = parse(svg);
1257
-
1258
- // clear element contents
1259
- clear(element);
1260
-
1261
- if (!svg) {
1262
- return;
1263
- }
1264
-
1265
- if (!isFragment(parsed)) {
1266
- // extract <svg> from parsed document
1267
- parsed = parsed.documentElement;
1268
- }
1269
-
1270
- var nodes = slice(parsed.childNodes);
1271
-
1272
- // import + append each node
1273
- for (var i = 0; i < nodes.length; i++) {
1274
- appendTo(nodes[i], element);
1275
- }
1276
-
1277
- }
1278
-
1279
- function get(element) {
1280
- var child = element.firstChild,
1281
- output = [];
1282
-
1283
- while (child) {
1284
- serialize(child, output);
1285
- child = child.nextSibling;
1286
- }
1287
-
1288
- return output.join('');
1289
- }
1290
-
1291
- function isFragment(node) {
1292
- return node.nodeName === '#document-fragment';
1293
- }
1294
-
1295
- function innerSVG(element, svg) {
1296
-
1297
- if (svg !== undefined) {
1298
-
1299
- try {
1300
- set(element, svg);
1301
- } catch (e) {
1302
- throw new Error('error parsing SVG: ' + e.message);
1303
- }
1304
-
1305
- return element;
1306
- } else {
1307
- return get(element);
1308
- }
1309
- }
1310
-
1311
-
1312
- function slice(arr) {
1313
- return Array.prototype.slice.call(arr);
1314
- }
1315
-
1316
1193
  /**
1317
1194
  * transform accessor utility
1318
1195
  */
@@ -1463,11 +1340,11 @@
1463
1340
  radius = shape.width / 2;
1464
1341
 
1465
1342
  var circlePath = [
1466
- ['M', cx, cy],
1467
- ['m', 0, -radius],
1468
- ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
1469
- ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
1470
- ['z']
1343
+ [ 'M', cx, cy ],
1344
+ [ 'm', 0, -radius ],
1345
+ [ 'a', radius, radius, 0, 1, 1, 0, 2 * radius ],
1346
+ [ 'a', radius, radius, 0, 1, 1, 0, -2 * radius ],
1347
+ [ 'z' ]
1471
1348
  ];
1472
1349
 
1473
1350
  return componentsToPath(circlePath);
@@ -1481,16 +1358,16 @@
1481
1358
  height = shape.height;
1482
1359
 
1483
1360
  var roundRectPath = [
1484
- ['M', x + borderRadius, y],
1485
- ['l', width - borderRadius * 2, 0],
1486
- ['a', borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius],
1487
- ['l', 0, height - borderRadius * 2],
1488
- ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius],
1489
- ['l', borderRadius * 2 - width, 0],
1490
- ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius],
1491
- ['l', 0, borderRadius * 2 - height],
1492
- ['a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius],
1493
- ['z']
1361
+ [ 'M', x + borderRadius, y ],
1362
+ [ 'l', width - borderRadius * 2, 0 ],
1363
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius ],
1364
+ [ 'l', 0, height - borderRadius * 2 ],
1365
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius ],
1366
+ [ 'l', borderRadius * 2 - width, 0 ],
1367
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius ],
1368
+ [ 'l', 0, borderRadius * 2 - height ],
1369
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius ],
1370
+ [ 'z' ]
1494
1371
  ];
1495
1372
 
1496
1373
  return componentsToPath(roundRectPath);
@@ -1506,11 +1383,11 @@
1506
1383
  halfHeight = height / 2;
1507
1384
 
1508
1385
  var diamondPath = [
1509
- ['M', x + halfWidth, y],
1510
- ['l', halfWidth, halfHeight],
1511
- ['l', -halfWidth, halfHeight],
1512
- ['l', -halfWidth, -halfHeight],
1513
- ['z']
1386
+ [ 'M', x + halfWidth, y ],
1387
+ [ 'l', halfWidth, halfHeight ],
1388
+ [ 'l', -halfWidth, halfHeight ],
1389
+ [ 'l', -halfWidth, -halfHeight ],
1390
+ [ 'z' ]
1514
1391
  ];
1515
1392
 
1516
1393
  return componentsToPath(diamondPath);
@@ -1523,11 +1400,11 @@
1523
1400
  height = shape.height;
1524
1401
 
1525
1402
  var rectPath = [
1526
- ['M', x, y],
1527
- ['l', width, 0],
1528
- ['l', 0, height],
1529
- ['l', -width, 0],
1530
- ['z']
1403
+ [ 'M', x, y ],
1404
+ [ 'l', width, 0 ],
1405
+ [ 'l', 0, height ],
1406
+ [ 'l', -width, 0 ],
1407
+ [ 'z' ]
1531
1408
  ];
1532
1409
 
1533
1410
  return componentsToPath(rectPath);
@@ -2048,97 +1925,733 @@
2048
1925
  _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
2049
1926
  };
2050
1927
 
2051
- map$1.td =
2052
- map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
1928
+ map$1.td =
1929
+ map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
1930
+
1931
+ map$1.option =
1932
+ map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
1933
+
1934
+ map$1.thead =
1935
+ map$1.tbody =
1936
+ map$1.colgroup =
1937
+ map$1.caption =
1938
+ map$1.tfoot = [1, '<table>', '</table>'];
1939
+
1940
+ map$1.polyline =
1941
+ map$1.ellipse =
1942
+ map$1.polygon =
1943
+ map$1.circle =
1944
+ map$1.text =
1945
+ map$1.line =
1946
+ map$1.path =
1947
+ map$1.rect =
1948
+ map$1.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
1949
+
1950
+ /**
1951
+ * Parse `html` and return a DOM Node instance, which could be a TextNode,
1952
+ * HTML DOM Node of some kind (<div> for example), or a DocumentFragment
1953
+ * instance, depending on the contents of the `html` string.
1954
+ *
1955
+ * @param {String} html - HTML string to "domify"
1956
+ * @param {Document} doc - The `document` instance to create the Node for
1957
+ * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
1958
+ * @api private
1959
+ */
1960
+
1961
+ function parse$1(html, doc) {
1962
+ if ('string' != typeof html) throw new TypeError('String expected');
1963
+
1964
+ // default to the global `document` object
1965
+ if (!doc) doc = document;
1966
+
1967
+ // tag name
1968
+ var m = /<([\w:]+)/.exec(html);
1969
+ if (!m) return doc.createTextNode(html);
1970
+
1971
+ html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
1972
+
1973
+ var tag = m[1];
1974
+
1975
+ // body support
1976
+ if (tag == 'body') {
1977
+ var el = doc.createElement('html');
1978
+ el.innerHTML = html;
1979
+ return el.removeChild(el.lastChild);
1980
+ }
1981
+
1982
+ // wrap map
1983
+ var wrap = map$1[tag] || map$1._default;
1984
+ var depth = wrap[0];
1985
+ var prefix = wrap[1];
1986
+ var suffix = wrap[2];
1987
+ var el = doc.createElement('div');
1988
+ el.innerHTML = prefix + html + suffix;
1989
+ while (depth--) el = el.lastChild;
1990
+
1991
+ // one element
1992
+ if (el.firstChild == el.lastChild) {
1993
+ return el.removeChild(el.firstChild);
1994
+ }
1995
+
1996
+ // several elements
1997
+ var fragment = doc.createDocumentFragment();
1998
+ while (el.firstChild) {
1999
+ fragment.appendChild(el.removeChild(el.firstChild));
2000
+ }
2001
+
2002
+ return fragment;
2003
+ }
2004
+
2005
+ function query(selector, el) {
2006
+ el = el || document;
2007
+
2008
+ return el.querySelector(selector);
2009
+ }
2010
+
2011
+ function all(selector, el) {
2012
+ el = el || document;
2013
+
2014
+ return el.querySelectorAll(selector);
2015
+ }
2016
+
2017
+ function remove$1(el) {
2018
+ el.parentNode && el.parentNode.removeChild(el);
2019
+ }
2020
+
2021
+ function ensureImported$1(element, target) {
2022
+
2023
+ if (element.ownerDocument !== target.ownerDocument) {
2024
+ try {
2025
+ // may fail on webkit
2026
+ return target.ownerDocument.importNode(element, true);
2027
+ } catch (e) {
2028
+ // ignore
2029
+ }
2030
+ }
2031
+
2032
+ return element;
2033
+ }
2034
+
2035
+ /**
2036
+ * appendTo utility
2037
+ */
2038
+
2039
+ /**
2040
+ * Append a node to a target element and return the appended node.
2041
+ *
2042
+ * @param {SVGElement} element
2043
+ * @param {SVGElement} target
2044
+ *
2045
+ * @return {SVGElement} the appended node
2046
+ */
2047
+ function appendTo$1(element, target) {
2048
+ return target.appendChild(ensureImported$1(element, target));
2049
+ }
2050
+
2051
+ /**
2052
+ * append utility
2053
+ */
2054
+
2055
+ /**
2056
+ * Append a node to an element
2057
+ *
2058
+ * @param {SVGElement} element
2059
+ * @param {SVGElement} node
2060
+ *
2061
+ * @return {SVGElement} the element
2062
+ */
2063
+ function append$1(target, node) {
2064
+ appendTo$1(node, target);
2065
+ return target;
2066
+ }
2067
+
2068
+ /**
2069
+ * attribute accessor utility
2070
+ */
2071
+
2072
+ var LENGTH_ATTR$1 = 2;
2073
+
2074
+ var CSS_PROPERTIES$1 = {
2075
+ 'alignment-baseline': 1,
2076
+ 'baseline-shift': 1,
2077
+ 'clip': 1,
2078
+ 'clip-path': 1,
2079
+ 'clip-rule': 1,
2080
+ 'color': 1,
2081
+ 'color-interpolation': 1,
2082
+ 'color-interpolation-filters': 1,
2083
+ 'color-profile': 1,
2084
+ 'color-rendering': 1,
2085
+ 'cursor': 1,
2086
+ 'direction': 1,
2087
+ 'display': 1,
2088
+ 'dominant-baseline': 1,
2089
+ 'enable-background': 1,
2090
+ 'fill': 1,
2091
+ 'fill-opacity': 1,
2092
+ 'fill-rule': 1,
2093
+ 'filter': 1,
2094
+ 'flood-color': 1,
2095
+ 'flood-opacity': 1,
2096
+ 'font': 1,
2097
+ 'font-family': 1,
2098
+ 'font-size': LENGTH_ATTR$1,
2099
+ 'font-size-adjust': 1,
2100
+ 'font-stretch': 1,
2101
+ 'font-style': 1,
2102
+ 'font-variant': 1,
2103
+ 'font-weight': 1,
2104
+ 'glyph-orientation-horizontal': 1,
2105
+ 'glyph-orientation-vertical': 1,
2106
+ 'image-rendering': 1,
2107
+ 'kerning': 1,
2108
+ 'letter-spacing': 1,
2109
+ 'lighting-color': 1,
2110
+ 'marker': 1,
2111
+ 'marker-end': 1,
2112
+ 'marker-mid': 1,
2113
+ 'marker-start': 1,
2114
+ 'mask': 1,
2115
+ 'opacity': 1,
2116
+ 'overflow': 1,
2117
+ 'pointer-events': 1,
2118
+ 'shape-rendering': 1,
2119
+ 'stop-color': 1,
2120
+ 'stop-opacity': 1,
2121
+ 'stroke': 1,
2122
+ 'stroke-dasharray': 1,
2123
+ 'stroke-dashoffset': 1,
2124
+ 'stroke-linecap': 1,
2125
+ 'stroke-linejoin': 1,
2126
+ 'stroke-miterlimit': 1,
2127
+ 'stroke-opacity': 1,
2128
+ 'stroke-width': LENGTH_ATTR$1,
2129
+ 'text-anchor': 1,
2130
+ 'text-decoration': 1,
2131
+ 'text-rendering': 1,
2132
+ 'unicode-bidi': 1,
2133
+ 'visibility': 1,
2134
+ 'word-spacing': 1,
2135
+ 'writing-mode': 1
2136
+ };
2137
+
2138
+
2139
+ function getAttribute$1(node, name) {
2140
+ if (CSS_PROPERTIES$1[name]) {
2141
+ return node.style[name];
2142
+ } else {
2143
+ return node.getAttributeNS(null, name);
2144
+ }
2145
+ }
2146
+
2147
+ function setAttribute$1(node, name, value) {
2148
+ var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
2149
+
2150
+ var type = CSS_PROPERTIES$1[hyphenated];
2151
+
2152
+ if (type) {
2153
+ // append pixel unit, unless present
2154
+ if (type === LENGTH_ATTR$1 && typeof value === 'number') {
2155
+ value = String(value) + 'px';
2156
+ }
2157
+
2158
+ node.style[hyphenated] = value;
2159
+ } else {
2160
+ node.setAttributeNS(null, name, value);
2161
+ }
2162
+ }
2163
+
2164
+ function setAttributes$1(node, attrs) {
2165
+
2166
+ var names = Object.keys(attrs), i, name;
2167
+
2168
+ for (i = 0, name; (name = names[i]); i++) {
2169
+ setAttribute$1(node, name, attrs[name]);
2170
+ }
2171
+ }
2172
+
2173
+ /**
2174
+ * Gets or sets raw attributes on a node.
2175
+ *
2176
+ * @param {SVGElement} node
2177
+ * @param {Object} [attrs]
2178
+ * @param {String} [name]
2179
+ * @param {String} [value]
2180
+ *
2181
+ * @return {String}
2182
+ */
2183
+ function attr$2(node, name, value) {
2184
+ if (typeof name === 'string') {
2185
+ if (value !== undefined) {
2186
+ setAttribute$1(node, name, value);
2187
+ } else {
2188
+ return getAttribute$1(node, name);
2189
+ }
2190
+ } else {
2191
+ setAttributes$1(node, name);
2192
+ }
2193
+
2194
+ return node;
2195
+ }
2196
+
2197
+ /**
2198
+ * Clear utility
2199
+ */
2200
+ function index$1(arr, obj) {
2201
+ if (arr.indexOf) {
2202
+ return arr.indexOf(obj);
2203
+ }
2204
+
2205
+
2206
+ for (var i = 0; i < arr.length; ++i) {
2207
+ if (arr[i] === obj) {
2208
+ return i;
2209
+ }
2210
+ }
2211
+
2212
+ return -1;
2213
+ }
2214
+
2215
+ var re$2 = /\s+/;
2216
+
2217
+ var toString$2 = Object.prototype.toString;
2218
+
2219
+ function defined$1(o) {
2220
+ return typeof o !== 'undefined';
2221
+ }
2222
+
2223
+ /**
2224
+ * Wrap `el` in a `ClassList`.
2225
+ *
2226
+ * @param {Element} el
2227
+ * @return {ClassList}
2228
+ * @api public
2229
+ */
2230
+
2231
+ function classes$2(el) {
2232
+ return new ClassList$2(el);
2233
+ }
2234
+
2235
+ function ClassList$2(el) {
2236
+ if (!el || !el.nodeType) {
2237
+ throw new Error('A DOM element reference is required');
2238
+ }
2239
+ this.el = el;
2240
+ this.list = el.classList;
2241
+ }
2242
+
2243
+ /**
2244
+ * Add class `name` if not already present.
2245
+ *
2246
+ * @param {String} name
2247
+ * @return {ClassList}
2248
+ * @api public
2249
+ */
2250
+
2251
+ ClassList$2.prototype.add = function(name) {
2252
+
2253
+ // classList
2254
+ if (this.list) {
2255
+ this.list.add(name);
2256
+ return this;
2257
+ }
2258
+
2259
+ // fallback
2260
+ var arr = this.array();
2261
+ var i = index$1(arr, name);
2262
+ if (!~i) {
2263
+ arr.push(name);
2264
+ }
2265
+
2266
+ if (defined$1(this.el.className.baseVal)) {
2267
+ this.el.className.baseVal = arr.join(' ');
2268
+ } else {
2269
+ this.el.className = arr.join(' ');
2270
+ }
2271
+
2272
+ return this;
2273
+ };
2274
+
2275
+ /**
2276
+ * Remove class `name` when present, or
2277
+ * pass a regular expression to remove
2278
+ * any which match.
2279
+ *
2280
+ * @param {String|RegExp} name
2281
+ * @return {ClassList}
2282
+ * @api public
2283
+ */
2284
+
2285
+ ClassList$2.prototype.remove = function(name) {
2286
+ if ('[object RegExp]' === toString$2.call(name)) {
2287
+ return this.removeMatching(name);
2288
+ }
2289
+
2290
+ // classList
2291
+ if (this.list) {
2292
+ this.list.remove(name);
2293
+ return this;
2294
+ }
2295
+
2296
+ // fallback
2297
+ var arr = this.array();
2298
+ var i = index$1(arr, name);
2299
+ if (~i) {
2300
+ arr.splice(i, 1);
2301
+ }
2302
+ this.el.className.baseVal = arr.join(' ');
2303
+ return this;
2304
+ };
2305
+
2306
+ /**
2307
+ * Remove all classes matching `re`.
2308
+ *
2309
+ * @param {RegExp} re
2310
+ * @return {ClassList}
2311
+ * @api private
2312
+ */
2313
+
2314
+ ClassList$2.prototype.removeMatching = function(re) {
2315
+ var arr = this.array();
2316
+ for (var i = 0; i < arr.length; i++) {
2317
+ if (re.test(arr[i])) {
2318
+ this.remove(arr[i]);
2319
+ }
2320
+ }
2321
+ return this;
2322
+ };
2323
+
2324
+ /**
2325
+ * Toggle class `name`, can force state via `force`.
2326
+ *
2327
+ * For browsers that support classList, but do not support `force` yet,
2328
+ * the mistake will be detected and corrected.
2329
+ *
2330
+ * @param {String} name
2331
+ * @param {Boolean} force
2332
+ * @return {ClassList}
2333
+ * @api public
2334
+ */
2335
+
2336
+ ClassList$2.prototype.toggle = function(name, force) {
2337
+ // classList
2338
+ if (this.list) {
2339
+ if (defined$1(force)) {
2340
+ if (force !== this.list.toggle(name, force)) {
2341
+ this.list.toggle(name); // toggle again to correct
2342
+ }
2343
+ } else {
2344
+ this.list.toggle(name);
2345
+ }
2346
+ return this;
2347
+ }
2348
+
2349
+ // fallback
2350
+ if (defined$1(force)) {
2351
+ if (!force) {
2352
+ this.remove(name);
2353
+ } else {
2354
+ this.add(name);
2355
+ }
2356
+ } else {
2357
+ if (this.has(name)) {
2358
+ this.remove(name);
2359
+ } else {
2360
+ this.add(name);
2361
+ }
2362
+ }
2363
+
2364
+ return this;
2365
+ };
2366
+
2367
+ /**
2368
+ * Return an array of classes.
2369
+ *
2370
+ * @return {Array}
2371
+ * @api public
2372
+ */
2373
+
2374
+ ClassList$2.prototype.array = function() {
2375
+ var className = this.el.getAttribute('class') || '';
2376
+ var str = className.replace(/^\s+|\s+$/g, '');
2377
+ var arr = str.split(re$2);
2378
+ if ('' === arr[0]) {
2379
+ arr.shift();
2380
+ }
2381
+ return arr;
2382
+ };
2383
+
2384
+ /**
2385
+ * Check if class `name` is present.
2386
+ *
2387
+ * @param {String} name
2388
+ * @return {ClassList}
2389
+ * @api public
2390
+ */
2391
+
2392
+ ClassList$2.prototype.has =
2393
+ ClassList$2.prototype.contains = function(name) {
2394
+ return (
2395
+ this.list ?
2396
+ this.list.contains(name) :
2397
+ !! ~index$1(this.array(), name)
2398
+ );
2399
+ };
2400
+
2401
+ function remove$2(element) {
2402
+ var parent = element.parentNode;
2403
+
2404
+ if (parent) {
2405
+ parent.removeChild(element);
2406
+ }
2407
+
2408
+ return element;
2409
+ }
2410
+
2411
+ /**
2412
+ * Clear utility
2413
+ */
2414
+
2415
+ /**
2416
+ * Removes all children from the given element
2417
+ *
2418
+ * @param {DOMElement} element
2419
+ * @return {DOMElement} the element (for chaining)
2420
+ */
2421
+ function clear$2(element) {
2422
+ var child;
2423
+
2424
+ while ((child = element.firstChild)) {
2425
+ remove$2(child);
2426
+ }
2427
+
2428
+ return element;
2429
+ }
2430
+
2431
+ var ns$1 = {
2432
+ svg: 'http://www.w3.org/2000/svg'
2433
+ };
2434
+
2435
+ /**
2436
+ * DOM parsing utility
2437
+ */
2438
+
2439
+ var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
2440
+
2441
+ function parse$2(svg) {
2442
+
2443
+ var unwrap = false;
2444
+
2445
+ // ensure we import a valid svg document
2446
+ if (svg.substring(0, 4) === '<svg') {
2447
+ if (svg.indexOf(ns$1.svg) === -1) {
2448
+ svg = SVG_START$1 + svg.substring(4);
2449
+ }
2450
+ } else {
2451
+ // namespace svg
2452
+ svg = SVG_START$1 + '>' + svg + '</svg>';
2453
+ unwrap = true;
2454
+ }
2455
+
2456
+ var parsed = parseDocument$1(svg);
2457
+
2458
+ if (!unwrap) {
2459
+ return parsed;
2460
+ }
2461
+
2462
+ var fragment = document.createDocumentFragment();
2463
+
2464
+ var parent = parsed.firstChild;
2465
+
2466
+ while (parent.firstChild) {
2467
+ fragment.appendChild(parent.firstChild);
2468
+ }
2469
+
2470
+ return fragment;
2471
+ }
2472
+
2473
+ function parseDocument$1(svg) {
2474
+
2475
+ var parser;
2476
+
2477
+ // parse
2478
+ parser = new DOMParser();
2479
+ parser.async = false;
2480
+
2481
+ return parser.parseFromString(svg, 'text/xml');
2482
+ }
2483
+
2484
+ /**
2485
+ * Create utility for SVG elements
2486
+ */
2487
+
2488
+
2489
+ /**
2490
+ * Create a specific type from name or SVG markup.
2491
+ *
2492
+ * @param {String} name the name or markup of the element
2493
+ * @param {Object} [attrs] attributes to set on the element
2494
+ *
2495
+ * @returns {SVGElement}
2496
+ */
2497
+ function create$1(name, attrs) {
2498
+ var element;
2499
+
2500
+ if (name.charAt(0) === '<') {
2501
+ element = parse$2(name).firstChild;
2502
+ element = document.importNode(element, true);
2503
+ } else {
2504
+ element = document.createElementNS(ns$1.svg, name);
2505
+ }
2506
+
2507
+ if (attrs) {
2508
+ attr$2(element, attrs);
2509
+ }
2510
+
2511
+ return element;
2512
+ }
2513
+
2514
+ /**
2515
+ * Serialization util
2516
+ */
2517
+
2518
+ var TEXT_ENTITIES = /([&<>]{1})/g;
2519
+ var ATTR_ENTITIES = /([\n\r"]{1})/g;
2520
+
2521
+ var ENTITY_REPLACEMENT = {
2522
+ '&': '&amp;',
2523
+ '<': '&lt;',
2524
+ '>': '&gt;',
2525
+ '"': '\''
2526
+ };
2527
+
2528
+ function escape(str, pattern) {
2529
+
2530
+ function replaceFn(match, entity) {
2531
+ return ENTITY_REPLACEMENT[entity] || entity;
2532
+ }
2533
+
2534
+ return str.replace(pattern, replaceFn);
2535
+ }
2536
+
2537
+ function serialize(node, output) {
2538
+
2539
+ var i, len, attrMap, attrNode, childNodes;
2540
+
2541
+ switch (node.nodeType) {
2542
+ // TEXT
2543
+ case 3:
2544
+ // replace special XML characters
2545
+ output.push(escape(node.textContent, TEXT_ENTITIES));
2546
+ break;
2547
+
2548
+ // ELEMENT
2549
+ case 1:
2550
+ output.push('<', node.tagName);
2551
+
2552
+ if (node.hasAttributes()) {
2553
+ attrMap = node.attributes;
2554
+ for (i = 0, len = attrMap.length; i < len; ++i) {
2555
+ attrNode = attrMap.item(i);
2556
+ output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
2557
+ }
2558
+ }
2559
+
2560
+ if (node.hasChildNodes()) {
2561
+ output.push('>');
2562
+ childNodes = node.childNodes;
2563
+ for (i = 0, len = childNodes.length; i < len; ++i) {
2564
+ serialize(childNodes.item(i), output);
2565
+ }
2566
+ output.push('</', node.tagName, '>');
2567
+ } else {
2568
+ output.push('/>');
2569
+ }
2570
+ break;
2571
+
2572
+ // COMMENT
2573
+ case 8:
2574
+ output.push('<!--', escape(node.nodeValue, TEXT_ENTITIES), '-->');
2575
+ break;
2053
2576
 
2054
- map$1.option =
2055
- map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
2577
+ // CDATA
2578
+ case 4:
2579
+ output.push('<![CDATA[', node.nodeValue, ']]>');
2580
+ break;
2056
2581
 
2057
- map$1.thead =
2058
- map$1.tbody =
2059
- map$1.colgroup =
2060
- map$1.caption =
2061
- map$1.tfoot = [1, '<table>', '</table>'];
2582
+ default:
2583
+ throw new Error('unable to handle node ' + node.nodeType);
2584
+ }
2062
2585
 
2063
- map$1.polyline =
2064
- map$1.ellipse =
2065
- map$1.polygon =
2066
- map$1.circle =
2067
- map$1.text =
2068
- map$1.line =
2069
- map$1.path =
2070
- map$1.rect =
2071
- map$1.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
2586
+ return output;
2587
+ }
2072
2588
 
2073
2589
  /**
2074
- * Parse `html` and return a DOM Node instance, which could be a TextNode,
2075
- * HTML DOM Node of some kind (<div> for example), or a DocumentFragment
2076
- * instance, depending on the contents of the `html` string.
2077
- *
2078
- * @param {String} html - HTML string to "domify"
2079
- * @param {Document} doc - The `document` instance to create the Node for
2080
- * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
2081
- * @api private
2590
+ * innerHTML like functionality for SVG elements.
2591
+ * based on innerSVG (https://code.google.com/p/innersvg)
2082
2592
  */
2083
2593
 
2084
- function parse$1(html, doc) {
2085
- if ('string' != typeof html) throw new TypeError('String expected');
2086
2594
 
2087
- // default to the global `document` object
2088
- if (!doc) doc = document;
2595
+ function set(element, svg) {
2089
2596
 
2090
- // tag name
2091
- var m = /<([\w:]+)/.exec(html);
2092
- if (!m) return doc.createTextNode(html);
2597
+ var parsed = parse$2(svg);
2093
2598
 
2094
- html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
2599
+ // clear element contents
2600
+ clear$2(element);
2095
2601
 
2096
- var tag = m[1];
2602
+ if (!svg) {
2603
+ return;
2604
+ }
2097
2605
 
2098
- // body support
2099
- if (tag == 'body') {
2100
- var el = doc.createElement('html');
2101
- el.innerHTML = html;
2102
- return el.removeChild(el.lastChild);
2606
+ if (!isFragment(parsed)) {
2607
+ // extract <svg> from parsed document
2608
+ parsed = parsed.documentElement;
2103
2609
  }
2104
2610
 
2105
- // wrap map
2106
- var wrap = map$1[tag] || map$1._default;
2107
- var depth = wrap[0];
2108
- var prefix = wrap[1];
2109
- var suffix = wrap[2];
2110
- var el = doc.createElement('div');
2111
- el.innerHTML = prefix + html + suffix;
2112
- while (depth--) el = el.lastChild;
2611
+ var nodes = slice(parsed.childNodes);
2113
2612
 
2114
- // one element
2115
- if (el.firstChild == el.lastChild) {
2116
- return el.removeChild(el.firstChild);
2613
+ // import + append each node
2614
+ for (var i = 0; i < nodes.length; i++) {
2615
+ appendTo$1(nodes[i], element);
2117
2616
  }
2118
2617
 
2119
- // several elements
2120
- var fragment = doc.createDocumentFragment();
2121
- while (el.firstChild) {
2122
- fragment.appendChild(el.removeChild(el.firstChild));
2618
+ }
2619
+
2620
+ function get(element) {
2621
+ var child = element.firstChild,
2622
+ output = [];
2623
+
2624
+ while (child) {
2625
+ serialize(child, output);
2626
+ child = child.nextSibling;
2123
2627
  }
2124
2628
 
2125
- return fragment;
2629
+ return output.join('');
2126
2630
  }
2127
2631
 
2128
- function query(selector, el) {
2129
- el = el || document;
2130
-
2131
- return el.querySelector(selector);
2632
+ function isFragment(node) {
2633
+ return node.nodeName === '#document-fragment';
2132
2634
  }
2133
2635
 
2134
- function all(selector, el) {
2135
- el = el || document;
2636
+ function innerSVG(element, svg) {
2136
2637
 
2137
- return el.querySelectorAll(selector);
2638
+ if (svg !== undefined) {
2639
+
2640
+ try {
2641
+ set(element, svg);
2642
+ } catch (e) {
2643
+ throw new Error('error parsing SVG: ' + e.message);
2644
+ }
2645
+
2646
+ return element;
2647
+ } else {
2648
+ return get(element);
2649
+ }
2138
2650
  }
2139
2651
 
2140
- function remove$1(el) {
2141
- el.parentNode && el.parentNode.removeChild(el);
2652
+
2653
+ function slice(arr) {
2654
+ return Array.prototype.slice.call(arr);
2142
2655
  }
2143
2656
 
2144
2657
  /**
@@ -2390,16 +2903,16 @@
2390
2903
  // fix for safari / chrome / firefox bug not correctly
2391
2904
  // resetting stroke dash array
2392
2905
  if (attrs.strokeDasharray === 'none') {
2393
- attrs.strokeDasharray = [10000, 1];
2906
+ attrs.strokeDasharray = [ 10000, 1 ];
2394
2907
  }
2395
2908
 
2396
- var marker = create('marker');
2909
+ var marker = create$1('marker');
2397
2910
 
2398
- attr(options.element, attrs);
2911
+ attr$2(options.element, attrs);
2399
2912
 
2400
- append(marker, options.element);
2913
+ append$1(marker, options.element);
2401
2914
 
2402
- attr(marker, {
2915
+ attr$2(marker, {
2403
2916
  id: id,
2404
2917
  viewBox: '0 0 20 20',
2405
2918
  refX: ref.x,
@@ -2412,12 +2925,12 @@
2412
2925
  var defs = query('defs', canvas._svg);
2413
2926
 
2414
2927
  if (!defs) {
2415
- defs = create('defs');
2928
+ defs = create$1('defs');
2416
2929
 
2417
- append(canvas._svg, defs);
2930
+ append$1(canvas._svg, defs);
2418
2931
  }
2419
2932
 
2420
- append(defs, marker);
2933
+ append$1(defs, marker);
2421
2934
 
2422
2935
  markers[id] = marker;
2423
2936
  }
@@ -2441,8 +2954,8 @@
2441
2954
  function createMarker(id, type, fill, stroke) {
2442
2955
 
2443
2956
  if (type === 'sequenceflow-end') {
2444
- var sequenceflowEnd = create('path');
2445
- attr(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
2957
+ var sequenceflowEnd = create$1('path');
2958
+ attr$2(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
2446
2959
 
2447
2960
  addMarker(id, {
2448
2961
  element: sequenceflowEnd,
@@ -2456,8 +2969,8 @@
2456
2969
  }
2457
2970
 
2458
2971
  if (type === 'messageflow-start') {
2459
- var messageflowStart = create('circle');
2460
- attr(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
2972
+ var messageflowStart = create$1('circle');
2973
+ attr$2(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
2461
2974
 
2462
2975
  addMarker(id, {
2463
2976
  element: messageflowStart,
@@ -2470,8 +2983,8 @@
2470
2983
  }
2471
2984
 
2472
2985
  if (type === 'messageflow-end') {
2473
- var messageflowEnd = create('path');
2474
- attr(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
2986
+ var messageflowEnd = create$1('path');
2987
+ attr$2(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
2475
2988
 
2476
2989
  addMarker(id, {
2477
2990
  element: messageflowEnd,
@@ -2485,8 +2998,8 @@
2485
2998
  }
2486
2999
 
2487
3000
  if (type === 'association-start') {
2488
- var associationStart = create('path');
2489
- attr(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
3001
+ var associationStart = create$1('path');
3002
+ attr$2(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
2490
3003
 
2491
3004
  addMarker(id, {
2492
3005
  element: associationStart,
@@ -2501,8 +3014,8 @@
2501
3014
  }
2502
3015
 
2503
3016
  if (type === 'association-end') {
2504
- var associationEnd = create('path');
2505
- attr(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
3017
+ var associationEnd = create$1('path');
3018
+ attr$2(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
2506
3019
 
2507
3020
  addMarker(id, {
2508
3021
  element: associationEnd,
@@ -2517,8 +3030,8 @@
2517
3030
  }
2518
3031
 
2519
3032
  if (type === 'conditional-flow-marker') {
2520
- var conditionalflowMarker = create('path');
2521
- attr(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
3033
+ var conditionalflowMarker = create$1('path');
3034
+ attr$2(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
2522
3035
 
2523
3036
  addMarker(id, {
2524
3037
  element: conditionalflowMarker,
@@ -2532,8 +3045,8 @@
2532
3045
  }
2533
3046
 
2534
3047
  if (type === 'conditional-default-flow-marker') {
2535
- var conditionaldefaultflowMarker = create('path');
2536
- attr(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
3048
+ var conditionaldefaultflowMarker = create$1('path');
3049
+ attr$2(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
2537
3050
 
2538
3051
  addMarker(id, {
2539
3052
  element: conditionaldefaultflowMarker,
@@ -2568,15 +3081,15 @@
2568
3081
  var cx = width / 2,
2569
3082
  cy = height / 2;
2570
3083
 
2571
- var circle = create('circle');
2572
- attr(circle, {
3084
+ var circle = create$1('circle');
3085
+ attr$2(circle, {
2573
3086
  cx: cx,
2574
3087
  cy: cy,
2575
3088
  r: Math.round((width + height) / 4 - offset)
2576
3089
  });
2577
- attr(circle, attrs);
3090
+ attr$2(circle, attrs);
2578
3091
 
2579
- append(parentGfx, circle);
3092
+ append$1(parentGfx, circle);
2580
3093
 
2581
3094
  return circle;
2582
3095
  }
@@ -2596,8 +3109,8 @@
2596
3109
  fill: 'white'
2597
3110
  });
2598
3111
 
2599
- var rect = create('rect');
2600
- attr(rect, {
3112
+ var rect = create$1('rect');
3113
+ attr$2(rect, {
2601
3114
  x: offset,
2602
3115
  y: offset,
2603
3116
  width: width - offset * 2,
@@ -2605,9 +3118,9 @@
2605
3118
  rx: r,
2606
3119
  ry: r
2607
3120
  });
2608
- attr(rect, attrs);
3121
+ attr$2(rect, attrs);
2609
3122
 
2610
- append(parentGfx, rect);
3123
+ append$1(parentGfx, rect);
2611
3124
 
2612
3125
  return rect;
2613
3126
  }
@@ -2617,7 +3130,7 @@
2617
3130
  var x_2 = width / 2;
2618
3131
  var y_2 = height / 2;
2619
3132
 
2620
- var points = [{ x: x_2, y: 0 }, { x: width, y: y_2 }, { x: x_2, y: height }, { x: 0, y: y_2 }];
3133
+ var points = [ { x: x_2, y: 0 }, { x: width, y: y_2 }, { x: x_2, y: height }, { x: 0, y: y_2 } ];
2621
3134
 
2622
3135
  var pointsString = points.map(function(point) {
2623
3136
  return point.x + ',' + point.y;
@@ -2629,13 +3142,13 @@
2629
3142
  fill: 'white'
2630
3143
  });
2631
3144
 
2632
- var polygon = create('polygon');
2633
- attr(polygon, {
3145
+ var polygon = create$1('polygon');
3146
+ attr$2(polygon, {
2634
3147
  points: pointsString
2635
3148
  });
2636
- attr(polygon, attrs);
3149
+ attr$2(polygon, attrs);
2637
3150
 
2638
- append(parentGfx, polygon);
3151
+ append$1(parentGfx, polygon);
2639
3152
 
2640
3153
  return polygon;
2641
3154
  }
@@ -2649,7 +3162,7 @@
2649
3162
 
2650
3163
  var line = createLine(waypoints, attrs);
2651
3164
 
2652
- append(parentGfx, line);
3165
+ append$1(parentGfx, line);
2653
3166
 
2654
3167
  return line;
2655
3168
  }
@@ -2661,11 +3174,11 @@
2661
3174
  stroke: black
2662
3175
  });
2663
3176
 
2664
- var path = create('path');
2665
- attr(path, { d: d });
2666
- attr(path, attrs);
3177
+ var path = create$1('path');
3178
+ attr$2(path, { d: d });
3179
+ attr$2(path, attrs);
2667
3180
 
2668
- append(parentGfx, path);
3181
+ append$1(parentGfx, path);
2669
3182
 
2670
3183
  return path;
2671
3184
  }
@@ -2689,7 +3202,7 @@
2689
3202
  var event = getSemantic(element);
2690
3203
  var isThrowing = isThrowEvent(event);
2691
3204
 
2692
- if (event.eventDefinitions && event.eventDefinitions.length>1) {
3205
+ if (event.eventDefinitions && event.eventDefinitions.length > 1) {
2693
3206
  if (event.parallelMultiple) {
2694
3207
  return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, isThrowing);
2695
3208
  }
@@ -2751,9 +3264,9 @@
2751
3264
 
2752
3265
  var text = textRenderer.createText(label || '', options);
2753
3266
 
2754
- classes(text).add('djs-label');
3267
+ classes$2(text).add('djs-label');
2755
3268
 
2756
- append(parentGfx, text);
3269
+ append$1(parentGfx, text);
2757
3270
 
2758
3271
  return text;
2759
3272
  }
@@ -3363,7 +3876,7 @@
3363
3876
  });
3364
3877
 
3365
3878
  var businessHeaderPath = drawPath(parentGfx, headerPathData);
3366
- attr(businessHeaderPath, {
3879
+ attr$2(businessHeaderPath, {
3367
3880
  strokeWidth: 1,
3368
3881
  fill: getFillColor(element, '#aaaaaa'),
3369
3882
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3377,7 +3890,7 @@
3377
3890
  });
3378
3891
 
3379
3892
  var businessPath = drawPath(parentGfx, headerData);
3380
- attr(businessPath, {
3893
+ attr$2(businessPath, {
3381
3894
  strokeWidth: 1,
3382
3895
  stroke: getStrokeColor(element, defaultStrokeColor)
3383
3896
  });
@@ -3395,7 +3908,7 @@
3395
3908
  var expanded = isExpanded(element);
3396
3909
 
3397
3910
  if (isEventSubProcess(element)) {
3398
- attr(rect, {
3911
+ attr$2(rect, {
3399
3912
  strokeDasharray: '1,2'
3400
3913
  });
3401
3914
  }
@@ -3405,7 +3918,7 @@
3405
3918
  if (expanded) {
3406
3919
  attachTaskMarkers(parentGfx, element);
3407
3920
  } else {
3408
- attachTaskMarkers(parentGfx, element, ['SubProcessMarker']);
3921
+ attachTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ]);
3409
3922
  }
3410
3923
 
3411
3924
  return rect;
@@ -3617,7 +4130,7 @@
3617
4130
  });
3618
4131
 
3619
4132
  var parallelPath = drawPath(parentGfx, pathData);
3620
- attr(parallelPath, {
4133
+ attr$2(parallelPath, {
3621
4134
  strokeWidth: 1,
3622
4135
  fill: 'none'
3623
4136
  });
@@ -3625,7 +4138,7 @@
3625
4138
 
3626
4139
  if (!instantiate) {
3627
4140
  var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26);
3628
- attr(innerCircle, {
4141
+ attr$2(innerCircle, {
3629
4142
  strokeWidth: 1,
3630
4143
  fill: 'none',
3631
4144
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3670,7 +4183,7 @@
3670
4183
 
3671
4184
  // conditional flow marker
3672
4185
  if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Activity')) {
3673
- attr(path, {
4186
+ attr$2(path, {
3674
4187
  markerStart: marker('conditional-flow-marker', fill, stroke)
3675
4188
  });
3676
4189
  }
@@ -3678,7 +4191,7 @@
3678
4191
  // default marker
3679
4192
  if (source.default && (source.$instanceOf('bpmn:Gateway') || source.$instanceOf('bpmn:Activity')) &&
3680
4193
  source.default === sequenceFlow) {
3681
- attr(path, {
4194
+ attr$2(path, {
3682
4195
  markerStart: marker('conditional-default-flow-marker', fill, stroke)
3683
4196
  });
3684
4197
  }
@@ -4739,22 +5252,22 @@
4739
5252
  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}',
4740
5253
  height: 36,
4741
5254
  width: 36,
4742
- heightElements: [6, 14],
4743
- widthElements: [10.5, 21]
5255
+ heightElements: [ 6, 14 ],
5256
+ widthElements: [ 10.5, 21 ]
4744
5257
  },
4745
5258
  'EVENT_SIGNAL': {
4746
5259
  d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
4747
5260
  height: 36,
4748
5261
  width: 36,
4749
- heightElements: [18],
4750
- widthElements: [10, 20]
5262
+ heightElements: [ 18 ],
5263
+ widthElements: [ 10, 20 ]
4751
5264
  },
4752
5265
  'EVENT_ESCALATION': {
4753
5266
  d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z',
4754
5267
  height: 36,
4755
5268
  width: 36,
4756
- heightElements: [20, 7],
4757
- widthElements: [8]
5269
+ heightElements: [ 20, 7 ],
5270
+ widthElements: [ 8 ]
4758
5271
  },
4759
5272
  'EVENT_CONDITIONAL': {
4760
5273
  d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
@@ -4766,67 +5279,67 @@
4766
5279
  'M {e.x2},{e.y8} l {e.x0},0 ',
4767
5280
  height: 36,
4768
5281
  width: 36,
4769
- heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
4770
- widthElements: [10.5, 14.5, 12.5]
5282
+ heightElements: [ 8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5 ],
5283
+ widthElements: [ 10.5, 14.5, 12.5 ]
4771
5284
  },
4772
5285
  'EVENT_LINK': {
4773
5286
  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',
4774
5287
  height: 36,
4775
5288
  width: 36,
4776
- heightElements: [4.4375, 6.75, 7.8125],
4777
- widthElements: [9.84375, 13.5]
5289
+ heightElements: [ 4.4375, 6.75, 7.8125 ],
5290
+ widthElements: [ 9.84375, 13.5 ]
4778
5291
  },
4779
5292
  'EVENT_ERROR': {
4780
5293
  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',
4781
5294
  height: 36,
4782
5295
  width: 36,
4783
- heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
4784
- widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
5296
+ heightElements: [ 0.023, 8.737, 8.151, 16.564, 10.591, 8.714 ],
5297
+ widthElements: [ 0.085, 6.672, 6.97, 4.273, 5.337, 6.636 ]
4785
5298
  },
4786
5299
  'EVENT_CANCEL_45': {
4787
5300
  d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
4788
5301
  '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
4789
5302
  height: 36,
4790
5303
  width: 36,
4791
- heightElements: [4.75, 8.5],
4792
- widthElements: [4.75, 8.5]
5304
+ heightElements: [ 4.75, 8.5 ],
5305
+ widthElements: [ 4.75, 8.5 ]
4793
5306
  },
4794
5307
  'EVENT_COMPENSATION': {
4795
5308
  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',
4796
5309
  height: 36,
4797
5310
  width: 36,
4798
- heightElements: [6.5, 13, 0.4, 6.1],
4799
- widthElements: [9, 9.3, 8.7]
5311
+ heightElements: [ 6.5, 13, 0.4, 6.1 ],
5312
+ widthElements: [ 9, 9.3, 8.7 ]
4800
5313
  },
4801
5314
  'EVENT_TIMER_WH': {
4802
5315
  d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
4803
5316
  height: 36,
4804
5317
  width: 36,
4805
- heightElements: [10, 2],
4806
- widthElements: [3, 7]
5318
+ heightElements: [ 10, 2 ],
5319
+ widthElements: [ 3, 7 ]
4807
5320
  },
4808
5321
  'EVENT_TIMER_LINE': {
4809
5322
  d: 'M {mx},{my} ' +
4810
5323
  'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
4811
5324
  height: 36,
4812
5325
  width: 36,
4813
- heightElements: [10, 3],
4814
- widthElements: [0, 0]
5326
+ heightElements: [ 10, 3 ],
5327
+ widthElements: [ 0, 0 ]
4815
5328
  },
4816
5329
  'EVENT_MULTIPLE': {
4817
5330
  d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
4818
5331
  height: 36,
4819
5332
  width: 36,
4820
- heightElements: [6.28099, 12.56199],
4821
- widthElements: [3.1405, 9.42149, 12.56198]
5333
+ heightElements: [ 6.28099, 12.56199 ],
5334
+ widthElements: [ 3.1405, 9.42149, 12.56198 ]
4822
5335
  },
4823
5336
  'EVENT_PARALLEL_MULTIPLE': {
4824
5337
  d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
4825
5338
  '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
4826
5339
  height: 36,
4827
5340
  width: 36,
4828
- heightElements: [2.56228, 7.68683],
4829
- widthElements: [2.56228, 7.68683]
5341
+ heightElements: [ 2.56228, 7.68683 ],
5342
+ widthElements: [ 2.56228, 7.68683 ]
4830
5343
  },
4831
5344
  'GATEWAY_EXCLUSIVE': {
4832
5345
  d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
@@ -4834,23 +5347,23 @@
4834
5347
  '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
4835
5348
  height: 17.5,
4836
5349
  width: 17.5,
4837
- heightElements: [8.5, 6.5312, -6.5312, -8.5],
4838
- widthElements: [6.5, -6.5, 3, -3, 5, -5]
5350
+ heightElements: [ 8.5, 6.5312, -6.5312, -8.5 ],
5351
+ widthElements: [ 6.5, -6.5, 3, -3, 5, -5 ]
4839
5352
  },
4840
5353
  'GATEWAY_PARALLEL': {
4841
5354
  d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
4842
5355
  '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
4843
5356
  height: 30,
4844
5357
  width: 30,
4845
- heightElements: [5, 12.5],
4846
- widthElements: [5, 12.5]
5358
+ heightElements: [ 5, 12.5 ],
5359
+ widthElements: [ 5, 12.5 ]
4847
5360
  },
4848
5361
  'GATEWAY_EVENT_BASED': {
4849
5362
  d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
4850
5363
  height: 11,
4851
5364
  width: 11,
4852
- heightElements: [-6, 6, 12, -12],
4853
- widthElements: [9, -3, -12]
5365
+ heightElements: [ -6, 6, 12, -12 ],
5366
+ widthElements: [ 9, -3, -12 ]
4854
5367
  },
4855
5368
  'GATEWAY_COMPLEX': {
4856
5369
  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} ' +
@@ -4859,15 +5372,15 @@
4859
5372
  '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
4860
5373
  height: 17.125,
4861
5374
  width: 17.125,
4862
- heightElements: [4.875, 3.4375, 2.125, 3],
4863
- widthElements: [3.4375, 2.125, 4.875, 3]
5375
+ heightElements: [ 4.875, 3.4375, 2.125, 3 ],
5376
+ widthElements: [ 3.4375, 2.125, 4.875, 3 ]
4864
5377
  },
4865
5378
  'DATA_OBJECT_PATH': {
4866
5379
  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',
4867
5380
  height: 61,
4868
5381
  width: 51,
4869
- heightElements: [10, 50, 60],
4870
- widthElements: [10, 40, 50, 60]
5382
+ heightElements: [ 10, 50, 60 ],
5383
+ widthElements: [ 10, 40, 50, 60 ]
4871
5384
  },
4872
5385
  'DATA_OBJECT_COLLECTION_PATH': {
4873
5386
  d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
@@ -4896,15 +5409,15 @@
4896
5409
  'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
4897
5410
  height: 61,
4898
5411
  width: 61,
4899
- heightElements: [7, 10, 45],
4900
- widthElements: [2, 58, 60]
5412
+ heightElements: [ 7, 10, 45 ],
5413
+ widthElements: [ 2, 58, 60 ]
4901
5414
  },
4902
5415
  'TEXT_ANNOTATION': {
4903
5416
  d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
4904
5417
  height: 30,
4905
5418
  width: 10,
4906
- heightElements: [30],
4907
- widthElements: [10]
5419
+ heightElements: [ 30 ],
5420
+ widthElements: [ 10 ]
4908
5421
  },
4909
5422
  'MARKER_SUB_PROCESS': {
4910
5423
  d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
@@ -4959,8 +5472,8 @@
4959
5472
  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}',
4960
5473
  height: 14,
4961
5474
  width: 21,
4962
- heightElements: [6, 14],
4963
- widthElements: [10.5, 21]
5475
+ heightElements: [ 6, 14 ],
5476
+ widthElements: [ 10.5, 21 ]
4964
5477
  },
4965
5478
  'TASK_TYPE_SCRIPT': {
4966
5479
  d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
@@ -4971,8 +5484,8 @@
4971
5484
  'm -4,3 l 5,0',
4972
5485
  height: 15,
4973
5486
  width: 12.6,
4974
- heightElements: [6, 14],
4975
- widthElements: [10.5, 21]
5487
+ heightElements: [ 6, 14 ],
5488
+ widthElements: [ 10.5, 21 ]
4976
5489
  },
4977
5490
  'TASK_TYPE_USER_1': {
4978
5491
  d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
@@ -5653,11 +6166,6 @@
5653
6166
  parentElement = this._canvas.findRoot(parentElement);
5654
6167
  }
5655
6168
 
5656
- // insert sequence flows behind other flow nodes (cf. #727)
5657
- if (is(semantic, 'bpmn:SequenceFlow')) {
5658
- parentIndex = 0;
5659
- }
5660
-
5661
6169
  this._canvas.addConnection(element, parentElement, parentIndex);
5662
6170
  } else {
5663
6171
  throw new Error(translate('unknown di {di} for element {semantic}', {
@@ -8419,7 +8927,7 @@
8419
8927
 
8420
8928
  // dataAssociations are children of the subprocess but rendered on process level
8421
8929
  // cf. https://github.com/bpmn-io/bpmn-js/issues/1619
8422
- if (isAny(bo, ['bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation'])) {
8930
+ if (isAny(bo, [ 'bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation' ])) {
8423
8931
  return false;
8424
8932
  }
8425
8933
 
@@ -8467,7 +8975,7 @@
8467
8975
  }, true);
8468
8976
 
8469
8977
 
8470
- this.executed(['shape.create', 'shape.move', 'shape.delete'], LOW_PRIORITY$3,
8978
+ this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$3,
8471
8979
  function(context) {
8472
8980
  var oldParent = context.oldParent,
8473
8981
  newParent = context.newParent || context.parent,
@@ -8484,7 +8992,7 @@
8484
8992
  }, true);
8485
8993
 
8486
8994
 
8487
- this.reverted(['shape.create', 'shape.move', 'shape.delete'], LOW_PRIORITY$3,
8995
+ this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$3,
8488
8996
  function(context) {
8489
8997
  var oldParent = context.oldParent,
8490
8998
  newParent = context.newParent || context.parent,
@@ -8603,7 +9111,7 @@
8603
9111
 
8604
9112
  var DrilldownModdule = {
8605
9113
  __depends__: [ OverlaysModule, ChangeSupportModule, RootElementsModule ],
8606
- __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility'],
9114
+ __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility' ],
8607
9115
  drilldownBreadcrumbs: [ 'type', DrilldownBreadcrumbs ],
8608
9116
  drilldownCentering: [ 'type', DrilldownCentering ],
8609
9117
  drilldownOverlayBehavior: [ 'type', DrilldownOverlayBehavior ],
@@ -8931,20 +9439,11 @@
8931
9439
  return function() {
8932
9440
  initializers.forEach(function(initializer) {
8933
9441
 
8934
- try {
8935
-
8936
- // eagerly resolve component (fn or string)
8937
- if (typeof initializer === 'string') {
8938
- injector.get(initializer);
8939
- } else {
8940
- injector.invoke(initializer);
8941
- }
8942
- } catch (error) {
8943
- if (typeof AggregateError !== 'undefined') {
8944
- throw new AggregateError([ error ], 'Failed to initialize!');
8945
- }
8946
-
8947
- throw new Error('Failed to initialize! ' + error.message);
9442
+ // eagerly resolve component (fn or string)
9443
+ if (typeof initializer === 'string') {
9444
+ injector.get(initializer);
9445
+ } else {
9446
+ injector.invoke(initializer);
8948
9447
  }
8949
9448
  });
8950
9449
  };
@@ -9260,7 +9759,7 @@
9260
9759
  *
9261
9760
  * @return {number} the previous index of the element
9262
9761
  */
9263
- function remove$2(collection, element) {
9762
+ function remove$3(collection, element) {
9264
9763
 
9265
9764
  if (!collection || !element) {
9266
9765
  return -1;
@@ -10212,7 +10711,7 @@
10212
10711
  graphicsFactory.remove(element);
10213
10712
 
10214
10713
  // unset parent <-> child relationship
10215
- remove$2(element.parent && element.parent.children, element);
10714
+ remove$3(element.parent && element.parent.children, element);
10216
10715
  element.parent = null;
10217
10716
 
10218
10717
  eventBus.fire(type + '.removed', { element: element });
@@ -11536,7 +12035,7 @@
11536
12035
  *
11537
12036
  * @return {Base} the new model instance
11538
12037
  */
11539
- function create$1(type, attrs) {
12038
+ function create$2(type, attrs) {
11540
12039
  var Type = types[type];
11541
12040
  if (!Type) {
11542
12041
  throw new Error('unknown type: <' + type + '>');
@@ -11584,7 +12083,7 @@
11584
12083
  attrs.id = type + '_' + (this._uid++);
11585
12084
  }
11586
12085
 
11587
- return create$1(type, attrs);
12086
+ return create$2(type, attrs);
11588
12087
  };
11589
12088
 
11590
12089
  var FN_REF = '__fn';
@@ -16105,7 +16604,23 @@
16105
16604
  value = escapeAttr(value);
16106
16605
  }
16107
16606
 
16108
- attrs.push({ name: name, value: value });
16607
+ // de-duplicate attributes
16608
+ // https://github.com/bpmn-io/moddle-xml/issues/66
16609
+ var idx = findIndex(attrs, function(element) {
16610
+ return (
16611
+ element.name.localName === name.localName &&
16612
+ element.name.uri === name.uri &&
16613
+ element.name.prefix === name.prefix
16614
+ );
16615
+ });
16616
+
16617
+ var attr = { name: name, value: value };
16618
+
16619
+ if (idx !== -1) {
16620
+ attrs.splice(idx, 1, attr);
16621
+ } else {
16622
+ attrs.push(attr);
16623
+ }
16109
16624
  };
16110
16625
 
16111
16626
  ElementSerializer.prototype.serializeAttributes = function(writer) {
@@ -16365,12 +16880,12 @@
16365
16880
  });
16366
16881
  };
16367
16882
 
16368
- var name = "BPMN20";
16369
- var uri = "http://www.omg.org/spec/BPMN/20100524/MODEL";
16370
- var prefix$1 = "bpmn";
16371
- var associations = [
16883
+ var name$5 = "BPMN20";
16884
+ var uri$5 = "http://www.omg.org/spec/BPMN/20100524/MODEL";
16885
+ var prefix$5 = "bpmn";
16886
+ var associations$5 = [
16372
16887
  ];
16373
- var types$1 = [
16888
+ var types$5 = [
16374
16889
  {
16375
16890
  name: "Interface",
16376
16891
  superClass: [
@@ -19188,7 +19703,7 @@
19188
19703
  ]
19189
19704
  }
19190
19705
  ];
19191
- var enumerations = [
19706
+ var enumerations$3 = [
19192
19707
  {
19193
19708
  name: "ProcessType",
19194
19709
  literalValues: [
@@ -19319,24 +19834,24 @@
19319
19834
  ]
19320
19835
  }
19321
19836
  ];
19322
- var xml = {
19837
+ var xml$1 = {
19323
19838
  tagAlias: "lowerCase",
19324
19839
  typePrefix: "t"
19325
19840
  };
19326
19841
  var BpmnPackage = {
19327
- name: name,
19328
- uri: uri,
19329
- prefix: prefix$1,
19330
- associations: associations,
19331
- types: types$1,
19332
- enumerations: enumerations,
19333
- xml: xml
19842
+ name: name$5,
19843
+ uri: uri$5,
19844
+ prefix: prefix$5,
19845
+ associations: associations$5,
19846
+ types: types$5,
19847
+ enumerations: enumerations$3,
19848
+ xml: xml$1
19334
19849
  };
19335
19850
 
19336
- var name$1 = "BPMNDI";
19337
- var uri$1 = "http://www.omg.org/spec/BPMN/20100524/DI";
19338
- var prefix$1$1 = "bpmndi";
19339
- var types$1$1 = [
19851
+ var name$4 = "BPMNDI";
19852
+ var uri$4 = "http://www.omg.org/spec/BPMN/20100524/DI";
19853
+ var prefix$4 = "bpmndi";
19854
+ var types$4 = [
19340
19855
  {
19341
19856
  name: "BPMNDiagram",
19342
19857
  properties: [
@@ -19487,7 +20002,7 @@
19487
20002
  ]
19488
20003
  }
19489
20004
  ];
19490
- var enumerations$1 = [
20005
+ var enumerations$2 = [
19491
20006
  {
19492
20007
  name: "ParticipantBandKind",
19493
20008
  literalValues: [
@@ -19523,21 +20038,21 @@
19523
20038
  ]
19524
20039
  }
19525
20040
  ];
19526
- var associations$1 = [
20041
+ var associations$4 = [
19527
20042
  ];
19528
20043
  var BpmnDiPackage = {
19529
- name: name$1,
19530
- uri: uri$1,
19531
- prefix: prefix$1$1,
19532
- types: types$1$1,
19533
- enumerations: enumerations$1,
19534
- associations: associations$1
20044
+ name: name$4,
20045
+ uri: uri$4,
20046
+ prefix: prefix$4,
20047
+ types: types$4,
20048
+ enumerations: enumerations$2,
20049
+ associations: associations$4
19535
20050
  };
19536
20051
 
19537
- var name$2 = "DC";
19538
- var uri$2 = "http://www.omg.org/spec/DD/20100524/DC";
19539
- var prefix$2 = "dc";
19540
- var types$2 = [
20052
+ var name$3 = "DC";
20053
+ var uri$3 = "http://www.omg.org/spec/DD/20100524/DC";
20054
+ var prefix$3 = "dc";
20055
+ var types$3 = [
19541
20056
  {
19542
20057
  name: "Boolean"
19543
20058
  },
@@ -19630,20 +20145,20 @@
19630
20145
  ]
19631
20146
  }
19632
20147
  ];
19633
- var associations$2 = [
20148
+ var associations$3 = [
19634
20149
  ];
19635
20150
  var DcPackage = {
19636
- name: name$2,
19637
- uri: uri$2,
19638
- prefix: prefix$2,
19639
- types: types$2,
19640
- associations: associations$2
20151
+ name: name$3,
20152
+ uri: uri$3,
20153
+ prefix: prefix$3,
20154
+ types: types$3,
20155
+ associations: associations$3
19641
20156
  };
19642
20157
 
19643
- var name$3 = "DI";
19644
- var uri$3 = "http://www.omg.org/spec/DD/20100524/DI";
19645
- var prefix$3 = "di";
19646
- var types$3 = [
20158
+ var name$2 = "DI";
20159
+ var uri$2 = "http://www.omg.org/spec/DD/20100524/DI";
20160
+ var prefix$2 = "di";
20161
+ var types$2 = [
19647
20162
  {
19648
20163
  name: "DiagramElement",
19649
20164
  isAbstract: true,
@@ -19872,24 +20387,24 @@
19872
20387
  ]
19873
20388
  }
19874
20389
  ];
19875
- var associations$3 = [
20390
+ var associations$2 = [
19876
20391
  ];
19877
- var xml$1 = {
20392
+ var xml = {
19878
20393
  tagAlias: "lowerCase"
19879
20394
  };
19880
20395
  var DiPackage = {
19881
- name: name$3,
19882
- uri: uri$3,
19883
- prefix: prefix$3,
19884
- types: types$3,
19885
- associations: associations$3,
19886
- xml: xml$1
20396
+ name: name$2,
20397
+ uri: uri$2,
20398
+ prefix: prefix$2,
20399
+ types: types$2,
20400
+ associations: associations$2,
20401
+ xml: xml
19887
20402
  };
19888
20403
 
19889
- var name$4 = "bpmn.io colors for BPMN";
19890
- var uri$4 = "http://bpmn.io/schema/bpmn/biocolor/1.0";
19891
- var prefix$4 = "bioc";
19892
- var types$4 = [
20404
+ var name$1 = "bpmn.io colors for BPMN";
20405
+ var uri$1 = "http://bpmn.io/schema/bpmn/biocolor/1.0";
20406
+ var prefix$1 = "bioc";
20407
+ var types$1 = [
19893
20408
  {
19894
20409
  name: "ColoredShape",
19895
20410
  "extends": [
@@ -19927,23 +20442,23 @@
19927
20442
  ]
19928
20443
  }
19929
20444
  ];
19930
- var enumerations$2 = [
20445
+ var enumerations$1 = [
19931
20446
  ];
19932
- var associations$4 = [
20447
+ var associations$1 = [
19933
20448
  ];
19934
20449
  var BiocPackage = {
19935
- name: name$4,
19936
- uri: uri$4,
19937
- prefix: prefix$4,
19938
- types: types$4,
19939
- enumerations: enumerations$2,
19940
- associations: associations$4
20450
+ name: name$1,
20451
+ uri: uri$1,
20452
+ prefix: prefix$1,
20453
+ types: types$1,
20454
+ enumerations: enumerations$1,
20455
+ associations: associations$1
19941
20456
  };
19942
20457
 
19943
- var name$5 = "BPMN in Color";
19944
- var uri$5 = "http://www.omg.org/spec/BPMN/non-normative/color/1.0";
19945
- var prefix$5 = "color";
19946
- var types$5 = [
20458
+ var name = "BPMN in Color";
20459
+ var uri = "http://www.omg.org/spec/BPMN/non-normative/color/1.0";
20460
+ var prefix$6 = "color";
20461
+ var types$6 = [
19947
20462
  {
19948
20463
  name: "ColoredLabel",
19949
20464
  "extends": [
@@ -19989,17 +20504,17 @@
19989
20504
  ]
19990
20505
  }
19991
20506
  ];
19992
- var enumerations$3 = [
20507
+ var enumerations = [
19993
20508
  ];
19994
- var associations$5 = [
20509
+ var associations = [
19995
20510
  ];
19996
20511
  var BpmnInColorPackage = {
19997
- name: name$5,
19998
- uri: uri$5,
19999
- prefix: prefix$5,
20000
- types: types$5,
20001
- enumerations: enumerations$3,
20002
- associations: associations$5
20512
+ name: name,
20513
+ uri: uri,
20514
+ prefix: prefix$6,
20515
+ types: types$6,
20516
+ enumerations: enumerations,
20517
+ associations: associations
20003
20518
  };
20004
20519
 
20005
20520
  var packages = {
@@ -20079,6 +20594,7 @@
20079
20594
  // bpmnElement can have multiple independent DIs
20080
20595
  if (!has(businessObject, 'di')) {
20081
20596
  Object.defineProperty(businessObject, 'di', {
20597
+ enumerable: false,
20082
20598
  get: function() {
20083
20599
  throw new Error(DI_ERROR_MESSAGE);
20084
20600
  }
@@ -21648,6 +22164,16 @@
21648
22164
  // default moddle extensions the viewer is composed of
21649
22165
  Viewer.prototype._moddleExtensions = {};
21650
22166
 
22167
+ var KEYCODE_C = 67;
22168
+ var KEYCODE_V = 86;
22169
+ var KEYCODE_Y = 89;
22170
+ var KEYCODE_Z = 90;
22171
+
22172
+ var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
22173
+ var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
22174
+ var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
22175
+ var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
22176
+
21651
22177
  /**
21652
22178
  * Returns true if event was triggered with any modifier
21653
22179
  * @param {KeyboardEvent} event
@@ -21687,6 +22213,26 @@
21687
22213
  */
21688
22214
  function isShift(event) {
21689
22215
  return event.shiftKey;
22216
+ }
22217
+
22218
+ function isCopy(event) {
22219
+ return isCmd(event) && isKey(KEYS_COPY, event);
22220
+ }
22221
+
22222
+ function isPaste(event) {
22223
+ return isCmd(event) && isKey(KEYS_PASTE, event);
22224
+ }
22225
+
22226
+ function isUndo(event) {
22227
+ return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);
22228
+ }
22229
+
22230
+ function isRedo(event) {
22231
+ return isCmd(event) && (
22232
+ isKey(KEYS_REDO, event) || (
22233
+ isKey(KEYS_UNDO, event) && isShift(event)
22234
+ )
22235
+ );
21690
22236
  }
21691
22237
 
21692
22238
  var KEYDOWN_EVENT = 'keyboard.keydown',
@@ -21879,16 +22425,6 @@
21879
22425
 
21880
22426
  var LOW_PRIORITY$4 = 500;
21881
22427
 
21882
- var KEYCODE_C = 67;
21883
- var KEYCODE_V = 86;
21884
- var KEYCODE_Y = 89;
21885
- var KEYCODE_Z = 90;
21886
-
21887
- var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
21888
- var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
21889
- var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
21890
- var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
21891
-
21892
22428
 
21893
22429
  /**
21894
22430
  * Adds default keyboard bindings.
@@ -21946,7 +22482,7 @@
21946
22482
 
21947
22483
  var event = context.keyEvent;
21948
22484
 
21949
- if (isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event)) {
22485
+ if (isUndo(event)) {
21950
22486
  editorActions.trigger('undo');
21951
22487
 
21952
22488
  return true;
@@ -21960,7 +22496,7 @@
21960
22496
 
21961
22497
  var event = context.keyEvent;
21962
22498
 
21963
- if (isCmd(event) && (isKey(KEYS_REDO, event) || (isKey(KEYS_UNDO, event) && isShift(event)))) {
22499
+ if (isRedo(event)) {
21964
22500
  editorActions.trigger('redo');
21965
22501
 
21966
22502
  return true;
@@ -21973,7 +22509,7 @@
21973
22509
 
21974
22510
  var event = context.keyEvent;
21975
22511
 
21976
- if (isCmd(event) && isKey(KEYS_COPY, event)) {
22512
+ if (isCopy(event)) {
21977
22513
  editorActions.trigger('copy');
21978
22514
 
21979
22515
  return true;
@@ -21986,7 +22522,7 @@
21986
22522
 
21987
22523
  var event = context.keyEvent;
21988
22524
 
21989
- if (isCmd(event) && isKey(KEYS_PASTE, event)) {
22525
+ if (isPaste(event)) {
21990
22526
  editorActions.trigger('paste');
21991
22527
 
21992
22528
  return true;
@@ -22624,13 +23160,13 @@
22624
23160
 
22625
23161
  var name$6 = "Camunda";
22626
23162
  var uri$6 = "http://camunda.org/schema/1.0/bpmn";
22627
- var prefix$6 = "camunda";
23163
+ var prefix$7 = "camunda";
22628
23164
  var xml$2 = {
22629
23165
  tagAlias: "lowerCase"
22630
23166
  };
22631
23167
  var associations$6 = [
22632
23168
  ];
22633
- var types$6 = [
23169
+ var types$7 = [
22634
23170
  {
22635
23171
  name: "Definitions",
22636
23172
  isAbstract: true,
@@ -23787,10 +24323,10 @@
23787
24323
  var camundaModdle = {
23788
24324
  name: name$6,
23789
24325
  uri: uri$6,
23790
- prefix: prefix$6,
24326
+ prefix: prefix$7,
23791
24327
  xml: xml$2,
23792
24328
  associations: associations$6,
23793
- types: types$6,
24329
+ types: types$7,
23794
24330
  emumerations: emumerations
23795
24331
  };
23796
24332