UNPKG

bpmn-js

Version:

A bpmn 2.0 toolkit and web modeler

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