UNPKG

bpmn-js

Version:

A bpmn 2.0 toolkit and web modeler

2 lines 449 kB
/*! bpmn-js - bpmn-modeler v0.27.2 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).BpmnJS=e()}}(function(){var e=function(e,t,r){if("string"==typeof t){if(void 0===r)return function(e,t){return n[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);i(e,t,r)}else!function(e,t){var n,r,o=Object.keys(t);for(n=0;r=o[n];n++)i(e,r,t[r])}(e,t);return e},t=2,n={"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":t,"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":t,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function i(e,i,r){var o=i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=n[o];a?(a===t&&"number"==typeof r&&(r=String(r)+"px"),e.style[o]=r):e.setAttributeNS(null,i,r)}var r={svg:"http://www.w3.org/2000/svg"},o=function(e){"<svg"===e.substring(0,4)?-1===e.indexOf(r.svg)&&(e=a+e.substring(4)):e=a+">"+e+"</svg>";return function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e)},a='<svg xmlns="'+r.svg+'"';var s=function(t,n){var i;"<"===t.charAt(0)?(i=o(t).firstChild,i=document.importNode(i,!0)):i=document.createElementNS(r.svg,t);n&&e(i,n);return i};var c={};function p(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}c.componentsToPath=function(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")},c.createLine=function(t,n){var i=s("polyline");return e(i,{points:p(t)}),n&&e(i,n),i},c.updateLine=function(t,n){return e(t,{points:p(n)}),t};var l=function(e,t){for(var n=-1,i=e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0};var u=function(e,t){for(var n=-1,i=e.length;++n<i;)if(t(e[n],n,e))return!0;return!1};var h=function(e,t,n,i,r,o,a){var s=-1,c=e.length,p=t.length;if(c!=p&&!(r&&p>c))return!1;for(;++s<c;){var l=e[s],h=t[s],d=i?i(r?h:l,r?l:h,s):void 0;if(void 0!==d){if(d)continue;return!1}if(r){if(!u(t,function(e){return l===e||n(l,e,i,r,o,a)}))return!1}else if(l!==h&&!n(l,h,i,r,o,a))return!1}return!0},d="[object Boolean]",f="[object Date]",m="[object Error]",v="[object Number]",y="[object RegExp]",g="[object String]";var b=function(e,t,n){switch(n){case d:case f:return+e==+t;case m:return e.name==t.name&&e.message==t.message;case v:return e!=+e?t!=+t:e==+t;case y:case g:return e==t+""}return!1};var x=function(e){return!!e&&"object"==typeof e};var _=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)},E="[object Function]",w=Object.prototype.toString;var S=function(e){return _(e)&&w.call(e)==E},T=/^\[object .+?Constructor\]$/,C=Object.prototype,A=Function.prototype.toString,R=C.hasOwnProperty,P=RegExp("^"+A.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var M=function(e){return null!=e&&(S(e)?P.test(A.call(e)):x(e)&&T.test(e))};var k=function(e,t){var n=null==e?void 0:e[t];return M(n)?n:void 0};var N=function(e){return function(t){return null==t?void 0:t[e]}},D=N("length"),B=9007199254740991;var O=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=B};var j=function(e){return null!=e&&O(D(e))},L=/^\d+$/,I=9007199254740991;var z=function(e,t){return e="number"==typeof e||L.test(e)?+e:-1,t=null==t?I:t,e>-1&&e%1==0&&e<t},F=Object.prototype,$=F.hasOwnProperty,W=F.propertyIsEnumerable;var G=function(e){return x(e)&&j(e)&&$.call(e,"callee")&&!W.call(e,"callee")},H=Object.prototype.toString,V=k(Array,"isArray")||function(e){return x(e)&&O(e.length)&&"[object Array]"==H.call(e)},U=Object.prototype.hasOwnProperty;var q=function(e){if(null==e)return[];_(e)||(e=Object(e));var t=e.length;t=t&&O(t)&&(V(e)||G(e))&&t||0;for(var n=e.constructor,i=-1,r="function"==typeof n&&n.prototype===e,o=Array(t),a=t>0;++i<t;)o[i]=i+"";for(var s in e)a&&z(s,t)||"constructor"==s&&(r||!U.call(e,s))||o.push(s);return o},Y=Object.prototype.hasOwnProperty;var K=function(e){for(var t=q(e),n=t.length,i=n&&e.length,r=!!i&&O(i)&&(V(e)||G(e)),o=-1,a=[];++o<n;){var s=t[o];(r&&z(s,i)||Y.call(e,s))&&a.push(s)}return a},X=k(Object,"keys"),Z=X?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&j(e)?K(e):_(e)?X(e):[]}:K,Q=Object.prototype.hasOwnProperty;var J=function(e,t,n,i,r,o,a){var s=Z(e),c=s.length;if(c!=Z(t).length&&!r)return!1;for(var p=c;p--;){var l=s[p];if(!(r?l in t:Q.call(t,l)))return!1}for(var u=r;++p<c;){var h=e[l=s[p]],d=t[l],f=i?i(r?d:h,r?h:d,l):void 0;if(!(void 0===f?n(h,d,i,r,o,a):f))return!1;u||(u="constructor"==l)}if(!u){var m=e.constructor,v=t.constructor;if(m!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof v&&v instanceof v))return!1}return!0},ee={};ee["[object Float32Array]"]=ee["[object Float64Array]"]=ee["[object Int8Array]"]=ee["[object Int16Array]"]=ee["[object Int32Array]"]=ee["[object Uint8Array]"]=ee["[object Uint8ClampedArray]"]=ee["[object Uint16Array]"]=ee["[object Uint32Array]"]=!0,ee["[object Arguments]"]=ee["[object Array]"]=ee["[object ArrayBuffer]"]=ee["[object Boolean]"]=ee["[object Date]"]=ee["[object Error]"]=ee["[object Function]"]=ee["[object Map]"]=ee["[object Number]"]=ee["[object Object]"]=ee["[object RegExp]"]=ee["[object Set]"]=ee["[object String]"]=ee["[object WeakMap]"]=!1;var te=Object.prototype.toString;var ne=function(e){return x(e)&&O(e.length)&&!!ee[te.call(e)]},ie="[object Arguments]",re="[object Array]",oe="[object Object]",ae=Object.prototype,se=ae.hasOwnProperty,ce=ae.toString;var pe=function(e,t,n,i,r,o,a){var s=V(e),c=V(t),p=re,l=re;s||((p=ce.call(e))==ie?p=oe:p!=oe&&(s=ne(e))),c||((l=ce.call(t))==ie?l=oe:l!=oe&&(c=ne(t)));var u=p==oe,d=l==oe,f=p==l;if(f&&!s&&!u)return b(e,t,p);if(!r){var m=u&&se.call(e,"__wrapped__"),v=d&&se.call(t,"__wrapped__");if(m||v)return n(m?e.value():e,v?t.value():t,i,r,o,a)}if(!f)return!1;o||(o=[]),a||(a=[]);for(var y=o.length;y--;)if(o[y]==e)return a[y]==t;o.push(e),a.push(t);var g=(s?h:J)(e,t,n,i,r,o,a);return o.pop(),a.pop(),g};var le=function e(t,n,i,r,o,a){return t===n||(null==t||null==n||!_(t)&&!x(n)?t!=t&&n!=n:pe(t,n,e,i,r,o,a))};var ue=function(e){return _(e)?e:Object(e)};var he=function(e,t,n){var i=t.length,r=i,o=!n;if(null==e)return!r;for(e=ue(e);i--;){var a=t[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<r;){var s=(a=t[i])[0],c=e[s],p=a[1];if(o&&a[2]){if(void 0===c&&!(s in e))return!1}else{var l=n?n(c,p,s):void 0;if(!(void 0===l?le(p,c,n,!0):l))return!1}}return!0};var de=function(e){return e==e&&!_(e)};var fe=function(e){e=ue(e);for(var t=-1,n=Z(e),i=n.length,r=Array(i);++t<i;){var o=n[t];r[t]=[o,e[o]]}return r};var me=function(e){for(var t=fe(e),n=t.length;n--;)t[n][2]=de(t[n][1]);return t};var ve=function(e){var t=me(e);if(1==t.length&&t[0][2]){var n=t[0][0],i=t[0][1];return function(e){return null!=e&&e[n]===i&&(void 0!==i||n in ue(e))}}return function(e){return he(e,t)}};var ye=function(e){var t=e?e.length:0;return t?e[t-1]:void 0};var ge=function(e,t,n){if(null!=e){void 0!==n&&n in ue(e)&&(t=[n]);for(var i=0,r=t.length;null!=e&&i<r;)e=e[t[i++]];return i&&i==r?e:void 0}};var be=function(e,t,n){var i=-1,r=e.length;(t=null==t?0:+t||0)<0&&(t=-t>r?0:r+t),(n=void 0===n||n>r?r:+n||0)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(r);++i<r;)o[i]=e[i+t];return o},xe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,_e=/^\w*$/;var Ee=function(e,t){var n=typeof e;return!!("string"==n&&_e.test(e)||"number"==n)||!V(e)&&(!xe.test(e)||null!=t&&e in ue(t))};var we=function(e){return null==e?"":e+""},Se=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Te=/\\(\\)?/g;var Ce=function(e){if(V(e))return e;var t=[];return we(e).replace(Se,function(e,n,i,r){t.push(i?r.replace(Te,"$1"):n||e)}),t};var Ae=function(e,t){var n=V(e),i=Ee(e)&&de(t),r=e+"";return e=Ce(e),function(o){if(null==o)return!1;var a=r;if(o=ue(o),(n||!i)&&!(a in o)){if(null==(o=1==e.length?o:ge(o,be(e,0,-1))))return!1;a=ye(e),o=ue(o)}return o[a]===t?void 0!==t||a in o:le(t,o[a],void 0,!0)}};var Re=function(e){return e};var Pe=function(e,t,n){if("function"!=typeof e)return Re;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,i,r){return e.call(t,n,i,r)};case 4:return function(n,i,r,o){return e.call(t,n,i,r,o)};case 5:return function(n,i,r,o,a){return e.call(t,n,i,r,o,a)}}return function(){return e.apply(t,arguments)}};var Me=function(e){var t=e+"";return e=Ce(e),function(n){return ge(n,e,t)}};var ke=function(e){return Ee(e)?N(e):Me(e)};var Ne=function(e,t,n){var i=typeof e;return"function"==i?void 0===t?e:Pe(e,t,n):null==e?Re:"object"==i?ve(e):void 0===t?ke(e):Ae(e,t)};var De=function(e){return function(t,n,i){for(var r=ue(t),o=i(t),a=o.length,s=e?a:-1;e?s--:++s<a;){var c=o[s];if(!1===n(r[c],c,r))break}return t}}();var Be=function(e,t){return De(e,t,Z)};var Oe=function(e,t){return function(n,i){var r=n?D(n):0;if(!O(r))return e(n,i);for(var o=t?r:-1,a=ue(n);(t?o--:++o<r)&&!1!==i(a[o],o,a););return n}}(Be);var je=function(e,t){var n=!0;return Oe(e,function(e,i,r){return n=!!t(e,i,r)}),n};var Le=function(e,t,n){if(!_(n))return!1;var i=typeof t;if("number"==i?j(n)&&z(t,n.length):"string"==i&&t in n){var r=n[t];return e==e?e===r:r!=r}return!1};var Ie=function(e,t,n){var i=V(e)?l:je;return n&&Le(e,t,n)&&(t=void 0),"function"==typeof t&&void 0===n||(t=Ne(t,n,3)),i(e,t)};var ze=function(e,t){var n;return Oe(e,function(e,i,r){return!(n=t(e,i,r))}),!!n};var Fe=function(e,t,n){var i=V(e)?u:ze;return n&&Le(e,t,n)&&(t=void 0),"function"==typeof t&&void 0===n||(t=Ne(t,n,3)),i(e,t)},$e={},We=c.componentsToPath;function Ge(e){return e.businessObject.di}$e.isTypedEvent=function(e,t,n){return Fe(e.eventDefinitions,function(i){return i.$type===t&&function(e,t){return Ie(t,function(t,n){return e[n]==t})}(e,n)})},$e.isThrowEvent=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type},$e.isCollection=function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection},$e.getDi=Ge,$e.getSemantic=function(e){return e.businessObject},$e.getFillColor=function(e,t){return Ge(e).get("bioc:fill")||t||"white"},$e.getStrokeColor=function(e,t){return Ge(e).get("bioc:stroke")||t||"black"},$e.getCirclePath=function(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return We([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])},$e.getRoundRectPath=function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return We([["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.getDiamondPath=function(e){var t=e.width,n=e.height,i=e.x,r=e.y,o=t/2,a=n/2;return We([["M",i+o,r],["l",o,a],["l",-o,a],["l",-o,-a],["z"]])},$e.getRectPath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return We([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])};var He={};function Ve(e){return e&&e.businessObject||e}He.is=function(e,t){var n=Ve(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)},He.getBusinessObject=Ve;var Ue=function(e,t){for(var n=-1,i=e.length;++n<i&&!1!==t(e[n],n,e););return e};var qe=function(e,t){return function(n,i,r){return"function"==typeof i&&void 0===r&&V(n)?e(n,i):t(n,Pe(i,r,3))}}(Ue,Oe),Ye={},Ke=He.is,Xe=He.getBusinessObject;function Ze(e,t){var n=Xe(e),i=!1;return n.eventDefinitions&&qe(n.eventDefinitions,function(e){Ke(e,t)&&(i=!0)}),i}Ye.isExpanded=function(e){return!Ke(e,"bpmn:CallActivity")&&(Ke(e,"bpmn:SubProcess")?!!Xe(e).di.isExpanded:!Ke(e,"bpmn:Participant")||!!Xe(e).processRef)},Ye.isInterrupting=function(e){return e&&!1!==Xe(e).isInterrupting},Ye.isEventSubProcess=function(e){return e&&!!Xe(e).triggeredByEvent},Ye.hasErrorEventDefinition=function(e){return Ze(e,"bpmn:ErrorEventDefinition")},Ye.hasEscalationEventDefinition=function(e){return Ze(e,"bpmn:EscalationEventDefinition")},Ye.hasCompensateEventDefinition=function(e){return Ze(e,"bpmn:CompensateEventDefinition")};var Qe=1e3;function Je(e,t){var n=this;t=t||Qe,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,o=t.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r):n.drawConnection(o,r)}),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)})}Je.prototype.canRender=function(){},Je.prototype.drawShape=function(){},Je.prototype.drawConnection=function(){},Je.prototype.getShapePath=function(){},Je.prototype.getConnectionPath=function(){};var et=Je,tt={},nt=s("svg");function it(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}tt.createTransform=function(e){return e?nt.createSVGTransformFromMatrix(e):nt.createSVGTransform()},tt.createMatrix=function(e,t,n,i,r,o){var a=nt.createSVGMatrix();switch(arguments.length){case 0:return a;case 6:e={a:e,b:t,c:n,d:i,e:r,f:o}}return it(a,e)};var rt=function(e,t){var n=e.transform.baseVal;if(1===arguments.length)return n.consolidate();t.length?function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(ot(e,i));e.consolidate()}(n,t):n.initialize(ot(n,t))};function ot(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}var at={},st=tt.createTransform;at.transform=function(e,t,n,i,r){var o=st();o.setTranslate(t,n);var a=st();a.setRotate(i,0,0);var s=st();s.setScale(r||1,r||1),rt(e,[o,a,s])},at.translate=function(e,t,n){var i=st();i.setTranslate(t,n),rt(e,i)},at.rotate=function(e,t){var n=st();n.setRotate(t,0,0),rt(e,n)};var ct=function(e,t,n,i,r){return r(e,function(e,r,o){n=i?(i=!1,e):t(n,e,r,o)}),n};var pt=function(e,t){return function(n,i,r,o){var a=arguments.length<3;return"function"==typeof i&&void 0===o&&V(n)?e(n,i,r,a):ct(n,Ne(i,o,4),r,a,t)}}(function(e,t,n,i){var r=-1,o=e.length;for(i&&o&&(n=e[++r]);++r<o;)n=t(n,e[r],r,e);return n},Oe);var lt=function(e,t,n){for(var i=-1,r=Z(t),o=r.length;++i<o;){var a=r[i],s=e[a],c=n(s,t[a],a,e,t);(c==c?c===s:s!=s)&&(void 0!==s||a in e)||(e[a]=c)}return e};var ut=function(e,t,n){n||(n={});for(var i=-1,r=t.length;++i<r;){var o=t[i];n[o]=e[o]}return n};var ht=function(e,t){return null==t?e:ut(t,Z(t),e)},dt="Expected a function",ft=Math.max;var mt=function(e,t){if("function"!=typeof e)throw new TypeError(dt);return t=ft(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,i=-1,r=ft(n.length-t,0),o=Array(r);++i<r;)o[i]=n[t+i];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,n[0],o);case 2:return e.call(this,n[0],n[1],o)}var a=Array(t+1);for(i=-1;++i<t;)a[i]=n[i];return a[t]=o,e.apply(this,a)}};var vt=function(e){return mt(function(t,n){var i=-1,r=null==t?0:n.length,o=r>2?n[r-2]:void 0,a=r>2?n[2]:void 0,s=r>1?n[r-1]:void 0;for("function"==typeof o?(o=Pe(o,s,5),r-=2):r-=(o="function"==typeof s?s:void 0)?1:0,a&&Le(n[0],n[1],a)&&(o=r<3?void 0:o,r=1);++i<r;){var c=n[i];c&&e(t,c,o)}return t})},yt=vt(function(e,t,n){return n?lt(e,t,n):ht(e,t)});var gt=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t};var bt=function(e,t){return De(e,t,q)},xt="[object Object]",_t=Object.prototype,Et=_t.hasOwnProperty,wt=_t.toString;var St=function(e){var t,n;return!(!x(e)||wt.call(e)!=xt||G(e)||!(Et.call(e,"constructor")||"function"!=typeof(t=e.constructor)||t instanceof t))&&(bt(e,function(e,t){n=t}),void 0===n||Et.call(e,n))};var Tt=function(e){return ut(e,q(e))};var Ct=function(e,t,n,i,r,o,a){for(var s=o.length,c=t[n];s--;)if(o[s]==c)return void(e[n]=a[s]);var p=e[n],l=r?r(p,c,n,e,t):void 0,u=void 0===l;u&&(l=c,j(c)&&(V(c)||ne(c))?l=V(p)?p:j(p)?gt(p):[]:St(c)||G(c)?l=G(p)?Tt(p):St(p)?p:{}:u=!1),o.push(c),a.push(l),u?e[n]=i(l,c,r,o,a):(l==l?l!==p:p==p)&&(e[n]=l)};var At=vt(function e(t,n,i,r,o){if(!_(t))return t;var a=j(n)&&(V(n)||ne(n)),s=a?void 0:Z(n);return Ue(s||n,function(c,p){if(s&&(c=n[p=c]),x(c))r||(r=[]),o||(o=[]),Ct(t,n,p,e,i,r,o);else{var l=t[p],u=i?i(l,c,p,t,n):void 0,h=void 0===u;h&&(u=c),void 0===u&&(!a||p in t)||!h&&(u==u?u===l:l!=l)||(t[p]=u)}}),t});var Rt=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e};var Pt=function e(t,n,i,r){r||(r=[]);for(var o=-1,a=t.length;++o<a;){var s=t[o];x(s)&&j(s)&&(i||V(s)||G(s))?n?e(s,n,i,r):Rt(r,s):i||(r[r.length]=s)}return r};var Mt=function(e,t){e=ue(e);for(var n=-1,i=t.length,r={};++n<i;){var o=t[n];o in e&&(r[o]=e[o])}return r};var kt=function(e,t){var n={};return bt(e,function(e,i,r){t(e,i,r)&&(n[i]=e)}),n},Nt=mt(function(e,t){return null==e?{}:"function"==typeof t[0]?kt(e,Pe(t[0],t[1],3)):Mt(e,Pt(t))}),Dt=function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e};var Bt=function(e,t){return t.appendChild(Dt(e,t)),e};var Ot=function(e,t){return Bt(t,e),e};var jt=function(e){var t=e.parentNode;t&&t.removeChild(e);return e};var Lt=0,It={width:150,height:50};function zt(e,t){t.textContent=e;try{var n,i=""===e;return t.textContent=i?"dummy":e,n=Nt(t.getBBox(),["width","height"]),i&&(n.width=0),n}catch(e){return{width:0,height:0}}}function Ft(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=zt(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return $t(e,o,r,i);o=Wt(o,i.width,t)}}function $t(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 Wt(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"===n&&r.pop();break}r.push(n),o+=n.length}return r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function Gt(e){this._config=yt({},{size:It,padding:Lt,style:{},align:"center-top"},e||{})}Gt.prototype.createText=function(e,t){return this.layoutText(e,t).element},Gt.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Gt.prototype.layoutText=function(t,n){var i=At({},this._config.size,n.box||{}),r=At({},this._config.style,n.style||{}),o=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(n.align||this._config.align),a=function(e){return _(e)?yt({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==n.padding?n.padding:this._config.padding),c=n.fitBox||!1,p=t.split(/\r?\n/g),l=[],u=i.width-a.left-a.right,h=s("text");e(h,{x:0,y:0}),e(h,r);var d=function(){var t=document.getElementById("helper-svg");return t||(t=s("svg"),e(t,{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(t)),t}();for(Ot(d,h);p.length;)l.push(Ft(p,u,h));var f,m,v=pt(l,function(e,t,n){return e+t.height},0),y=pt(l,function(e,t,n){return t.width>e?t.width:e},0);switch(o.vertical){case"middle":f=(i.height-v)/2-l[0].height/4;break;default:f=a.top}var g=s("text");return e(g,r),qe(l,function(t){switch(f+=t.height,o.horizontal){case"left":m=a.left;break;case"right":m=(c?y:u)-a.right-t.width;break;default:m=Math.max(((c?y:u)-t.width)/2+a.left,0)}var n=s("tspan");e(n,{x:m,y:f}),n.textContent=t.text,Ot(g,n)}),jt(h),{dimensions:{width:y,height:v},element:g}};var Ht=Gt,Vt={},Ut=Vt=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),i=2;n===1/0;i*=2)n=Math.log(Math.pow(2,e/i))/Math.log(t)*i;var r=n-Math.floor(n),o="";for(i=0;i<Math.floor(n);i++){o=Math.floor(Math.random()*t).toString(t)+o}if(r){var a=Math.pow(t,r);o=Math.floor(Math.random()*a).toString(t)+o}var s=parseInt(o,t);return s!==1/0&&s>=Math.pow(2,e)?Ut(e,t):o};function qt(e){if(!(this instanceof qt))return new qt(e);e=e||[128,36,1],this._seed=e.length?Vt.rack(e[0],e[1],e[2]):e}Ut.rack=function(e,t,n){var i=function(i){var o=0;do{if(o++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var a=Ut(e,t)}while(Object.hasOwnProperty.call(r,a));return r[a]=i,a},r=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=t||16,i};var Yt=qt;qt.prototype.next=function(e){return this._seed(e||!0)},qt.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},qt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},qt.prototype.assigned=function(e){return this._seed.get(e)||!1},qt.prototype.unclaim=function(e){delete this._seed.hats[e]},qt.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Kt={};Kt="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var Xt={};(Xt=function(e,t){return(t=t||document).querySelector(e)}).all=function(e,t){return(t=t||document).querySelectorAll(e)};var Zt=function(e){return new nn(e)},Qt=function(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},Jt=/\s+/,en=Object.prototype.toString;function tn(e){return void 0!==e}function nn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}nn.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Qt(t,e)||t.push(e),tn(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},nn.prototype.remove=function(e){if("[object RegExp]"===en.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Qt(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},nn.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},nn.prototype.toggle=function(e,t){return this.list?(tn(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(tn(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},nn.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Jt);return""===e[0]&&e.shift(),e},nn.prototype.has=nn.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Qt(this.array(),e)};var rn=He.is,on=c.createLine,an=$e.isTypedEvent,sn=$e.isThrowEvent,cn=$e.isCollection,pn=$e.getDi,ln=$e.getSemantic,un=$e.getCirclePath,hn=$e.getRoundRectPath,dn=$e.getDiamondPath,fn=$e.getRectPath,mn=$e.getFillColor,vn=$e.getStrokeColor,yn=at.rotate,gn=at.transform,bn=at.translate,xn=new Yt,_n=10,En=3,wn={fontFamily:"Arial, sans-serif",fontSize:12},Sn=.95,Tn=.35;function Cn(t,n,i,r,o){et.call(this,t,o);var a=xn.next(),c=new Ht({style:wn,size:{width:100}}),p={},l=n.computeStyle;function u(t,n){var i=yt({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},n.attrs),o=n.ref||{x:0,y:0},a=n.scale||1;"none"===i.strokeDasharray&&(i.strokeDasharray=[1e4,1]);var c=s("marker");e(n.element,i),Ot(c,n.element),e(c,{id:t,viewBox:"0 0 20 20",refX:o.x,refY:o.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var l=Xt("defs",r._svg);l||(l=s("defs"),Ot(r._svg,l)),Ot(l,c),p[t]=c}function h(t,n,i){var r=t+"-"+n+"-"+i+"-"+a;return p[r]||function(t,n,i){var r=t+"-"+n+"-"+i+"-"+a;if("sequenceflow-end"===t){var o=s("path");e(o,{d:"M 1 5 L 11 10 L 1 15 Z"}),u(r,{element:o,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var c=s("circle");e(c,{cx:6,cy:6,r:3.5}),u(r,{element:c,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var p=s("path");e(p,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),u(r,{element:p,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var l=s("path");e(l,{d:"M 11 5 L 1 10 L 11 15"}),u(r,{element:l,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var h=s("path");e(h,{d:"M 1 5 L 11 10 L 1 15"}),u(r,{element:h,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var d=s("path");e(d,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),u(r,{element:d,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var f=s("path");e(f,{d:"M 6 4 L 10 16"}),u(r,{element:f,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(t,n,i),"url(#"+r+")"}function d(t,n,i,r,o){_(r)&&(o=r,r=0),r=r||0,o=l(o,{stroke:"black",strokeWidth:2,fill:"white"});var a=n/2,c=i/2,p=s("circle");return e(p,{cx:a,cy:c,r:Math.round((n+i)/4-r)}),e(p,o),Ot(t,p),p}function f(t,n,i,r,o,a){_(o)&&(a=o,o=0),o=o||0,a=l(a,{stroke:"black",strokeWidth:2,fill:"white"});var c=s("rect");return e(c,{x:o,y:o,width:n-2*o,height:i-2*o,rx:r,ry:r}),e(c,a),Ot(t,c),c}function m(e,t,n){n=l(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var i=on(t,n);return Ot(e,i),i}function v(t,n,i){i=l(i,["no-fill"],{strokeWidth:2,stroke:"black"});var r=s("path");return e(r,{d:n}),e(r,i),Ot(t,r),r}function y(e,t,n,i){return v(t,n,yt({"data-marker":e},i))}function g(e){return function(t,n){return C[e](t,n)}}function b(e){return C[e]}function x(e,t){var n=ln(e),i=sn(n);return an(n,"bpmn:MessageEventDefinition")?b("bpmn:MessageEventDefinition")(t,e,i):an(n,"bpmn:TimerEventDefinition")?b("bpmn:TimerEventDefinition")(t,e,i):an(n,"bpmn:ConditionalEventDefinition")?b("bpmn:ConditionalEventDefinition")(t,e):an(n,"bpmn:SignalEventDefinition")?b("bpmn:SignalEventDefinition")(t,e,i):an(n,"bpmn:CancelEventDefinition")&&an(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?b("bpmn:MultipleEventDefinition")(t,e,i):an(n,"bpmn:CancelEventDefinition")&&an(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?b("bpmn:ParallelMultipleEventDefinition")(t,e,i):an(n,"bpmn:EscalationEventDefinition")?b("bpmn:EscalationEventDefinition")(t,e,i):an(n,"bpmn:LinkEventDefinition")?b("bpmn:LinkEventDefinition")(t,e,i):an(n,"bpmn:ErrorEventDefinition")?b("bpmn:ErrorEventDefinition")(t,e,i):an(n,"bpmn:CancelEventDefinition")?b("bpmn:CancelEventDefinition")(t,e,i):an(n,"bpmn:CompensateEventDefinition")?b("bpmn:CompensateEventDefinition")(t,e,i):an(n,"bpmn:TerminateEventDefinition")?b("bpmn:TerminateEventDefinition")(t,e,i):null}function E(e,t,n){var i=c.createText(t||"",n);return Zt(i).add("djs-label"),Ot(e,i),i}function w(e,t,n){return E(e,ln(t).name,{box:t,align:n,padding:5,style:{fill:vn(t)}})}function S(e,t,n){var i=E(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:vn(n)}}),r=-1*n.height;gn(i,0,-r,270)}function T(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 C=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=Sn),d(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:mn(t),stroke:vn(t)};ln(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var i=b("bpmn:Event")(e,t,n);return x(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return v(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?vn(t):mn(t),stroke:n?mn(t):vn(t)})},"bpmn:TimerEventDefinition":function(e,t){var n=d(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:mn(t),stroke:vn(t)});v(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:vn(t)});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;v(e,o,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:vn(t)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return v(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?vn(t):"none",stroke:vn(t)})},"bpmn:ConditionalEventDefinition":function(e,t){return v(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:vn(t)})},"bpmn:LinkEventDefinition":function(e,t,n){return v(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?vn(t):"none",stroke:vn(t)})},"bpmn:ErrorEventDefinition":function(e,t,n){return v(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?vn(t):"none",stroke:vn(t)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=v(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?"black":"none"});return yn(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return v(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?vn(t):"none",stroke:vn(t)})},"bpmn:SignalEventDefinition":function(e,t,n){return v(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?vn(t):"none",stroke:vn(t)})},"bpmn:MultipleEventDefinition":function(e,t,n){return v(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?"black":"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return v(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:vn(t),stroke:vn(t)})},"bpmn:EndEvent":function(e,t){var n=b("bpmn:Event")(e,t,{strokeWidth:4,fill:mn(t),stroke:vn(t)});return x(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return d(e,t.width,t.height,8,{strokeWidth:4,fill:vn(t),stroke:vn(t)})},"bpmn:IntermediateEvent":function(e,t){var n=b("bpmn:Event")(e,t,{strokeWidth:1,fill:mn(t),stroke:vn(t)});return d(e,t.width,t.height,En,{strokeWidth:1,fill:mn(t,"none"),stroke:vn(t)}),x(t,e),n},"bpmn:IntermediateCatchEvent":g("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":g("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=Sn),f(e,t.width,t.height,_n,n)},"bpmn:Task":function(e,t){var n={fill:mn(t),stroke:vn(t)},i=b("bpmn:Activity")(e,t,n);return w(e,t,"center-middle"),A(e,t),i},"bpmn:ServiceTask":function(e,t){var n=b("bpmn:Task")(e,t);return v(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:mn(t),stroke:vn(t)}),v(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:mn(t)}),v(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:mn(t),stroke:vn(t)}),n},"bpmn:UserTask":function(e,t){var n=b("bpmn:Task")(e,t);return v(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:mn(t),stroke:vn(t)}),v(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:mn(t),stroke:vn(t)}),v(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:vn(t),stroke:vn(t)}),n},"bpmn:ManualTask":function(e,t){var n=b("bpmn:Task")(e,t);return v(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:mn(t),stroke:vn(t)}),n},"bpmn:SendTask":function(e,t){var n=b("bpmn:Task")(e,t);return v(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:vn(t),stroke:mn(t)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=ln(t),o=b("bpmn:Task")(e,t);return r.instantiate?(d(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}}),v(e,n,{strokeWidth:1,fill:mn(t),stroke:vn(t)}),o},"bpmn:ScriptTask":function(e,t){var n=b("bpmn:Task")(e,t);return v(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:vn(t)}),n},"bpmn:BusinessRuleTask":function(t,n){var r=b("bpmn:Task")(t,n),o=v(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}));e(o,{strokeWidth:1,fill:mn(n,"#aaaaaa"),stroke:vn(n)});var a=v(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));return e(a,{strokeWidth:1,stroke:vn(n)}),r},"bpmn:SubProcess":function(t,n,i){i=yt({fill:mn(n),stroke:vn(n)},i);var r=b("bpmn:Activity")(t,n,i),o=Ye.isExpanded(n);return Ye.isEventSubProcess(n)&&e(r,{strokeDasharray:"1,2"}),w(t,n,o?"center-top":"center-middle"),o?A(t,n):A(t,n,["SubProcessMarker"]),r},"bpmn:AdHocSubProcess":function(e,t){return b("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=b("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:vn(t)});return f(e,t.width,t.height,_n-2,En,r),i},"bpmn:CallActivity":function(e,t){return b("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:Sn,fill:mn(t),stroke:vn(t)},i=b("bpmn:Lane")(e,t,n);Ye.isExpanded(t)?(m(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:vn(t)}),S(e,ln(t).name,t)):E(e,ln(t).name,{box:t,align:"center-middle",style:{fill:vn(t)}});return!!ln(t).participantMultiplicity&&b("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=f(e,t.width,t.height,0,yt({fill:mn(t),fillOpacity:Tn,stroke:vn(t)},n)),r=ln(t);"bpmn:Lane"===r.$type&&S(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=b("bpmn:Gateway")(e,t);return d(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:mn(t),stroke:vn(t)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=b("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 pn(t).isMarkerVisible&&v(e,r,{strokeWidth:1,fill:vn(t),stroke:vn(t)}),n},"bpmn:ComplexGateway":function(e,t){var n=b("bpmn:Gateway")(e,t);return v(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:vn(t),stroke:vn(t)}),n},"bpmn:ParallelGateway":function(e,t){var n=b("bpmn:Gateway")(e,t);return v(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:vn(t),stroke:vn(t)}),n},"bpmn:EventBasedGateway":function(t,n){var r=ln(n),o=b("bpmn:Gateway")(t,n);d(t,n.width,n.height,.2*n.height,{strokeWidth:1,fill:"none",stroke:vn(n)});var a=r.eventGatewayType,s=!!r.instantiate;if("Parallel"===a){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:n.width,containerHeight:n.height,position:{mx:.474,my:.296}}),p=v(t,c);e(p,{strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!s){var l=d(t,n.width,n.height,.26*n.height);e(l,{strokeWidth:1,fill:"none",stroke:vn(n)})}!function(){var e=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:n.width,containerHeight:n.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:mn(n,"none"),stroke:vn(n)};v(t,e,r)}()}return o},"bpmn:Gateway":function(t,n){var i={fill:mn(n),fillOpacity:Sn,stroke:vn(n)};return function(t,n,i,r){var o=n/2,a=i/2,c=[{x:o,y:0},{x:n,y:a},{x:o,y:i},{x:0,y:a}].map(function(e){return e.x+","+e.y}).join(" ");r=l(r,{stroke:"black",strokeWidth:2,fill:"white"});var p=s("polygon");return e(p,{points:c}),e(p,r),Ot(t,p),p}(t,n.width,n.height,i)},"bpmn:SequenceFlow":function(t,n){var i,r=T(n),o=mn(n),a=vn(n),s=v(t,r,{strokeLinejoin:"round",markerEnd:h("sequenceflow-end",o,a),stroke:vn(n)}),c=ln(n);return n.source&&(i=n.source.businessObject,c.conditionExpression&&i.$instanceOf("bpmn:Activity")&&e(s,{markerStart:h("conditional-flow-marker",o,a)}),i.default&&(i.$instanceOf("bpmn:Gateway")||i.$instanceOf("bpmn:Activity"))&&i.default===c&&e(s,{markerStart:h("conditional-default-flow-marker",o,a)})),s},"bpmn:Association":function(e,t,n){var i=ln(t),r=mn(t),o=vn(t);return n=yt({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:vn(t)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=h("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=h("association-start",r,o)),m(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=mn(t),i=vn(t);return b("bpmn:Association")(e,t,{markerEnd:h("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=mn(t),i=vn(t);return b("bpmn:Association")(e,t,{markerEnd:h("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=ln(t),r=pn(t),o=mn(t),a=vn(t),s=v(e,T(t),{markerEnd:h("messageflow-end",o,a),markerStart:h("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:vn(t)});if(n.messageRef){var c=s.getPointAtLength(s.getTotalLength()/2),p=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:c.x,y:c.y}}),l={strokeWidth:1};"initiating"===r.messageVisibleKind?(l.fill="white",l.stroke="black"):(l.fill="#888",l.stroke="white"),v(e,p,l)}return s},"bpmn:DataObject":function(e,t){var n=v(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:mn(t),fillOpacity:Sn,stroke:vn(t)}),r=ln(t);return cn(r)&&function(e,t){var n=(t.height-16)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:n}});v(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":g("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=b("bpmn:DataObject")(e,t);return v(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=b("bpmn:DataObject")(e,t);return v(e,n,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(e,t){return v(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:mn(t),fillOpacity:Sn,stroke:vn(t)})},"bpmn:BoundaryEvent":function(e,t){var n=ln(t).cancelActivity,i={strokeWidth:1,fill:mn(t),stroke:vn(t),fillOpacity:1};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=b("bpmn:Event")(e,t,i);return d(e,t.width,t.height,En,yt(i,{fill:"none"})),x(t,e),r},"bpmn:Group":function(e,t){return f(e,t.width,t.height,_n,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n=ln(t),i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return E(e,n.name,{box:i,fitBox:!0,style:{fontSize:"11px"}})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=f(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return v(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:vn(t)}),E(e,ln(t).text||"",{box:t,align:"left-top",padding:5}),n},ParticipantMultiplicityMarker:function(e,t){y("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}}))},SubProcessMarker:function(e,t){var n=f(e,14,14,0,{strokeWidth:1,fill:mn(t),stroke:vn(t)});bn(n,t.width/2-7.5,t.height-20),y("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:mn(t),stroke:vn(t)})},ParallelMarker:function(e,t,n){y("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}}))},SequentialMarker:function(e,t,n){y("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}}))},CompensationMarker:function(e,t,n){y("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})},LoopMarker:function(e,t,n){y("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:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){y("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:"black"})}};function A(e,t,n){var i,r=ln(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},qe(n,function(n){b(n)(e,t,i)}),r.isForCompensation&&b("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&b("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&b("LoopMarker")(e,t,i),!1===s&&b("ParallelMarker")(e,t,i),!0===s&&b("SequentialMarker")(e,t,i))}this._drawPath=v}Kt(Cn,et),Cn.$inject=["eventBus","styles","pathMap","canvas"];var An=Cn;Cn.prototype.canRender=function(e){return rn(e,"bpmn:BaseElement")},Cn.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},Cn.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},Cn.prototype.getShapePath=function(e){return rn(e,"bpmn:Event")?un(e):rn(e,"bpmn:Activity")?hn(e,_n):rn(e,"bpmn:Gateway")?dn(e):fn(e)};var Rn=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 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},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