UNPKG

camunda-bpmn-js

Version:

Embeddable Camunda modeling distributions based on bpmn-js

1 lines 187 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnViewer=t()}(this,(function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}const t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0===e}function r(e){return void 0!==e}function o(e){return null==e}function a(e){return"[object Array]"===t.call(e)}function s(e){return"[object Object]"===t.call(e)}function l(e){return"[object Number]"===t.call(e)}function p(e){const n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function c(e){return"[object String]"===t.call(e)}function u(e,t){return!o(e)&&n.call(e,t)}function h(e,t){const n=x(t);let i;return m(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function f(e,t){const n=x(t);let i=[];return m(e,(function(e,t){n(e,t)&&i.push(e)})),i}function m(e,t){let n,r;if(i(e))return;const o=a(e)?b:w;for(let i in e)if(u(e,i)&&(n=e[i],r=t(n,o(i)),!1===r))return n}function d(e,t,n){return m(e,(function(e,i){n=t(n,e,i)})),n}function y(e,t){return!!d(e,(function(e,n,i){return e&&t(n,i)}),!0)}function g(e,t){return!!h(e,t)}function v(e){return function(t){return y(e,(function(e,n){return t[n]===e}))}}function x(e){return p(e)?e:t=>t===e}function w(e){return e}function b(e){return Number(e)}function E(e,t){return e.bind(t)}function _(e,...t){return Object.assign(e,...t)}var A=1e3;function k(e,t){var n=this;t=t||A,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function S(e,t){var n=R(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function R(e){return e&&e.businessObject||e}function C(e){return e&&e.di}function M(e,t){return!S(e,"bpmn:CallActivity")&&(S(e,"bpmn:SubProcess")?!(!(t=t||C(e))||!S(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!S(e,"bpmn:Participant")||!!R(e).processRef)}function P(e){if(S(e,"bpmn:Participant")||S(e,"bpmn:Lane")){var t=C(e).isHorizontal;return void 0===t||t}}k.prototype.canRender=function(e){},k.prototype.drawShape=function(e,t){},k.prototype.drawConnection=function(e,t){},k.prototype.getShapePath=function(e){},k.prototype.getConnectionPath=function(e){};var D={width:90,height:20},N=15;function T(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=N:a+=N,{x:a,y:s}}function B(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(D.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?T(e.waypoints):S(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+D.height/2}:{x:e.x+e.width/2,y:e.y+e.height+D.height/2}}(t),i=D),_({x:n.x-i.width/2,y:n.y-i.height/2},i)}function O(e){var t=e.businessObject,n=function(e){return S(e,"bpmn:FlowElement")||S(e,"bpmn:Participant")||S(e,"bpmn:Lane")||S(e,"bpmn:SequenceFlow")||S(e,"bpmn:MessageFlow")||S(e,"bpmn:DataInput")||S(e,"bpmn:DataOutput")?"name":S(e,"bpmn:TextAnnotation")?"text":S(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function L(e,t){var n,i,r,o;return t=!!t,a(e)||(e=[e]),m(e,(function(e){var a=e;e.waypoints&&!t&&(a=L(e.waypoints,!0));var s=a.x,l=a.y,p=a.height||0,c=a.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+c>r||void 0===r)&&(r=s+c),(l+p>o||void 0===o)&&(o=l+p)})),{x:n,y:i,height:o-i,width:r-n}}function I(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function F(e){return!(!e||!e.isFrame)}function j(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}var V=2,W={"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":V,"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":V,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function z(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=W[i];r?(r===V&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function $(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return W[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);z(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)z(e,i,t[i])}(e,t);return e}const G=Object.prototype.toString;function H(e){return new K(e)}function K(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}K.prototype.add=function(e){return this.list.add(e),this},K.prototype.remove=function(e){return"[object RegExp]"==G.call(e)?this.removeMatching(e):(this.list.remove(e),this)},K.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},K.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},K.prototype.array=function(){return Array.from(this.list)},K.prototype.has=K.prototype.contains=function(e){return this.list.contains(e)};var U={svg:"http://www.w3.org/2000/svg"},q='<svg xmlns="'+U.svg+'"';function Y(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(U.svg)&&(e=q+e.substring(4)):(e=q+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function X(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=Y(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(U.svg,e),t&&$(n,t),n}var Z=null;function J(){return null===Z&&(Z=X("svg")),Z}function Q(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function ee(e){return J().createSVGTransform()}function te(e){var t=e.parentNode;return t&&t.removeChild(e),e}function ne(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ie(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(ne(e,i))}(n,t)),n.consolidate()}function re(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function oe(e){return["L",e.x,e.y]}function ae(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let r=1;r<n;r++){const n=e[r-1],l=e[r],p=e[r+1];if(!p||!t){i.push(oe(l));continue}const c=Math.min(t,le(l.x-n.x,l.y-n.y),le(p.x-l.x,p.y-l.y));if(!c){i.push(oe(l));continue}const u=se(l,n,c),h=se(l,n,.5*c),f=se(l,p,c),m=se(l,p,.5*c);i.push(oe(u)),i.push((a=m,s=f,["C",(o=h).x,o.y,a.x,a.y,s.x,s.y]))}return i}function se(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/le(i,r);return{x:e.x+i*o,y:e.y+r*o}}function le(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function pe(e,t,n){l(t)&&(n=t,t=null),t||(t={});const i=X("path",t);return l(n)&&(i.dataset.cornerRadius=String(n)),ce(i,e)}function ce(e,t){return $(e,{d:re(ae(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}var ue="hsl(225, 10%, 15%)",he="white";function fe(e,t){return g(e.eventDefinitions,(function(e){return e.$type===t}))}function me(e,t,n){var i=C(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||he}function de(e,t,n){var i=C(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||ue}function ye(e,t,n,i){var r=C(e).get("label");return i||r&&r.get("color:color")||t||de(e,n)}function ge(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return re([["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"]])}function ve(e,t={}){return{width:xe(e,t),height:we(e,t)}}function xe(e,t={}){return u(t,"width")?t.width:e.width}function we(e,t={}){return u(t,"height")?t.height:e.height}const be={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};function Ee(e,t=globalThis.document){if("string"!=typeof e)throw new TypeError("String expected");const n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);const i=/<([\w:]+)/.exec(e)?.[1];if(!i)return t.createTextNode(e);if(e=e.trim(),"body"===i){const n=t.createElement("html");n.innerHTML=e;const{lastChild:i}=n;return i.remove(),i}let[r,o,a]=Object.hasOwn(be,i)?be[i]:be._default,s=t.createElement("div");for(s.innerHTML=o+e+a;r--;)s=s.lastChild;if(s.firstChild===s.lastChild){const{firstChild:e}=s;return e.remove(),e}const l=t.createDocumentFragment();return l.append(...s.childNodes),l}function _e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function Ae(e,...t){const n=e.style;return m(t,(function(e){e&&m(e,(function(e,t){n[t]=e}))})),e}function ke(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}be.td=be.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],be.option=be.optgroup=[1,'<select multiple="multiple">',"</select>"],be.thead=be.tbody=be.colgroup=be.caption=be.tfoot=[1,"<table>","</table>"],be.polyline=be.ellipse=be.polygon=be.circle=be.text=be.line=be.path=be.rect=be.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];const Se=Object.prototype.toString;function Re(e){return new Ce(e)}function Ce(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Me(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Ce.prototype.add=function(e){return this.list.add(e),this},Ce.prototype.remove=function(e){return"[object RegExp]"==Se.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ce.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ce.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ce.prototype.array=function(){return Array.from(this.list)},Ce.prototype.has=Ce.prototype.contains=function(e){return this.list.contains(e)};var De,Ne={};var Te=function(){if(De)return Ne;var e,t,n;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n="addEventListener"!==e?"on":""}return De=1,Ne.bind=function(t,r,o,a){return e||i(),t[e](n+r,o,a||!1),o},Ne.unbind=function(e,r,o,a){return t||i(),e[t](n+r,o,a||!1),o},Ne}(),Be=_e({__proto__:null,default:Pe(Te)},[Te]),Oe=["focus","blur"];var Le={bind:function(e,t,n,i,r){return-1!==Oe.indexOf(n)&&(r=!0),Be.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==Oe.indexOf(t)&&(i=!0),Be.unbind(e,t,n,i)}};function Ie(e,t){return(t=t||document).querySelector(e)}function Fe(e){e.parentNode&&e.parentNode.removeChild(e)}function je(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}var Ve=2,We={"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":Ve,"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":Ve,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function ze(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=We[i];r?(r===Ve&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function $e(e,t,n){return"string"==typeof t?function(e,t){return We[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t):(function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)ze(e,i,t[i])}(e,t),e)}const Ge=Object.prototype.toString;function He(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}He.prototype.add=function(e){return this.list.add(e),this},He.prototype.remove=function(e){return"[object RegExp]"==Ge.call(e)?this.removeMatching(e):(this.list.remove(e),this)},He.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},He.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},He.prototype.array=function(){return Array.from(this.list)},He.prototype.has=He.prototype.contains=function(e){return this.list.contains(e)};var Ke={svg:"http://www.w3.org/2000/svg"},Ue='<svg xmlns="'+Ke.svg+'"';function qe(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Ke.svg)&&(e=Ue+e.substring(4)):(e=Ue+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Ye(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=qe(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ke.svg,e),t&&$e(n,t),n}var Xe=/([&<>]{1})/g,Ze=/([&<>\n\r"]{1})/g,Je={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Qe(e,t){return e.replace(t,(function(e,t){return Je[t]||t}))}function et(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Qe(e.textContent,Xe));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Qe(o.value,Ze),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)et(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Qe(e.nodeValue,Xe),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function tt(e,t){return function(e){for(var t=e.firstChild,n=[];t;)et(t,n),t=t.nextSibling;return n.join("")}(e)}function nt(e,t,n,i,r){var o=ee();o.setTranslate(t,n);var a=ee();a.setRotate(i||0,0,0);var s=ee();s.setScale(1,1),ie(e,[o,a,s])}function it(e,t,n){var i=ee();i.setTranslate(t,n),ie(e,i)}function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ot,at={exports:{}};var st=function(){if(ot)return at.exports;ot=1;var e=at.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");t+=i}var s=e(t,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=t||128,r.base=n||16,r},at.exports}(),lt=rt(st);function pt(e){if(!(this instanceof pt))return new pt(e);e=e||[128,36,1],this._seed=e.length?lt.rack(e[0],e[1],e[2]):e}pt.prototype.next=function(e){return this._seed(e||!0)},pt.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},pt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},pt.prototype.assigned=function(e){return this._seed.get(e)||!1},pt.prototype.unclaim=function(e){delete this._seed.hats[e]},pt.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var ct=new pt,ut=.95;function ht(e,t,n,i,r,o,a){k.call(this,t,a);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor;function u(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ue,strokeWidth:2,fill:"white"})}function h(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ue,strokeWidth:2})}function f(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o,parentGfx:a=r._svg}=t,s=Ye("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});je(s,o);var l=Ie(":scope > defs",a);l||je(a,l=Ye("defs")),je(l,s)}function d(e,t,n,i){var r=ct.nextPrefixed("marker-");return function(e,t,n,i,r){if("sequenceflow-end"===n){f(t,{element:Ye("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:r,stroke:r,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){f(t,{element:Ye("circle",{cx:6,cy:6,r:3.5,...u({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){f(t,{element:Ye("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){f(t,{element:Ye("path",{d:"M 11 5 L 1 10 L 11 15",...h({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){f(t,{element:Ye("path",{d:"M 1 5 L 11 10 L 1 15",...h({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){f(t,{element:Ye("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:i,stroke:r})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){f(t,{element:Ye("path",{d:"M 6 4 L 10 16",...u({stroke:r,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,r,t,n,i),"url(#"+r+")"}function y(e,t,n,i,r={}){s(i)&&(r=i,i=0),i=i||0,r=u(r);var o=Ye("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return je(e,o),o}function g(e,t,n,i,r,o){s(r)&&(o=r,r=0),r=r||0,o=u(o);var a=Ye("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return je(e,a),a}function v(e,t,n,i){var r=pe(t,n=h(n),i);return je(e,r),r}function x(e,t,n){return v(e,t,n,5)}function w(e,t,n){n=h(n);var i=Ye("path",{...n,d:t});return je(e,i),i}function b(e,t,n,i){return w(t,n,_({"data-marker":e},i))}function E(e){return q[e]}function A(e){return function(t,n,i){return E(e)(t,n,i)}}var D={"bpmn:MessageEventDefinition":function(e,t,n={},r){return w(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:r?de(t,p,n.stroke):me(t,l,n.fill),stroke:r?me(t,l,n.fill):de(t,p,n.stroke),strokeWidth:1})},"bpmn:TimerEventDefinition":function(e,t,n={}){var r=n.width||t.width,o=n.height||t.height,a=n.width?1:2,s=y(e,r,o,.2*o,{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:a});w(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{stroke:de(t,p,n.stroke),strokeWidth:a});for(var c=0;c<12;c++){var u=r/2,h=o/2;w(e,i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{strokeWidth:1,stroke:de(t,p,n.stroke),transform:"rotate("+30*c+","+h+","+u+")"})}return s},"bpmn:EscalationEventDefinition":function(e,t,n={},r){return w(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:r?de(t,p,n.stroke):me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(e,t,n={}){return w(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(e,t,n={},r){return w(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?de(t,p,n.stroke):me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(e,t,n={},r){return w(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:r?de(t,p,n.stroke):me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(e,t,n={},r){var o=w(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?de(t,p,n.stroke):"none",stroke:de(t,p,n.stroke),strokeWidth:1});return function(e,t){var n=ee();n.setRotate(t,0,0),ie(e,n)}(o,45),o},"bpmn:CompensateEventDefinition":function(e,t,n={},r){return w(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:r?de(t,p,n.stroke):me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(e,t,n={},r){return w(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?de(t,p,n.stroke):me(t,l,n.fill),stroke:de(t,p,n.stroke)})},"bpmn:MultipleEventDefinition":function(e,t,n={},r){return w(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:r?de(t,p,n.stroke):me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(e,t,n={}){return w(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(e,t,n={}){return y(e,t.width,t.height,8,{fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke),strokeWidth:4})}};function N(e,t,n={},i){var r=R(e),o=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(r),a=i||e;return r.get("eventDefinitions")&&r.get("eventDefinitions").length>1?r.get("parallelMultiple")?D["bpmn:ParallelMultipleEventDefinition"](t,a,n,o):D["bpmn:MultipleEventDefinition"](t,a,n,o):fe(r,"bpmn:MessageEventDefinition")?D["bpmn:MessageEventDefinition"](t,a,n,o):fe(r,"bpmn:TimerEventDefinition")?D["bpmn:TimerEventDefinition"](t,a,n,o):fe(r,"bpmn:ConditionalEventDefinition")?D["bpmn:ConditionalEventDefinition"](t,a,n,o):fe(r,"bpmn:SignalEventDefinition")?D["bpmn:SignalEventDefinition"](t,a,n,o):fe(r,"bpmn:EscalationEventDefinition")?D["bpmn:EscalationEventDefinition"](t,a,n,o):fe(r,"bpmn:LinkEventDefinition")?D["bpmn:LinkEventDefinition"](t,a,n,o):fe(r,"bpmn:ErrorEventDefinition")?D["bpmn:ErrorEventDefinition"](t,a,n,o):fe(r,"bpmn:CancelEventDefinition")?D["bpmn:CancelEventDefinition"](t,a,n,o):fe(r,"bpmn:CompensateEventDefinition")?D["bpmn:CompensateEventDefinition"](t,a,n,o):fe(r,"bpmn:TerminateEventDefinition")?D["bpmn:TerminateEventDefinition"](t,a,n,o):null}var T={ParticipantMultiplicityMarker:function(e,t,n={}){var r=xe(t,n),o=we(t,n);b("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:me(t,l,n.fill),stroke:de(t,p,n.stroke)})},SubProcessMarker:function(e,t,n={}){it(g(e,14,14,0,{strokeWidth:1,fill:me(t,l,n.fill),stroke:de(t,p,n.stroke)}),t.width/2-7.5,t.height-20),b("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:me(t,l,n.fill),stroke:de(t,p,n.stroke)})},ParallelMarker:function(e,t,n){var r=xe(t,n),o=we(t,n);b("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke)})},SequentialMarker:function(e,t,n){b("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke)})},CompensationMarker:function(e,t,n){b("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:me(t,l,n.fill),stroke:de(t,p,n.stroke)})},LoopMarker:function(e,t,n){var r=xe(t,n),o=we(t,n);b("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:de(t,p,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=xe(t,n),o=we(t,n);b("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke)})}};function B(e,t,n,i){T[e](t,n,i)}function L(e,t,n=[],i={}){i={fill:i.fill,stroke:i.stroke,width:xe(t,i),height:we(t,i)};var r=R(t),o=n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},r.get("isForCompensation")&&n.push("CompensationMarker"),S(r,"bpmn:AdHocSubProcess")&&(n.push("AdhocMarker"),o||_(i,{compensation:i.compensation-18}));var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(_(i,{compensation:i.compensation-18}),n.includes("AdhocMarker")&&_(i,{seq:-23,loop:-18,parallel:-24}),void 0===s&&n.push("LoopMarker"),!1===s&&n.push("ParallelMarker"),!0===s&&n.push("SequentialMarker")),n.includes("CompensationMarker")&&1===n.length&&_(i,{compensation:-8}),m(n,(function(n){B(n,e,t,i)}))}function I(e,t,n={}){n=_({size:{width:100}},n);var i,r=o.createText(t||"",n);return(i=r,new He(i)).add("djs-label"),je(e,r),r}function F(e,t,n,i={}){var r=R(t),o=ve({x:t.x,y:t.y,width:t.width,height:t.height},i);return I(e,r.name,{align:n,box:o,padding:7,style:{fill:ye(t,c,p,i.stroke)}})}function j(e,t,n,i={}){var r=P(n),o=I(e,t,{box:{height:30,width:r?we(n,i):xe(n,i)},align:"center-middle",style:{fill:ye(n,c,p,i.stroke)}});r&&nt(o,0,-(-1*we(n,i)),270)}function V(e,t,n={}){var{width:i,height:r}=ve(t,n);return g(e,i,r,10,{...n,fill:me(t,l,n.fill),fillOpacity:ut,stroke:de(t,p,n.stroke)})}function W(e,t,n={}){var i=R(t),r=me(t,l,n.fill),o=de(t,p,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=d(e,"association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=d(e,"association-start",r,o)),n=ft(n,["markerStart","markerEnd"]),x(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function z(e,t,n={}){var r=me(t,l,n.fill),o=de(t,p,n.stroke),a=w(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:ut,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(R(t))&&w(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return a}function $(e,t,n={}){return y(e,t.width,t.height,{fillOpacity:ut,...n,fill:me(t,l,n.fill),stroke:de(t,p,n.stroke)})}function G(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=u(i);var s=Ye("polygon",{...i,points:a});return je(e,s),s}(e,t.width,t.height,{fill:me(t,l,n.fill),fillOpacity:ut,stroke:de(t,p,n.stroke)})}function H(e,t,n={}){var i=g(e,xe(t,n),we(t,n),0,{fill:me(t,l,n.fill),fillOpacity:n.fillOpacity||ut,stroke:de(t,p,n.stroke),strokeWidth:1.5}),r=R(t);S(r,"bpmn:Lane")&&j(e,r.get("name"),t,n);return i}function K(e,t,n={}){var i=V(e,t,n),r=M(t);if(function(e){return e&&!!R(e).triggeredByEvent}(t)&&($e(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!r)){var o=(R(t).flowElements||[]).filter((e=>S(e,"bpmn:StartEvent")));1===o.length&&function(e,t,n,i){var r=22,o={fill:me(i,l,n.fill),stroke:de(i,p,n.stroke),width:r,height:r},a=R(e).isInterrupting,s=a?0:3,c=a?1:1.2,u=20,h=(r-u)/2,f="translate("+h+","+h+")";y(t,u,u,{fill:o.fill,stroke:o.stroke,strokeWidth:c,strokeDasharray:s,transform:f}),N(e,t,o,i)}(o[0],e,n,t)}return F(e,t,r?"center-top":"center-middle",n),L(e,t,r?void 0:["SubProcessMarker"],n),i}function U(e,t,n={}){var i=V(e,t,n);return F(e,t,"center-middle",n),L(e,t,void 0,n),i}var q=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return K(e,t,n=M(t)?ft(n,["fill","stroke","width","height"]):ft(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return W(e,t,n=ft(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=ft(n,["fill","stroke"]);var r=R(t).get("cancelActivity");n={strokeWidth:1.5,fill:me(t,l,n.fill),fillOpacity:1,stroke:de(t,p,n.stroke)},r||(n.strokeDasharray="6");var o=$(e,t,n);return y(e,t.width,t.height,3,{...n,fill:"none"}),i&&N(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=U(e,t,n=ft(n,["fill","stroke"]));return $e(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1}),$e(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=ft(n,["fill","stroke"]),K(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=G(e,t,n=ft(n,["fill","stroke"]));return w(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=ft(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=z(e,t,n);return w(e,r,{fill:"none",stroke:de(t,p,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=ft(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",me(t,l,n.fill),de(t,p,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return z(e,t,n=ft(n,["fill","stroke"]))},"bpmn:DataObjectReference":A("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=ft(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=z(e,t,n);return w(e,r,{strokeWidth:1,fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=ft(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",me(t,l,n.fill),de(t,p,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=ft(n,["fill","stroke"]),w(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:me(t,l,n.fill),fillOpacity:ut,stroke:de(t,p,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=ft(n,["fill","stroke"]);var r=$(e,t,{...n,strokeWidth:4});return i&&N(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=ft(n,["fill","stroke"]);var r=R(t),o=G(e,t,n);y(e,t.width,t.height,.2*t.height,{fill:me(t,"none",n.fill),stroke:de(t,p,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var l=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});w(e,l,{fill:"none",stroke:de(t,p,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||y(e,t.width,t.height,.26*t.height,{fill:"none",stroke:de(t,p,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});w(e,r,{fill:"none",stroke:de(t,p,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=G(e,t,n=ft(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return C(t).get("isMarkerVisible")&&w(e,o,{fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return G(e,t,n=ft(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=ft(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:de(t,p,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:xe(t,n),height:we(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=G(e,t,n=ft(n,["fill","stroke"]));return y(e,t.width,t.height,.24*t.height,{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=ft(n,["fill","stroke"]);var r=$(e,t,{...n,strokeWidth:1.5});return y(e,t.width,t.height,3,{fill:"none",stroke:de(t,p,n.stroke),strokeWidth:1.5}),i&&N(t,e,n),r},"bpmn:IntermediateCatchEvent":A("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":A("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=ft(n,["fill","stroke","width","height"]),H(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=U(e,t,n=ft(n,["fill","stroke"]));return w(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=ft(n,["fill","stroke"]);var r=R(t),o=C(t),a=me(t,l,n.fill),s=de(t,p,n.stroke),c=x(e,t.waypoints,{markerEnd:d(e,"messageflow-end",a,s),markerStart:d(e,"messageflow-start",a,s),stroke:s,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=c.getPointAtLength(c.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),f={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(f.fill=a,f.stroke=s):(f.fill=s,f.stroke=a);var m=w(e,h,f),y=I(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:s}}),g=m.getBBox(),v=y.getBBox();nt(y,u.x-v.width/2,u.y+g.height/2+10,0)}return c},"bpmn:ParallelGateway":function(e,t,n={}){var r=G(e,t,n=ft(n,["fill","stroke"]));return w(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=H(e,t,n=ft(n,["fill","stroke","width","height"])),r=M(t),o=P(t),a=R(t),s=a.get("name");if(r){v(e,o?[{x:30,y:0},{x:30,y:we(t,n)}]:[{x:0,y:30},{x:xe(t,n),y:30}],{stroke:de(t,p,n.stroke),strokeWidth:1.5}),j(e,s,t,n)}else{var l=ve(t,n);o||(l.height=xe(t,n),l.width=we(t,n));var u=I(e,s,{box:l,align:"center-middle",style:{fill:ye(t,c,p,n.stroke)}});if(!o)nt(u,0,-(-1*we(t,n)),270)}return a.get("participantMultiplicity")&&B("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=ft(n,["fill","stroke"]);var r,o=R(t),a=U(e,t,n);return o.get("instantiate")?(y(e,28,28,4.4,{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,r,{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=U(e,t,n=ft(n,["fill","stroke"]));return w(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=U(e,t,n=ft(n,["fill","stroke"]));return w(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:de(t,p,n.stroke),stroke:me(t,l,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=ft(n,["fill","stroke"]);var i=me(t,l,n.fill),r=de(t,p,n.stroke),o=x(e,t.waypoints,{markerEnd:d(e,"sequenceflow-end",i,r),stroke:r}),a=R(t),{source:s}=t;if(s){var c=R(s);a.get("conditionExpression")&&S(c,"bpmn:Activity")&&$e(o,{markerStart:d(e,"conditional-flow-marker",i,r)}),c.get("default")&&(S(c,"bpmn:Gateway")||S(c,"bpmn:Activity"))&&c.get("default")===a&&$e(o,{markerStart:d(e,"conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=U(e,t,n=ft(n,["fill","stroke"]));return y(e,10,10,{fill:me(t,l,n.fill),stroke:"none",transform:"translate(6, 6)"}),w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1}),y(e,10,10,{fill:me(t,l,n.fill),stroke:"none",transform:"translate(11, 10)"}),w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=ft(n,["fill","stroke"]),R(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=$(e,t,n);return i&&N(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return K(e,t,n=M(t)?ft(n,["fill","stroke","width","height"]):ft(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return U(e,t,n=ft(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=ft(n,["fill","stroke"]);var{width:r,height:o}=ve(t,n),a=g(e,r,o,0,0,{fill:"none",stroke:"none"});return w(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:de(t,p,n.stroke)}),I(e,R(t).get("text")||"",{align:"left-top",box:ve(t,n),padding:7,style:{fill:ye(t,c,p,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=M(t)?ft(i,["fill","stroke","width","height"]):ft(i,["fill","stroke"]);var r=K(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:de(t,p,i.stroke),strokeWidth:1.5});return M(t)||(i={}),g(e,xe(t,i),we(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=U(e,t,n=ft(n,["fill","stroke"]));return w(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:.5}),w(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:me(t,l,n.fill),stroke:de(t,p,n.stroke),strokeWidth:.5}),w(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:de(t,p,n.stroke),stroke:de(t,p,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return I(e,O(t),{box:i,style:_({},o.getExternalStyle(),{fill:ye(t,c,p,n.stroke)})})}(e,t,n)}};this._drawPath=w,this._renderer=E}function ft(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(ht,k),ht.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],ht.prototype.canRender=function(e){return S(e,"bpmn:BaseElement")},ht.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},ht.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},ht.prototype.getShapePath=function(e){return s(t=e)&&u(t,"labelTarget")?ge(e,4):S(e,"bpmn:Event")?function(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return re([["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):S(e,"bpmn:Activity")?ge(e,10):S(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return re([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return re([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t};var mt=0,dt={width:150,height:50};var yt=null;function gt(e){if(null!=e)return"number"==typeof e||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function vt(e,t){var n=(yt||(yt=document.createElement("canvas").getContext("2d")),yt);if(!n)return{width:0,height:0};n.font=function(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(gt(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}(t),"letterSpacing"in n&&(n.letterSpacing=gt(t.letterSpacing)||"0px");var i=""===e,r=i?"dummy":e.replace(/\s+$/,""),o=n.measureText(r);return{width:i?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function xt(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=vt(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return wt(e,o,r,i);o=Et(o,i.width,t)}}function wt(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}}var bt="­";function Et(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&n!==bt||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&a===bt&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function _t(e){this._config=_({},{size:dt,padding:mt,style:{},align:"center-top"},e||{})}_t.prototype.createText=function(e,t){return this.layoutText(e,t).element},_t.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},_t.prototype.layoutText=function(e,t){for(var n=_({},this._config.size,t.box),i=_({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return s(e)?_({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,l=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),p=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right;p.length;)c.push(xt(p,u,i));"middle"===r.vertical&&(o.top=o.bottom=0);var h=d(c,(function(e,t,n){return e+(l||t.height)}),0)+o.top+o.bottom,f=d(c,(function(e,t,n){return t.width>e?t.width:e}),0),y=o.top;"middle"===r.vertical&&(y+=(n.height-h)/2),y-=(l||c[0].height)/4;var g=X("text");return $(g,i),m(c,(function(e){var t;switch(y+=l||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?f:u)-o.right-e.width;break;default:t=Math.max(((a?f:u)-e.width)/2+o.left,0)}var n=X("tspan");$(n,{x:t,y:y}),n.textContent=e.text,j(g,n)})),{dimensions:{width:f,height:h},element:g}};function At(e){var t=_({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=_({},t,{fontSize:n},e&&e.externalStyle||{}),r=new _t({style:t});function o(e,t,n){return r.getDimensions(e,_({box:t},n))}this.getExternalLabelBounds=function(e,t){var n=o(t,{width:Math.max(e.width,D.width),height:30},{style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=o(n,e,{style:t,align:"left-top",padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(40,Math.round(i.height))}},this.getDimensions=function(e,t){return r.getDimensions(e,t||{})},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}At.$inject=["config.textRenderer"];var kt=/\{([^{}]+)\}/g,St=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Rt={__init__:["bpmnRenderer"],bpmnRenderer:["type",ht],textRenderer:["type",At],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heigh