camunda-bpmn-js 0.18.0 → 0.20.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.
@@ -1,3 +1,3 @@
1
- !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).BpmnNavigatedViewer=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=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0!==e}function r(e){return"[object Array]"===t.call(e)}function o(e){return"[object Object]"===t.call(e)}function a(e){return"[object Number]"===t.call(e)}function s(e){var n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function l(e){return"[object String]"===t.call(e)}function p(e,t){return n.call(e,t)}function c(e,t){var n;return t=g(t),h(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function u(e,t){var n=[];return h(e,(function(e,i){t(e,i)&&n.push(e)})),n}function h(e,t){var n;if(void 0!==e){var i=r(e)?b:v;for(var o in e)if(p(e,o)&&!1===t(n=e[o],i(o)))return n}}function m(e,t,n){return h(e,(function(e,i){n=t(n,e,i)})),n}function f(e,t){return!!m(e,(function(e,n,i){return e&&t(n,i)}),!0)}function d(e,t){return!!c(e,t)}function y(e){return function(t){return f(e,(function(e,n){return t[n]===e}))}}function g(e){return s(e)?e:function(t){return t===e}}function v(e){return e}function b(e){return Number(e)}function x(e,t){return e.bind(t)}function w(){return w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},w.apply(this,arguments)}function E(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return w.apply(void 0,[e].concat(n))}function _(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 A(e,t){var n=S(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function S(e){return e&&e.businessObject||e}function R(e){return e&&e.di}function C(e,t){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?!(!(t=t||R(e))||!A(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!A(e,"bpmn:Participant")||!!S(e).processRef)}function M(e){var t=e.businessObject,n=function(e){return A(e,"bpmn:FlowElement")||A(e,"bpmn:Participant")||A(e,"bpmn:Lane")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")?"name":A(e,"bpmn:TextAnnotation")?"text":A(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function k(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}_.prototype.canRender=function(){},_.prototype.drawShape=function(){},_.prototype.drawConnection=function(){},_.prototype.getShapePath=function(){},_.prototype.getConnectionPath=function(){};var P={"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 D(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=P[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function N(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return P[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);D(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)D(e,i,t[i])}(e,t);return e}function T(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var O=/\s+/,B=Object.prototype.toString;function L(e){return void 0!==e}function I(e){return new j(e)}function j(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function F(e){var t=e.parentNode;return t&&t.removeChild(e),e}j.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~T(t,e)||t.push(e),L(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},j.prototype.remove=function(e){if("[object RegExp]"===B.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=T(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},j.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},j.prototype.toggle=function(e,t){return this.list?(L(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(L(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},j.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(O);return""===e[0]&&e.shift(),e},j.prototype.has=j.prototype.contains=function(e){return this.list?this.list.contains(e):!!~T(this.array(),e)};var V="http://www.w3.org/2000/svg",z='<svg xmlns="'+V+'"';function W(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(V)&&(e=z+e.substring(4)):(e=z+">"+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 G(e,t){var n;return"<"===e.charAt(0)?(n=W(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(V,e),t&&N(n,t),n}var $=G("svg");function H(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function K(e){return e?$.createSVGTransformFromMatrix(e):$.createSVGTransform()}function U(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function q(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(U(e,i))}(n,t)),n.consolidate()}function Y(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function X(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function Z(e,t){var n=G("polyline");return N(n,{points:X(e)}),t&&N(n,t),n}var J="hsl(225, 10%, 15%)";function Q(e,t,n){return d(e.eventDefinitions,(function(i){return i.$type===t&&function(e,t){return f(t,(function(t,n){return e[n]==t}))}(e,n)}))}function ee(e){return e.businessObject}function te(e,t){var n=R(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function ne(e,t){var n=R(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||J}function ie(e,t,n){var i=R(e).get("label");return i&&i.get("color:color")||t||ne(e,n)}var re=Object.prototype.toString,oe=Object.prototype.hasOwnProperty;function ae(e,t){return oe.call(e,t)}function se(e,t){var n;if(void 0!==e){var i=function(e){return"[object Array]"===re.call(e)}(e)?pe:le;for(var r in e)if(ae(e,r)&&!1===t(n=e[r],i(r)))return n}}function le(e){return e}function pe(e){return Number(e)}function ce(e){for(var t=e.style,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return se(i,(function(e){e&&se(e,(function(e,n){t[n]=e}))})),e}var ue=[].indexOf,he=function(e,t){if(ue)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},me=/\s+/,fe=Object.prototype.toString;function de(e){return new ye(e)}function ye(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ge(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}ye.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~he(t,e)||t.push(e),this.el.className=t.join(" "),this},ye.prototype.remove=function(e){if("[object RegExp]"==fe.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=he(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},ye.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ye.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},ye.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(me);return""===e[0]&&e.shift(),e},ye.prototype.has=ye.prototype.contains=function(e){return this.list?this.list.contains(e):!!~he(this.array(),e)};var ve="undefined"!=typeof Element?Element.prototype:{},be=ve.matches||ve.matchesSelector||ve.webkitMatchesSelector||ve.mozMatchesSelector||ve.msMatchesSelector||ve.oMatchesSelector,xe=function(e,t){if(!e||1!==e.nodeType)return!1;if(be)return be.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0;return!1};function we(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(xe(i,t))return i;i=i.parentNode}return xe(i,t)?i:null}var Ee=window.addEventListener?"addEventListener":"attachEvent",_e=window.removeEventListener?"removeEventListener":"detachEvent",Ae="addEventListener"!==Ee?"on":"",Se={bind:function(e,t,n,i){return e[Ee](Ae+t,n,i||!1),n},unbind:function(e,t,n,i){return e[_e](Ae+t,n,i||!1),n}},Re=["focus","blur"];var Ce,Me={bind:function(e,t,n,i,r){return-1!==Re.indexOf(n)&&(r=!0),Se.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=we(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==Re.indexOf(t)&&(i=!0),Se.unbind(e,t,n,i)}},ke=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=De[i]||De._default,a=o[0],s=o[1],l=o[2];(r=t.createElement("div")).innerHTML=s+e+l;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},Pe=!1;"undefined"!=typeof document&&((Ce=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Pe=!Ce.getElementsByTagName("link").length,Ce=void 0);var De={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Pe?[1,"X<div>","</div>"]:[0,"",""]};function Ne(e,t){return(t=t||document).querySelector(e)}function Te(e){e.parentNode&&e.parentNode.removeChild(e)}function Oe(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 Be(e,t){return Oe(t,e),e}De.td=De.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],De.option=De.optgroup=[1,'<select multiple="multiple">',"</select>"],De.thead=De.tbody=De.colgroup=De.caption=De.tfoot=[1,"<table>","</table>"],De.polyline=De.ellipse=De.polygon=De.circle=De.text=De.line=De.path=De.rect=De.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Le={"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 Ie(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Le[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function je(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Le[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Ie(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)Ie(e,i,t[i])}(e,t);return e}function Fe(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var Ve=/\s+/,ze=Object.prototype.toString;function We(e){return void 0!==e}function Ge(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function $e(e){var t=e.parentNode;return t&&t.removeChild(e),e}Ge.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Fe(t,e)||t.push(e),We(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},Ge.prototype.remove=function(e){if("[object RegExp]"===ze.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Fe(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},Ge.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ge.prototype.toggle=function(e,t){return this.list?(We(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(We(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Ge.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Ve);return""===e[0]&&e.shift(),e},Ge.prototype.has=Ge.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Fe(this.array(),e)};var He="http://www.w3.org/2000/svg",Ke='<svg xmlns="'+He+'"';function Ue(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(He)&&(e=Ke+e.substring(4)):(e=Ke+">"+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 qe(e,t){var n;return"<"===e.charAt(0)?(n=Ue(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(He,e),t&&je(n,t),n}var Ye=/([&<>]{1})/g,Xe=/([\n\r"]{1})/g,Ze={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Je(e,t){return e.replace(t,(function(e,t){return Ze[t]||t}))}function Qe(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Je(e.textContent,Ye));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,'="',Je(o.value,Xe),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)Qe(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Je(e.nodeValue,Ye),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function et(e,t){var n=Ue(t);if(function(e){for(var t;t=e.firstChild;)$e(t)}(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++)Oe(r[o],e)}}function tt(e,t){if(void 0!==t){try{et(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Qe(t,n),t=t.nextSibling;return n.join("")}(e)}function nt(e,t,n,i,r){var o=K();o.setTranslate(t,n);var a=K();a.setRotate(i||0,0,0);var s=K();s.setScale(r||1,r||1),q(e,[o,a,s])}function it(e,t,n){var i=K();i.setTranslate(t,n),q(e,i)}var rt=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 l=parseInt(a,n);return l!==1/0&&l>=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 ot(e){if(!(this instanceof ot))return new ot(e);e=e||[128,36,1],this._seed=e.length?rt.rack(e[0],e[1],e[2]):e}ot.prototype.next=function(e){return this._seed(e||!0)},ot.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},ot.prototype.claim=function(e,t){this._seed.set(e,t||!0)},ot.prototype.assigned=function(e){return this._seed.get(e)||!1},ot.prototype.unclaim=function(e){delete this._seed.hats[e]},ot.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var at=new ot,st=.95;function lt(e,t,n,i,r,a,s){_.call(this,t,s);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=at.next(),m={},f=n.computeStyle;function d(e,t){var n=E({fill:J,strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=qe("marker");je(t.element,n),Be(a,t.element),je(a,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var s=Ne("defs",r._svg);s||(s=qe("defs"),Be(r._svg,s)),Be(s,a),m[e]=a}function y(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function g(e,t,n){var i=e+"-"+y(t)+"-"+y(n)+"-"+u;return m[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=qe("path");je(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),d(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var o=qe("circle");je(o,{cx:6,cy:6,r:3.5}),d(e,{element:o,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var a=qe("path");je(a,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),d(e,{element:a,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=qe("path");je(s,{d:"M 11 5 L 1 10 L 11 15"}),d(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var l=qe("path");je(l,{d:"M 1 5 L 11 10 L 1 15"}),d(e,{element:l,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var p=qe("path");je(p,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),d(e,{element:p,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var c=qe("path");je(c,{d:"M 6 4 L 10 16"}),d(e,{element:c,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function v(e,t,n,i,r){o(i)&&(r=i,i=0),i=i||0,"none"===(r=f(r,{stroke:J,strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var a=t/2,s=n/2,l=qe("circle");return je(l,{cx:a,cy:s,r:Math.round((t+n)/4-i)}),je(l,r),Be(e,l),l}function b(e,t,n,i,r,a){o(r)&&(a=r,r=0),r=r||0,a=f(a,{stroke:J,strokeWidth:2,fill:"white"});var s=qe("rect");return je(s,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),je(s,a),Be(e,s),s}function x(e,t,n){var i=Z(t,n=f(n,["no-fill"],{stroke:J,strokeWidth:2,fill:"none"}));return Be(e,i),i}function w(e,t,n){n=f(n,["no-fill"],{strokeWidth:2,stroke:J});var i=qe("path");return je(i,{d:t}),je(i,n),Be(e,i),i}function A(e,t,n,i){return w(t,n,E({"data-marker":e},i))}function k(e){return L[e]}function P(e){return function(t,n){return k(e)(t,n)}}function D(e,t){var n=ee(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?k("bpmn:ParallelMultipleEventDefinition")(t,e,i):k("bpmn:MultipleEventDefinition")(t,e,i):Q(n,"bpmn:MessageEventDefinition")?k("bpmn:MessageEventDefinition")(t,e,i):Q(n,"bpmn:TimerEventDefinition")?k("bpmn:TimerEventDefinition")(t,e,i):Q(n,"bpmn:ConditionalEventDefinition")?k("bpmn:ConditionalEventDefinition")(t,e):Q(n,"bpmn:SignalEventDefinition")?k("bpmn:SignalEventDefinition")(t,e,i):Q(n,"bpmn:EscalationEventDefinition")?k("bpmn:EscalationEventDefinition")(t,e,i):Q(n,"bpmn:LinkEventDefinition")?k("bpmn:LinkEventDefinition")(t,e,i):Q(n,"bpmn:ErrorEventDefinition")?k("bpmn:ErrorEventDefinition")(t,e,i):Q(n,"bpmn:CancelEventDefinition")?k("bpmn:CancelEventDefinition")(t,e,i):Q(n,"bpmn:CompensateEventDefinition")?k("bpmn:CompensateEventDefinition")(t,e,i):Q(n,"bpmn:TerminateEventDefinition")?k("bpmn:TerminateEventDefinition")(t,e,i):null}function N(e,t,n){n=E({size:{width:100}},n);var i,r=a.createText(t||"",n);return(i=r,new Ge(i)).add("djs-label"),Be(e,r),r}function T(e,t,n){return N(e,ee(t).name,{box:t,align:n,padding:5,style:{fill:ie(t,c,p)}})}function O(e,t,n){nt(N(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ie(n,c,p)}}),0,-(-1*n.height),270)}function B(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var L=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=st),v(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:te(t,l),stroke:ne(t,p)};ee(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:te(t,l),stroke:ne(t,p)});var i=k("bpmn:Event")(e,t,n);return D(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?ne(t,p):te(t,l),stroke:n?te(t,l):ne(t,p)})},"bpmn:TimerEventDefinition":function(e,t){var n=v(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:te(t,l),stroke:ne(t,p)});w(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:ne(t,p)});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,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:ne(t,p)})}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?ne(t,p):"none",stroke:ne(t,p)})},"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:ne(t,p)})},"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?ne(t,p):"none",stroke:ne(t,p)})},"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?ne(t,p):"none",stroke:ne(t,p)})},"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?ne(t,p):"none",stroke:ne(t,p)});return function(e,t){var n=K();n.setRotate(t,0,0),q(e,n)}(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?ne(t,p):"none",stroke:ne(t,p)})},"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?ne(t,p):"none",stroke:ne(t,p)})},"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?ne(t,p):"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:ne(t,p),stroke:ne(t,p)})},"bpmn:EndEvent":function(e,t){var n=k("bpmn:Event")(e,t,{strokeWidth:4,fill:te(t,l),stroke:ne(t,p)});return D(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return v(e,t.width,t.height,8,{strokeWidth:4,fill:ne(t,p),stroke:ne(t,p)})},"bpmn:IntermediateEvent":function(e,t){var n=k("bpmn:Event")(e,t,{strokeWidth:1,fill:te(t,l),stroke:ne(t,p)});return v(e,t.width,t.height,3,{strokeWidth:1,fill:te(t,"none"),stroke:ne(t,p)}),D(t,e),n},"bpmn:IntermediateCatchEvent":P("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":P("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=st),b(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:te(t,l),stroke:ne(t,p)},i=k("bpmn:Activity")(e,t,n);return T(e,t,"center-middle"),I(e,t),i},"bpmn:ServiceTask":function(e,t){var n=k("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:te(t,l),stroke:ne(t,p)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:te(t,l)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:te(t,l),stroke:ne(t,p)}),n},"bpmn:UserTask":function(e,t){var n=k("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:te(t,l),stroke:ne(t,p)}),w(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:te(t,l),stroke:ne(t,p)}),w(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ne(t,p),stroke:ne(t,p)}),n},"bpmn:ManualTask":function(e,t){var n=k("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:te(t,l),stroke:ne(t,p)}),n},"bpmn:SendTask":function(e,t){var n=k("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:ne(t,p),stroke:te(t,l)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=ee(t),o=k("bpmn:Task")(e,t);return r.instantiate?(v(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:te(t,l),stroke:ne(t,p)}),o},"bpmn:ScriptTask":function(e,t){var n=k("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:ne(t,p)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=k("bpmn:Task")(e,t);return je(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:te(t,"#aaaaaa"),stroke:ne(t,p)}),je(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:ne(t,p)}),n},"bpmn:SubProcess":function(e,t,n){n=E({fill:te(t,l),stroke:ne(t,p)},n);var i=k("bpmn:Activity")(e,t,n),r=C(t);return function(e){return e&&!!S(e).triggeredByEvent}(t)&&je(i,{strokeDasharray:"1,2"}),T(e,t,r?"center-top":"center-middle"),r?I(e,t):I(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return k("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=k("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:ne(t,p)});return b(e,t.width,t.height,8,3,r),i},"bpmn:CallActivity":function(e,t){return k("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:st,fill:te(t,l),stroke:ne(t,p)},i=k("bpmn:Lane")(e,t,n);C(t)?(x(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:ne(t,p)}),O(e,ee(t).name,t)):N(e,ee(t).name,{box:t,align:"center-middle",style:{fill:ie(t,c,p)}});return!!ee(t).participantMultiplicity&&k("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=b(e,t.width,t.height,0,E({fill:te(t,l),fillOpacity:.35,stroke:ne(t,p)},n)),r=ee(t);"bpmn:Lane"===r.$type&&O(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=k("bpmn:Gateway")(e,t);return v(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:te(t,l),stroke:ne(t,p)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=k("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 R(t).isMarkerVisible&&w(e,r,{strokeWidth:1,fill:ne(t,p),stroke:ne(t,p)}),n},"bpmn:ComplexGateway":function(e,t){var n=k("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:ne(t,p),stroke:ne(t,p)}),n},"bpmn:ParallelGateway":function(e,t){var n=k("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:ne(t,p),stroke:ne(t,p)}),n},"bpmn:EventBasedGateway":function(e,t){var n=ee(t),r=k("bpmn:Gateway")(e,t);v(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:ne(t,p)});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}});je(w(e,s),{strokeWidth:1,fill:"none"})}else if("Exclusive"===o){if(!a)je(v(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:ne(t,p)});!function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:te(t,"none"),stroke:ne(t,p)};w(e,n,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:te(t,l),fillOpacity:st,stroke:ne(t,p)};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=f(i,{stroke:J,strokeWidth:2,fill:"white"});var s=qe("polygon");return je(s,{points:a}),je(s,i),Be(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=B(t),r=te(t,l),o=ne(t,p),a=w(e,i,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",r,o),stroke:ne(t,p)}),s=ee(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&je(a,{markerStart:g("conditional-flow-marker",r,o)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&je(a,{markerStart:g("conditional-default-flow-marker",r,o)})),a},"bpmn:Association":function(e,t,n){var i=ee(t),r=te(t,l),o=ne(t,p);return n=E({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:ne(t,p)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=g("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=g("association-start",r,o)),x(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=te(t,l),i=ne(t,p);return k("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=te(t,l),i=ne(t,p);return k("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=ee(t),r=R(t),o=te(t,l),a=ne(t,p),s=w(e,B(t),{markerEnd:g("messageflow-end",o,a),markerStart:g("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:ne(t,p)});if(n.messageRef){var u=s.getPointAtLength(s.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),m={strokeWidth:1};"initiating"===r.messageVisibleKind?(m.fill="white",m.stroke=J):(m.fill="#888",m.stroke="white");var f=w(e,h,m),d=N(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:ne(t,c)}}),y=f.getBBox(),v=d.getBBox();nt(d,u.x-v.width/2,u.y+y.height/2+10,0)}return s},"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:te(t,l),fillOpacity:st,stroke:ne(t,p)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(ee(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":P("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=k("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=k("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1,fill:J}),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:te(t,l),fillOpacity:st,stroke:ne(t,p)})},"bpmn:BoundaryEvent":function(e,t){var n=ee(t).cancelActivity,i={strokeWidth:1,fill:te(t,l),stroke:ne(t,p)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=E({},i,{fillOpacity:1}),o=E({},i,{fill:"none"}),a=k("bpmn:Event")(e,t,r);return v(e,t.width,t.height,3,o),D(t,e),a},"bpmn:Group":function(e,t){return b(e,t.width,t.height,10,{stroke:ne(t,p),strokeWidth:1,strokeDasharray:"8,3,1,3",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 N(e,M(t),{box:n,fitBox:!0,style:E({},a.getExternalStyle(),{fill:ie(t,c,p)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=b(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:ne(t,p)}),N(e,ee(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:ie(t,c,p)}}),n},ParticipantMultiplicityMarker:function(e,t){A("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:te(t,l),stroke:ne(t,p)})},SubProcessMarker:function(e,t){it(b(e,14,14,0,{strokeWidth:1,fill:te(t,l),stroke:ne(t,p)}),t.width/2-7.5,t.height-20),A("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:te(t,l),stroke:ne(t,p)})},ParallelMarker:function(e,t,n){A("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:te(t,l),stroke:ne(t,p)})},SequentialMarker:function(e,t,n){A("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:te(t,l),stroke:ne(t,p)})},CompensationMarker:function(e,t,n){A("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:te(t,l),stroke:ne(t,p)})},LoopMarker:function(e,t,n){A("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,fill:te(t,l),stroke:ne(t,p),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){A("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:ne(t,p),stroke:ne(t,p)})}};function I(e,t,n){var i,r=ee(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},h(n,(function(n){k(n)(e,t,i)})),r.isForCompensation&&k("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&k("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&k("LoopMarker")(e,t,i),!1===s&&k("ParallelMarker")(e,t,i),!0===s&&k("SequentialMarker")(e,t,i))}this._drawPath=w,this._renderer=k}e(lt,_),lt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],lt.prototype.canRender=function(e){return A(e,"bpmn:BaseElement")},lt.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},lt.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},lt.prototype.getShapePath=function(e){return A(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,Y([["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"]])):A(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return Y([["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):A(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return Y([["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 Y([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var pt={width:150,height:50};function ct(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 ut(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=ct(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return ht(e,o,r,i);o=mt(o,i.width,t)}}function ht(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 mt(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 ft(e){this._config=E({},{size:pt,padding:0,style:{},align:"center-top"},e||{})}ft.prototype.createText=function(e,t){return this.layoutText(e,t).element},ft.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},ft.prototype.layoutText=function(e,t){var n=E({},this._config.size,t.box),i=E({},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),a=function(e){return o(e)?E({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),s=t.fitBox||!1,l=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),p=e.split(/\u00AD?\r?\n/),c=[],u=n.width-a.left-a.right,f=G("text");for(N(f,{x:0,y:0}),N(f,i),k(function(){var e=document.getElementById("helper-svg");return e||(N(e=G("svg"),{id:"helper-svg"}),ce(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),f);p.length;)c.push(ut(p,u,f));"middle"===r.vertical&&(a.top=a.bottom=0);var d=m(c,(function(e,t,n){return e+(l||t.height)}),0)+a.top+a.bottom,y=m(c,(function(e,t,n){return t.width>e?t.width:e}),0),g=a.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(l||c[0].height)/4;var v=G("text");return N(v,i),h(c,(function(e){var t;switch(g+=l||e.height,r.horizontal){case"left":t=a.left;break;case"right":t=(s?y:u)-a.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+a.left,0)}var n=G("tspan");N(n,{x:t,y:g}),n.textContent=e.text,k(v,n)})),F(f),{dimensions:{width:y,height:d},element:v}};function dt(e){var t=E({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=E({},t,{fontSize:n},e&&e.externalStyle||{}),r=new ft({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},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}}dt.$inject=["config.textRenderer"];var yt=/\{([^{}]+)\}/g,gt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var vt={__init__:["bpmnRenderer"],bpmnRenderer:["type",lt],textRenderer:["type",dt],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,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var p=0;p<r.widthElements.length;p++)o["x"+p]=r.widthElements[p]*s}var c,u,h=(c=r.d,u={mx:n,my:i,e:o},String(c).replace(yt,(function(e,t){return function(e,t,n){var i=n;return t.replace(gt,(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 bt={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]},xt={width:90,height:20};function wt(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 Et(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(xt.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?wt(e.waypoints):A(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+xt.height/2}:{x:e.x+e.width/2,y:e.y+e.height+xt.height/2}}(t),i=xt),E({x:n.x-i.width/2,y:n.y-i.height/2},i)}function _t(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function At(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function St(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r,o,a=t[i-1];if(a){var s=e[e.length-1],l=s&&s.endLength||0,p=(r=a,o=n,Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)));e.push({start:a,end:n,startLength:l,endLength:l+p,length:p})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length;return{x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s}}function Rt(e){return function(e){return!!e.waypoints}(e)?St(e):At(e)}function Ct(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function Mt(e,t,n){return E({id:e.id,type:e.$type,businessObject:e,di:t},n)}function kt(e,t,n){var i=e.waypoint;return!i||i.length<2?[Rt(t),Rt(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function Pt(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Ct(n),referenced:Ct(t),property:i}))}function Dt(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Dt.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Dt.prototype.add=function(e,t,n){var i,r,o,a,s,l,p,c=this._translate;if(A(t,"bpmndi:BPMNPlane")){var u=A(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Mt(e,t,u)),this._canvas.addRootElement(i)}else if(A(t,"bpmndi:BPMNShape")){var h=!C(e,t),m=function(e){return A(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var f=t.bounds;i=this._elementFactory.createShape(Mt(e,t,{collapsed:h,hidden:r,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:m})),A(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),A(e,"bpmn:Lane")&&(o=0),A(e,"bpmn:DataStoreReference")&&(a=n,s=Rt(f),l=s.x,p=s.y,l>=a.x&&l<=a.x+a.width&&p>=a.y&&p<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!A(t,"bpmndi:BPMNEdge"))throw new Error(c("unknown di {di} for element {semantic}",{di:Ct(t),semantic:Ct(e)}));var d=this._getSource(e),y=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Mt(e,t,{hidden:r,source:d,target:y,waypoints:kt(t,d,y)})),A(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return function(e){return A(e,"bpmn:Event")||A(e,"bpmn:Gateway")||A(e,"bpmn:DataStoreReference")||A(e,"bpmn:DataObjectReference")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:Group")}(e)&&M(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Dt.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Ct(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Pt(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Dt.prototype.addLabel=function(e,t,n){var i,r,o;return i=Et(t,n),(r=M(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Mt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!M(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)},Dt.prototype._getEnd=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?Pt(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Ct(e),side:t}))},Dt.prototype._getSource=function(e){return this._getEnd(e,"source")},Dt.prototype._getTarget=function(e){return this._getEnd(e,"target")},Dt.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Nt={__depends__:[vt,{__depends__:[bt],bpmnImporter:["type",Dt]}]};function Tt(e){return e.originalEvent||e.srcEvent}function Ot(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 Bt(e,t){return(Tt(e)||e).button===t}function Lt(e){return Bt(e,0)}function It(e){var t=Tt(e)||e;return!!Lt(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function jt(e){return!0}function Ft(e){return Lt(e)||function(e){return Bt(e,1)}(e)}function Vt(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(l[e]||Lt)(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"},l={"element.contextmenu":jt,"element.mousedown":Ft,"element.mouseup":Ft,"element.click":Ft,"element.dblclick":Ft};function p(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=Me.bind(e,"svg, .djs-element",t,a)}function c(e,t,n){var i=a(n);i&&Me.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,h(s,(function(e,n){c(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,h(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=d("djs-hit djs-hit-stroke"),m=d("djs-hit djs-hit-click-stroke"),f={all:d("djs-hit djs-hit-all"),"click-stroke":m,stroke:u,"no-move":d("djs-hit djs-hit-no-move")};function d(e,t){return t=E({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function y(e,t){var n=f[t];if(!n)throw new Error("invalid hit type <"+t+">");return N(e,n),e}function g(e,t){k(e,t)}this.removeHits=function(e){var t;h((t=".djs-hit",(e||document).querySelectorAll(t)),F)},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=Z(t);return y(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=E({x:0,y:0},n);var i=G("rect");return y(i,t),N(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=Ne(".djs-hit",t);if(n)return e.waypoints?function(e,t){N(e,{points:X(t)})}(n,e.waypoints):N(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=c}Vt.$inject=["eventBus","elementRegistry","styles"];var zt={__init__:["interactionEvents"],interactionEvents:["type",Vt]};function Wt(e,t){var n,i,o,a;return t=!!t,r(e)||(e=[e]),h(e,(function(e){var r=e;e.waypoints&&!t&&(r=Wt(e.waypoints,!0));var s=r.x,l=r.y,p=r.height||0,c=r.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+c>o||void 0===o)&&(o=s+c),(l+p>a||void 0===a)&&(a=l+p)})),{x:n,y:i,height:a-i,width:o-n}}function Gt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function $t(e){return!(!e||!e.isFrame)}function Ht(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(e,t){var n=G("rect");return N(n,E({x:10,y:10,rx:3,width:100,height:100},i)),k(e,n),n}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,i=Ne(".djs-outline",n);i||(i=o(n)),r.updateShapeOutline(i,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,i=Ne(".djs-outline",n);i||(i=o(n)),r.updateConnectionOutline(i,t)}))}Ht.prototype.updateShapeOutline=function(e,t){N(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Ht.prototype.updateConnectionOutline=function(e,t){var n=Wt(t);N(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Ht.$inject=["eventBus","styles","elementRegistry"];var Kt={__init__:["outline"],outline:["type",Ht]};function Ut(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)}))}Ut.$inject=["eventBus","canvas"],Ut.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})}},Ut.prototype.get=function(){return this._selectedElements},Ut.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Ut.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();r(e)||(e=e?[e]:[]);var o=this._canvas,a=o.getRootElement();e=e.filter((function(e){var t=o.findRoot(e);return a===t})),t?h(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 qt="hover",Yt="selected";function Xt(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,qt)})),t.on("element.out",(function(e){o(e.element,qt)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;h(t,(function(e){-1===n.indexOf(e)&&o(e,Yt)})),h(n,(function(e){-1===t.indexOf(e)&&r(e,Yt)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Zt(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,o=n.elements,a=(n.hints||{}).autoSelect;if(i){if(!1===a)return;r(a)?t.select(a):t.select(o.filter(Jt))}})),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);c(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Lt(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=It(e)||function(e){var t=Tt(e)||e;return Lt(e)&&t.shiftKey}(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function Jt(e){return!e.hidden}Xt.$inject=["canvas","eventBus","selection"],Xt.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");!function(e){for(var t;t=e.firstChild;)F(t)}(t);var n=e.length>1;if(I(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}}(Wt(e)),r=G("rect");N(r,E({rx:3},i)),I(r).add("djs-selection-outline"),k(t,r)}},Zt.$inject=["eventBus","selection","canvas","elementRegistry"];var Qt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[zt,Kt],selection:["type",Ut],selectionVisuals:["type",Xt],selectionBehavior:["type",Zt]};function en(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}en.prototype.next=function(){return this._prefix+ ++this._counter};var tn=new en("ov");function nn(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=tn,this._overlayDefaults=E({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),ce(o=ke('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function rn(e,t,n){ce(e,{left:t+"px",top:n+"px"})}function on(e,t){e.style.display=!1===t?"none":""}function an(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}nn.$inject=["config.overlays","eventBus","canvas","elementRegistry"],nn.prototype.get=function(e){if(l(e)&&(e={id:e}),l(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?u(t.overlays,y({type:e.type})):t.overlays.slice():[]}return e.type?u(this._overlays,y({type:e.type})):e.id?this._overlays[e.id]:null},nn.prototype.add=function(e,t,n){if(o(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=E({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},nn.prototype.remove=function(e){var t=this.get(e)||[];r(t)||(t=[t]);var n=this;h(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Te(e.html),Te(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)}}))},nn.prototype.show=function(){on(this._overlayRoot)},nn.prototype.hide=function(){on(this._overlayRoot,!1)},nn.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ge(this._overlayRoot)},nn.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Wt(t);i=o.x,r=o.y}rn(n,i,r),function(e,t,n){2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e.html,"data-container-id",t.id)},nn.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?Wt(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Wt(o).height:o.height,s=-1*i.bottom+n);rn(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},nn.prototype._createOverlayContainer=function(e){var t=ke('<div class="djs-overlays" />');ce(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},nn.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";an(this._overlayRoot,n)},nn.prototype._getOverlayContainer=function(e,t){var n=c(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},nn.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)),l(o)&&(o=ke(o)),n=this._getOverlayContainer(r),ce(t=ke('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&de(t).add("djs-overlay-"+e.type),on(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())},nn.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),o=n&&n.minZoom,a=n&&n.maxZoom,s=e.htmlContainer,l=!0;(r!==this._canvas.getRootElement()||n&&(i(o)&&o>t.scale||i(a)&&a<t.scale))&&(l=!1),on(s,l),this._updateOverlayScale(e,t)},nn.prototype._updateOverlayScale=function(e,t){var n,r,o,a=e.scale,s=e.htmlContainer,l="";!0!==a&&(!1===a?(n=1,r=1):(n=a.min,r=a.max),i(n)&&t.scale<n&&(o=(1/t.scale||1)*n),i(r)&&t.scale>r&&(o=(1/t.scale||1)*r)),i(o)&&(l="scale("+o+","+o+")"),an(s,l)},nn.prototype._updateOverlaysVisibilty=function(e){var t=this;h(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},nn.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;h(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Te(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&&(h(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&&de(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 sn={__init__:["overlays"],overlays:["type",nn]};function ln(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(Gt(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)}))}ln.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var pn={__init__:["changeSupport"],changeSupport:["type",ln]};function cn(e){this._eventBus=e}cn.$inject=["eventBus"],cn.prototype.on=function(e,t,n,i,l,p){if((s(t)||a(t))&&(p=l,l=i,i=n,n=t,t=null),s(n)&&(p=l,l=i,i=n,n=1e3),o(l)&&(p=l,l=!1),!s(i))throw new Error("handlerFn must be a function");r(e)||(e=[e]);var c=this._eventBus;h(e,(function(e){var r=["commandStack",e,t].filter((function(e){return e})).join(".");c.on(r,n,l?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,p):i,p)}))};function un(e,t){t.invoke(cn,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)}))}h(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){cn.prototype[e]=function(t,n,i,r,o){(s(t)||a(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}})),e(un,cn),un.$inject=["canvas","injector"];var hn={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",un]},mn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};
1
+ !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).BpmnNavigatedViewer=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}}))}const t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0!==e}function r(e){return"[object Array]"===t.call(e)}function o(e){return"[object Object]"===t.call(e)}function a(e){return"[object Number]"===t.call(e)}function s(e){const n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function l(e){return"[object String]"===t.call(e)}function c(e,t){return n.call(e,t)}function p(e,t){let n;return t=function(e){return s(e)?e:t=>t===e}(t),h(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function u(e,t){let n=[];return h(e,(function(e,i){t(e,i)&&n.push(e)})),n}function h(e,t){let n,i;if(void 0===e)return;const o=r(e)?v:g;for(let r in e)if(c(e,r)&&(n=e[r],i=t(n,o(r)),!1===i))return n}function m(e,t,n){return h(e,(function(e,i){n=t(n,e,i)})),n}function f(e,t){return!!m(e,(function(e,n,i){return e&&t(n,i)}),!0)}function d(e,t){return!!p(e,t)}function y(e){return function(t){return f(e,(function(e,n){return t[n]===e}))}}function g(e){return e}function v(e){return Number(e)}function b(e,t){return e.bind(t)}function x(e,...t){return Object.assign(e,...t)}function w(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 E(e,t){var n=_(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function _(e){return e&&e.businessObject||e}function A(e){return e&&e.di}function S(e,t){return!E(e,"bpmn:CallActivity")&&(E(e,"bpmn:SubProcess")?!(!(t=t||A(e))||!E(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!E(e,"bpmn:Participant")||!!_(e).processRef)}function R(e){var t=e.businessObject,n=function(e){return E(e,"bpmn:FlowElement")||E(e,"bpmn:Participant")||E(e,"bpmn:Lane")||E(e,"bpmn:SequenceFlow")||E(e,"bpmn:MessageFlow")||E(e,"bpmn:DataInput")||E(e,"bpmn:DataOutput")?"name":E(e,"bpmn:TextAnnotation")?"text":E(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function C(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}w.prototype.canRender=function(){},w.prototype.drawShape=function(){},w.prototype.drawConnection=function(){},w.prototype.getShapePath=function(){},w.prototype.getConnectionPath=function(){};var M={"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 k(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=M[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function P(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return M[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);k(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)k(e,i,t[i])}(e,t);return e}const O=Object.prototype.toString;function D(e){return new T(e)}function T(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function N(e){var t=e.parentNode;return t&&t.removeChild(e),e}T.prototype.add=function(e){return this.list.add(e),this},T.prototype.remove=function(e){return"[object RegExp]"==O.call(e)?this.removeMatching(e):(this.list.remove(e),this)},T.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},T.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},T.prototype.array=function(){return Array.from(this.list)},T.prototype.has=T.prototype.contains=function(e){return this.list.contains(e)};var B="http://www.w3.org/2000/svg",L='<svg xmlns="'+B+'"';function I(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(B)&&(e=L+e.substring(4)):(e=L+">"+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 j(e,t){var n;return"<"===e.charAt(0)?(n=I(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(B,e),t&&P(n,t),n}var F=null;function V(){return null===F&&(F=j("svg")),F}function z(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function W(e){return e?V().createSVGTransformFromMatrix(e):V().createSVGTransform()}function G(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function $(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(G(e,i))}(n,t)),n.consolidate()}function H(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function K(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function U(e,t){var n=j("polyline");return P(n,{points:K(e)}),t&&P(n,t),n}var q="hsl(225, 10%, 15%)";function Y(e,t,n){return d(e.eventDefinitions,(function(i){return i.$type===t&&function(e,t){return f(t,(function(t,n){return e[n]==t}))}(e,n)}))}function X(e){return e.businessObject}function Z(e,t){var n=A(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function J(e,t){var n=A(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||q}function Q(e,t,n){var i=A(e).get("label");return i&&i.get("color:color")||t||J(e,n)}function ee(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)}var te=Object.prototype.toString,ne=Object.prototype.hasOwnProperty;function ie(e,t){return ne.call(e,t)}function re(e,t){var n;if(void 0!==e){var i=function(e){return"[object Array]"===te.call(e)}(e)?ae:oe;for(var r in e)if(ie(e,r)&&!1===t(n=e[r],i(r)))return n}}function oe(e){return e}function ae(e){return Number(e)}function se(e,...t){const n=e.style;return re(t,(function(e){e&&re(e,(function(e,t){n[t]=e}))})),e}const le=Object.prototype.toString;function ce(e){return new pe(e)}function pe(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ue(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function he(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function me(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(he(i,t))return i;i=i.parentNode}return he(i,t)?i:null}pe.prototype.add=function(e){return this.list.add(e),this},pe.prototype.remove=function(e){return"[object RegExp]"==le.call(e)?this.removeMatching(e):(this.list.remove(e),this)},pe.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},pe.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},pe.prototype.array=function(){return Array.from(this.list)},pe.prototype.has=pe.prototype.contains=function(e){return this.list.contains(e)};var fe={},de=window.addEventListener?"addEventListener":"attachEvent",ye=window.removeEventListener?"removeEventListener":"detachEvent",ge="addEventListener"!==de?"on":"",ve=ee({__proto__:null,bind:fe.bind=function(e,t,n,i){return e[de](ge+t,n,i||!1),n},unbind:fe.unbind=function(e,t,n,i){return e[ye](ge+t,n,i||!1),n},default:fe},[fe]),be=["focus","blur"];var xe,we={bind:function(e,t,n,i,r){return-1!==be.indexOf(n)&&(r=!0),ve.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=me(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==be.indexOf(t)&&(i=!0),ve.unbind(e,t,n,i)}},Ee=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(Ae,i)?Ae[i]:Ae._default,a=o[0],s=o[1],l=o[2];(r=t.createElement("div")).innerHTML=s+e+l;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var c=t.createDocumentFragment();for(;r.firstChild;)c.appendChild(r.removeChild(r.firstChild));return c},_e=!1;"undefined"!=typeof document&&((xe=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',_e=!xe.getElementsByTagName("link").length,xe=void 0);var Ae={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:_e?[1,"X<div>","</div>"]:[0,"",""]};Ae.td=Ae.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Ae.option=Ae.optgroup=[1,'<select multiple="multiple">',"</select>"],Ae.thead=Ae.tbody=Ae.colgroup=Ae.caption=Ae.tfoot=[1,"<table>","</table>"],Ae.polyline=Ae.ellipse=Ae.polygon=Ae.circle=Ae.text=Ae.line=Ae.path=Ae.rect=Ae.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Se=Ee;function Re(e,t){return(t=t||document).querySelector(e)}function Ce(e){e.parentNode&&e.parentNode.removeChild(e)}function Me(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 ke(e,t){return Me(t,e),e}var Pe={"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 Oe(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Pe[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function De(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Pe[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Oe(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)Oe(e,i,t[i])}(e,t);return e}const Te=Object.prototype.toString;function Ne(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Be(e){var t=e.parentNode;return t&&t.removeChild(e),e}Ne.prototype.add=function(e){return this.list.add(e),this},Ne.prototype.remove=function(e){return"[object RegExp]"==Te.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ne.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},Ne.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ne.prototype.array=function(){return Array.from(this.list)},Ne.prototype.has=Ne.prototype.contains=function(e){return this.list.contains(e)};var Le="http://www.w3.org/2000/svg",Ie='<svg xmlns="'+Le+'"';function je(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Le)&&(e=Ie+e.substring(4)):(e=Ie+">"+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 Fe(e,t){var n;return"<"===e.charAt(0)?(n=je(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Le,e),t&&De(n,t),n}var Ve=/([&<>]{1})/g,ze=/([\n\r"]{1})/g,We={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Ge(e,t){return e.replace(t,(function(e,t){return We[t]||t}))}function $e(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Ge(e.textContent,Ve));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,'="',Ge(o.value,ze),'"');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!--",Ge(e.nodeValue,Ve),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function He(e,t){var n=je(t);if(function(e){for(var t;t=e.firstChild;)Be(t)}(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++)Me(r[o],e)}}function Ke(e,t){if(void 0!==t){try{He(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 Ue(e,t,n,i,r){var o=W();o.setTranslate(t,n);var a=W();a.setRotate(i||0,0,0);var s=W();s.setScale(r||1,r||1),$(e,[o,a,s])}function qe(e,t,n){var i=W();i.setTranslate(t,n),$(e,i)}var Ye=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 l=parseInt(a,n);return l!==1/0&&l>=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 Xe(e){if(!(this instanceof Xe))return new Xe(e);e=e||[128,36,1],this._seed=e.length?Ye.rack(e[0],e[1],e[2]):e}Xe.prototype.next=function(e){return this._seed(e||!0)},Xe.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},Xe.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Xe.prototype.assigned=function(e){return this._seed.get(e)||!1},Xe.prototype.unclaim=function(e){delete this._seed.hats[e]},Xe.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Ze=new Xe,Je=.95;function Qe(e,t,n,i,r,a,s){w.call(this,t,s);var l=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,p=e&&e.defaultLabelColor,u=Ze.next(),m={},f=n.computeStyle;function d(e,t){var n=x({fill:q,strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=Fe("marker");De(t.element,n),ke(a,t.element),De(a,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var s=Re("defs",r._svg);s||(s=Fe("defs"),ke(r._svg,s)),ke(s,a),m[e]=a}function y(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function g(e,t,n){var i=e+"-"+y(t)+"-"+y(n)+"-"+u;return m[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=Fe("path");De(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),d(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var o=Fe("circle");De(o,{cx:6,cy:6,r:3.5}),d(e,{element:o,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var a=Fe("path");De(a,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),d(e,{element:a,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=Fe("path");De(s,{d:"M 11 5 L 1 10 L 11 15"}),d(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var l=Fe("path");De(l,{d:"M 1 5 L 11 10 L 1 15"}),d(e,{element:l,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var c=Fe("path");De(c,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),d(e,{element:c,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var p=Fe("path");De(p,{d:"M 6 4 L 10 16"}),d(e,{element:p,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function v(e,t,n,i,r){o(i)&&(r=i,i=0),i=i||0,"none"===(r=f(r,{stroke:q,strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var a=t/2,s=n/2,l=Fe("circle");return De(l,{cx:a,cy:s,r:Math.round((t+n)/4-i)}),De(l,r),ke(e,l),l}function b(e,t,n,i,r,a){o(r)&&(a=r,r=0),r=r||0,a=f(a,{stroke:q,strokeWidth:2,fill:"white"});var s=Fe("rect");return De(s,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),De(s,a),ke(e,s),s}function E(e,t,n){var i=U(t,n=f(n,["no-fill"],{stroke:q,strokeWidth:2,fill:"none"}));return ke(e,i),i}function C(e,t,n){n=f(n,["no-fill"],{strokeWidth:2,stroke:q});var i=Fe("path");return De(i,{d:t}),De(i,n),ke(e,i),i}function M(e,t,n,i){return C(t,n,x({"data-marker":e},i))}function k(e){return L[e]}function P(e){return function(t,n){return k(e)(t,n)}}function O(e,t){var n=X(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?k("bpmn:ParallelMultipleEventDefinition")(t,e,i):k("bpmn:MultipleEventDefinition")(t,e,i):Y(n,"bpmn:MessageEventDefinition")?k("bpmn:MessageEventDefinition")(t,e,i):Y(n,"bpmn:TimerEventDefinition")?k("bpmn:TimerEventDefinition")(t,e,i):Y(n,"bpmn:ConditionalEventDefinition")?k("bpmn:ConditionalEventDefinition")(t,e):Y(n,"bpmn:SignalEventDefinition")?k("bpmn:SignalEventDefinition")(t,e,i):Y(n,"bpmn:EscalationEventDefinition")?k("bpmn:EscalationEventDefinition")(t,e,i):Y(n,"bpmn:LinkEventDefinition")?k("bpmn:LinkEventDefinition")(t,e,i):Y(n,"bpmn:ErrorEventDefinition")?k("bpmn:ErrorEventDefinition")(t,e,i):Y(n,"bpmn:CancelEventDefinition")?k("bpmn:CancelEventDefinition")(t,e,i):Y(n,"bpmn:CompensateEventDefinition")?k("bpmn:CompensateEventDefinition")(t,e,i):Y(n,"bpmn:TerminateEventDefinition")?k("bpmn:TerminateEventDefinition")(t,e,i):null}function D(e,t,n){n=x({size:{width:100}},n);var i,r=a.createText(t||"",n);return(i=r,new Ne(i)).add("djs-label"),ke(e,r),r}function T(e,t,n){return D(e,X(t).name,{box:t,align:n,padding:5,style:{fill:Q(t,p,c)}})}function N(e,t,n){Ue(D(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:Q(n,p,c)}}),0,-(-1*n.height),270)}function B(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var L=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=Je),v(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:Z(t,l),stroke:J(t,c)};X(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:Z(t,l),stroke:J(t,c)});var i=k("bpmn:Event")(e,t,n);return O(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return C(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?J(t,c):Z(t,l),stroke:n?Z(t,l):J(t,c)})},"bpmn:TimerEventDefinition":function(e,t){var n=v(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:Z(t,l),stroke:J(t,c)});C(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:J(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;C(e,o,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:J(t,c)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return C(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?J(t,c):"none",stroke:J(t,c)})},"bpmn:ConditionalEventDefinition":function(e,t){return C(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:J(t,c)})},"bpmn:LinkEventDefinition":function(e,t,n){return C(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?J(t,c):"none",stroke:J(t,c)})},"bpmn:ErrorEventDefinition":function(e,t,n){return C(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?J(t,c):"none",stroke:J(t,c)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=C(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?J(t,c):"none",stroke:J(t,c)});return function(e,t){var n=W();n.setRotate(t,0,0),$(e,n)}(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return C(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?J(t,c):"none",stroke:J(t,c)})},"bpmn:SignalEventDefinition":function(e,t,n){return C(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?J(t,c):"none",stroke:J(t,c)})},"bpmn:MultipleEventDefinition":function(e,t,n){return C(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?J(t,c):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return C(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:J(t,c),stroke:J(t,c)})},"bpmn:EndEvent":function(e,t){var n=k("bpmn:Event")(e,t,{strokeWidth:4,fill:Z(t,l),stroke:J(t,c)});return O(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return v(e,t.width,t.height,8,{strokeWidth:4,fill:J(t,c),stroke:J(t,c)})},"bpmn:IntermediateEvent":function(e,t){var n=k("bpmn:Event")(e,t,{strokeWidth:1,fill:Z(t,l),stroke:J(t,c)});return v(e,t.width,t.height,3,{strokeWidth:1,fill:Z(t,"none"),stroke:J(t,c)}),O(t,e),n},"bpmn:IntermediateCatchEvent":P("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":P("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=Je),b(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:Z(t,l),stroke:J(t,c)},i=k("bpmn:Activity")(e,t,n);return T(e,t,"center-middle"),I(e,t),i},"bpmn:ServiceTask":function(e,t){var n=k("bpmn:Task")(e,t);return C(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:Z(t,l),stroke:J(t,c)}),C(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:Z(t,l)}),C(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:Z(t,l),stroke:J(t,c)}),n},"bpmn:UserTask":function(e,t){var n=k("bpmn:Task")(e,t);return C(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Z(t,l),stroke:J(t,c)}),C(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Z(t,l),stroke:J(t,c)}),C(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:J(t,c),stroke:J(t,c)}),n},"bpmn:ManualTask":function(e,t){var n=k("bpmn:Task")(e,t);return C(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:Z(t,l),stroke:J(t,c)}),n},"bpmn:SendTask":function(e,t){var n=k("bpmn:Task")(e,t);return C(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:J(t,c),stroke:Z(t,l)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=X(t),o=k("bpmn:Task")(e,t);return r.instantiate?(v(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}}),C(e,n,{strokeWidth:1,fill:Z(t,l),stroke:J(t,c)}),o},"bpmn:ScriptTask":function(e,t){var n=k("bpmn:Task")(e,t);return C(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:J(t,c)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=k("bpmn:Task")(e,t);return De(C(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:Z(t,"#aaaaaa"),stroke:J(t,c)}),De(C(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:J(t,c)}),n},"bpmn:SubProcess":function(e,t,n){n=x({fill:Z(t,l),stroke:J(t,c)},n);var i=k("bpmn:Activity")(e,t,n),r=S(t);return function(e){return e&&!!_(e).triggeredByEvent}(t)&&De(i,{strokeDasharray:"1,2"}),T(e,t,r?"center-top":"center-middle"),r?I(e,t):I(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return k("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=k("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:J(t,c)});return b(e,t.width,t.height,8,3,r),i},"bpmn:CallActivity":function(e,t){return k("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:Je,fill:Z(t,l),stroke:J(t,c)},i=k("bpmn:Lane")(e,t,n);S(t)?(E(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:J(t,c)}),N(e,X(t).name,t)):D(e,X(t).name,{box:t,align:"center-middle",style:{fill:Q(t,p,c)}});return!!X(t).participantMultiplicity&&k("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=b(e,t.width,t.height,0,x({fill:Z(t,l),fillOpacity:.35,stroke:J(t,c)},n)),r=X(t);"bpmn:Lane"===r.$type&&N(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=k("bpmn:Gateway")(e,t);return v(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:Z(t,l),stroke:J(t,c)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=k("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 A(t).isMarkerVisible&&C(e,r,{strokeWidth:1,fill:J(t,c),stroke:J(t,c)}),n},"bpmn:ComplexGateway":function(e,t){var n=k("bpmn:Gateway")(e,t);return C(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:J(t,c),stroke:J(t,c)}),n},"bpmn:ParallelGateway":function(e,t){var n=k("bpmn:Gateway")(e,t);return C(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:J(t,c),stroke:J(t,c)}),n},"bpmn:EventBasedGateway":function(e,t){var n=X(t),r=k("bpmn:Gateway")(e,t);v(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:J(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}});De(C(e,s),{strokeWidth:1,fill:"none"})}else if("Exclusive"===o){if(!a)De(v(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:J(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}}),r={strokeWidth:2,fill:Z(t,"none"),stroke:J(t,c)};C(e,n,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:Z(t,l),fillOpacity:Je,stroke:J(t,c)};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=f(i,{stroke:q,strokeWidth:2,fill:"white"});var s=Fe("polygon");return De(s,{points:a}),De(s,i),ke(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=B(t),r=Z(t,l),o=J(t,c),a=C(e,i,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",r,o),stroke:J(t,c)}),s=X(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&De(a,{markerStart:g("conditional-flow-marker",r,o)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&De(a,{markerStart:g("conditional-default-flow-marker",r,o)})),a},"bpmn:Association":function(e,t,n){var i=X(t),r=Z(t,l),o=J(t,c);return n=x({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:J(t,c)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=g("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=g("association-start",r,o)),E(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=Z(t,l),i=J(t,c);return k("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=Z(t,l),i=J(t,c);return k("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=X(t),r=A(t),o=Z(t,l),a=J(t,c),s=C(e,B(t),{markerEnd:g("messageflow-end",o,a),markerStart:g("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:J(t,c)});if(n.messageRef){var u=s.getPointAtLength(s.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),m={strokeWidth:1};"initiating"===r.messageVisibleKind?(m.fill="white",m.stroke=q):(m.fill="#888",m.stroke="white");var f=C(e,h,m),d=D(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:J(t,p)}}),y=f.getBBox(),v=d.getBBox();Ue(d,u.x-v.width/2,u.y+y.height/2+10,0)}return s},"bpmn:DataObject":function(e,t){var n=C(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:Z(t,l),fillOpacity:Je,stroke:J(t,c)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(X(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}});C(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":P("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=k("bpmn:DataObject")(e,t);return C(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=k("bpmn:DataObject")(e,t);return C(e,n,{strokeWidth:1,fill:q}),r},"bpmn:DataStoreReference":function(e,t){return C(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:Z(t,l),fillOpacity:Je,stroke:J(t,c)})},"bpmn:BoundaryEvent":function(e,t){var n=X(t).cancelActivity,i={strokeWidth:1,fill:Z(t,l),stroke:J(t,c)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=x({},i,{fillOpacity:1}),o=x({},i,{fill:"none"}),a=k("bpmn:Event")(e,t,r);return v(e,t.width,t.height,3,o),O(t,e),a},"bpmn:Group":function(e,t){return b(e,t.width,t.height,10,{stroke:J(t,c),strokeWidth:1,strokeDasharray:"8,3,1,3",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 D(e,R(t),{box:n,fitBox:!0,style:x({},a.getExternalStyle(),{fill:Q(t,p,c)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=b(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return C(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:J(t,c)}),D(e,X(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:Q(t,p,c)}}),n},ParticipantMultiplicityMarker:function(e,t){M("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:Z(t,l),stroke:J(t,c)})},SubProcessMarker:function(e,t){qe(b(e,14,14,0,{strokeWidth:1,fill:Z(t,l),stroke:J(t,c)}),t.width/2-7.5,t.height-20),M("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:Z(t,l),stroke:J(t,c)})},ParallelMarker:function(e,t,n){M("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:Z(t,l),stroke:J(t,c)})},SequentialMarker:function(e,t,n){M("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:Z(t,l),stroke:J(t,c)})},CompensationMarker:function(e,t,n){M("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:Z(t,l),stroke:J(t,c)})},LoopMarker:function(e,t,n){M("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,fill:Z(t,l),stroke:J(t,c),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){M("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:J(t,c),stroke:J(t,c)})}};function I(e,t,n){var i,r=X(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},h(n,(function(n){k(n)(e,t,i)})),r.isForCompensation&&k("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&k("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&k("LoopMarker")(e,t,i),!1===s&&k("ParallelMarker")(e,t,i),!0===s&&k("SequentialMarker")(e,t,i))}this._drawPath=C,this._renderer=k}e(Qe,w),Qe.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Qe.prototype.canRender=function(e){return E(e,"bpmn:BaseElement")},Qe.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},Qe.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},Qe.prototype.getShapePath=function(e){return E(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,H([["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"]])):E(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return H([["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):E(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return H([["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 H([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var et={width:150,height:50};function tt(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 nt(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=tt(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return it(e,o,r,i);o=rt(o,i.width,t)}}function it(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 rt(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 ot(e){this._config=x({},{size:et,padding:0,style:{},align:"center-top"},e||{})}ot.prototype.createText=function(e,t){return this.layoutText(e,t).element},ot.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},ot.prototype.layoutText=function(e,t){var n=x({},this._config.size,t.box),i=x({},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),a=function(e){return o(e)?x({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),s=t.fitBox||!1,l=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-a.left-a.right,f=j("text");for(P(f,{x:0,y:0}),P(f,i),C(function(){var e=document.getElementById("helper-svg");return e||(P(e=j("svg"),{id:"helper-svg"}),se(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),f);c.length;)p.push(nt(c,u,f));"middle"===r.vertical&&(a.top=a.bottom=0);var d=m(p,(function(e,t,n){return e+(l||t.height)}),0)+a.top+a.bottom,y=m(p,(function(e,t,n){return t.width>e?t.width:e}),0),g=a.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(l||p[0].height)/4;var v=j("text");return P(v,i),h(p,(function(e){var t;switch(g+=l||e.height,r.horizontal){case"left":t=a.left;break;case"right":t=(s?y:u)-a.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+a.left,0)}var n=j("tspan");P(n,{x:t,y:g}),n.textContent=e.text,C(v,n)})),N(f),{dimensions:{width:y,height:d},element:v}};function at(e){var t=x({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=x({},t,{fontSize:n},e&&e.externalStyle||{}),r=new ot({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},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}}at.$inject=["config.textRenderer"];var st=/\{([^{}]+)\}/g,lt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var ct={__init__:["bpmnRenderer"],bpmnRenderer:["type",Qe],textRenderer:["type",at],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,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var c=0;c<r.widthElements.length;c++)o["x"+c]=r.widthElements[c]*s}var p,u,h=(p=r.d,u={mx:n,my:i,e:o},String(p).replace(st,(function(e,t){return function(e,t,n){var i=n;return t.replace(lt,(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 pt={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]},ut={width:90,height:20};function ht(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 mt(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(ut.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?ht(e.waypoints):E(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+ut.height/2}:{x:e.x+e.width/2,y:e.y+e.height+ut.height/2}}(t),i=ut),x({x:n.x-i.width/2,y:n.y-i.height/2},i)}var ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yt(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function gt(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function vt(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r,o,a=t[i-1];if(a){var s=e[e.length-1],l=s&&s.endLength||0,c=(r=a,o=n,Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)));e.push({start:a,end:n,startLength:l,endLength:l+c,length:c})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length;return{x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s}}function bt(e){return function(e){return!!e.waypoints}(e)?vt(e):gt(e)}function xt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function wt(e,t,n){return x({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Et(e,t,n){var i=e.waypoint;return!i||i.length<2?[bt(t),bt(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function _t(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:xt(n),referenced:xt(t),property:i}))}function At(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}At.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],At.prototype.add=function(e,t,n){var i,r,o,a,s,l,c,p=this._translate;if(E(t,"bpmndi:BPMNPlane")){var u=E(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(wt(e,t,u)),this._canvas.addRootElement(i)}else if(E(t,"bpmndi:BPMNShape")){var h=!S(e,t),m=function(e){return E(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var f=t.bounds;i=this._elementFactory.createShape(wt(e,t,{collapsed:h,hidden:r,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:m})),E(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),E(e,"bpmn:Lane")&&(o=0),E(e,"bpmn:DataStoreReference")&&(a=n,s=bt(f),l=s.x,c=s.y,l>=a.x&&l<=a.x+a.width&&c>=a.y&&c<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!E(t,"bpmndi:BPMNEdge"))throw new Error(p("unknown di {di} for element {semantic}",{di:xt(t),semantic:xt(e)}));var d=this._getSource(e),y=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(wt(e,t,{hidden:r,source:d,target:y,waypoints:Et(t,d,y)})),E(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return function(e){return E(e,"bpmn:Event")||E(e,"bpmn:Gateway")||E(e,"bpmn:DataStoreReference")||E(e,"bpmn:DataObjectReference")||E(e,"bpmn:DataInput")||E(e,"bpmn:DataOutput")||E(e,"bpmn:SequenceFlow")||E(e,"bpmn:MessageFlow")||E(e,"bpmn:Group")}(e)&&R(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},At.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:xt(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw _t(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},At.prototype.addLabel=function(e,t,n){var i,r,o;return i=mt(t,n),(r=R(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(wt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!R(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)},At.prototype._getEnd=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?_t(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:xt(e),side:t}))},At.prototype._getSource=function(e){return this._getEnd(e,"source")},At.prototype._getTarget=function(e){return this._getEnd(e,"target")},At.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var St={__depends__:[ct,{__depends__:[pt],bpmnImporter:["type",At]}]};function Rt(e){return e.originalEvent||e.srcEvent}function Ct(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 Mt(e,t){return(Rt(e)||e).button===t}function kt(e){return Mt(e,0)}function Pt(e){var t=Rt(e)||e;return!!kt(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Ot(e){return!0}function Dt(e){return kt(e)||function(e){return Mt(e,1)}(e)}function Tt(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(l[e]||kt)(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"},l={"element.contextmenu":Ot,"element.mousedown":Dt,"element.mouseup":Dt,"element.click":Dt,"element.dblclick":Dt};function c(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=we.bind(e,"svg, .djs-element",t,a)}function p(e,t,n){var i=a(n);i&&we.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,h(s,(function(e,n){p(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,h(s,(function(e,n){c(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=d("djs-hit djs-hit-stroke"),m=d("djs-hit djs-hit-click-stroke"),f={all:d("djs-hit djs-hit-all"),"click-stroke":m,stroke:u,"no-move":d("djs-hit djs-hit-no-move")};function d(e,t){return t=x({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function y(e,t){var n=f[t];if(!n)throw new Error("invalid hit type <"+t+">");return P(e,n),e}function g(e,t){C(e,t)}this.removeHits=function(e){var t;h((t=".djs-hit",(e||document).querySelectorAll(t)),N)},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=U(t);return y(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=x({x:0,y:0},n);var i=j("rect");return y(i,t),P(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=Re(".djs-hit",t);if(n)return e.waypoints?function(e,t){P(e,{points:K(t)})}(n,e.waypoints):P(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=c,this.unregisterEvent=p}Tt.$inject=["eventBus","elementRegistry","styles"];var Nt={__init__:["interactionEvents"],interactionEvents:["type",Tt]};function Bt(e,t){var n,i,o,a;return t=!!t,r(e)||(e=[e]),h(e,(function(e){var r=e;e.waypoints&&!t&&(r=Bt(e.waypoints,!0));var s=r.x,l=r.y,c=r.height||0,p=r.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+p>o||void 0===o)&&(o=s+p),(l+c>a||void 0===a)&&(a=l+c)})),{x:n,y:i,height:a-i,width:o-n}}function Lt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function It(e){return!(!e||!e.isFrame)}function jt(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(e,t){var n=j("rect");return P(n,x({x:10,y:10,rx:3,width:100,height:100},i)),C(e,n),n}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,i=Re(".djs-outline",n);i||(i=o(n)),r.updateShapeOutline(i,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,i=Re(".djs-outline",n);i||(i=o(n)),r.updateConnectionOutline(i,t)}))}jt.prototype.updateShapeOutline=function(e,t){P(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},jt.prototype.updateConnectionOutline=function(e,t){var n=Bt(t);P(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},jt.$inject=["eventBus","styles","elementRegistry"];var Ft={__init__:["outline"],outline:["type",jt]};function Vt(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)}))}Vt.$inject=["eventBus","canvas"],Vt.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})}},Vt.prototype.get=function(){return this._selectedElements},Vt.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Vt.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();r(e)||(e=e?[e]:[]);var o=this._canvas,a=o.getRootElement();e=e.filter((function(e){var t=o.findRoot(e);return a===t})),t?h(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 zt="hover",Wt="selected";function Gt(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,zt)})),t.on("element.out",(function(e){o(e.element,zt)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;h(t,(function(e){-1===n.indexOf(e)&&o(e,Wt)})),h(n,(function(e){-1===t.indexOf(e)&&r(e,Wt)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function $t(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,o=n.elements,a=(n.hints||{}).autoSelect;if(i){if(!1===a)return;r(a)?t.select(a):t.select(o.filter(Ht))}})),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);p(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(kt(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=Pt(e)||function(e){var t=Rt(e)||e;return kt(e)&&t.shiftKey}(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function Ht(e){return!e.hidden}Gt.$inject=["canvas","eventBus","selection"],Gt.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");!function(e){for(var t;t=e.firstChild;)N(t)}(t);var n=e.length>1;if(D(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}}(Bt(e)),r=j("rect");P(r,x({rx:3},i)),D(r).add("djs-selection-outline"),C(t,r)}},$t.$inject=["eventBus","selection","canvas","elementRegistry"];var Kt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Nt,Ft],selection:["type",Vt],selectionVisuals:["type",Gt],selectionBehavior:["type",$t]};function Ut(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Ut.prototype.next=function(){return this._prefix+ ++this._counter};var qt=new Ut("ov");function Yt(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=qt,this._overlayDefaults=x({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),se(o=Se('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Xt(e,t,n){se(e,{left:t+"px",top:n+"px"})}function Zt(e,t){e.style.display=!1===t?"none":""}function Jt(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Yt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Yt.prototype.get=function(e){if(l(e)&&(e={id:e}),l(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?u(t.overlays,y({type:e.type})):t.overlays.slice():[]}return e.type?u(this._overlays,y({type:e.type})):e.id?this._overlays[e.id]:null},Yt.prototype.add=function(e,t,n){if(o(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=x({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Yt.prototype.remove=function(e){var t=this.get(e)||[];r(t)||(t=[t]);var n=this;h(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Ce(e.html),Ce(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)}}))},Yt.prototype.show=function(){Zt(this._overlayRoot)},Yt.prototype.hide=function(){Zt(this._overlayRoot,!1)},Yt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ue(this._overlayRoot)},Yt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Bt(t);i=o.x,r=o.y}Xt(n,i,r),function(e,t,n){2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e.html,"data-container-id",t.id)},Yt.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?Bt(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Bt(o).height:o.height,s=-1*i.bottom+n);Xt(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Yt.prototype._createOverlayContainer=function(e){var t=Se('<div class="djs-overlays" />');se(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Yt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Jt(this._overlayRoot,n)},Yt.prototype._getOverlayContainer=function(e,t){var n=p(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Yt.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)),l(o)&&(o=Se(o)),n=this._getOverlayContainer(r),se(t=Se('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&ce(t).add("djs-overlay-"+e.type),Zt(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())},Yt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),o=n&&n.minZoom,a=n&&n.maxZoom,s=e.htmlContainer,l=!0;(r!==this._canvas.getRootElement()||n&&(i(o)&&o>t.scale||i(a)&&a<t.scale))&&(l=!1),Zt(s,l),this._updateOverlayScale(e,t)},Yt.prototype._updateOverlayScale=function(e,t){var n,r,o,a=e.scale,s=e.htmlContainer,l="";!0!==a&&(!1===a?(n=1,r=1):(n=a.min,r=a.max),i(n)&&t.scale<n&&(o=(1/t.scale||1)*n),i(r)&&t.scale>r&&(o=(1/t.scale||1)*r)),i(o)&&(l="scale("+o+","+o+")"),Jt(s,l)},Yt.prototype._updateOverlaysVisibilty=function(e){var t=this;h(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Yt.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;h(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Ce(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&&(h(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&&ce(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 Qt={__init__:["overlays"],overlays:["type",Yt]};function en(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(Lt(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)}))}en.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var tn={__init__:["changeSupport"],changeSupport:["type",en]};function nn(e){this._eventBus=e}nn.$inject=["eventBus"],nn.prototype.on=function(e,t,n,i,l,c){if((s(t)||a(t))&&(c=l,l=i,i=n,n=t,t=null),s(n)&&(c=l,l=i,i=n,n=1e3),o(l)&&(c=l,l=!1),!s(i))throw new Error("handlerFn must be a function");r(e)||(e=[e]);var p=this._eventBus;h(e,(function(e){var r=["commandStack",e,t].filter((function(e){return e})).join(".");p.on(r,n,l?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,c):i,c)}))};function rn(e,t){t.invoke(nn,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)}))}h(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){nn.prototype[e]=function(t,n,i,r,o){(s(t)||a(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}})),e(rn,nn),rn.$inject=["canvas","injector"];var on={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",rn]};
2
2
  /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
3
- !function(e){var t={exports:{}};e(t,t.exports)}((function(e,t){var n;n=mn,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==r&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(r):n.charAt(r):o+="�";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}));var fn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var dn="_plane";function yn(e){var t=e.id;return A(e,"bpmn:SubProcess")?function(e){return e+dn}(t):t}function gn(e,t,n,i){var r=ke('<ul class="bjs-breadcrumbs"></ul>'),o=i.getContainer(),a=de(o);o.appendChild(r);var s=[];function l(e){e&&(s=function(e){for(var t=S(e),n=[],i=t;i;i=i.$parent)(A(i,"bpmn:SubProcess")||A(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var n=s.map((function(e){var n,r=(n=""+(n=e.name||e.id))&&n.replace(/[&<>"']/g,(function(e){return fn[e]})),o=ke('<li><span class="bjs-crumb"><a title="'+r+'">'+r+"</a></span></li>"),a=i.findRoot(yn(e))||i.findRoot(e.id);if(!a&&A(e,"bpmn:Process")){var s=t.find((function(t){var n=S(t);return n&&n.processRef&&n.processRef===e}));a=i.findRoot(s.id)}return o.addEventListener("click",(function(){i.setRootElement(a)})),o}));r.innerHTML="";var o=n.length>1;a.toggle("bjs-breadcrumbs-shown",o),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=S(e.element);c(s,(function(e){return e===t}))&&l()})),e.on("root.set",(function(e){l(e.element)}))}function vn(e,t){var n=null,i=new bn;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,!A(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function bn(){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)}}gn.$inject=["eventBus","elementRegistry","overlays","canvas"],vn.$inject=["eventBus","canvas"];var xn=180,wn=160;function En(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 _n(e){return A(e,"bpmndi:BPMNDiagram")?e:_n(e.$parent)}En.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)}))}},En.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;A(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!A(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(function(e,t){return d(t,(function(t){return A(e,t)}))}(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},En.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=_t(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),i=n.x-xn,r=n.y-wn;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)}))},En.prototype.moveToDiPlane=function(e,t){var n=_n(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},En.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},En.$inject=["eventBus","moddle"];var An=250;function Sn(e,t,n,i){cn.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",An,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",An,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],An,(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"],An,(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(Sn,cn),Sn.prototype.updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this.updateOverlayVisibility(n)}},Sn.prototype.canDrillDown=function(e){var t=this._canvas;return A(e,"bpmn:SubProcess")&&t.findRoot(yn(e))},Sn.prototype.updateOverlayVisibility=function(e){var t=this._overlays,n=e.businessObject,i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.flowElements&&n.flowElements.length;de(i.html).toggle("bjs-drilldown-empty",!r)}},Sn.prototype.addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this.removeOverlay(e);var i=ke('<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(yn(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this.updateOverlayVisibility(e)},Sn.prototype.removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Sn.$inject=["canvas","eventBus","elementRegistry","overlays"];var Rn={__depends__:[sn,pn,hn],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",gn],drilldownCentering:["type",vn],drilldownOverlayBehavior:["type",Sn],subprocessCompatibility:["type",En]},Cn=/^class /;function Mn(e){return"[object Array]"===Object.prototype.toString.call(e)}function kn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Pn(){var e=Array.prototype.slice.call(arguments);1===e.length&&Mn(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var Dn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Nn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Tn=/\/\*([^*]*)\*\//m;function On(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return Cn.test(e.toString())}(e)?Dn:Nn);if(!t)return[];var n=t[1]||t[2];return n&&n.split(",").map((function(e){var t=e.match(Tn);return(t&&t[1]||e).trim()}))||[]}function Bn(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a('No provider for "'+e+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){for(var l=e.split("."),p=s(l.shift());l.length;)p=p[l.shift()];return p}if(kn(r,e))return r[e];if(kn(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 l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Mn(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=Pn(e.slice())}return{fn:e,dependencies:(e.$inject||On(e)).map((function(e){return kn(t,e)?t[e]:s(e)}))}}function p(e){var t=l(e),n=t.fn,i=t.dependencies;return new(Function.prototype.bind.apply(n,[null].concat(i)))}function c(e,t,n){var i=l(e,n),r=i.fn,o=i.dependencies;return r.apply(t,o)}function u(e){return Pn((function(t){return e.get(t)}))}function h(e,t){if(t&&t.length){var n,r,a,s,l=Object.create(null),p=Object.create(null),c=[],h=[],m=[];for(var f in i)n=i[f],-1!==t.indexOf(f)&&("private"===n[2]?-1===(r=c.indexOf(n[3]))?(s=u(a=n[3].createChild([],t)),c.push(n[3]),h.push(a),m.push(s),l[f]=[s,f,"private",a]):l[f]=[m[r],f,"private",h[r]]:l[f]=[n[2],n[1]],p[f]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach((function(e){-1!==n[1].$scope.indexOf(e)&&(l[f]=[n[2],n[1]],p[e]=!0)}));t.forEach((function(e){if(!p[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(l)}return new Bn(e,o)}var m,f,d={factory:c,type:p,value:function(e){return e}};function y(e,t){var n=e.__init__||[];return function(){n.forEach((function(e){"string"==typeof e?t.get(e):t.invoke(e)}))}}function g(e){var t=e.__exports__;if(t){var n=e.__modules__,r=Object.keys(e).reduce((function(t,n){return"__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t}),Object.create(null)),a=h((n||[]).concat(r)),s=Pn((function(e){return a.get(e)}));t.forEach((function(e){i[e]=[s,e,"private",a]}));var l=(e.__init__||[]).slice();return l.unshift((function(){a.init()})),y(e=Object.assign({},e,{__init__:l}),a)}return Object.keys(e).forEach((function(t){if("__init__"!==t&&"__depends__"!==t)if("private"!==e[t][2]){var n=e[t][0],r=e[t][1];i[t]=[d[n],Ln(n,r),n]}else i[t]=e[t]})),y(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=c,this.instantiate=p,this.createChild=h,this.init=(m=e.reduce(v,[]).map(g),f=!1,function(){f||(f=!0,m.forEach((function(e){return e()})))})}function Ln(e,t){return"value"!==e&&Mn(t)&&(t=Pn(t.slice())),t}function In(e,t){_.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(In,_),In.prototype.canRender=function(){return!0},In.prototype.drawShape=function(e,t,n){var i=G("rect");return N(i,{x:0,y:0,width:t.width||0,height:t.height||0}),$t(t)?N(i,E({},this.FRAME_STYLE,n||{})):N(i,E({},this.SHAPE_STYLE,n||{})),k(e,i),i},In.prototype.drawConnection=function(e,t,n){var i=Z(t.waypoints,E({},this.CONNECTION_STYLE,n||{}));return k(e,i),i},In.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Y([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},In.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 Y(r)},In.$inject=["eventBus","styles"];var jn={__init__:["defaultRenderer"],defaultRenderer:["type",In],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 E(this.style(t,n),{class:e})},this.style=function(t,n){r(t)||n||(n=t,t=[]);var i=m(t,(function(t,n){return E(t,e[n]||{})}),{});return n?E(i,n):i},this.computeStyle=function(e,n,i){return r(n)||(i=n,n=[]),t.style(n||[],E({},i,e||{}))}}]};function Fn(e,t){return Math.round(e*t)/t}function Vn(e){return a(e)?e+"px":e}function zn(e,t,n){var i=G("g");I(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var Wn={shape:["x","y","width","height"],connection:["waypoints"]};function Gn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function $n(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Gn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Gn.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=E({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),ce(n,{position:"relative",overflow:"hidden",width:Vn(e.width),height:Vn(e.height)}),t.appendChild(n),n}(e),i=this._svg=G("svg");N(i,{width:"100%",height:"100%"}),k(n,i);var r=this._viewport=zn(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=function(e,t){var n,i,r,o;function a(n){var a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function p(){o=Date.now();for(var e=arguments.length,a=new Array(e),l=0;l<e;l++)a[l]=arguments[l];i=a,r=this,n||s(t)}return p.flush=function(){n&&a(!0),l()},p.cancel=l,p}(x(this._viewboxChanged,this),300)),t.on("diagram.init",(function(){t.fire("canvas.init",{svg:i,viewport:r})}),this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(function(){delete this._cachedViewbox}),this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Gn.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},Gn.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach((function(t){var n=Gt(t);"root"===n?e.removeRootElement(t):e._removeElement(t,n)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Gn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Gn.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},Gn.prototype._getChildIndex=function(e){return m(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Gn.prototype._createLayer=function(e,t){void 0===t&&(t=1);var n=this._getChildIndex(t);return{group:zn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Gn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;var o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},Gn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=t.group;return t.visible?(F(n),t.visible=!1,n):n},Gn.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],F(t.group))},Gn.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Gn.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),e){var t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement}},Gn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Gn.prototype._findPlaneForRoot=function(e){return c(this._planes,(function(t){return t.rootElement===e}))},Gn.prototype.getContainer=function(){return this._container},Gn.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(h([i.gfx,i.secondaryGfx],(function(e){e&&(n?I(e).add(t):I(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Gn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Gn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Gn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),I(this.getGraphics(e)).has(t)},Gn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Gn.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Gn.prototype.addRootElement=function(e){var t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});var n=e.layer="root-"+t;this._ensureValid("root",e);var i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},Gn.prototype.removeRootElement=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},Gn.prototype.setRootElement=function(e,t){if(i(t))throw new Error("override not supported");if(e!==this._rootElement){if(!e)throw new Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e}},Gn.prototype._removeRoot=function(e){var t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},Gn.prototype._addRoot=function(e,t){var n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},Gn.prototype._setRoot=function(e,t){var n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},Gn.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");var n=Wn[e],i=f(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Gn.prototype._setParent=function(e,t,n){!function(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)}}(t.children,e,n),e.parent=t},Gn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},Gn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Gn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Gn.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Gn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Gn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Gn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Gn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Gn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Gn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a,s,l=this._viewport,p=this.getSize();return e?(this._changeViewbox((function(){o=Math.min(p.width/e.width,p.height/e.height);var t=this._svg.createSVGMatrix().scale(o).translate(-e.x,-e.y);q(l,t)})),e):(t=(i=this._rootElement?this.getActiveLayer():null)&&i.getBBox()||{},n=(r=q(l))?r.matrix:function(e,t,n,i,r,o){var a=$.createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return H(a,e);case 6:return H(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),o=Fn(n.a,1e3),a=Fn(-n.e||0,1e3),s=Fn(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/o:0,y:s?s/o:0,width:p.width/o,height:p.height/o,scale:o,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:p})},Gn.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox((function(){e=E({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),$n(t,n)})),{x:n.e,y:n.f}},Gn.prototype.scrollToElement=function(e,t){var n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));var i=this.findRoot(e);i!==this.getRootElement()&&this.setRootElement(i),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var r,o,a=Wt(e),s=_t(a),l=this.viewbox(),p=this.zoom();l.y+=t.top/p,l.x+=t.left/p,l.width-=(t.right+t.left)/p,l.height-=(t.bottom+t.top)/p;var c=_t(l);if(a.width<l.width&&a.height<l.height){var u=Math.max(0,s.right-c.right),h=Math.min(0,s.left-c.left),m=Math.max(0,s.bottom-c.bottom),f=Math.min(0,s.top-c.top);r=u||h,o=m||f}else r=a.x-l.x,o=a.y-l.y;this.scroll({dx:-r*p,dy:-o*p})},Gn.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Fn(i.a,1e3)):this.viewbox(e).scale;var n,i},Gn.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},Gn.prototype._setZoom=function(e,t){var n,i,r,o,a=this._svg,s=this._viewport,l=a.createSVGMatrix(),p=a.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=E(p,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(e),$n(this._viewport,o),o},Gn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Gn.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():t=e;return{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},Gn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Hn="data-element-id";function Kn(e){this._elements={},this._eventBus=e}Kn.$inject=["eventBus"],Kn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),N(t,Hn,i),n&&N(n,Hn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Kn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(N(i.gfx,Hn,""),i.secondaryGfx&&N(i.secondaryGfx,Hn,""),delete t[n])},Kn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Kn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&N(t,Hn,i),t},Kn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&N(e,Hn);var n=this._elements[t];return n&&n.element},Kn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},Kn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},Kn.prototype.getAll=function(){return this.filter((function(e){return e}))},Kn.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},Kn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Kn.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var Un=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},qn=function(e){return!0===e.__refs_collection},Yn={extend:Un,isExtended:qn};function Xn(e,t,n){var i=Yn.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function Zn(e,t){if(!(this instanceof Zn))return new Zn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Zn.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Xn(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Zn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Yn.isExtended(n)||Xn(this,t,e),n},Zn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Zn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Zn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Jn=Zn,Qn=Yn;Jn.Collection=Qn;var ei=new Jn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),ti=new Jn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),ni=new Jn({name:"attachers",collection:!0},{name:"host"}),ii=new Jn({name:"outgoing",collection:!0},{name:"source"}),ri=new Jn({name:"incoming",collection:!0},{name:"target"});function oi(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),ei.bind(this,"parent"),ti.bind(this,"labels"),ii.bind(this,"outgoing"),ri.bind(this,"incoming")}function ai(){oi.call(this),ei.bind(this,"children"),ni.bind(this,"host"),ni.bind(this,"attachers")}function si(){ai.call(this)}function li(){ai.call(this),ti.bind(this,"labelTarget")}function pi(){oi.call(this),ii.bind(this,"source"),ri.bind(this,"target")}e(ai,oi),e(si,ai),e(li,ai),e(pi,oi);var ci={connection:pi,shape:ai,label:li,root:si};function ui(){this._uid=12}ui.prototype.createRoot=function(e){return this.create("root",e)},ui.prototype.createLabel=function(e){return this.create("label",e)},ui.prototype.createShape=function(e){return this.create("shape",e)},ui.prototype.createConnection=function(e){return this.create("connection",e)},ui.prototype.create=function(e,t){return(t=E({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=ci[e];if(!n)throw new Error("unknown type: <"+e+">");return E(new n,t)}(e,t)};var hi=Array.prototype.slice;function mi(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function fi(){}function di(e,t){this._eventBus=e,this._elementRegistry=t}function yi(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}mi.prototype.on=function(e,t,n,i){if(e=r(e)?e:[e],s(t)&&(i=n,n=t,t=1e3),!a(t))throw new Error("priority must be a number");var o=n;i&&((o=x(n,i)).__fn=n.__fn||n);var l=this;e.forEach((function(e){l._addListener(e,{priority:t,callback:o,next:null})}))},mi.prototype.once=function(e,t,n,i){var r=this;if(s(t)&&(i=n,n=t,t=1e3),!a(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o.__fn=n,this.on(e,t,o)},mi.prototype.off=function(e,t){e=r(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},mi.prototype.createEvent=function(e){var t=new fi;return t.init(e),t},mi.prototype.fire=function(e,t){var n,i,r,o;if(o=hi.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof fi?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},mi.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},mi.prototype._destroy=function(){this._listeners={}},mi.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},mi.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},mi.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},mi.prototype._getListeners=function(e){return this._listeners[e]},mi.prototype._setListeners=function(e,t){this._listeners[e]=t},mi.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r.__fn!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},fi.prototype.stopPropagation=function(){this.cancelBubble=!0},fi.prototype.preventDefault=function(){this.defaultPrevented=!0},fi.prototype.init=function(e){E(this,e||{})},di.$inject=["eventBus","elementRegistry"],di.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(I(t=G("g")).add("djs-children"),k(n.parentNode,t))):t=n,t},di.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return ge(t),t},di.prototype._createContainer=function(e,t,n,i){var r=G("g");I(r).add("djs-group"),void 0!==n?yi(r,t,t.childNodes[n]):k(t,r);var o=G("g");I(o).add("djs-element"),I(o).add("djs-"+e),i&&I(o).add("djs-frame"),k(r,o);var a=G("g");return I(a).add("djs-visual"),k(o,a),o},di.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,$t(t))},di.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=m(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),h(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);h(t.slice().reverse(),(function(e){yi(i.getGraphics(e).parentNode,r)}))}}))},di.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},di.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},di.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},di.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},di.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),it(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?N(n,"display","none"):N(n,"display","block")}},di.prototype.remove=function(e){F(this._elementRegistry.getGraphics(e).parentNode)};var gi={__depends__:[jn],__init__:["canvas"],canvas:["type",Gn],elementRegistry:["type",Kn],elementFactory:["type",ui],eventBus:["type",mi],graphicsFactory:["type",di]};function vi(e){return function(e){var t=new Bn(e);return t.init(),t}([{config:["value",e=e||{}]},gi].concat(e.modules||[]))}function bi(e,t){this.injector=t=t||vi(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function xi(){}function wi(e,t){this.model=e,this.properties=t}bi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},bi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},xi.prototype.get=function(e){return this.$model.properties.get(this,e)},xi.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},wi.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(xi.prototype);h(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),h(e,x((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Ei={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},_i={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Ai(e,t){var n=_i[e];return n?n(t):t}function Si(e){return!!Ei[e]}function Ri(e){return!!_i[e]}function Ci(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Mi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function ki(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,h(e,x(this.registerPackage,this))}function Pi(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Di(e){this.model=e}function Ni(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Ti(e){this.properties=new Di(this),this.factory=new wi(this,this.properties),this.registry=new ki(e,this.properties),this.typeCache={}}Mi.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),h(t,(function(t){t in i&&(n[t]=e[t])})),n;var e,t,n,i},Mi.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Mi.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Mi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Ci(r[0],i),a=Ci(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Mi.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Mi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Mi.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Mi.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Mi.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Mi.prototype.hasProperty=function(e){return this.propertiesByName[e]},Mi.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(h(e.properties,x((function(n){n=E({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},ki.prototype.getPackage=function(e){return this.packageMap[e]},ki.prototype.getPackages=function(){return this.packages},ki.prototype.registerPackage=function(e){e=E({},e);var t=this.packageMap;Pi(t,e,"prefix"),Pi(t,e,"uri"),h(e.types,x((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},ki.prototype.registerType=function(e,t){var n=Ci((e=E({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:E(e.meta||{})})).name,t.prefix),i=n.name,r={};h(e.properties,x((function(e){var t=Ci(e.name,n.prefix),i=t.name;Si(e.type)||(e.type=Ci(e.type,t.prefix).name),E(e,{ns:t,name:i}),r[i]=e}),this)),E(e,{ns:n,name:i,propertiesByName:r}),h(e.extends,x((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},ki.prototype.mapTypes=function(e,t,n){var i=Si(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(e){return a(e,!0)}function a(n,i){var o=Ci(n,Si(n)?"":e.prefix);r.mapTypes(o,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");h(i.superClass,n?o:a),t(i,!n),h(i.traits,o)},ki.prototype.getEffectiveDescriptor=function(e){var t=Ci(e),n=new Mi(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},ki.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Di.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Ni(e,i,n):e.$attrs[t]=n},Di.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Ni(e,n,[]),e[i]},Di.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=E({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Di.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Di.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Ti.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Ti.prototype.getType=function(e){var t=this.typeCache,n=l(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Ti.prototype.createAny=function(e,t,n){var i=Ci(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},a={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,a),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),h(n,(function(e,t){o(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Ti.prototype.getPackage=function(e){return this.registry.getPackage(e)},Ti.prototype.getPackages=function(){return this.registry.getPackages()},Ti.prototype.getElementDescriptor=function(e){return e.$descriptor},Ti.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Ti.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Ti.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Oi=String.fromCharCode,Bi=Object.prototype.hasOwnProperty,Li=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Ii={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function ji(e,t,n,i){return i?Bi.call(Ii,i)?Ii[i]:"&"+i+";":Oi(t||parseInt(n,16))}function Fi(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Li,ji):e}Object.keys(Ii).forEach((function(e){Ii[e.toUpperCase()]=Ii[e]}));var Vi="xsi:type",zi="non-whitespace outside of root node";function Wi(e){return new Error(e)}function Gi(e){return"missing namespace for prefix <"+e+">"}function $i(e){return{get:e,enumerable:!0}}function Hi(e){var t,n={};for(t in e)n[t]=e[t];return n}function Ki(e){return e+"$uri"}function Ui(){return{line:0,column:0}}function qi(e){throw e}function Yi(e){if(!this)return new Yi(e);var t,n,i,r,o,a,s,l,p,c=e&&e.proxy,u=qi,h=Ui,m=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=Wi(e)),d=e,u(e,h)}function v(e){o&&(e instanceof Error||(e=Wi(e)),o(e,h))}this.on=function(e,p){if("function"!=typeof p)throw Wi("required args <name, cb>");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":o=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw Wi("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Wi("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw Wi("required args <xml=string>");return d=null,function(e){var o,u,d,b,x,w,E,_,A,S,R,C=f?[]:null,M=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Ki(n)]=t;return i}(p):null,k=[],P=0,D=!1,N=!1,T=0,O=0,B="",L=0;function I(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,c,u,h=f&&M.xmlns,d=f&&m?[]:null,y=L,g=B,b=g.length,x={},w={};e:for(;y<b;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u<b;u++)if(!((c=g.charCodeAt(u))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=g.substring(y,u)),y=u;u+1<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in w)v("attribute <"+s+"> already defined");else if(w[s]=!0,f)if(m){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=Fi(o),t=Ki(r),!(a=p[e])){if("xmlns"===r||t in M&&M[t]!==e)do{a="ns"+P++}while(void 0!==M[a]);else a=r;p[e]=a}M[r]!==a&&(i||(M=Hi(M),i=!0),M[r]=a,"xmlns"===r&&(M[Ki(a)]=e,h=a),M[t]=e),x[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=M[s.substring(0,c)])?((s=h===n?s.substr(c+1):n+s.substr(c))===Vi&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=M[n]||n)+o.substring(c)):o=h+":"+o),x[s]=o):v(Gi(s.substring(0,c))):x[s]=o;else x[s]=o}if(m)for(y=0,b=d.length;y<b;y++){if(s=d[y++],o=d[y],-1!==(c=s.indexOf(":"))){if(!(n=M[s.substring(0,c)])){v(Gi(s.substring(0,c)));continue}(s=h===n?s.substr(c+1):n+s.substr(c))===Vi&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=M[n]||n)+o.substring(c)):o=h+":"+o)}x[s]=o}return R=x}function j(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=O;T>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>T);)r+=1,a=s;return-1==T?(o=s,n=e.substring(O)):0===O?n=e.substring(O,T):(o=T-a,n=-1==O?e.substring(T):e.substring(T,O+1)),{data:n,line:r,column:o}}h=j,c&&(S=Object.create({},{name:$i((function(){return _})),originalName:$i((function(){return A})),attrs:$i(I),ns:$i((function(){return M}))}));for(;-1!==O;){if(-1===(T=60===e.charCodeAt(O)?O:e.indexOf("<",O)))return k.length?g("unexpected end of file"):0===O?g("missing start tag"):void(O<e.length&&e.substring(O).trim()&&v(zi));if(O!==T)if(k.length){if(t&&(t(e.substring(O,T),Fi,h),y))return}else if(e.substring(O,T).trim()&&(v(zi),y))return;if(33===(x=e.charCodeAt(T+1))){if(91===(b=e.charCodeAt(T+2))&&"CDATA["===e.substr(T+3,6)){if(-1===(O=e.indexOf("]]>",T)))return g("unclosed cdata");if(r&&(r(e.substring(T+9,O),h),y))return;O+=3;continue}if(45===b&&45===e.charCodeAt(T+3)){if(-1===(O=e.indexOf("--\x3e",T)))return g("unclosed comment");if(a&&(a(e.substring(T+4,O),Fi,h),y))return;O+=3;continue}}if(63!==x){for(u=T+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return O=-1,g("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){O=u;break}}if(33!==x){if(R={},47===x){if(D=!1,N=!0,!k.length)return g("missing open tag");if(u=_=k.pop(),b=T+2+u.length,e.substring(T+2,b)!==u)return g("closing tag mismatch");for(;b<O;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return g("close tag")}else{if(47===e.charCodeAt(O-1)?(u=_=e.substring(T+1,O-1),D=!0,N=!0):(u=_=e.substring(T+1,O),D=!0,N=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return g("illegal first char nodeName");for(b=1,d=u.length;b<d;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){_=u.substring(0,b),R=null;break}return g("invalid nodeName")}N||k.push(_)}if(f){if(o=M,D&&(N||C.push(o),null===R&&(m=-1!==u.indexOf("xmlns",b))&&(L=b,B=u,I(),m=!1)),A=_,-1!==(x=_.indexOf(":"))){if(!(E=M[_.substring(0,x)]))return g("missing namespace on <"+A+">");_=_.substr(x+1)}else E=M.xmlns;E&&(_=E+":"+_)}if(D&&(L=b,B=u,n&&(c?n(S,Fi,N,h):n(_,I,Fi,N,h),y)))return;if(N){if(i&&(i(c?S:_,Fi,D,h),y))return;f&&(M=D?o:C.pop())}O+=1}else{if(l&&(l(e.substring(T,O+1),Fi,h),y))return;O+=1}}else{if(-1===(O=e.indexOf("?>",T)))return g("unclosed question");if(s&&(s(e.substring(T,O+2),h),y))return;O+=2}}}(e),h=Ui,y=!1,d},this.stop=function(){y=!0}}function Xi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Zi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ji="xsi:type";function Qi(e){return e.xml&&e.xml.serialize}function er(e){return Qi(e)===Ji}function tr(e,t){return Xi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function nr(e){return new Error(e)}function ir(e){return e.$descriptor}function rr(e){E(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw nr("expected element");var t,n=this.elementsById,i=ir(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw nr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function or(){}function ar(){}function sr(){}function lr(e,t){this.property=e,this.context=t}function pr(e,t){this.element=t,this.propertyDesc=e}function cr(){}function ur(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function hr(e,t,n){ur.call(this,e,t,n)}function mr(e,t,n){this.model=e,this.context=n}function fr(e){e instanceof Ti&&(e={model:e}),E(this,{lax:!1},e)}or.prototype.handleEnd=function(){},or.prototype.handleText=function(){},or.prototype.handleNode=function(){},ar.prototype=Object.create(or.prototype),ar.prototype.handleNode=function(){return this},sr.prototype=Object.create(or.prototype),sr.prototype.handleText=function(e){this.body=(this.body||"")+e},lr.prototype=Object.create(sr.prototype),lr.prototype.handleNode=function(e){if(this.element)throw nr("expected no sub nodes");return this.element=this.createReference(e),this},lr.prototype.handleEnd=function(){this.element.id=this.body},lr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},pr.prototype=Object.create(sr.prototype),pr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Ai(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},cr.prototype=Object.create(sr.prototype),cr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},ur.prototype=Object.create(cr.prototype),ur.prototype.addReference=function(e){this.context.addReference(e)},ur.prototype.handleText=function(e){if(!ir(this.element).bodyProperty)throw nr("unexpected body text <"+e+">");sr.prototype.handleText.call(this,e)},ur.prototype.handleEnd=function(){var e=this.body,t=this.element,n=ir(t).bodyProperty;n&&void 0!==e&&(e=Ai(n.type,e),t.set(n.name,e))},ur.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=ir(i),o=this.context,a=new i({}),s=this.model;return h(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?h(e.split(" "),(function(e){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=Ai(i.type,e):"xmlns"!==n&&(t=Ci(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},ur.prototype.getPropertyForNode=function(e){var t,n,i=Ci(e.name),r=this.type,o=this.model,a=ir(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return er(l)&&(t=e.attributes[Ji])?(t=function(e,t){var n=Ci(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),E({},l,{effectiveType:ir(n=o.getType(t)).name})):l;var p=o.getPackage(i.prefix);if(p){if(t=tr(i,p),n=o.getType(t),l=c(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return E({},l,{effectiveType:ir(n).name})}else if(l=c(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw nr("unrecognized element <"+i.name+">")},ur.prototype.toString=function(){return"ElementDescriptor["+ir(this.type).name+"]"},ur.prototype.valueHandler=function(e,t){return new pr(e,t)},ur.prototype.referenceHandler=function(e){return new lr(e,this.context)},ur.prototype.handler=function(e){return"Element"===e?new mr(this.model,e,this.context):new ur(this.model,e,this.context)},ur.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Ri(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(E(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},hr.prototype=Object.create(ur.prototype),hr.prototype.createElement=function(e){var t=e.name,n=Ci(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&tr(n,o)||t;if(!r.hasType(a))throw nr("unexpected element <"+e.originalName+">");return ur.prototype.createElement.call(this,e)},mr.prototype=Object.create(cr.prototype),mr.prototype.createElement=function(e){var t=e.name,n=Ci(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},mr.prototype.handleChild=function(e){var t=new mr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},mr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},fr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof ur?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new rr(E({},t,{rootHandler:i})),s=new Yi({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw nr(l)}function c(e,t){return p(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,m=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,o)&&l.push(new ar)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!m.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",p).on("warn",c),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=ir(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),o?l[p]=o:l.splice(p,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=nr("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,p=a.references,c=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:c,references:p,warnings:l})}))},fr.prototype.handler=function(e){return new hr(this.model,e)};var dr=/<|>|'|"|&|\n\r|\n/g,yr=/<|>|&/g;function gr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function vr(e,t){return Xi(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function br(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function xr(e){return l(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var wr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Er={"<":"lt",">":"gt","&":"amp"};function _r(e,t,n){return(e=l(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Ar(e){this.tagName=e}function Sr(){}function Rr(e){this.tagName=e}function Cr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Mr(e,t){Cr.call(this,e,t)}function kr(){this.value="",this.write=function(e){this.value+=e}}function Pr(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Dr(e){return e=E({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new kr,r=new Pr(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Cr).build(t).serializeTo(r),!n)return i.value}}}function Nr(e,t){Ti.call(this,e,t)}Ar.prototype.build=function(e){return this.element=e,this},Ar.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Sr.prototype.serializeValue=Sr.prototype.serializeTo=function(e){e.append(this.escape?_r(this.value,yr,Er):this.value)},Sr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(yr)&&(this.escape=!0),this},br(Rr,Sr),Rr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Cr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return u(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!p(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(u(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return u(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Cr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?E({localName:t.ns.localName},e):E({localName:vr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Cr.prototype.nsPropertyTagName=function(e){return function(e,t){return E({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Cr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Cr.prototype.nsAttributeName=function(e){var t;if(t=l(e)?Ci(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:E({localName:t.localName},n)},Cr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return h(e,(function(r,o){"$body"===o?n.push((new Sr).build({type:"String"},r)):"$children"===o?h(r,(function(e){n.push(new Cr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Cr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Ci(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Cr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return h(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Cr.prototype.parseGenericAttributes=function(e,t){var n=this;h(t,(function(t){if(t.name!==Ji)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Cr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;h(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Sr).build(e,r[0]));else if(Ri(e.type))h(r,(function(i){n.push(new Rr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)h(r,(function(i){n.push(new Ar(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=er(e),s=function(e){return"property"===Qi(e)}(e);h(r,(function(i){var r;r=a?new Mr(t,e):s?new Cr(t,e):new Cr(t),n.push(r.build(i))}))}}))},Cr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new gr(t):n=t),n},Cr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Cr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=Zi[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&a.mapPrefix(s,l),e},Cr.prototype.parseAttributes=function(e){var t=this,n=this.element;h(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];h(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Cr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),xr(e)},Cr.prototype.addAttribute=function(e,t){var n=this.attrs;l(t)&&(t=_r(t,dr,wr));var i=function(e,t){t=g(t);var n=r(e)?-1:void 0;return h(e,(function(e,i){if(t(e,i))return n=i,!1})),n}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),o={name:e,value:t};-1!==i?n.splice(i,1,o):n.push(o)},Cr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),h(t,(function(t){e.append(" ").append(xr(t.name)).append('="').append(t.value).append('"')}))},Cr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Sr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),h(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},br(Mr,Cr),Mr.prototype.parseNsAttributes=function(e){var t=Cr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Ji),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Mr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Nr.prototype=Object.create(Ti.prototype),Nr.prototype.fromXML=function(e,t,n){l(t)||(n=t,t="bpmn:Definitions");var i=new fr(E({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Nr.prototype.toXML=function(e,t){var n=new Dr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Tr={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Or(e,t){return new Nr(E({},Tr,e),t)}function Br(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&s(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function Lr(e,t){return e.$instanceOf(t)}function Ir(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:Ct(n)}));return e.element(n,r[n.id],i)}(n,i);return a(n),o}catch(e){l(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:Ct(n)})),console.error(e)}}function l(t,n){e.error(t,n)}function m(e){var n,i=e.bpmnElement;i?r[i.id]?l(t("multiple DI elements defined for {element}",{element:Ct(i)}),{element:i}):(r[i.id]=e,p(n=i,"di")||Object.defineProperty(n,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})):l(t("no bpmnElement referenced in {element}",{element:Ct(e)}),{element:e})}function f(e){var t;m(t=e.plane),h(t.planeElement,d)}function d(e){m(e)}function y(){for(;i.length;)i.shift()()}function g(e,t){P(e,t),A(e.ioSpecification,t),_(e.artifacts,t),a(e)}function v(e,t){s(e,t)}function b(e,t){s(e,t)}function x(e,t){s(e,t)}function w(e,t){s(e,t)}function E(e,t){s(e,t)}function _(e,t){h(e,(function(e){Lr(e,"bpmn:Association")?i.push((function(){E(e,t)})):E(e,t)}))}function A(e,t){e&&(h(e.dataInputs,o(x,t)),h(e.dataOutputs,o(w,t)))}function S(e,t){P(e,t),_(e.artifacts,t)}function R(e,t){var n=s(e,t);Lr(e,"bpmn:SubProcess")&&S(e,n||t),Lr(e,"bpmn:Activity")&&A(e.ioSpecification,t),i.push((function(){h(e.dataInputAssociations,o(b,t)),h(e.dataOutputAssociations,o(b,t))}))}function C(e,t){s(e,t)}function M(e,t){i.push((function(){var n=s(e,t);e.childLaneSet&&k(e.childLaneSet,n||t),function(e){h(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function k(e,t){h(e.lanes,o(M,t))}function P(e,n){!function(e,n){h(e,(function(e){Lr(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):Lr(e,"bpmn:BoundaryEvent")?i.unshift((function(){R(e,n)})):Lr(e,"bpmn:FlowNode")?R(e,n):Lr(e,"bpmn:DataObject")||(Lr(e,"bpmn:DataStoreReference")||Lr(e,"bpmn:DataObjectReference")?C(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:Ct(e),context:n?Ct(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){h(e,o(k,t))}(e.laneSets,n)}function D(e,t){var n=s(e,t),i=e.processRef;i&&g(i,n||t)}return{handleDeferred:y,handleDefinitions:function(a,s){var p=a.diagrams;if(s&&-1===p.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&p&&p.length&&(s=p[0]),!s)throw new Error(t("no diagram to display"));r={},f(s);var d=s.plane;if(!d)throw new Error(t("no plane for {element}",{element:Ct(s)}));var b=d.bpmnElement;if(!b){if(b=function(e){return c(e.rootElements,(function(e){return Lr(e,"bpmn:Process")||Lr(e,"bpmn:Collaboration")}))}(a),!b)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Ct(d),rootElement:Ct(b)})),d.bpmnElement=b,m(d)}var x,w,E=function(t,n){return e.root(t,r[t.id],n)}(b,d);if(Lr(b,"bpmn:Process")||Lr(b,"bpmn:SubProcess"))g(b,E);else{if(!Lr(b,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Ct(d),rootElement:Ct(b)}));w=E,h((x=b).participants,o(D,w)),_(x.artifacts,w),i.push((function(){!function(e,t){h(e,o(v,t))}(x.messageFlows,w)})),function(e,t){var i=u(e,(function(e){return!n[e.id]&&Lr(e,"bpmn:Process")&&e.laneSets}));i.forEach(o(g,t))}(a.rootElements,E)}y()},handleSubProcess:S,registerDi:m}}function jr(e,t,n){var i,r,o,a,s=[];function l(e,t){var n=new Ir({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;A(i,"bpmn:Process")||A(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(A(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=A(r,"bpmn:Collaboration")?r:c(e.rootElements,(function(e){if(A(e,"bpmn:Collaboration"))return c(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){var n=[];return h(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef})),o.push(n));var a=Fr(o),s=[t],l=[i];return h(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))})),s}(e,t);if(!r)throw new Error(o("no diagram to display"));h(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(l+"_plane")||a.findRoot(l))}return new Promise((function(p,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),p({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function Fr(e){var t=[];return h(e,(function(e){e&&(t.push(e),t=t.concat(Fr(e.flowElements)))})),t}var Vr,zr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',Wr={verticalAlign:"middle"},Gr={color:"#404040"},$r={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Hr={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Kr={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"};function Ur(){Vr||(ce(Vr=ke('<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg></a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>'),$r),ce(Ne("svg",Vr),Wr),ce(Ne(".backdrop",Vr),Hr),ce(Ne(".notice",Vr),Kr),ce(Ne(".link",Vr),Gr,{margin:"15px 20px 15px 10px",alignSelf:"center"}),Me.bind(Vr,".backdrop","click",(function(e){document.body.removeChild(Vr)}))),document.body.appendChild(Vr)}function qr(e){var t,n;e=E({},Xr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,ce(Ne("svg",n=ke('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+zr+"</a>")),Wr),ce(n,Gr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),t.appendChild(n),Se.bind(n,"click",(function(e){Ur(),e.preventDefault()})),this._init(this._container,this._moddle,e)}function Yr(e,t){return e.warnings=t,e}e(qr,bi),qr.prototype.importXML=Br((function(e,t){var n=this;return new Promise((function(i,r){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then((function(e){var o,a,s=e.rootElement,l=e.references,p=e.warnings,c=e.elementsById;s=n._emit("import.parse.complete",(o={error:null,definitions:s,elementsById:c,references:l,warnings:p},a=n.get("eventBus").createEvent(o),Object.defineProperty(a,"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:o.warnings,references:o.references,elementsById:o.elementsById}}}),a))||s,n.importDefinitions(s,t).then((function(e){var t=[].concat(p,e.warnings||[]);return n._emit("import.done",{error:null,warnings:t}),i({warnings:t})})).catch((function(e){var t=[].concat(p,e.warnings||[]);return n._emit("import.done",{error:e,warnings:t}),r(Yr(e,t))}))})).catch((function(e){return n._emit("import.parse.complete",{error:e}),e=function(e){var 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}(e),n._emit("import.done",{error:e,warnings:e.warnings}),r(e)}))}))})),qr.prototype.importDefinitions=Br((function(e,t){var n=this;return new Promise((function(i,r){n._setDefinitions(e),n.open(t).then((function(e){var t=e.warnings;return i({warnings:t})})).catch((function(e){return r(e)}))}))})),qr.prototype.open=Br((function(e){var t=this._definitions,n=e,i=this;return new Promise((function(r,o){if(!t){var a=new Error("no XML imported");return o(Yr(a,[]))}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return c(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){var s=new Error("BPMNDiagram <"+e+"> not found");return o(Yr(s,[]))}try{i.clear()}catch(e){return o(Yr(e,[]))}jr(i,t,n).then((function(e){var t=e.warnings;return r({warnings:t})})).catch((function(e){return o(e)}))}))})),qr.prototype.saveXML=Br((function(e){e=e||{};var t=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){var n=e.xml;return n=t._emit("saveXML.serialized",{xml:n})||n,i({xml:n})}))})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e);var n=e.error;return n?Promise.reject(n):e}))})),qr.prototype.saveSVG=Br((function(e){var t=this;return new Promise((function(e,n){var i,r;t._emit("saveSVG.start");try{var o=t.get("canvas"),a=o.getActiveLayer(),s=Ne("defs",o._svg),l=tt(a),p=s?"<defs>"+tt(s)+"</defs>":"",c=a.getBBox();i='<?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="'+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+p+l+"</svg>"}catch(e){r=e}return t._emit("saveSVG.done",{error:r,svg:i}),r?n(r):e({svg:i})}))})),qr.prototype._setDefinitions=function(e){this._definitions=e},qr.prototype.getModules=function(){return this._modules},qr.prototype.clear=function(){this.getDefinitions()&&bi.prototype.clear.call(this)},qr.prototype.destroy=function(){bi.prototype.destroy.call(this),Te(this._container)},qr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},qr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},qr.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=Ne(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},qr.prototype.getDefinitions=function(){return this._definitions},qr.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},qr.prototype._init=function(e,t,n){var i,r,o=n.modules||this.getModules(),a=n.additionalModules||[],s=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],o,a),l=E((i=["additionalModules"],r={},h(Object(n),(function(e,t){-1===i.indexOf(t)&&(r[t]=e)})),r),{canvas:E({},n.canvas,{container:e}),modules:s});bi.call(this,l),n&&n.container&&this.attachTo(n.container)},qr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},qr.prototype._createContainer=function(e){var t=ke('<div class="bjs-container"></div>');return ce(t,{width:Zr(e.width),height:Zr(e.height),position:e.position}),t},qr.prototype._createModdle=function(e){return new Or(E({},this._moddleExtensions,e.moddleExtensions))},qr.prototype._modules=[];var Xr={width:"100%",height:"100%",position:"relative"};function Zr(e){return e+(a(e)?"px":"")}function Jr(e){qr.call(this,e)}e(Jr,qr),Jr.prototype._modules=[Nt,bt,Qt,sn,Rn],Jr.prototype._moddleExtensions={};var Qr=["c","C",67],eo=["v","V",86],to=["y","Y",89],no=["z","Z",90];function io(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function ro(e,t){return-1!==(e=r(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.keyCode)}function oo(e){return e.shiftKey}var ao="keyboard.keydown",so="input-handle-modified-keys";function lo(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()}))}lo.$inject=["config.keyboard","eventBus"],lo.prototype._keydownHandler=function(e){this._keyHandler(e,ao)},lo.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},lo.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||ao,n)&&e.preventDefault()}},lo.prototype._isEventIgnored=function(e){return(t=e.target)&&(xe(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},lo.prototype._isModifiedKeyIgnored=function(e){return!io(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},lo.prototype._getAllowedModifiers=function(e){var t=we(e,"[input-handle-modified-keys]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(so).split(",")},lo.prototype.bind=function(e){this.unbind(),this._node=e,Se.bind(e,"keydown",this._keydownHandler,!0),Se.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},lo.prototype.getBinding=function(){return this._node},lo.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Se.unbind(e,"keydown",this._keydownHandler,!0),Se.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},lo.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},lo.prototype.addListener=function(e,t,n){s(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||ao,e,t)},lo.prototype.removeListener=function(e,t){this._eventBus.off(t||ao,e)},lo.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},lo.prototype.isCmd=io,lo.prototype.isShift=oo,lo.prototype.isKey=ro;function po(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}po.$inject=["eventBus","keyboard"],po.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(function(e){return io(e)&&!oo(e)&&ro(no,e)}(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(function(e){return io(e)&&(ro(to,e)||ro(no,e)&&oo(e))}(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return io(e)&&ro(Qr,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return io(e)&&ro(eo,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(ro(["+","Add","="],n)&&io(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(ro(["-","Subtract"],n)&&io(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(ro("0",n)&&io(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(ro(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var co={__init__:["keyboard","keyboardBindings"],keyboard:["type",lo],keyboardBindings:["type",po]},uo={moveSpeed:50,moveSpeedAccelerated:200};function ho(e,t,n){var i=this;this._config=E({},uo,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})}}ho.$inject=["config.keyboardMove","keyboard","canvas"];var mo={__depends__:[co],__init__:["keyboardMove"],keyboardMove:["type",ho]},fo=/^djs-cursor-.*$/;function yo(e){var t=de(document.body);t.removeMatching(fo),e&&t.add("djs-cursor-"+e)}function go(e,t){return{x:e.x-t.x,y:e.y-t.y}}function vo(e,t){var n;function i(i){var r,o=n.start,a=n.button,s=Ot(i),l=go(s,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&function(e,t){function n(){return!1}t=t||"element.click",e.once(t,5e3,n)}(e),yo("grab")),n.dragging)&&(l=go(s,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=s);i.preventDefault()}function r(e){Se.unbind(document,"mousemove",i),Se.unbind(document,"mouseup",r),n=null,yo(null)}e.on("element.mousedown",500,(function(e){return function(e){if(we(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Ot(e)},Se.bind(document,"mousemove",i),Se.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}vo.$inject=["eventBus","canvas"];var bo={__init__:["moveCanvas"],moveCanvas:["type",vo]};function xo(e){return Math.log(e)/Math.log(10)}function wo(e,t){var n=xo(e.min),i=xo(e.max);return(Math.abs(n)+Math.abs(i))/t}var Eo=Math.sign||function(e){return e>=0?1:-1},_o={min:.2,max:4};function Ao(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=x(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)}))}Ao.$inject=["config.zoomScroll","eventBus","canvas"],Ao.prototype.scroll=function(e){this._canvas.scroll(e)},Ao.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Ao.prototype.zoom=function(e,t){var n=wo(_o,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Ao.prototype._handleWheel=function(e){if(!we(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))*Eo(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)}},Ao.prototype.stepZoom=function(e,t){var n=wo(_o,10);this._zoom(e,t,n)},Ao.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=xo(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,l,p=Math.pow(10,a);i.zoom((s=_o,l=p,Math.max(s.min,Math.min(s.max,l))),t)},Ao.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Se[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Ao.prototype._init=function(e){this.toggle(e)};var So={__init__:["zoomScroll"],zoomScroll:["type",Ao]};function Ro(e){Jr.call(this,e)}return e(Ro,Jr),Ro.prototype._navigationModules=[mo,bo,So],Ro.prototype._modules=[].concat(Jr.prototype._modules,Ro.prototype._navigationModules),Ro}));
3
+ !function(e,t){var n;n=ft,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==r&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(r):n.charAt(r):o+="�";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}({exports:{}});var an={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var sn="_plane";function ln(e){var t=e.id;return E(e,"bpmn:SubProcess")?function(e){return e+sn}(t):t}function cn(e,t,n,i){var r=Se('<ul class="bjs-breadcrumbs"></ul>'),o=i.getContainer(),a=ce(o);o.appendChild(r);var s=[];function l(e){e&&(s=function(e){for(var t=_(e),n=[],i=t;i;i=i.$parent)(E(i,"bpmn:SubProcess")||E(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var n=s.map((function(e){var n,r=(n=""+(n=e.name||e.id))&&n.replace(/[&<>"']/g,(function(e){return an[e]})),o=Se('<li><span class="bjs-crumb"><a title="'+r+'">'+r+"</a></span></li>"),a=i.findRoot(ln(e))||i.findRoot(e.id);if(!a&&E(e,"bpmn:Process")){var s=t.find((function(t){var n=_(t);return n&&n.processRef&&n.processRef===e}));a=i.findRoot(s.id)}return o.addEventListener("click",(function(){i.setRootElement(a)})),o}));r.innerHTML="";var o=n.length>1;a.toggle("bjs-breadcrumbs-shown",o),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=_(e.element);p(s,(function(e){return e===t}))&&l()})),e.on("root.set",(function(e){l(e.element)}))}function pn(e,t){var n=null,i=new un;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,!E(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function un(){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)}}cn.$inject=["eventBus","elementRegistry","overlays","canvas"],pn.$inject=["eventBus","canvas"];var hn=180,mn=160;function fn(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 dn(e){return E(e,"bpmndi:BPMNDiagram")?e:dn(e.$parent)}fn.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)}))}},fn.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;E(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!E(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(function(e,t){return d(t,(function(t){return E(e,t)}))}(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},fn.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=yt(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),i=n.x-hn,r=n.y-mn;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)}))},fn.prototype.moveToDiPlane=function(e,t){var n=dn(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},fn.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},fn.$inject=["eventBus","moddle"];var yn=250;function gn(e,t,n,i){nn.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",yn,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",yn,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],yn,(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"],yn,(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(gn,nn),gn.prototype.updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this.updateOverlayVisibility(n)}},gn.prototype.canDrillDown=function(e){var t=this._canvas;return E(e,"bpmn:SubProcess")&&t.findRoot(ln(e))},gn.prototype.updateOverlayVisibility=function(e){var t=this._overlays,n=e.businessObject,i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.flowElements&&n.flowElements.length;ce(i.html).toggle("bjs-drilldown-empty",!r)}},gn.prototype.addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this.removeOverlay(e);var i=Se('<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(ln(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this.updateOverlayVisibility(e)},gn.prototype.removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},gn.$inject=["canvas","eventBus","elementRegistry","overlays"];var vn={__depends__:[Qt,tn,on],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",cn],drilldownCentering:["type",pn],drilldownOverlayBehavior:["type",gn],subprocessCompatibility:["type",fn]};const bn=/^class[ {]/;function xn(e){return Array.isArray(e)}function wn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function En(...e){1===e.length&&xn(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const _n=/constructor\s*[^(]*\(\s*([^)]*)\)/m,An=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Sn=/\/\*([^*]*)\*\//m;function Rn(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return bn.test(e.toString())}(e)?_n:An);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(Sn);return(t&&t[1]||e).trim()}))||[]}function Cn(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(wn(r,e))return r[e];if(wn(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 l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!xn(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=En(e.slice())}return{fn:e,dependencies:(e.$inject||Rn(e)).map((e=>wn(t,e)?t[e]:s(e)))}}function c(e){const{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.apply(t,[null].concat(n)))}function p(e,t,n){const{fn:i,dependencies:r}=l(e,n);return i.apply(t,r)}function u(e){return En((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 l,c,p,h;for(let e in i)l=i[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(p=l[3].createChild([],t),h=u(p),o.push(l[3]),a.push(p),s.push(h),n[e]=[h,e,"private",p]):n[e]=[s[c],e,"private",a[c]]):n[e]=[l[2],l[1]],r[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[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 Cn(e,o)}const m={factory:p,type:c,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 d(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=En((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]=[m[n],Mn(n,r),n]})),f(e,o)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=p,this.instantiate=c,this.createChild=h,this.init=function(e){const t=e.reduce(y,[]).map(d);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function Mn(e,t){return"value"!==e&&xn(t)&&(t=En(t.slice())),t}function kn(e,t){w.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(kn,w),kn.prototype.canRender=function(){return!0},kn.prototype.drawShape=function(e,t,n){var i=j("rect");return P(i,{x:0,y:0,width:t.width||0,height:t.height||0}),It(t)?P(i,x({},this.FRAME_STYLE,n||{})):P(i,x({},this.SHAPE_STYLE,n||{})),C(e,i),i},kn.prototype.drawConnection=function(e,t,n){var i=U(t.waypoints,x({},this.CONNECTION_STYLE,n||{}));return C(e,i),i},kn.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return H([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},kn.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 H(r)},kn.$inject=["eventBus","styles"];var Pn={__init__:["defaultRenderer"],defaultRenderer:["type",kn],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 x(this.style(t,n),{class:e})},this.style=function(t,n){r(t)||n||(n=t,t=[]);var i=m(t,(function(t,n){return x(t,e[n]||{})}),{});return n?x(i,n):i},this.computeStyle=function(e,n,i){return r(n)||(i=n,n=[]),t.style(n||[],x({},i,e||{}))}}]};function On(e,t){return Math.round(e*t)/t}function Dn(e){return a(e)?e+"px":e}function Tn(e,t,n){const i=j("g");D(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const Nn={shape:["x","y","width","height"],connection:["waypoints"]};function Bn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function Ln(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Bn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Bn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=x({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),se(n,{position:"relative",overflow:"hidden",width:Dn(e.width),height:Dn(e.height)}),t.appendChild(n),n}(e),i=this._svg=j("svg");P(i,{width:"100%",height:"100%"}),C(n,i);const r=this._viewport=Tn(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=function(e,t){let n,i,r,o;function a(n){let a=Date.now(),c=n?0:o+t-a;if(c>0)return s(c);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function c(...e){o=Date.now(),i=e,r=this,n||s(t)}return c.flush=function(){n&&a(!0),l()},c.cancel=l,c}(b(this._viewboxChanged,this),300)),t.on("diagram.init",(function(){t.fire("canvas.init",{svg:i,viewport:r})}),this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(function(){delete this._cachedViewbox}),this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Bn.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},Bn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=Lt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Bn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Bn.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},Bn.prototype._getChildIndex=function(e){return m(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Bn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:Tn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Bn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},Bn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(N(n),t.visible=!1,n):n},Bn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],N(t.group))},Bn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Bn.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},Bn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Bn.prototype._findPlaneForRoot=function(e){return p(this._planes,(function(t){return t.rootElement===e}))},Bn.prototype.getContainer=function(){return this._container},Bn.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(h([i.gfx,i.secondaryGfx],(function(e){e&&(n?D(e).add(t):D(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Bn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Bn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Bn.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return D(this.getGraphics(e)).has(t)},Bn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Bn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Bn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},Bn.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},Bn.prototype.setRootElement=function(e,t){if(i(t))throw new Error("override not supported");if(e===this._rootElement)return;let n;if(!e)throw new Error("rootElement required");return n=this._findPlaneForRoot(e),n||(e=this.addRootElement(e)),this._setRoot(e),e},Bn.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},Bn.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},Bn.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},Bn.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=Nn[e],i=f(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Bn.prototype._setParent=function(e,t,n){!function(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)}}(t.children,e,n),e.parent=t},Bn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},Bn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Bn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Bn.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Bn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Bn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Bn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Bn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Bn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Bn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,a,s,l,c;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);$(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=$(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=V().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return z(a,e);case 6:return z(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=On(r.a,1e3),l=On(-r.e||0,1e3),c=On(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/s:0,y:c?c/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},Bn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=x({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ln(t,n)})),{x:n.e,y:n.f}},Bn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);i!==this.getRootElement()&&this.setRootElement(i),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Bt(e),o=yt(r),a=this.viewbox(),s=this.zoom();let l,c;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const p=yt(a);if(r.width<a.width&&r.height<a.height){const e=Math.max(0,o.right-p.right),t=Math.min(0,o.left-p.left),n=Math.max(0,o.bottom-p.bottom),i=Math.min(0,o.top-p.top);l=e||t,c=n||i}else l=r.x-a.x,c=r.y-a.y;this.scroll({dx:-l*s,dy:-c*s})},Bn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),On(i.a,1e3)},Bn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},Bn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,l,c,p;l=i.getCTM();const u=l.a;return t?(a=x(o,t),s=a.matrixTransform(l.inverse()),c=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),p=l.multiply(c)):p=r.scale(e),Ln(this._viewport,p),p},Bn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Bn.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},Bn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var In="data-element-id";function jn(e){this._elements={},this._eventBus=e}jn.$inject=["eventBus"],jn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),P(t,In,i),n&&P(n,In,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},jn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(P(i.gfx,In,""),i.secondaryGfx&&P(i.secondaryGfx,In,""),delete t[n])},jn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},jn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&P(t,In,i),t},jn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&P(e,In);var n=this._elements[t];return n&&n.element},jn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},jn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},jn.prototype.getAll=function(){return this.filter((function(e){return e}))},jn.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},jn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},jn.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var Fn={exports:{}},Vn={};Vn.extend=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Vn.isExtended=function(e){return!0===e.__refs_collection};var zn=Vn;function Wn(e,t,n){var i=zn.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function Gn(e,t){if(!(this instanceof Gn))return new Gn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Gn.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Wn(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Gn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return zn.isExtended(n)||Wn(this,t,e),n},Gn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Gn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Gn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var $n=Gn;!function(e){e.exports=$n,e.exports.Collection=Vn}(Fn);var Hn=dt(Fn.exports),Kn=new Hn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Un=new Hn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),qn=new Hn({name:"attachers",collection:!0},{name:"host"}),Yn=new Hn({name:"outgoing",collection:!0},{name:"source"}),Xn=new Hn({name:"incoming",collection:!0},{name:"target"});function Zn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Kn.bind(this,"parent"),Un.bind(this,"labels"),Yn.bind(this,"outgoing"),Xn.bind(this,"incoming")}function Jn(){Zn.call(this),Kn.bind(this,"children"),qn.bind(this,"host"),qn.bind(this,"attachers")}function Qn(){Jn.call(this)}function ei(){Jn.call(this),Un.bind(this,"labelTarget")}function ti(){Zn.call(this),Yn.bind(this,"source"),Xn.bind(this,"target")}e(Jn,Zn),e(Qn,Jn),e(ei,Jn),e(ti,Zn);var ni={connection:ti,shape:Jn,label:ei,root:Qn};function ii(){this._uid=12}ii.prototype.createRoot=function(e){return this.create("root",e)},ii.prototype.createLabel=function(e){return this.create("label",e)},ii.prototype.createShape=function(e){return this.create("shape",e)},ii.prototype.createConnection=function(e){return this.create("connection",e)},ii.prototype.create=function(e,t){return(t=x({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=ni[e];if(!n)throw new Error("unknown type: <"+e+">");return x(new n,t)}(e,t)};var ri=Array.prototype.slice;function oi(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function ai(){}function si(e,t){this._eventBus=e,this._elementRegistry=t}function li(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}oi.prototype.on=function(e,t,n,i){if(e=r(e)?e:[e],s(t)&&(i=n,n=t,t=1e3),!a(t))throw new Error("priority must be a number");var o=n;i&&((o=b(n,i)).__fn=n.__fn||n);var l=this;e.forEach((function(e){l._addListener(e,{priority:t,callback:o,next:null})}))},oi.prototype.once=function(e,t,n,i){var r=this;if(s(t)&&(i=n,n=t,t=1e3),!a(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o.__fn=n,this.on(e,t,o)},oi.prototype.off=function(e,t){e=r(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},oi.prototype.createEvent=function(e){var t=new ai;return t.init(e),t},oi.prototype.fire=function(e,t){var n,i,r,o;if(o=ri.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof ai?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},oi.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},oi.prototype._destroy=function(){this._listeners={}},oi.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},oi.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},oi.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},oi.prototype._getListeners=function(e){return this._listeners[e]},oi.prototype._setListeners=function(e,t){this._listeners[e]=t},oi.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r.__fn!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},ai.prototype.stopPropagation=function(){this.cancelBubble=!0},ai.prototype.preventDefault=function(){this.defaultPrevented=!0},ai.prototype.init=function(e){x(this,e||{})},si.$inject=["eventBus","elementRegistry"],si.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(D(t=j("g")).add("djs-children"),C(n.parentNode,t))):t=n,t},si.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return ue(t),t},si.prototype._createContainer=function(e,t,n,i){var r=j("g");D(r).add("djs-group"),void 0!==n?li(r,t,t.childNodes[n]):C(t,r);var o=j("g");D(o).add("djs-element"),D(o).add("djs-"+e),i&&D(o).add("djs-frame"),C(r,o);var a=j("g");return D(a).add("djs-visual"),C(o,a),o},si.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,It(t))},si.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=m(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),h(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);h(t.slice().reverse(),(function(e){li(i.getGraphics(e).parentNode,r)}))}}))},si.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},si.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},si.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},si.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},si.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),qe(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?P(n,"display","none"):P(n,"display","block")}},si.prototype.remove=function(e){N(this._elementRegistry.getGraphics(e).parentNode)};var ci={__depends__:[Pn],__init__:["canvas"],canvas:["type",Bn],elementRegistry:["type",jn],elementFactory:["type",ii],eventBus:["type",oi],graphicsFactory:["type",si]};function pi(e){return function(e){var t=new Cn(e);return t.init(),t}([{config:["value",e=e||{}]},ci].concat(e.modules||[]))}function ui(e,t){this.injector=t=t||pi(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}ui.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},ui.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var hi=Object.prototype.toString;function mi(){return mi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},mi.apply(this,arguments)}function fi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return mi.apply(void 0,[e].concat(n))}var di=Object.prototype.toString,yi=Object.prototype.hasOwnProperty;function gi(e,t){return yi.call(e,t)}function vi(e,t){var n;if(void 0!==e){var i=function(e){return"[object Array]"===di.call(e)}(e)?xi:bi;for(var r in e)if(gi(e,r)&&!1===t(n=e[r],i(r)))return n}}function bi(e){return e}function xi(e){return Number(e)}function wi(e,t){return e.bind(t)}function Ei(){return Ei=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ei.apply(this,arguments)}function _i(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Ei.apply(void 0,[e].concat(n))}function Ai(){}function Si(e,t){this.model=e,this.properties=t}Ai.prototype.get=function(e){return this.$model.properties.get(this,e)},Ai.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Si.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Ai.prototype);vi(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),vi(e,wi((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Ri={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ci={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Mi(e,t){var n=Ci[e];return n?n(t):t}function ki(e){return!!Ri[e]}function Pi(e){return!!Ci[e]}function Oi(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Di(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Ti(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,vi(e,wi(this.registerPackage,this))}function Ni(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Bi(e){this.model=e}function Li(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Ii(e){this.properties=new Bi(this),this.factory=new Si(this,this.properties),this.registry=new Ti(e,this.properties),this.typeCache={}}Di.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),vi(t,(function(t){t in i&&(n[t]=e[t])})),n;var e,t,n,i},Di.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Di.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Di.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Oi(r[0],i),a=Oi(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Di.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Di.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Di.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Di.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Di.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Di.prototype.hasProperty=function(e){return this.propertiesByName[e]},Di.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(vi(e.properties,wi((function(n){n=_i({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Ti.prototype.getPackage=function(e){return this.packageMap[e]},Ti.prototype.getPackages=function(){return this.packages},Ti.prototype.registerPackage=function(e){e=_i({},e);var t=this.packageMap;Ni(t,e,"prefix"),Ni(t,e,"uri"),vi(e.types,wi((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Ti.prototype.registerType=function(e,t){var n=Oi((e=_i({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:_i(e.meta||{})})).name,t.prefix),i=n.name,r={};vi(e.properties,wi((function(e){var t=Oi(e.name,n.prefix),i=t.name;ki(e.type)||(e.type=Oi(e.type,t.prefix).name),_i(e,{ns:t,name:i}),r[i]=e}),this)),_i(e,{ns:n,name:i,propertiesByName:r}),vi(e.extends,wi((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Ti.prototype.mapTypes=function(e,t,n){var i=ki(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(e){return a(e,!0)}function a(n,i){var o=Oi(n,ki(n)?"":e.prefix);r.mapTypes(o,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");vi(i.superClass,n?o:a),t(i,!n),vi(i.traits,o)},Ti.prototype.getEffectiveDescriptor=function(e){var t=Oi(e),n=new Di(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Ti.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Bi.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Li(e,i,n):e.$attrs[t]=n},Bi.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Li(e,n,[]),e[i]},Bi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=_i({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Bi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Bi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Ii.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Ii.prototype.getType=function(e){var t,n=this.typeCache,i=(t=e,"[object String]"===di.call(t)?e:e.ns.name),r=n[i];return r||(e=this.registry.getEffectiveDescriptor(i),r=n[i]=this.factory.createType(e)),r},Ii.prototype.createAny=function(e,t,n){var i=Oi(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),vi(n,(function(e,t){var n;n=e,"[object Object]"===di.call(n)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Ii.prototype.getPackage=function(e){return this.registry.getPackage(e)},Ii.prototype.getPackages=function(){return this.registry.getPackages()},Ii.prototype.getElementDescriptor=function(e){return e.$descriptor},Ii.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Ii.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Ii.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ji=Object.prototype.toString,Fi=Object.prototype.hasOwnProperty;function Vi(e){return"[object Array]"===ji.call(e)}function zi(e){return"[object String]"===ji.call(e)}function Wi(e,t){return Fi.call(e,t)}function Gi(e,t){var n;return t=Ki(t),Hi(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function $i(e,t){var n=[];return Hi(e,(function(e,i){t(e,i)&&n.push(e)})),n}function Hi(e,t){var n;if(void 0!==e){var i=Vi(e)?qi:Ui;for(var r in e)if(Wi(e,r)&&!1===t(n=e[r],i(r)))return n}}function Ki(e){return t=e,"[object Function]"===(n=ji.call(t))||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n?e:function(t){return t===e};var t,n}function Ui(e){return e}function qi(e){return Number(e)}function Yi(){return Yi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Yi.apply(this,arguments)}function Xi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Yi.apply(void 0,[e].concat(n))}var Zi=String.fromCharCode,Ji=Object.prototype.hasOwnProperty,Qi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,er={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function tr(e,t,n,i){return i?Ji.call(er,i)?er[i]:"&"+i+";":Zi(t||parseInt(n,16))}function nr(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Qi,tr):e}Object.keys(er).forEach((function(e){er[e.toUpperCase()]=er[e]}));var ir="xsi:type",rr="non-whitespace outside of root node";function or(e){return new Error(e)}function ar(e){return"missing namespace for prefix <"+e+">"}function sr(e){return{get:e,enumerable:!0}}function lr(e){var t,n={};for(t in e)n[t]=e[t];return n}function cr(e){return e+"$uri"}function pr(){return{line:0,column:0}}function ur(e){throw e}function hr(e){if(!this)return new hr(e);var t,n,i,r,o,a,s,l,c,p=e&&e.proxy,u=ur,h=pr,m=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=or(e)),d=e,u(e,h)}function v(e){o&&(e instanceof Error||(e=or(e)),o(e,h))}this.on=function(e,c){if("function"!=typeof c)throw or("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":s=c;break;case"comment":a=c;break;default:throw or("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw or("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw or("required args <xml=string>");return d=null,function(e){var o,u,d,b,x,w,E,_,A,S,R,C=f?[]:null,M=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[cr(n)]=t;return i}(c):null,k=[],P=0,O=!1,D=!1,T=0,N=0,B="",L=0;function I(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,p,u,h=f&&M.xmlns,d=f&&m?[]:null,y=L,g=B,b=g.length,x={},w={};e:for(;y<b;y++)if(l=!1,!(32===(p=g.charCodeAt(y))||p<14&&p>8)){for((p<65||p>122||p>90&&p<97)&&95!==p&&58!==p&&(v("illegal first char attribute name"),l=!0),u=y+1;u<b;u++)if(!((p=g.charCodeAt(u))>96&&p<123||p>64&&p<91||p>47&&p<59||46===p||45===p||95===p)){if(32===p||p<14&&p>8){v("missing attribute value"),y=u;continue e}if(61===p)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(p=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===p)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(p=g.charCodeAt(u+1))||p<14&&p>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=g.substring(y,u)),y=u;u+1<b&&!(32===(p=g.charCodeAt(u+1))||p<14&&p>8);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in w)v("attribute <"+s+"> already defined");else if(w[s]=!0,f)if(m){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=nr(o),t=cr(r),!(a=c[e])){if("xmlns"===r||t in M&&M[t]!==e)do{a="ns"+P++}while(void 0!==M[a]);else a=r;c[e]=a}M[r]!==a&&(i||(M=lr(M),i=!0),M[r]=a,"xmlns"===r&&(M[cr(a)]=e,h=a),M[t]=e),x[s]=o;continue}d.push(s,o)}else-1!==(p=s.indexOf(":"))?(n=M[s.substring(0,p)])?((s=h===n?s.substr(p+1):n+s.substr(p))===ir&&(-1!==(p=o.indexOf(":"))?(n=o.substring(0,p),o=(n=M[n]||n)+o.substring(p)):o=h+":"+o),x[s]=o):v(ar(s.substring(0,p))):x[s]=o;else x[s]=o}if(m)for(y=0,b=d.length;y<b;y++){if(s=d[y++],o=d[y],-1!==(p=s.indexOf(":"))){if(!(n=M[s.substring(0,p)])){v(ar(s.substring(0,p)));continue}(s=h===n?s.substr(p+1):n+s.substr(p))===ir&&(-1!==(p=o.indexOf(":"))?(n=o.substring(0,p),o=(n=M[n]||n)+o.substring(p)):o=h+":"+o)}x[s]=o}return R=x}function j(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=N;T>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>T);)r+=1,a=s;return-1==T?(o=s,n=e.substring(N)):0===N?n=e.substring(N,T):(o=T-a,n=-1==N?e.substring(T):e.substring(T,N+1)),{data:n,line:r,column:o}}h=j,p&&(S=Object.create({},{name:sr((function(){return _})),originalName:sr((function(){return A})),attrs:sr(I),ns:sr((function(){return M}))}));for(;-1!==N;){if(-1===(T=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return k.length?g("unexpected end of file"):0===N?g("missing start tag"):void(N<e.length&&e.substring(N).trim()&&v(rr));if(N!==T)if(k.length){if(t&&(t(e.substring(N,T),nr,h),y))return}else if(e.substring(N,T).trim()&&(v(rr),y))return;if(33===(x=e.charCodeAt(T+1))){if(91===(b=e.charCodeAt(T+2))&&"CDATA["===e.substr(T+3,6)){if(-1===(N=e.indexOf("]]>",T)))return g("unclosed cdata");if(r&&(r(e.substring(T+9,N),h),y))return;N+=3;continue}if(45===b&&45===e.charCodeAt(T+3)){if(-1===(N=e.indexOf("--\x3e",T)))return g("unclosed comment");if(a&&(a(e.substring(T+4,N),nr,h),y))return;N+=3;continue}}if(63!==x){for(u=T+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return N=-1,g("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){N=u;break}}if(33!==x){if(R={},47===x){if(O=!1,D=!0,!k.length)return g("missing open tag");if(u=_=k.pop(),b=T+2+u.length,e.substring(T+2,b)!==u)return g("closing tag mismatch");for(;b<N;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return g("close tag")}else{if(47===e.charCodeAt(N-1)?(u=_=e.substring(T+1,N-1),O=!0,D=!0):(u=_=e.substring(T+1,N),O=!0,D=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return g("illegal first char nodeName");for(b=1,d=u.length;b<d;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){_=u.substring(0,b),R=null;break}return g("invalid nodeName")}D||k.push(_)}if(f){if(o=M,O&&(D||C.push(o),null===R&&(m=-1!==u.indexOf("xmlns",b))&&(L=b,B=u,I(),m=!1)),A=_,-1!==(x=_.indexOf(":"))){if(!(E=M[_.substring(0,x)]))return g("missing namespace on <"+A+">");_=_.substr(x+1)}else E=M.xmlns;E&&(_=E+":"+_)}if(O&&(L=b,B=u,n&&(p?n(S,nr,D,h):n(_,I,nr,D,h),y)))return;if(D){if(i&&(i(p?S:_,nr,O,h),y))return;f&&(M=O?o:C.pop())}N+=1}else{if(l&&(l(e.substring(T,N+1),nr,h),y))return;N+=1}}else{if(-1===(N=e.indexOf("?>",T)))return g("unclosed question");if(s&&(s(e.substring(T,N+2),h),y))return;N+=2}}}(e),h=pr,y=!1,d},this.stop=function(){y=!0}}function mr(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var fr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},dr="xsi:type";function yr(e){return e.xml&&e.xml.serialize}function gr(e){return yr(e)===dr}function vr(e,t){return mr(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function br(e){return new Error(e)}function xr(e){return e.$descriptor}function wr(e){Xi(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw br("expected element");var t,n=this.elementsById,i=xr(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw br("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Er(){}function _r(){}function Ar(){}function Sr(e,t){this.property=e,this.context=t}function Rr(e,t){this.element=t,this.propertyDesc=e}function Cr(){}function Mr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function kr(e,t,n){Mr.call(this,e,t,n)}function Pr(e,t,n){this.model=e,this.context=n}function Or(e){e instanceof Ii&&(e={model:e}),Xi(this,{lax:!1},e)}Er.prototype.handleEnd=function(){},Er.prototype.handleText=function(){},Er.prototype.handleNode=function(){},_r.prototype=Object.create(Er.prototype),_r.prototype.handleNode=function(){return this},Ar.prototype=Object.create(Er.prototype),Ar.prototype.handleText=function(e){this.body=(this.body||"")+e},Sr.prototype=Object.create(Ar.prototype),Sr.prototype.handleNode=function(e){if(this.element)throw br("expected no sub nodes");return this.element=this.createReference(e),this},Sr.prototype.handleEnd=function(){this.element.id=this.body},Sr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Rr.prototype=Object.create(Ar.prototype),Rr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Mi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Cr.prototype=Object.create(Ar.prototype),Cr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Mr.prototype=Object.create(Cr.prototype),Mr.prototype.addReference=function(e){this.context.addReference(e)},Mr.prototype.handleText=function(e){if(!xr(this.element).bodyProperty)throw br("unexpected body text <"+e+">");Ar.prototype.handleText.call(this,e)},Mr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xr(t).bodyProperty;n&&void 0!==e&&(e=Mi(n.type,e),t.set(n.name,e))},Mr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=xr(i),o=this.context,a=new i({}),s=this.model;return Hi(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?Hi(e.split(" "),(function(e){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=Mi(i.type,e):"xmlns"!==n&&(t=Oi(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},Mr.prototype.getPropertyForNode=function(e){var t,n,i=Oi(e.name),r=this.type,o=this.model,a=xr(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return gr(l)&&(t=e.attributes[dr])?(t=function(e,t){var n=Oi(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),Xi({},l,{effectiveType:xr(n=o.getType(t)).name})):l;var c=o.getPackage(i.prefix);if(c){if(t=vr(i,c),n=o.getType(t),l=Gi(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return Xi({},l,{effectiveType:xr(n).name})}else if(l=Gi(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw br("unrecognized element <"+i.name+">")},Mr.prototype.toString=function(){return"ElementDescriptor["+xr(this.type).name+"]"},Mr.prototype.valueHandler=function(e,t){return new Rr(e,t)},Mr.prototype.referenceHandler=function(e){return new Sr(e,this.context)},Mr.prototype.handler=function(e){return"Element"===e?new Pr(this.model,e,this.context):new Mr(this.model,e,this.context)},Mr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Pi(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(Xi(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},kr.prototype=Object.create(Mr.prototype),kr.prototype.createElement=function(e){var t=e.name,n=Oi(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&vr(n,o)||t;if(!r.hasType(a))throw br("unexpected element <"+e.originalName+">");return Mr.prototype.createElement.call(this,e)},Pr.prototype=Object.create(Cr.prototype),Pr.prototype.createElement=function(e){var t=e.name,n=Oi(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Pr.prototype.handleChild=function(e){var t=new Pr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Pr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Or.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Mr?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new wr(Xi({},t,{rootHandler:i})),s=new hr({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw br(l)}function p(e,t){return c(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,m=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){p(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new _r)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!m.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",c).on("warn",p),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=xr(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=br("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,c=a.references,p=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:p,references:c,warnings:l})}))},Or.prototype.handler=function(e){return new kr(this.model,e)};var Dr=/<|>|'|"|&|\n\r|\n/g,Tr=/<|>|&/g;function Nr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function Br(e,t){return mr(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Lr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ir(e){return zi(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var jr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Fr={"<":"lt",">":"gt","&":"amp"};function Vr(e,t,n){return(e=zi(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function zr(e){this.tagName=e}function Wr(){}function Gr(e){this.tagName=e}function $r(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Hr(e,t){$r.call(this,e,t)}function Kr(){this.value="",this.write=function(e){this.value+=e}}function Ur(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function qr(e){return e=Xi({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Kr,r=new Ur(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new $r).build(t).serializeTo(r),!n)return i.value}}}function Yr(e,t){Ii.call(this,e,t)}zr.prototype.build=function(e){return this.element=e,this},zr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Wr.prototype.serializeValue=Wr.prototype.serializeTo=function(e){e.append(this.escape?Vr(this.value,Tr,Fr):this.value)},Wr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Tr)&&(this.escape=!0),this},Lr(Gr,Wr),Gr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},$r.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return $i(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!Wi(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes($i(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return $i(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},$r.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?Xi({localName:t.ns.localName},e):Xi({localName:Br(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},$r.prototype.nsPropertyTagName=function(e){return function(e,t){return Xi({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},$r.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},$r.prototype.nsAttributeName=function(e){var t;if(t=zi(e)?Oi(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:Xi({localName:t.localName},n)},$r.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return Hi(e,(function(r,o){"$body"===o?n.push((new Wr).build({type:"String"},r)):"$children"===o?Hi(r,(function(e){n.push(new $r(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},$r.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Oi(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},$r.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return Hi(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},$r.prototype.parseGenericAttributes=function(e,t){var n=this;Hi(t,(function(t){if(t.name!==dr)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},$r.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;Hi(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Wr).build(e,r[0]));else if(Pi(e.type))Hi(r,(function(i){n.push(new Gr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)Hi(r,(function(i){n.push(new zr(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=gr(e),s=function(e){return"property"===yr(e)}(e);Hi(r,(function(i){var r;r=a?new Hr(t,e):s?new $r(t,e):new $r(t),n.push(r.build(i))}))}}))},$r.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Nr(t):n=t),n},$r.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},$r.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=fr[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&a.mapPrefix(s,l),e},$r.prototype.parseAttributes=function(e){var t=this,n=this.element;Hi(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];Hi(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},$r.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ir(e)},$r.prototype.addAttribute=function(e,t){var n=this.attrs;zi(t)&&(t=Vr(t,Dr,jr));var i=function(e,t){t=Ki(t);var n=Vi(e)?-1:void 0;return Hi(e,(function(e,i){if(t(e,i))return n=i,!1})),n}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},$r.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),Hi(t,(function(t){e.append(" ").append(Ir(t.name)).append('="').append(t.value).append('"')}))},$r.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Wr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),Hi(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Lr(Hr,$r),Hr.prototype.parseNsAttributes=function(e){var t=$r.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(dr),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Hr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Yr.prototype=Object.create(Ii.prototype),Yr.prototype.fromXML=function(e,t,n){var i;i=t,"[object String]"!==hi.call(i)&&(n=t,t="bpmn:Definitions");var r=new Or(fi({model:this,lax:!0},n)),o=r.handler(t);return r.fromXML(e,o)},Yr.prototype.toXML=function(e,t){var n=new qr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Xr={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Zr(e,t){return new Yr(fi({},Xr,e),t)}function Jr(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&s(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function Qr(e,t){return e.$instanceOf(t)}function eo(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:xt(n)}));return e.element(n,r[n.id],i)}(n,i);return a(n),o}catch(e){l(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:xt(n)})),console.error(e)}}function l(t,n){e.error(t,n)}function m(e){var n,i=e.bpmnElement;i?r[i.id]?l(t("multiple DI elements defined for {element}",{element:xt(i)}),{element:i}):(r[i.id]=e,c(n=i,"di")||Object.defineProperty(n,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})):l(t("no bpmnElement referenced in {element}",{element:xt(e)}),{element:e})}function f(e){var t;m(t=e.plane),h(t.planeElement,d)}function d(e){m(e)}function y(){for(;i.length;)i.shift()()}function g(e,t){P(e,t),A(e.ioSpecification,t),_(e.artifacts,t),a(e)}function v(e,t){s(e,t)}function b(e,t){s(e,t)}function x(e,t){s(e,t)}function w(e,t){s(e,t)}function E(e,t){s(e,t)}function _(e,t){h(e,(function(e){Qr(e,"bpmn:Association")?i.push((function(){E(e,t)})):E(e,t)}))}function A(e,t){e&&(h(e.dataInputs,o(x,t)),h(e.dataOutputs,o(w,t)))}function S(e,t){P(e,t),_(e.artifacts,t)}function R(e,t){var n=s(e,t);Qr(e,"bpmn:SubProcess")&&S(e,n||t),Qr(e,"bpmn:Activity")&&A(e.ioSpecification,t),i.push((function(){h(e.dataInputAssociations,o(b,t)),h(e.dataOutputAssociations,o(b,t))}))}function C(e,t){s(e,t)}function M(e,t){i.push((function(){var n=s(e,t);e.childLaneSet&&k(e.childLaneSet,n||t),function(e){h(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function k(e,t){h(e.lanes,o(M,t))}function P(e,n){!function(e,n){h(e,(function(e){Qr(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):Qr(e,"bpmn:BoundaryEvent")?i.unshift((function(){R(e,n)})):Qr(e,"bpmn:FlowNode")?R(e,n):Qr(e,"bpmn:DataObject")||(Qr(e,"bpmn:DataStoreReference")||Qr(e,"bpmn:DataObjectReference")?C(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:xt(e),context:n?xt(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){h(e,o(k,t))}(e.laneSets,n)}function O(e,t){var n=s(e,t),i=e.processRef;i&&g(i,n||t)}return{handleDeferred:y,handleDefinitions:function(a,s){var c=a.diagrams;if(s&&-1===c.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&c&&c.length&&(s=c[0]),!s)throw new Error(t("no diagram to display"));r={},f(s);var d=s.plane;if(!d)throw new Error(t("no plane for {element}",{element:xt(s)}));var b=d.bpmnElement;if(!b){if(b=function(e){return p(e.rootElements,(function(e){return Qr(e,"bpmn:Process")||Qr(e,"bpmn:Collaboration")}))}(a),!b)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:xt(d),rootElement:xt(b)})),d.bpmnElement=b,m(d)}var x,w,E=function(t,n){return e.root(t,r[t.id],n)}(b,d);if(Qr(b,"bpmn:Process")||Qr(b,"bpmn:SubProcess"))g(b,E);else{if(!Qr(b,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:xt(d),rootElement:xt(b)}));w=E,h((x=b).participants,o(O,w)),_(x.artifacts,w),i.push((function(){!function(e,t){h(e,o(v,t))}(x.messageFlows,w)})),function(e,t){var i=u(e,(function(e){return!n[e.id]&&Qr(e,"bpmn:Process")&&e.laneSets}));i.forEach(o(g,t))}(a.rootElements,E)}y()},handleSubProcess:S,registerDi:m}}function to(e,t,n){var i,r,o,a,s=[];function l(e,t){var n=new eo({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;E(i,"bpmn:Process")||E(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(E(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=E(r,"bpmn:Collaboration")?r:p(e.rootElements,(function(e){if(E(e,"bpmn:Collaboration"))return p(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){let n=[];return h(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef})),o.push(n));var a=no(o),s=[t],l=[i];return h(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))})),s}(e,t);if(!r)throw new Error(o("no diagram to display"));h(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(l+"_plane")||a.findRoot(l))}return new Promise((function(c,p){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),c({warnings:s})}catch(e){return e.warnings=s,p(e)}}))}function no(e){var t=[];return h(e,(function(e){e&&(t.push(e),t=t.concat(no(e.flowElements)))})),t}var io,ro='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',oo={verticalAlign:"middle"},ao={color:"#404040"},so={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},lo={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},co={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"};function po(){io||(se(io=Se('<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg></a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>'),so),se(Re("svg",io),oo),se(Re(".backdrop",io),lo),se(Re(".notice",io),co),se(Re(".link",io),ao,{margin:"15px 20px 15px 10px",alignSelf:"center"}),we.bind(io,".backdrop","click",(function(e){document.body.removeChild(io)}))),document.body.appendChild(io)}function uo(e){e=x({},mo,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=Se('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ro+"</a>");se(Re("svg",t),oo),se(t,ao,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),ve.bind(t,"click",(function(e){po(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function ho(e,t){return e.warnings=t,e}e(uo,ui),uo.prototype.importXML=Jr((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,l=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:l,references:a,warnings:i}))||o;const c=await this.importDefinitions(o,t);return i=i.concat(c.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),ho(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}})),uo.prototype.importDefinitions=Jr((async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}})),uo.prototype.open=Jr((async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw ho(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return p(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw ho(t,[]),t}try{this.clear()}catch(e){throw ho(e,[]),e}const{warnings:i}=await to(this,t,n);return{warnings:i}})),uo.prototype.saveXML=Jr((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})),uo.prototype.saveSVG=Jr((async function(e={}){let t,n;this._emit("saveSVG.start");try{const e=this.get("canvas"),n=e.getActiveLayer(),i=Re("defs",e._svg),r=Ke(n),o=i?"<defs>"+Ke(i)+"</defs>":"",a=n.getBBox();t='<?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){n=e}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}})),uo.prototype._setDefinitions=function(e){this._definitions=e},uo.prototype.getModules=function(){return this._modules},uo.prototype.clear=function(){this.getDefinitions()&&ui.prototype.clear.call(this)},uo.prototype.destroy=function(){ui.prototype.destroy.call(this),Ce(this._container)},uo.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},uo.prototype.off=function(e,t){this.get("eventBus").off(e,t)},uo.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=Re(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},uo.prototype.getDefinitions=function(){return this._definitions},uo.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},uo.prototype._init=function(e,t,n){const i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=x(function(e,t){let n={};return h(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}(n,["additionalModules"]),{canvas:x({},n.canvas,{container:e}),modules:o});ui.call(this,a),n&&n.container&&this.attachTo(n.container)},uo.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},uo.prototype._createContainer=function(e){const t=Se('<div class="bjs-container"></div>');return se(t,{width:fo(e.width),height:fo(e.height),position:e.position}),t},uo.prototype._createModdle=function(e){return new Zr(x({},this._moddleExtensions,e.moddleExtensions))},uo.prototype._modules=[];const mo={width:"100%",height:"100%",position:"relative"};function fo(e){return e+(a(e)?"px":"")}function yo(e){uo.call(this,e)}e(yo,uo),yo.prototype._modules=[St,pt,Kt,Qt,vn],yo.prototype._moddleExtensions={};var go=["c","C",67],vo=["v","V",86],bo=["y","Y",89],xo=["z","Z",90];function wo(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Eo(e,t){return-1!==(e=r(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.keyCode)}function _o(e){return e.shiftKey}var Ao="keyboard.keydown",So="input-handle-modified-keys";function Ro(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()}))}Ro.$inject=["config.keyboard","eventBus"],Ro.prototype._keydownHandler=function(e){this._keyHandler(e,Ao)},Ro.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Ro.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ao,n)&&e.preventDefault()}},Ro.prototype._isEventIgnored=function(e){return(t=e.target)&&(he(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},Ro.prototype._isModifiedKeyIgnored=function(e){return!wo(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},Ro.prototype._getAllowedModifiers=function(e){var t=me(e,"[input-handle-modified-keys]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(So).split(",")},Ro.prototype.bind=function(e){this.unbind(),this._node=e,ve.bind(e,"keydown",this._keydownHandler,!0),ve.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},Ro.prototype.getBinding=function(){return this._node},Ro.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ve.unbind(e,"keydown",this._keydownHandler,!0),ve.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},Ro.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Ro.prototype.addListener=function(e,t,n){s(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ao,e,t)},Ro.prototype.removeListener=function(e,t){this._eventBus.off(t||Ao,e)},Ro.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Ro.prototype.isCmd=wo,Ro.prototype.isShift=_o,Ro.prototype.isKey=Eo;function Co(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}Co.$inject=["eventBus","keyboard"],Co.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(function(e){return wo(e)&&!_o(e)&&Eo(xo,e)}(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(function(e){return wo(e)&&(Eo(bo,e)||Eo(xo,e)&&_o(e))}(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return wo(e)&&Eo(go,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return wo(e)&&Eo(vo,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Eo(["+","Add","="],n)&&wo(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Eo(["-","Subtract"],n)&&wo(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Eo("0",n)&&wo(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Eo(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Mo={__init__:["keyboard","keyboardBindings"],keyboard:["type",Ro],keyboardBindings:["type",Co]},ko={moveSpeed:50,moveSpeedAccelerated:200};function Po(e,t,n){var i=this;this._config=x({},ko,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})}}Po.$inject=["config.keyboardMove","keyboard","canvas"];var Oo={__depends__:[Mo],__init__:["keyboardMove"],keyboardMove:["type",Po]},Do=/^djs-cursor-.*$/;function To(e){var t=ce(document.body);t.removeMatching(Do),e&&t.add("djs-cursor-"+e)}function No(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Bo(e,t){var n;function i(i){var r,o=n.start,a=n.button,s=Ct(i),l=No(s,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&function(e,t){function n(){return!1}t=t||"element.click",e.once(t,5e3,n)}(e),To("grab")),n.dragging)&&(l=No(s,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=s);i.preventDefault()}function r(e){ve.unbind(document,"mousemove",i),ve.unbind(document,"mouseup",r),n=null,To(null)}e.on("element.mousedown",500,(function(e){return function(e){if(me(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Ct(e)},ve.bind(document,"mousemove",i),ve.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Bo.$inject=["eventBus","canvas"];var Lo={__init__:["moveCanvas"],moveCanvas:["type",Bo]};function Io(e){return Math.log(e)/Math.log(10)}function jo(e,t){var n=Io(e.min),i=Io(e.max);return(Math.abs(n)+Math.abs(i))/t}var Fo=Math.sign||function(e){return e>=0?1:-1},Vo={min:.2,max:4};function zo(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=b(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)}))}zo.$inject=["config.zoomScroll","eventBus","canvas"],zo.prototype.scroll=function(e){this._canvas.scroll(e)},zo.prototype.reset=function(){this._canvas.zoom("fit-viewport")},zo.prototype.zoom=function(e,t){var n=jo(Vo,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},zo.prototype._handleWheel=function(e){if(!me(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))*Fo(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)}},zo.prototype.stepZoom=function(e,t){var n=jo(Vo,10);this._zoom(e,t,n)},zo.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Io(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,l,c=Math.pow(10,a);i.zoom((s=Vo,l=c,Math.max(s.min,Math.min(s.max,l))),t)},zo.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&ve[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},zo.prototype._init=function(e){this.toggle(e)};var Wo={__init__:["zoomScroll"],zoomScroll:["type",zo]};function Go(e){yo.call(this,e)}return e(Go,yo),Go.prototype._navigationModules=[Oo,Lo,Wo],Go.prototype._modules=[].concat(yo.prototype._modules,Go.prototype._navigationModules),Go}));