camunda-bpmn-js 4.6.0 → 4.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnModeler=t()}(this,(function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var t=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),s="";for(r=0;r<Math.floor(i);r++){s=Math.floor(Math.random()*n).toString(n)+s}if(o){var a=Math.pow(n,o);s=Math.floor(Math.random()*a).toString(n)+s}var l=parseInt(s,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):s};t.rack=function(e,n,i){var r=function(r){var s=0;do{if(s++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var a=t(e,n)}while(Object.hasOwnProperty.call(o,a));return o[a]=r,a},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function n(e){if(!(this instanceof n))return new n(e);e=e||[128,36,1],this._seed=e.length?t.rack(e[0],e[1],e[2]):e}function i(e){return Array.prototype.concat.apply([],e)}n.prototype.next=function(e){return this._seed(e||!0)},n.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},n.prototype.claim=function(e,t){this._seed.set(e,t||!0)},n.prototype.assigned=function(e){return this._seed.get(e)||!1},n.prototype.unclaim=function(e){delete this._seed.hats[e]},n.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;function s(e){return void 0===e}function a(e){return void 0!==e}function l(e){return null==e}function c(e){return"[object Array]"===r.call(e)}function h(e){return"[object Object]"===r.call(e)}function u(e){return"[object Number]"===r.call(e)}function p(e){const t=r.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function d(e){return"[object String]"===r.call(e)}function f(e,t){return o.call(e,t)}function m(e,t){const n=R(t);let i;return y(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function g(e,t){const n=R(t);let i=c(e)?-1:void 0;return y(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function v(e,t){const n=R(t);let i=[];return y(e,(function(e,t){n(e,t)&&i.push(e)})),i}function y(e,t){let n,i;if(s(e))return;const r=c(e)?B:D;for(let o in e)if(f(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function b(e,t){if(s(e))return[];!function(e){if(!c(e))throw new Error("must supply array")}(e);const n=R(t);return e.filter((function(e,t){return!n(e,t)}))}function x(e,t,n){return y(e,(function(e,i){n=t(n,e,i)})),n}function w(e,t){return!!x(e,(function(e,n,i){return e&&t(n,i)}),!0)}function _(e,t){return!!m(e,t)}function E(e,t){let n=[];return y(e,(function(e,i){n.push(t(e,i))})),n}function k(e){return e&&Object.keys(e)||[]}function O(e){return E(e,(e=>e))}function S(e,t,n={}){return t=T(t),y(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function C(e,...t){e=T(e);let n={};return y(t,(t=>S(t,e,n))),E(n,(function(e,t){return e[0]}))}const P=C;function A(e,t){t=T(t);let n=[];return y(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var s=0;s<n.length;s++){let{d:e}=n[s];if(r<e)return void n.splice(s,0,o)}n.push(o)})),E(n,(e=>e.v))}function M(e){return function(t){return w(e,(function(e,n){return t[n]===e}))}}function T(e){return p(e)?e:t=>t[e]}function R(e){return p(e)?e:t=>t===e}function D(e){return e}function B(e){return Number(e)}function L(e,t){let n,i,r,o;function s(n){let s=Date.now(),c=n?0:o+t-s;if(c>0)return a(c);e.apply(r,i),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function c(...e){o=Date.now(),i=e,r=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function N(e,t){return e.bind(t)}function z(e,...t){return Object.assign(e,...t)}function I(e,t,n){let i=e;return y(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],c=i[e];a(o)&&l(c)&&(c=i[e]=isNaN(+o)?{}:[]),s(o)?s(n)?delete i[e]:i[e]=n:i=c})),e}function j(e,t){let n={},i=Object(e);return y(t,(function(t){t in i&&(n[t]=e[t])})),n}function $(e,t){let n={};return y(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}function F(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)}const H=Object.prototype.toString,V=Object.prototype.hasOwnProperty;function q(e,t){return V.call(e,t)}function W(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===H.call(e)}(e)?X:Q;for(let o in e)if(q(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function Q(e){return e}function X(e){return Number(e)}function G(e,...t){const n=e.style;return W(t,(function(e){e&&W(e,(function(e,t){n[t]=e}))})),e}const U=Object.prototype.toString;function Y(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}function Z(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}K.prototype.add=function(e){return this.list.add(e),this},K.prototype.remove=function(e){return"[object RegExp]"==U.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 J,ee,te,ne={};function ie(){J=window.addEventListener?"addEventListener":"attachEvent",ee=window.removeEventListener?"removeEventListener":"detachEvent",te="addEventListener"!==J?"on":""}var re=ne.bind=function(e,t,n,i){return J||ie(),e[J](te+t,n,i||!1),n},oe=ne.unbind=function(e,t,n,i){return ee||ie(),e[ee](te+t,n,i||!1),n},se=F({__proto__:null,bind:re,unbind:oe,default:ne},[ne]),ae=["focus","blur"];var le,ce={bind:function(e,t,n,i,r){return-1!==ae.indexOf(n)&&(r=!0),se.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Z(i,t))return i;i=i.parentNode}return Z(i,t)?i:null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==ae.indexOf(t)&&(i=!0),se.unbind(e,t,n,i)}},he=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(l=t.createElement("html")).innerHTML=e,l.removeChild(l.lastChild)}var r=Object.prototype.hasOwnProperty.call(pe,i)?pe[i]:pe._default,o=r[0],s=r[1],a=r[2],l=t.createElement("div");l.innerHTML=s+e+a;for(;o--;)l=l.lastChild;if(l.firstChild==l.lastChild)return l.removeChild(l.firstChild);var c=t.createDocumentFragment();for(;l.firstChild;)c.appendChild(l.removeChild(l.firstChild));return c},ue=!1;"undefined"!=typeof document&&((le=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',ue=!le.getElementsByTagName("link").length,le=void 0);var pe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:ue?[1,"X<div>","</div>"]:[0,"",""]};pe.td=pe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],pe.option=pe.optgroup=[1,'<select multiple="multiple">',"</select>"],pe.thead=pe.tbody=pe.colgroup=pe.caption=pe.tfoot=[1,"<table>","</table>"],pe.polyline=pe.ellipse=pe.polygon=pe.circle=pe.text=pe.line=pe.path=pe.rect=pe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var de=he;function fe(e,t){return(t=t||document).querySelector(e)}function me(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function ge(e,t){return me(t,e),e}var ve=2,ye={"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 be(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=ye[i];r?(r===ve&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function xe(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return ye[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);be(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)be(e,i,t[i])}(e,t);return e}const we=Object.prototype.toString;function _e(e){return new Ee(e)}function Ee(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ke(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Oe(e){for(var t;t=e.firstChild;)ke(t);return e}function Se(e){return e.cloneNode(!0)}Ee.prototype.add=function(e){return this.list.add(e),this},Ee.prototype.remove=function(e){return"[object RegExp]"==we.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ee.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},Ee.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ee.prototype.array=function(){return Array.from(this.list)},Ee.prototype.has=Ee.prototype.contains=function(e){return this.list.contains(e)};var Ce={svg:"http://www.w3.org/2000/svg"},Pe='<svg xmlns="'+Ce.svg+'"';function Ae(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Ce.svg)&&(e=Pe+e.substring(4)):(e=Pe+">"+e+"</svg>",t=!0);var n=function(e){var t;return t=new DOMParser,t.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 Me(e,t){var n;return"<"===e.charAt(0)?(n=Ae(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ce.svg,e),t&&xe(n,t),n}var Te=null;function Re(){return null===Te&&(Te=Me("svg")),Te}function De(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Be(e){return e?Re().createSVGTransformFromMatrix(e):Re().createSVGTransform()}var Le=/([&<>]{1})/g,Ne=/([\n\r"]{1})/g,ze={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Ie(e,t){return e.replace(t,(function(e,t){return ze[t]||t}))}function je(e,t){var n,i,r,o,s;switch(e.nodeType){case 3:t.push(Ie(e.textContent,Le));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,'="',Ie(o.value,Ne),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(s=e.childNodes).length;n<i;++n)je(s.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Ie(e.nodeValue,Le),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function $e(e,t){var n=Ae(t);if(Oe(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)me(r[o],e)}}function Fe(e,t){if(void 0!==t){try{$e(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)je(t,n),t=t.nextSibling;return n.join("")}(e)}function He(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ve(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(He(e,i))}(n,t)),n.consolidate()}const qe=/^class[ {]/;function We(e){return Array.isArray(e)}function Qe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xe(...e){1===e.length&&We(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Ge=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Ue=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Ye=/\/\*([^*]*)\*\//m;function Ke(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return qe.test(e.toString())}(e)?Ge:Ue);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(Ye);return(t&&t[1]||e).trim()}))||[]}function Ze(e,t){const n=t||{get:function(e,t){if(i.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),s=o.injector=this,a=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){if(!r[e]&&e.includes(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Qe(o,e))return o[e];if(Qe(r,e)){if(-1!==i.indexOf(e))throw i.push(e),a("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!We(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Xe(e.slice())}return{fn:e,dependencies:(e.$inject||Ke(e)).map((e=>Qe(t,e)?t[e]:l(e)))}}function h(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:i,dependencies:r}=c(e,n);return i.apply(t,r)}function p(e){return Xe((t=>e.get(t)))}function d(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],s=[],a=[];let l,c,h,u;for(let e in r)l=r[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(h=l[3].createChild([],t),u=p(h),o.push(l[3]),s.push(h),a.push(u),n[e]=[u,e,"private",h]):n[e]=[a[c],e,"private",s[c]]):n[e]=[l[2],l[1]],i[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],i[t]=!0)}));t.forEach((e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new Ze(e,s)}const f={factory:u,type:h,value:function(e){return e}};function m(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function g(e){const t=e.__exports__;if(t){const n=e.__modules__,i=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=d((n||[]).concat(i)),s=Xe((function(e){return o.get(e)}));t.forEach((function(e){r[e]=[s,e,"private",o]}));const a=(e.__init__||[]).slice();return a.unshift((function(){o.init()})),m(e=Object.assign({},e,{__init__:a}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],Je(i,o),i]})),m(e,s)}function v(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(v,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=h,this.createChild=d,this.init=function(e){const t=e.reduce(v,[]).map(g);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function Je(e,t){return"value"!==e&&We(t)&&(t=Xe(t.slice())),t}var et=1e3;function tt(e,t){var n=this;t=t||et,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,s=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,s):n.drawConnection(o,r,s)})),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 nt(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function it(e){return["L",e.x,e.y]}function rt(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,s,a;for(let r=1;r<n;r++){const n=e[r-1],l=e[r],c=e[r+1];if(!c||!t){i.push(it(l));continue}const h=Math.min(t,st(l.x-n.x,l.y-n.y),st(c.x-l.x,c.y-l.y));if(!h){i.push(it(l));continue}const u=ot(l,n,h),p=ot(l,n,.5*h),d=ot(l,c,h),f=ot(l,c,.5*h);i.push(it(u)),i.push((s=f,a=d,["C",(o=p).x,o.y,s.x,s.y,a.x,a.y]))}return i}function ot(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/st(i,r);return{x:e.x+i*o,y:e.y+r*o}}function st(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function at(e,t,n){u(t)&&(n=t,t=null),t||(t={});const i=Me("path",t);return u(n)&&(i.dataset.cornerRadius=String(n)),lt(i,e)}function lt(e,t){return xe(e,{d:nt(rt(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function ct(e){return v(e,(function(t){return!m(e,(function(e){return e!==t&&ht(t,e)}))}))}function ht(e,t){if(t){if(e===t)return t;if(e.parent)return ht(e.parent,t)}}function ut(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function pt(e,t,n){n=n||0,c(e)||(e=[e]),y(e,(function(e,i){var r=t(e,i,n);c(r)&&r.length&&pt(r,t,n+1)}))}function dt(e,t){return function(e,t,n){var i=[],r=[];return pt(e,(function(e,o,s){ut(i,e,t);var a=e.children;if((-1===n||s<n)&&a&&ut(r,a,t))return a})),i}(e,!t,-1)}function ft(e,t){var n,i,r,o;return t=!!t,c(e)||(e=[e]),y(e,(function(e){var s=e;e.waypoints&&!t&&(s=ft(e.waypoints,!0));var a=s.x,l=s.y,c=s.height||0,h=s.width||0;(a<n||void 0===n)&&(n=a),(l<i||void 0===i)&&(i=l),(a+h>r||void 0===r)&&(r=a+h),(l+c>o||void 0===o)&&(o=l+c)})),{x:n,y:i,height:o-i,width:r-n}}function mt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function gt(e){return!(!e||!e.isFrame)}function vt(e,t){return z({},e||{},t||{})}tt.prototype.canRender=function(e){},tt.prototype.drawShape=function(e,t){},tt.prototype.drawConnection=function(e,t){},tt.prototype.getShapePath=function(e){},tt.prototype.getConnectionPath=function(e){};function yt(e,t){tt.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(yt,tt),yt.prototype.canRender=function(){return!0},yt.prototype.drawShape=function(e,t,n){var i=Me("rect");return xe(i,{x:0,y:0,width:t.width||0,height:t.height||0}),gt(t)?xe(i,z({},this.FRAME_STYLE,n||{})):xe(i,z({},this.SHAPE_STYLE,n||{})),ge(e,i),i},yt.prototype.drawConnection=function(e,t,n){var i=at(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return ge(e,i),i},yt.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return nt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},yt.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return nt(r)},yt.$inject=["eventBus","styles"];var bt={__init__:["defaultRenderer"],defaultRenderer:["type",yt],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return z(this.style(t,n),{class:e})},this.style=function(t,n){c(t)||n||(n=t,t=[]);var i=x(t,(function(t,n){return z(t,e[n]||{})}),{});return n?z(i,n):i},this.computeStyle=function(e,n,i){return c(n)||(i=n,n=[]),t.style(n||[],z({},i,e||{}))}}]};function xt(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)}const wt=Object.prototype.toString,_t=Object.prototype.hasOwnProperty;function Et(e,t){return _t.call(e,t)}function kt(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===wt.call(e)}(e)?St:Ot;for(let o in e)if(Et(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function Ot(e){return e}function St(e){return Number(e)}function Ct(e,...t){const n=e.style;return kt(t,(function(e){e&&kt(e,(function(e,t){n[t]=e}))})),e}function Pt(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const At=Object.prototype.toString;function Mt(e){return new Tt(e)}function Tt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Rt(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function Dt(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function Bt(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Dt(i,t))return i;i=i.parentNode}return Dt(i,t)?i:null}Tt.prototype.add=function(e){return this.list.add(e),this},Tt.prototype.remove=function(e){return"[object RegExp]"==At.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Tt.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},Tt.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Tt.prototype.array=function(){return Array.from(this.list)},Tt.prototype.has=Tt.prototype.contains=function(e){return this.list.contains(e)};var Lt,Nt,zt,It={};function jt(){Lt=window.addEventListener?"addEventListener":"attachEvent",Nt=window.removeEventListener?"removeEventListener":"detachEvent",zt="addEventListener"!==Lt?"on":""}var $t=It.bind=function(e,t,n,i){return Lt||jt(),e[Lt](zt+t,n,i||!1),n},Ft=It.unbind=function(e,t,n,i){return Nt||jt(),e[Nt](zt+t,n,i||!1),n},Ht=xt({__proto__:null,bind:$t,unbind:Ft,default:It},[It]),Vt=["focus","blur"];var qt,Wt={bind:function(e,t,n,i,r){return-1!==Vt.indexOf(n)&&(r=!0),Ht.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=Bt(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==Vt.indexOf(t)&&(i=!0),Ht.unbind(e,t,n,i)}},Qt=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(l=t.createElement("html")).innerHTML=e,l.removeChild(l.lastChild)}var r=Object.prototype.hasOwnProperty.call(Gt,i)?Gt[i]:Gt._default,o=r[0],s=r[1],a=r[2],l=t.createElement("div");l.innerHTML=s+e+a;for(;o--;)l=l.lastChild;if(l.firstChild==l.lastChild)return l.removeChild(l.firstChild);var c=t.createDocumentFragment();for(;l.firstChild;)c.appendChild(l.removeChild(l.firstChild));return c},Xt=!1;"undefined"!=typeof document&&((qt=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Xt=!qt.getElementsByTagName("link").length,qt=void 0);var Gt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Xt?[1,"X<div>","</div>"]:[0,"",""]};Gt.td=Gt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Gt.option=Gt.optgroup=[1,'<select multiple="multiple">',"</select>"],Gt.thead=Gt.tbody=Gt.colgroup=Gt.caption=Gt.tfoot=[1,"<table>","</table>"],Gt.polyline=Gt.ellipse=Gt.polygon=Gt.circle=Gt.text=Gt.line=Gt.path=Gt.rect=Gt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ut=Qt;function Yt(e,t){return(t=t||document).querySelector(e)}function Kt(e,t){return(t=t||document).querySelectorAll(e)}function Zt(e){e.parentNode&&e.parentNode.removeChild(e)}function Jt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function en(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function tn(e,t){return e&&t?e.indexOf(t):-1}function nn(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function rn(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=nn(e,t);return Math.abs(r/o)<=i}var on=2;function sn(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(an(e,n))return t;return!1}function an(e,t){const n=t[0];return w(t,(function(t){return Math.abs(n[e]-t[e])<=on}))}function ln(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function cn(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var hn=/,?([a-z]),?/gi,un=parseFloat,pn=Math,dn=pn.PI,fn=pn.min,mn=pn.max,gn=pn.pow,vn=pn.abs,yn=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,bn=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,xn=Array.isArray||function(e){return e instanceof Array};function wn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)wn(e,n)&&(t[n]=_n(e[n]));return t}function En(e){var t=En.ps=En.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout((function(){for(var n in t)wn(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])})),t[e]}function kn(e,t,n,i){return 1===arguments.length&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function On(){return this.join(",").replace(hn,"$1")}function Sn(e){var t=_n(e);return t.toString=On,t}function Cn(e,t,n,i,r,o,s,a,l){var c=1-l,h=gn(c,3),u=gn(c,2),p=l*l*l,d=h*t+3*u*l*i+3*c*l*l*o+p*a;return{x:Dn(h*e+3*u*l*n+3*c*l*l*r+p*s),y:Dn(d)}}function Pn(e){var t=function(e,t,n,i,r,o,s,a){for(var l,c,h,u,p,d,f,m,g=[],v=[[],[]],y=0;y<2;++y)if(0==y?(c=6*e-12*n+6*r,l=-3*e+9*n-9*r+3*s,h=3*n-3*e):(c=6*t-12*i+6*o,l=-3*t+9*i-9*o+3*a,h=3*i-3*t),vn(l)<1e-12){if(vn(c)<1e-12)continue;0<(u=-h/c)&&u<1&&g.push(u)}else f=c*c-4*h*l,m=pn.sqrt(f),f<0||(0<(p=(-c+m)/(2*l))&&p<1&&g.push(p),0<(d=(-c-m)/(2*l))&&d<1&&g.push(d));var b,x=g.length,w=x;for(;x--;)b=1-(u=g[x]),v[0][x]=b*b*b*e+3*b*b*u*n+3*b*u*u*r+u*u*u*s,v[1][x]=b*b*b*t+3*b*b*u*i+3*b*u*u*o+u*u*u*a;return v[0][w]=e,v[1][w]=t,v[0][w+1]=s,v[1][w+1]=a,v[0].length=v[1].length=w+2,{x0:fn(...v[0]),y0:fn(...v[1]),x1:mn(...v[0]),y1:mn(...v[1])}}(...e);return kn(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function An(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Mn(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Tn(e,t,n,i,r,o,s,a,l){null==l&&(l=1);for(var c=(l=l>1?1:l<0?0:l)/2,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],u=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,d=0;d<12;d++){var f=c*h[d]+c,m=Mn(f,e,n,r,s),g=Mn(f,t,i,o,a),v=m*m+g*g;p+=u[d]*pn.sqrt(v)}return c*p}function Rn(e,t,n,i,r,o,s,a){if(!(mn(e,n)<fn(r,s)||fn(e,n)>mn(r,s)||mn(t,i)<fn(o,a)||fn(t,i)>mn(o,a))){var l=(e*i-t*n)*(o-a)-(t-i)*(r*a-o*s),c=(e-n)*(o-a)-(t-i)*(r-s);if(c){var h=Dn(((e*i-t*n)*(r-s)-(e-n)*(r*a-o*s))/c),u=Dn(l/c),p=+h.toFixed(2),d=+u.toFixed(2);if(!(p<+fn(e,n).toFixed(2)||p>+mn(e,n).toFixed(2)||p<+fn(r,s).toFixed(2)||p>+mn(r,s).toFixed(2)||d<+fn(t,i).toFixed(2)||d>+mn(t,i).toFixed(2)||d<+fn(o,a).toFixed(2)||d>+mn(o,a).toFixed(2)))return{x:h,y:u}}}}function Dn(e){return Math.round(1e11*e)/1e11}function Bn(e,t,n){if(!function(e,t){return e=kn(e),An(t=kn(t),e.x,e.y)||An(t,e.x2,e.y)||An(t,e.x,e.y2)||An(t,e.x2,e.y2)||An(e,t.x,t.y)||An(e,t.x2,t.y)||An(e,t.x,t.y2)||An(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}(Pn(e),Pn(t)))return n?0:[];for(var i=Tn(...e),r=Tn(...t),o=zn(e)?1:~~(i/5)||1,s=zn(t)?1:~~(r/5)||1,a=[],l=[],c={},h=n?0:[],u=0;u<o+1;u++){var p=Cn(...e,u/o);a.push({x:p.x,y:p.y,t:u/o})}for(u=0;u<s+1;u++)p=Cn(...t,u/s),l.push({x:p.x,y:p.y,t:u/s});for(u=0;u<o;u++)for(var d=0;d<s;d++){var f,m=a[u],g=a[u+1],v=l[d],y=l[d+1],b=vn(g.x-m.x)<.01?"y":"x",x=vn(y.x-v.x)<.01?"y":"x",w=Rn(m.x,m.y,g.x,g.y,v.x,v.y,y.x,y.y);if(w){if(c[f=w.x.toFixed(9)+"#"+w.y.toFixed(9)])continue;c[f]=!0;var _=m.t+vn((w[b]-m[b])/(g[b]-m[b]))*(g.t-m.t),E=v.t+vn((w[x]-v[x])/(y[x]-v[x]))*(y.t-v.t);_>=0&&_<=1&&E>=0&&E<=1&&(n?h++:h.push({x:w.x,y:w.y,t1:_,t2:E}))}}return h}function Ln(e,t,n){e=Fn(e),t=Fn(t);for(var i,r,o,s,a,l,c,h,u,p,d=n?0:[],f=0,m=e.length;f<m;f++){var g=e[f];if("M"==g[0])i=a=g[1],r=l=g[2];else{"C"==g[0]?(i=(u=[i,r,...g.slice(1)])[6],r=u[7]):(u=[i,r,i,r,a,l,a,l],i=a,r=l);for(var v=0,y=t.length;v<y;v++){var b=t[v];if("M"==b[0])o=c=b[1],s=h=b[2];else{"C"==b[0]?(o=(p=[o,s,...b.slice(1)])[6],s=p[7]):(p=[o,s,o,s,c,h,c,h],o=c,s=h);var x=Bn(u,p,n);if(n)d+=x;else{for(var w=0,_=x.length;w<_;w++)x[w].segment1=f,x[w].segment2=v,x[w].bez1=u,x[w].bez2=p;d=d.concat(x)}}}}}return d}function Nn(e){var t=En(e);if(t.abs)return Sn(t.abs);if(xn(e)&&xn(e&&e[0])||(e=function(e){if(!e)return null;var t=En(e);if(t.arr)return _n(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return xn(e)&&xn(e[0])&&(i=_n(e)),i.length||String(e).replace(yn,(function(e,t,r){var o=[],s=t.toLowerCase();for(r.replace(bn,(function(e,t){t&&o.push(+t)})),"m"==s&&o.length>2&&(i.push([t,...o.splice(0,2)]),s="l",t="m"==t?"l":"L");o.length>=n[s]&&(i.push([t,...o.splice(0,n[s])]),n[s]););})),i.toString=En.toString,t.arr=_n(i),i}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,s=0,a=0,l=0;"M"==e[0][0]&&(s=r=+e[0][1],a=o=+e[0][2],l++,i[0]=["M",r,o]);for(var c,h,u=l,p=e.length;u<p;u++){if(i.push(c=[]),(n=(h=e[u])[0])!=n.toUpperCase())switch(c[0]=n.toUpperCase(),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+h[6]+r,c[7]=+h[7]+o;break;case"V":c[1]=+h[1]+o;break;case"H":c[1]=+h[1]+r;break;case"M":s=+h[1]+r,a=+h[2]+o;default:for(var d=1,f=h.length;d<f;d++)c[d]=+h[d]+(d%2?r:o)}else for(var m=0,g=h.length;m<g;m++)c[m]=h[m];switch(n=n.toUpperCase(),c[0]){case"Z":r=+s,o=+a;break;case"H":r=c[1];break;case"V":o=c[1];break;case"M":s=c[c.length-2],a=c[c.length-1];default:r=c[c.length-2],o=c[c.length-1]}}return i.toString=On,t.abs=Sn(i),i}function zn(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function In(e,t,n,i){return[e,t,n,i,n,i]}function jn(e,t,n,i,r,o){var s=1/3,a=2/3;return[s*e+a*n,s*t+a*i,s*r+a*n,s*o+a*i,r,o]}function $n(e,t,n,i,r,o,s,a,l,c){var h,u=120*dn/180,p=dn/180*(+r||0),d=[],f=function(e){return function t(){var n=Array.prototype.slice.call(arguments,0).join("␀"),i=t.cache=t.cache||{},r=t.count=t.count||[];return wn(i,n)?(function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(r,n),i[n]):(r.length>=1e3&&delete i[r.shift()],r.push(n),i[n]=e(...arguments),i[n])}}((function(e,t,n){return{x:e*pn.cos(n)-t*pn.sin(n),y:e*pn.sin(n)+t*pn.cos(n)}}));if(c)E=c[0],k=c[1],w=c[2],_=c[3];else{e=(h=f(e,t,-p)).x,t=h.y;var m=(e-(a=(h=f(a,l,-p)).x))/2,g=(t-(l=h.y))/2,v=m*m/(n*n)+g*g/(i*i);v>1&&(n*=v=pn.sqrt(v),i*=v);var y=n*n,b=i*i,x=(o==s?-1:1)*pn.sqrt(vn((y*b-y*g*g-b*m*m)/(y*g*g+b*m*m))),w=x*n*g/i+(e+a)/2,_=x*-i*m/n+(t+l)/2,E=pn.asin(((t-_)/i).toFixed(9)),k=pn.asin(((l-_)/i).toFixed(9));(E=e<w?dn-E:E)<0&&(E=2*dn+E),(k=a<w?dn-k:k)<0&&(k=2*dn+k),s&&E>k&&(E-=2*dn),!s&&k>E&&(k-=2*dn)}var O=k-E;if(vn(O)>u){var S=k,C=a,P=l;k=E+u*(s&&k>E?1:-1),d=$n(a=w+n*pn.cos(k),l=_+i*pn.sin(k),n,i,r,0,s,C,P,[k,S,w,_])}O=k-E;var A=pn.cos(E),M=pn.sin(E),T=pn.cos(k),R=pn.sin(k),D=pn.tan(O/4),B=4/3*n*D,L=4/3*i*D,N=[e,t],z=[e+B*M,t-L*A],I=[a+B*R,l-L*T],j=[a,l];if(z[0]=2*N[0]-z[0],z[1]=2*N[1]-z[1],c)return[z,I,j].concat(d);for(var $=[],F=0,H=(d=[z,I,j].concat(d).join().split(",")).length;F<H;F++)$[F]=F%2?f(d[F-1],d[F],p).y:f(d[F],d[F+1],p).x;return $}function Fn(e){var t=En(e);if(t.curve)return Sn(t.curve);for(var n=Nn(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(e,t,n){var i,r;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C",...$n(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(i=2*t.x-t.bx,r=2*t.y-t.by):(i=t.x,r=t.y),e=["C",i,r,...e.slice(1)];break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C",...jn(t.x,t.y,t.qx,t.qy,e[1],e[2])];break;case"Q":t.qx=e[1],t.qy=e[2],e=["C",...jn(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...In(t.x,t.y,e[1],e[2])];break;case"H":e=["C",...In(t.x,t.y,e[1],t.y)];break;case"V":e=["C",...In(t.x,t.y,t.x,e[1])];break;case"Z":e=["C",...In(t.x,t.y,t.X,t.Y)]}return e},o=function(e,t){if(e[t].length>7){e[t].shift();for(var i=e[t];i.length;)s[t]="A",e.splice(t++,0,["C",...i.splice(0,6)]);e.splice(t,1),h=n.length}},s=[],a="",l="",c=0,h=n.length;c<h;c++){n[c]&&(a=n[c][0]),"C"!=a&&(s[c]=a,c&&(l=s[c-1])),n[c]=r(n[c],i,l),"A"!=s[c]&&"C"==a&&(s[c]="C"),o(n,c);var u=n[c],p=u.length;i.x=u[p-2],i.y=u[p-1],i.bx=un(u[p-4])||i.x,i.by=un(u[p-3])||i.y}return t.curve=Sn(n),n}function Hn(e){return h(e)&&f(e,"waypoints")}function Vn(e){return h(e)&&f(e,"labelTarget")}function qn(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Wn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Qn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Xn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function Gn(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r=t[i-1];if(r){var o=e[e.length-1],s=o&&o.endLength||0,a=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}(r,n);e.push({start:r,end:n,startLength:s,endLength:s+a,length:a})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0),r=i/2,o=0,s=n[o];s.endLength<r;)s=n[++o];var a=(r-s.startLength)/s.length;return{x:s.start.x+(s.end.x-s.start.x)*a,y:s.start.y+(s.end.y-s.start.y)*a}}function Un(e){return Hn(e)?Gn(e):Wn({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function Yn(e,t,n){h(n=n||0)||(n={x:n,y:n});var i=Qn(e),r=Qn(t),o=i.bottom+n.y<=r.top,s=i.left-n.x>=r.right,a=i.top-n.y>=r.bottom,l=o?"top":a?"bottom":null,c=i.right+n.x<=r.left?"left":s?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function Kn(e,t,n){var i=function(e,t){return Ln(e,t)}(e,t);return 1===i.length||2===i.length&&nn(i[0],i[1])<1?Wn(i[0]):i.length>1?(i=A(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),Wn(i[n?0:i.length-1])):null}function Zn(e,t){return Math.round(e*t)/t}function Jn(e){return u(e)?e+"px":e}function ei(e,t,n){const i=Me("g");_e(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const ti={shape:["x","y","width","height"],connection:["waypoints"]};function ni(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function ii(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ni.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ni.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=z({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Ct(n,{position:"relative",overflow:"hidden",width:Jn(e.width),height:Jn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Me("svg");xe(i,{width:"100%",height:"100%"}),ge(n,i);const r=this._viewport=ei(i,"viewport");e.deferUpdate&&(this._viewboxChanged=L(N(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(()=>{delete this._cachedViewbox})),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ni.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},ni.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=mt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ni.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},ni.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ni.prototype._getChildIndex=function(e){return x(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},ni.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:ei(this._viewport,"layer-"+e,n),index:t,visible:!0}},ni.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},ni.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(ke(n),t.visible=!1,n):n},ni.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],ke(t.group))},ni.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ni.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},ni.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},ni.prototype._findPlaneForRoot=function(e){return m(this._planes,(function(t){return t.rootElement===e}))},ni.prototype.getContainer=function(){return this._container},ni.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(y([i.gfx,i.secondaryGfx],(function(e){e&&(n?_e(e).add(t):_e(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ni.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ni.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ni.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return _e(this.getGraphics(e)).has(t)},ni.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ni.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ni.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ni.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},ni.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},ni.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},ni.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},ni.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},ni.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=ti[e],i=w(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},ni.prototype._setParent=function(e,t,n){en(t.children,e,n),e.parent=t},ni.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const s=o.create(e,t,i);return this._elementRegistry.add(t,s),o.update(e,t,s),r.fire(e+".added",{element:t,gfx:s}),t},ni.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ni.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ni.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Jt(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ni.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ni.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ni.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ni.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ni.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ni.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,s,a,l,c;return e?(this._changeViewbox((function(){a=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);Ve(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},s=Ve(t),r=s?s.matrix:function(e,t,n,i,r,o){var s=Re().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return De(s,e);case 6:return De(s,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),a=Zn(r.a,1e3),l=Zn(-r.e||0,1e3),c=Zn(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/a:0,y:c?c/a:0,width:n.width/a,height:n.height/a,scale:a,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},ni.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),ii(t,n)})),{x:n.e,y:n.f}},ni.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=ft(e),o=Qn(r),s=this.viewbox(),a=this.zoom();let l,c;s.y+=t.top/a,s.x+=t.left/a,s.width-=(t.right+t.left)/a,s.height-=(t.bottom+t.top)/a;const h=Qn(s);if(r.width<s.width&&r.height<s.height){const e=Math.max(0,o.right-h.right),t=Math.min(0,o.left-h.left),n=Math.max(0,o.bottom-h.bottom),i=Math.min(0,o.top-h.top);l=e||t,c=n||i}else l=r.x-s.x,c=r.y-s.y;this.scroll({dx:-l*a,dy:-c*a})},ni.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Zn(i.a,1e3)},ni.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},ni.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let s,a,l,c,h;l=i.getCTM();const u=l.a;return t?(s=z(o,t),a=s.matrixTransform(l.inverse()),c=r.translate(a.x,a.y).scale(1/u*e).translate(-a.x,-a.y),h=l.multiply(c)):h=r.scale(e),ii(this._viewport,h),h},ni.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ni.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},ni.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var ri="data-element-id";function oi(e){this._elements={},this._eventBus=e}function si(e,t,n){var i=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function ai(e,t){if(!(this instanceof ai))return new ai(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}oi.$inject=["eventBus"],oi.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),xe(t,ri,i),n&&xe(n,ri,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},oi.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(xe(i.gfx,ri,""),i.secondaryGfx&&xe(i.secondaryGfx,ri,""),delete t[n])},oi.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},oi.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&xe(t,ri,i),t},oi.prototype.get=function(e){var t;t="string"==typeof e?e:e&&xe(e,ri);var n=this._elements[t];return n&&n.element},oi.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},oi.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},oi.prototype.getAll=function(){return this.filter((function(e){return e}))},oi.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},oi.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},oi.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")},ai.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?si(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},ai.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||si(this,t,e),n},ai.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},ai.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},ai.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var li=new ai({name:"children",enumerable:!0,collection:!0},{name:"parent"}),ci=new ai({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),hi=new ai({name:"attachers",collection:!0},{name:"host"}),ui=new ai({name:"outgoing",collection:!0},{name:"source"}),pi=new ai({name:"incoming",collection:!0},{name:"target"});function di(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),li.bind(this,"parent"),ci.bind(this,"labels"),ui.bind(this,"outgoing"),pi.bind(this,"incoming")}function fi(){di.call(this),li.bind(this,"children"),hi.bind(this,"host"),hi.bind(this,"attachers")}function mi(){di.call(this),li.bind(this,"children")}function gi(){fi.call(this),ci.bind(this,"labelTarget")}function vi(){di.call(this),ui.bind(this,"source"),pi.bind(this,"target")}e(fi,di),e(mi,fi),e(gi,fi),e(vi,di);var yi={connection:vi,shape:fi,label:gi,root:mi};function bi(){this._uid=12}bi.prototype.createRoot=function(e){return this.create("root",e)},bi.prototype.createLabel=function(e){return this.create("label",e)},bi.prototype.createShape=function(e){return this.create("shape",e)},bi.prototype.createConnection=function(e){return this.create("connection",e)},bi.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=yi[e];if(!n)throw new Error("unknown type: <"+e+">");return z(new n,t)}(e,t)};var xi="__fn",wi=Array.prototype.slice;function _i(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Ei(){}function ki(e){return e.childNodes[0]}function Oi(e,t,n,i,r){var o=Be();o.setTranslate(t,n);var s=Be();s.setRotate(i||0,0,0);var a=Be();a.setScale(r||1,r||1),Ve(e,[o,s,a])}function Si(e,t,n){var i=Be();i.setTranslate(t,n),Ve(e,i)}function Ci(e,t){var n=Be();n.setRotate(t,0,0),Ve(e,n)}function Pi(e,t){this._eventBus=e,this._elementRegistry=t}function Ai(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}_i.prototype.on=function(e,t,n,i){if(e=c(e)?e:[e],p(t)&&(i=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");var r=n;i&&((r=N(n,i))[xi]=n[xi]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},_i.prototype.once=function(e,t,n,i){var r=this;if(p(t)&&(i=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[xi]=n,this.on(e,t,o)},_i.prototype.off=function(e,t){e=c(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},_i.prototype.createEvent=function(e){var t=new Ei;return t.init(e),t},_i.prototype.fire=function(e,t){var n,i,r,o;if(o=wi.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Ei?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==s&&(n.type=s)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},_i.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},_i.prototype._destroy=function(){this._listeners={}},_i.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},_i.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},_i.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},_i.prototype._getListeners=function(e){return this._listeners[e]},_i.prototype._setListeners=function(e,t){this._listeners[e]=t},_i.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[xi]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Ei.prototype.stopPropagation=function(){this.cancelBubble=!0},Ei.prototype.preventDefault=function(){this.defaultPrevented=!0},Ei.prototype.init=function(e){z(this,e||{})},Pi.$inject=["eventBus","elementRegistry"],Pi.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(_e(t=Me("g")).add("djs-children"),ge(n.parentNode,t))):t=n,t},Pi.prototype._clear=function(e){var t=ki(e);return Rt(t),t},Pi.prototype._createContainer=function(e,t,n,i){var r=Me("g");_e(r).add("djs-group"),void 0!==n?Ai(r,t,t.childNodes[n]):ge(t,r);var o=Me("g");_e(o).add("djs-element"),_e(o).add("djs-"+e),i&&_e(o).add("djs-frame"),ge(r,o);var s=Me("g");return _e(s).add("djs-visual"),ge(o,s),o},Pi.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,gt(t))},Pi.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=x(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),y(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);y(t.slice().reverse(),(function(e){Ai(i.getGraphics(e).parentNode,r)}))}}))},Pi.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Pi.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Pi.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Pi.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Pi.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),Si(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?xe(n,"display","none"):xe(n,"display","block")}},Pi.prototype.remove=function(e){ke(this._elementRegistry.getGraphics(e).parentNode)};var Mi={__depends__:[bt],__init__:["canvas"],canvas:["type",ni],elementRegistry:["type",oi],elementFactory:["type",bi],eventBus:["type",_i],graphicsFactory:["type",Pi]};function Ti(e){return function(e){var t=new Ze(e);return t.init(),t}([{config:["value",e=e||{}]},Mi].concat(e.modules||[]))}function Ri(e,t){this._injector=t||Ti(e),this.get("eventBus").fire("diagram.init")}function Di(){}function Bi(e,t){this.model=e,this.properties=t}Ri.prototype.get=function(e,t){return this._injector.get(e,t)},Ri.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Ri.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ri.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Di.prototype.get=function(e){return this.$model.properties.get(this,e)},Di.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Bi.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Di.prototype);y(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),y(e,N((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Li={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ni={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function zi(e,t){var n=Ni[e];return n?n(t):t}function Ii(e){return!!Li[e]}function ji(e){return!!Ni[e]}function $i(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Fi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Hi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,y(e,N(this.registerPackage,this))}function Vi(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function qi(e){this.model=e}function Wi(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Qi(e){return e.replace(/^:/,"")}function Xi(e,t={}){this.properties=new qi(this),this.factory=new Bi(this,this.properties),this.registry=new Hi(e,this.properties),this.typeCache={},this.config=t}Fi.prototype.build=function(){return j(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Fi.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Fi.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,s=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var a=r.indexOf(e);if(-1===a)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(t,n?void 0:a,s),o[i.name]=o[i.localName]=t},Fi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=$i(r[0],i),s=$i(r[1],o.prefix).name,a=this.propertiesByName[s];if(!a)throw new Error("refined property <"+s+"> not found");this.replaceProperty(a,e,n),delete e.redefines},Fi.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Fi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Fi.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Fi.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Fi.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Fi.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Fi.prototype.hasProperty=function(e){return this.propertiesByName[e]},Fi.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(y(e.properties,N((function(n){n=z({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Hi.prototype.getPackage=function(e){return this.packageMap[e]},Hi.prototype.getPackages=function(){return this.packages},Hi.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Vi(t,e,"prefix"),Vi(t,e,"uri"),y(e.types,N((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Hi.prototype.registerType=function(e,t){var n=$i((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};y(e.properties,N((function(e){var t=$i(e.name,n.prefix),i=t.name;Ii(e.type)||(e.type=$i(e.type,t.prefix).name),z(e,{ns:t,name:i}),r[i]=e}),this)),z(e,{ns:n,name:i,propertiesByName:r}),y(e.extends,N((function(e){var t=$i(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Hi.prototype.mapTypes=function(e,t,n){var i=Ii(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=$i(n,Ii(n)?"":e.prefix);r.mapTypes(o,t,i)}function s(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");y(i.superClass,n?s:function(e){return o(e,!1)}),t(i,!n),y(i.traits,s)},Hi.prototype.getEffectiveDescriptor=function(e){var t=$i(e),n=new Fi(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Hi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},qi.prototype.set=function(e,t,n){if(!d(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[Qi(t)]:i?r in e?e[r]=n:Wi(e,i,n):e.$attrs[Qi(t)]=n},qi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Qi(t)];var i=n.name;return!e[i]&&n.isMany&&Wi(e,n,[]),e[i]},qi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},qi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},qi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},qi.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},Xi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Xi.prototype.getType=function(e){var t=this.typeCache,n=d(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Xi.prototype.createAny=function(e,t,n){var i=$i(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){I(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),y(n,(function(e,t){h(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Xi.prototype.getPackage=function(e){return this.registry.getPackage(e)},Xi.prototype.getPackages=function(){return this.registry.getPackages()},Xi.prototype.getElementDescriptor=function(e){return e.$descriptor},Xi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Xi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Xi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Gi=String.fromCharCode,Ui=Object.prototype.hasOwnProperty,Yi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Ki={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Zi(e,t,n,i){return i?Ui.call(Ki,i)?Ki[i]:"&"+i+";":Gi(t||parseInt(n,16))}function Ji(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Yi,Zi):e}Object.keys(Ki).forEach((function(e){Ki[e.toUpperCase()]=Ki[e]}));var er="xsi:type",tr="non-whitespace outside of root node";function nr(e){return new Error(e)}function ir(e){return"missing namespace for prefix <"+e+">"}function rr(e){return{get:e,enumerable:!0}}function or(e){var t,n={};for(t in e)n[t]=e[t];return n}function sr(e){return e+"$uri"}function ar(){return{line:0,column:0}}function lr(e){throw e}function cr(e){if(!this)return new cr(e);var t,n,i,r,o,s,a,l,c,h=e&&e.proxy,u=lr,p=ar,d=!1,f=!1,m=null,g=!1;function v(e){e instanceof Error||(e=nr(e)),m=e,u(e,p)}function y(e){o&&(e instanceof Error||(e=nr(e)),o(e,p))}this.on=function(e,c){if("function"!=typeof c)throw nr("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw nr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw nr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw nr("required args <xml=string>");return m=null,function(e){var o,u,m,b,x,w,_,E,k,O,S,C=f?[]:null,P=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[sr(n)]=t;return i}(c):null,A=[],M=0,T=!1,R=!1,D=0,B=0,L="",N=0;function z(){if(null!==S)return S;var e,t,n,i,r,o,s,a,l,h,u,p=f&&P.xmlns,m=f&&d?[]:null,g=N,v=L,b=v.length,x={},w={};e:for(;g<b;g++)if(l=!1,!(32===(h=v.charCodeAt(g))||h<14&&h>8)){for((h<65||h>122||h>90&&h<97)&&95!==h&&58!==h&&(y("illegal first char attribute name"),l=!0),u=g+1;u<b;u++)if(!((h=v.charCodeAt(u))>96&&h<123||h>64&&h<91||h>47&&h<59||46===h||45===h||95===h)){if(32===h||h<14&&h>8){y("missing attribute value"),g=u;continue e}if(61===h)break;y("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(a=v.substring(g,u))&&(y("illegal declaration of xmlns"),l=!0),34===(h=v.charCodeAt(u+1)))-1===(u=v.indexOf('"',g=u+2))&&-1!==(u=v.indexOf("'",g))&&(y("attribute value quote missmatch"),l=!0);else if(39===h)-1===(u=v.indexOf("'",g=u+2))&&-1!==(u=v.indexOf('"',g))&&(y("attribute value quote missmatch"),l=!0);else for(y("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(h=v.charCodeAt(u+1))||h<14&&h>8);u++);for(-1===u&&(y("missing closing quotes"),u=b,l=!0),l||(o=v.substring(g,u)),g=u;u+1<b&&!(32===(h=v.charCodeAt(u+1))||h<14&&h>8);u++)g===u&&(y("illegal character after attribute end"),l=!0);if(g=u+1,!l)if(a in w)y("attribute <"+a+"> already defined");else if(w[a]=!0,f)if(d){if(null!==(r="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=Ji(o),t=sr(r),!(s=c[e])){if("xmlns"===r||t in P&&P[t]!==e)do{s="ns"+M++}while(void 0!==P[s]);else s=r;c[e]=s}P[r]!==s&&(i||(P=or(P),i=!0),P[r]=s,"xmlns"===r&&(P[sr(s)]=e,p=s),P[t]=e),x[a]=o;continue}m.push(a,o)}else-1!==(h=a.indexOf(":"))?(n=P[a.substring(0,h)])?((a=p===n?a.substr(h+1):n+a.substr(h))===er&&(-1!==(h=o.indexOf(":"))?(n=o.substring(0,h),o=(n=P[n]||n)+o.substring(h)):o=p+":"+o),x[a]=o):y(ir(a.substring(0,h))):x[a]=o;else x[a]=o}if(d)for(g=0,b=m.length;g<b;g++){if(a=m[g++],o=m[g],-1!==(h=a.indexOf(":"))){if(!(n=P[a.substring(0,h)])){y(ir(a.substring(0,h)));continue}(a=p===n?a.substr(h+1):n+a.substr(h))===er&&(-1!==(h=o.indexOf(":"))?(n=o.substring(0,h),o=(n=P[n]||n)+o.substring(h)):o=p+":"+o)}x[a]=o}return S=x}function I(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,s=0,a=B;D>=s&&(t=i.exec(e))&&!((a=t[0].length+t.index)>D);)r+=1,s=a;return-1==D?(o=a,n=e.substring(B)):0===B?n=e.substring(B,D):(o=D-s,n=-1==B?e.substring(D):e.substring(D,B+1)),{data:n,line:r,column:o}}p=I,h&&(O=Object.create({},{name:rr((function(){return E})),originalName:rr((function(){return k})),attrs:rr(z),ns:rr((function(){return P}))}));for(;-1!==B;){if(-1===(D=60===e.charCodeAt(B)?B:e.indexOf("<",B)))return A.length?v("unexpected end of file"):0===B?v("missing start tag"):void(B<e.length&&e.substring(B).trim()&&y(tr));if(B!==D)if(A.length){if(t&&(t(e.substring(B,D),Ji,p),g))return}else if(e.substring(B,D).trim()&&(y(tr),g))return;if(33===(x=e.charCodeAt(D+1))){if(91===(b=e.charCodeAt(D+2))&&"CDATA["===e.substr(D+3,6)){if(-1===(B=e.indexOf("]]>",D)))return v("unclosed cdata");if(r&&(r(e.substring(D+9,B),p),g))return;B+=3;continue}if(45===b&&45===e.charCodeAt(D+3)){if(-1===(B=e.indexOf("--\x3e",D)))return v("unclosed comment");if(s&&(s(e.substring(D+4,B),Ji,p),g))return;B+=3;continue}}if(63!==x){for(u=D+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return B=-1,v("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){B=u;break}}if(33!==x){if(S={},47===x){if(T=!1,R=!0,!A.length)return v("missing open tag");if(u=E=A.pop(),b=D+2+u.length,e.substring(D+2,b)!==u)return v("closing tag mismatch");for(;b<B;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return v("close tag")}else{if(47===e.charCodeAt(B-1)?(u=E=e.substring(D+1,B-1),T=!0,R=!0):(u=E=e.substring(D+1,B),T=!0,R=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return v("illegal first char nodeName");for(b=1,m=u.length;b<m;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){E=u.substring(0,b),S=null;break}return v("invalid nodeName")}R||A.push(E)}if(f){if(o=P,T&&(R||C.push(o),null===S&&(d=-1!==u.indexOf("xmlns",b))&&(N=b,L=u,z(),d=!1)),k=E,-1!==(x=E.indexOf(":"))){if(!(_=P[E.substring(0,x)]))return v("missing namespace on <"+k+">");E=E.substr(x+1)}else _=P.xmlns;_&&(E=_+":"+E)}if(T&&(N=b,L=u,n&&(h?n(O,Ji,R,p):n(E,z,Ji,R,p),g)))return;if(R){if(i&&(i(h?O:E,Ji,T,p),g))return;f&&(P=T?o:C.pop())}B+=1}else{if(l&&(l(e.substring(D,B+1),Ji,p),g))return;B+=1}}else{if(-1===(B=e.indexOf("?>",D)))return v("unclosed question");if(a&&(a(e.substring(D,B+2),p),g))return;B+=2}}}(e),p=ar,g=!1,m},this.stop=function(){g=!0}}function hr(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var ur={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},pr="xsi:type";function dr(e){return e.xml&&e.xml.serialize}function fr(e){return dr(e)===pr}function mr(e,t){return hr(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function gr(e){return new Error(e)}function vr(e){return e.$descriptor}function yr(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw gr("expected element");var t,n=this.elementsById,i=vr(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw gr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function br(){}function xr(){}function wr(){}function _r(e,t){this.property=e,this.context=t}function Er(e,t){this.element=t,this.propertyDesc=e}function kr(){}function Or(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Sr(e,t,n){Or.call(this,e,t,n)}function Cr(e,t,n){this.model=e,this.context=n}function Pr(e){e instanceof Xi&&(e={model:e}),z(this,{lax:!1},e)}br.prototype.handleEnd=function(){},br.prototype.handleText=function(){},br.prototype.handleNode=function(){},xr.prototype=Object.create(br.prototype),xr.prototype.handleNode=function(){return this},wr.prototype=Object.create(br.prototype),wr.prototype.handleText=function(e){this.body=(this.body||"")+e},_r.prototype=Object.create(wr.prototype),_r.prototype.handleNode=function(e){if(this.element)throw gr("expected no sub nodes");return this.element=this.createReference(e),this},_r.prototype.handleEnd=function(){this.element.id=this.body},_r.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Er.prototype=Object.create(wr.prototype),Er.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=zi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},kr.prototype=Object.create(wr.prototype),kr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Or.prototype=Object.create(kr.prototype),Or.prototype.addReference=function(e){this.context.addReference(e)},Or.prototype.handleText=function(e){if(!vr(this.element).bodyProperty)throw gr("unexpected body text <"+e+">");wr.prototype.handleText.call(this,e)},Or.prototype.handleEnd=function(){var e=this.body,t=this.element,n=vr(t).bodyProperty;n&&void 0!==e&&(e=zi(n.type,e),t.set(n.name,e))},Or.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=vr(i),o=this.context,s=new i({}),a=this.model;return y(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?y(e.split(" "),(function(e){o.addReference({element:s,property:i.ns.name,id:e})})):o.addReference({element:s,property:i.ns.name,id:e}):(i?e=zi(i.type,e):"xmlns"!==n&&(t=$i(n,r.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},Or.prototype.getPropertyForNode=function(e){var t,n,i=$i(e.name),r=this.type,o=this.model,s=vr(r),a=i.name,l=s.propertiesByName[a];if(l&&!l.isAttr)return fr(l)&&(t=e.attributes[pr])?(t=function(e,t){var n=$i(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),z({},l,{effectiveType:vr(n=o.getType(t)).name})):l;var c=o.getPackage(i.prefix);if(c){if(t=mr(i,c),n=o.getType(t),l=m(s.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),l)return z({},l,{effectiveType:vr(n).name})}else if(l=m(s.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),l)return l;throw gr("unrecognized element <"+i.name+">")},Or.prototype.toString=function(){return"ElementDescriptor["+vr(this.type).name+"]"},Or.prototype.valueHandler=function(e,t){return new Er(e,t)},Or.prototype.referenceHandler=function(e){return new _r(e,this.context)},Or.prototype.handler=function(e){return"Element"===e?new Cr(this.model,e,this.context):new Or(this.model,e,this.context)},Or.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,ji(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Sr.prototype=Object.create(Or.prototype),Sr.prototype.createElement=function(e){var t=e.name,n=$i(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),s=o&&mr(n,o)||t;if(!r.hasType(s))throw gr("unexpected element <"+e.originalName+">");return Or.prototype.createElement.call(this,e)},Cr.prototype=Object.create(kr.prototype),Cr.prototype.createElement=function(e){var t=e.name,n=$i(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Cr.prototype.handleChild=function(e){var t=new Cr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Cr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Pr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Or?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,s=new yr(z({},t,{rootHandler:i})),a=new cr({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw gr(l)}function h(e,t){return c(e,t,!0)}i.context=s,l.push(i);var u=/^<\?xml /i,p=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){h(e,t)}}var m=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return a.ns(m).on("openTag",(function(e,t,n,i){var r=e.attrs||{},s=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new xr)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=p.exec(e),n=t&&t[1];n&&!d.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",c).on("warn",h),new Promise((function(t,n){var r;try{a.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=vr(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var l=r.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(a.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=gr("failed to parse document as <"+i.type.$descriptor.name+">"));var l=s.warnings,c=s.references,h=s.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:h,references:c,warnings:l})}))},Pr.prototype.handler=function(e){return new Sr(this.model,e)};var Ar=/<|>|'|"|&|\n\r|\n/g,Mr=/<|>|&/g;function Tr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function Rr(e,t){return hr(t)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(e):e}function Dr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Br(e){return d(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Lr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Nr={"<":"lt",">":"gt","&":"amp"};function zr(e,t,n){return(e=d(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Ir(e){this.tagName=e}function jr(){}function $r(e){this.tagName=e}function Fr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Hr(e,t){Fr.call(this,e,t)}function Vr(){this.value="",this.write=function(e){this.value+=e}}function qr(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Wr(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Vr,r=new qr(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Fr).build(t).serializeTo(r),!n)return i.value}}}function Qr(e,t){Xi.call(this,e,t)}Ir.prototype.build=function(e){return this.element=e,this},Ir.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},jr.prototype.serializeValue=jr.prototype.serializeTo=function(e){e.append(this.escape?zr(this.value,Mr,Nr):this.value)},jr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Mr)&&(this.escape=!0),this},Dr($r,jr),$r.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Fr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return v(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!f(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(v(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return v(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Fr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?z({localName:t.ns.localName},e):z({localName:Rr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Fr.prototype.nsPropertyTagName=function(e){return function(e,t){return z({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Fr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Fr.prototype.nsAttributeName=function(e){var t;if(t=d(e)?$i(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},Fr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return y(e,(function(r,o){"$body"===o?n.push((new jr).build({type:"String"},r)):"$children"===o?y(r,(function(e){n.push(new Fr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Fr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=$i(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var s=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(s)}},Fr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return y(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Fr.prototype.parseGenericAttributes=function(e,t){var n=this;y(t,(function(t){if(t.name!==pr)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Fr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;y(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new jr).build(e,r[0]));else if(ji(e.type))y(r,(function(i){n.push(new $r(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)y(r,(function(i){n.push(new Ir(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var s=fr(e),a=function(e){return"property"===dr(e)}(e);y(r,(function(i){var r;r=s?new Hr(t,e):a?new Fr(t,e):new Fr(t),n.push(r.build(i))}))}}))},Fr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Tr(t):n=t),n},Fr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Fr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,s=this.getNamespaces(t),a=e.prefix,l=e.uri;if(!a&&!l)return{localName:e.localName};if(r=ur[a]||o&&(o.getPackage(a)||{}).uri,!(l=l||r||s.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=s.byUri(l))){for(n=a,i=1;s.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return a&&s.mapPrefix(a,l),e},Fr.prototype.parseAttributes=function(e){var t=this,n=this.element;y(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];y(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Fr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Br(e)},Fr.prototype.addAttribute=function(e,t){var n=this.attrs;d(t)&&(t=zr(t,Ar,Lr));var i=g(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Fr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),y(t,(function(t){e.append(" ").append(Br(t.name)).append('="').append(t.value).append('"')}))},Fr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==jr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),y(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Dr(Hr,Fr),Hr.prototype.parseNsAttributes=function(e){var t=Fr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(pr),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Hr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Qr.prototype=Object.create(Xi.prototype),Qr.prototype.fromXML=function(e,t,n){d(t)||(n=t,t="bpmn:Definitions");var i=new Pr(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Qr.prototype.toXML=function(e,t){var n=new Wr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Xr={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Gr(e,t){return new Qr(z({},Xr,e),t)}function Ur(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var Yr="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function Kr(e){f(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(Yr)}})}function Zr(e,t){return e.$instanceOf(t)}function Jr(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function s(t,n){try{var r=i[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${Ur(t)}`);return e.element(t,i[t.id],n)}(t,n);return o(t),r}catch(e){a(e.message,{element:t,error:e}),console.error(`failed to import ${Ur(t)}`,e)}}function a(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t=e.bpmnElement;t?i[t.id]?a(`multiple DI elements defined for ${Ur(t)}`,{element:t}):(i[t.id]=e,Kr(t)):a(`no bpmnElement referenced in ${Ur(e)}`,{element:e})};function c(e){var t;t=e.plane,l(t),y(t.planeElement,h)}function h(e){l(e)}this.handleDefinitions=function(o,s){var h=o.diagrams;if(s&&-1===h.indexOf(s))throw new Error("diagram not part of <bpmn:Definitions />");if(!s&&h&&h.length&&(s=h[0]),!s)throw new Error("no diagram to display");i={},c(s);var f=s.plane;if(!f)throw new Error(`no plane for ${Ur(s)}`);var g=f.bpmnElement;if(!g){if(g=function(e){return m(e.rootElements,(function(e){return Zr(e,"bpmn:Process")||Zr(e,"bpmn:Collaboration")}))}(o),!g)throw new Error("no process or collaboration to display");a(`correcting missing bpmnElement on ${Ur(f)} to ${Ur(g)}`),f.bpmnElement=g,l(f)}var b,x,_=function(t,n){return e.root(t,i[t.id],n)}(g,f);if(Zr(g,"bpmn:Process")||Zr(g,"bpmn:SubProcess"))p(g,_);else{if(!Zr(g,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${Ur(f)}: ${Ur(g)}`);x=_,y((b=g).participants,r(A,x)),w(b.artifacts,x),n.push((function(){!function(e,t){y(e,r(d,t))}(b.messageFlows,x)})),function(e,n){var i=v(e,(function(e){return!t[e.id]&&Zr(e,"bpmn:Process")&&e.laneSets}));i.forEach(r(p,n))}(o.rootElements,_)}u(n)};var u=this.handleDeferred=function(){for(;n.length;)n.shift()()};function p(e,t){P(e,t),_(e.ioSpecification,t),w(e.artifacts,t),o(e)}function d(e,t){s(e,t)}function f(e,t){s(e,t)}function g(e,t){s(e,t)}function b(e,t){s(e,t)}function x(e,t){s(e,t)}function w(e,t){y(e,(function(e){Zr(e,"bpmn:Association")?n.push((function(){x(e,t)})):x(e,t)}))}function _(e,t){e&&(y(e.dataInputs,r(g,t)),y(e.dataOutputs,r(b,t)))}var E=this.handleSubProcess=function(e,t){P(e,t),w(e.artifacts,t)};function k(e,t){var i=s(e,t);Zr(e,"bpmn:SubProcess")&&E(e,i||t),Zr(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){y(e.dataInputAssociations,r(f,t)),y(e.dataOutputAssociations,r(f,t))}))}function O(e,t){s(e,t)}function S(e,t){n.push((function(){var n=s(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){y(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function C(e,t){y(e.lanes,r(S,t))}function P(e,t){!function(e,t){y(e,(function(e){Zr(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){s(e,t)}(e,t)})):Zr(e,"bpmn:BoundaryEvent")?n.unshift((function(){k(e,t)})):Zr(e,"bpmn:FlowNode")?k(e,t):Zr(e,"bpmn:DataObject")||(Zr(e,"bpmn:DataStoreReference")||Zr(e,"bpmn:DataObjectReference")?O(e,t):a(`unrecognized flowElement ${Ur(e)} in context ${Ur(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){y(e,r(C,t))}(e.laneSets,t)}function A(e,t){var n=s(e,t),i=e.processRef;i&&p(i,n||t)}}function eo(e,t){var n=no(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function to(e,t){return _(t,(function(t){return eo(e,t)}))}function no(e){return e&&e.businessObject||e}function io(e){return e&&e.di}function ro(e,t,n){var i,r,o,s=[];function a(e,t){var n=new Jr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;eo(i,"bpmn:Process")||eo(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(eo(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=eo(r,"bpmn:Collaboration")?r:m(e.rootElements,(function(e){if(eo(e,"bpmn:Collaboration"))return m(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=E(n.participants,(function(e){return e.processRef}))).push(n);var s=oo(o),a=[t],l=[i];return y(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===l.indexOf(t)&&(a.push(e),l.push(t))})),a}(e,t);if(!r)throw new Error("no diagram to display");y(r,(function(t){n.handleDefinitions(e,t)}));var a=t.plane.bpmnElement.id;o.setRootElement(o.findRoot(a+"_plane")||o.findRoot(a))}return new Promise((function(l,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),a(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),l({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function oo(e){var t=[];return y(e,(function(e){e&&(t.push(e),t=t.concat(oo(e.flowElements)))})),t}var so,ao='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',lo={verticalAlign:"middle"},co={color:"#404040"},ho={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},uo={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},po={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},fo='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ao+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function mo(){so||(G(so=de(fo),ho),G(fe("svg",so),lo),G(fe(".backdrop",so),uo),G(fe(".notice",so),po),G(fe(".link",so),co,{margin:"15px 20px 15px 10px",alignSelf:"center"}),ce.bind(so,".backdrop","click",(function(e){document.body.removeChild(so)}))),document.body.appendChild(so)}function go(e){e=z({},yo,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=de('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ao+"</a>");G(fe("svg",t),lo),G(t,co,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),se.bind(t,"click",(function(e){mo(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function vo(e,t){return e.warnings=t,e}e(go,Ri),go.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let s=o.rootElement;const a=o.references,l=o.warnings,c=o.elementsById;i=i.concat(l),s=this._emit("import.parse.complete",(r={error:null,definitions:s,elementsById:c,references:a,warnings:i},n.get("eventBus").createEvent(r)))||s;const h=await this.importDefinitions(s,t);return i=i.concat(h.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),vo(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},go.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},go.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw vo(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return m(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw vo(t,[]),t}try{this.clear()}catch(e){throw vo(e,[]),e}const{warnings:i}=await ro(this,t,n);return{warnings:i}},go.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},go.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=fe("defs",t._svg),r=Fe(n),o=i?"<defs>"+Fe(i)+"</defs>":"",s=n.getBBox();e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},go.prototype._setDefinitions=function(e){this._definitions=e},go.prototype.getModules=function(){return this._modules},go.prototype.clear=function(){this.getDefinitions()&&Ri.prototype.clear.call(this)},go.prototype.destroy=function(){var e;Ri.prototype.destroy.call(this),(e=this._container).parentNode&&e.parentNode.removeChild(e)},go.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},go.prototype.off=function(e,t){this.get("eventBus").off(e,t)},go.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=fe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},go.prototype.getDefinitions=function(){return this._definitions},go.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},go.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),s=z($(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Ri.call(this,s),n&&n.container&&this.attachTo(n.container)},go.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},go.prototype._createContainer=function(e){const t=de('<div class="bjs-container"></div>');return G(t,{width:bo(e.width),height:bo(e.height),position:e.position}),t},go.prototype._createModdle=function(e){return new Gr(z({},this._moddleExtensions,e.moddleExtensions))},go.prototype._modules=[];const yo={width:"100%",height:"100%",position:"relative"};function bo(e){return e+(u(e)?"px":"")}function xo(e){go.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function wo(e,t){return!eo(e,"bpmn:CallActivity")&&(eo(e,"bpmn:SubProcess")?!(!(t=t||io(e))||!eo(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!eo(e,"bpmn:Participant")||!!no(e).processRef)}function _o(e){if(eo(e,"bpmn:Participant")||eo(e,"bpmn:Lane")){var t=io(e).isHorizontal;return void 0===t||t}}function Eo(e){return e&&!1!==no(e).isInterrupting}function ko(e){return e&&!!no(e).triggeredByEvent}function Oo(e,t){return _(no(e).eventDefinitions,(function(e){return eo(e,t)}))}e(xo,go),xo.prototype._createModdle=function(e){var t=go.prototype._createModdle.call(this,e);return t.ids=new n([32,36,1]),t},xo.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var So={width:90,height:20},Co=15;function Po(e){return eo(e,"bpmn:Event")||eo(e,"bpmn:Gateway")||eo(e,"bpmn:DataStoreReference")||eo(e,"bpmn:DataObjectReference")||eo(e,"bpmn:DataInput")||eo(e,"bpmn:DataOutput")||eo(e,"bpmn:SequenceFlow")||eo(e,"bpmn:MessageFlow")||eo(e,"bpmn:Group")}function Ao(e){return Vn(e.label)}function Mo(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)),s=r.x,a=r.y;return Math.abs(o)<Math.PI/2?a-=Co:s+=Co,{x:s,y:a}}function To(e){return e.waypoints?Mo(e.waypoints):eo(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+So.height/2}:{x:e.x+e.width/2,y:e.y+e.height+So.height/2}}function Ro(e){return eo(e,"bpmn:FlowElement")||eo(e,"bpmn:Participant")||eo(e,"bpmn:Lane")||eo(e,"bpmn:SequenceFlow")||eo(e,"bpmn:MessageFlow")||eo(e,"bpmn:DataInput")||eo(e,"bpmn:DataOutput")?"name":eo(e,"bpmn:TextAnnotation")?"text":eo(e,"bpmn:Group")?"categoryValueRef":void 0}function Do(e){var t=e.businessObject,n=Ro(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}var Bo="hsl(225, 10%, 15%)",Lo="white";function No(e,t){return _(e.eventDefinitions,(function(e){return e.$type===t}))}function zo(e,t,n){var i=io(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||Lo}function Io(e,t,n){var i=io(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||Bo}function jo(e,t,n,i){var r=io(e).get("label");return i||r&&r.get("color:color")||t||Io(e,n)}function $o(e,t={}){return{width:Fo(e,t),height:Ho(e,t)}}function Fo(e,t={}){return f(t,"width")?t.width:e.width}function Ho(e,t={}){return f(t,"height")?t.height:e.height}var Vo=new n,qo=.95;function Wo(e,t,n,i,r,o,s){tt.call(this,t,s);var a=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=Vo.next(),p={};function d(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Bo,strokeWidth:2,fill:"white"})}function f(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Bo,strokeWidth:2})}function m(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o}=t,s=Me("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ge(s,o);var a=fe("defs",r._svg);a||(a=Me("defs"),ge(r._svg,a)),ge(a,s),p[e]=s}function g(e){return e.replace(/[^0-9a-zA-Z]+/g,"_")}function v(e,t,n){var i=e+"-"+g(t)+"-"+g(n)+"-"+u;return p[i]||function(e,t,n,i){if("sequenceflow-end"===t){m(e,{element:Me("path",{d:"M 1 5 L 11 10 L 1 15 Z",...d({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5})}if("messageflow-start"===t){m(e,{element:Me("circle",{cx:6,cy:6,r:3.5,...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6}})}if("messageflow-end"===t){m(e,{element:Me("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5}})}if("association-start"===t){m(e,{element:Me("path",{d:"M 11 5 L 1 10 L 11 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5})}if("association-end"===t){m(e,{element:Me("path",{d:"M 1 5 L 11 10 L 1 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5})}if("conditional-flow-marker"===t){m(e,{element:Me("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...d({fill:n,stroke:i})}),ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){m(e,{element:Me("path",{d:"M 6 4 L 10 16",...d({stroke:i})}),ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function b(e,t,n,i,r={}){h(i)&&(r=i,i=0),i=i||0,r=d(r);var o=Me("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return ge(e,o),o}function x(e,t,n,i,r,o){h(r)&&(o=r,r=0),r=r||0,o=d(o);var s=Me("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return ge(e,s),s}function w(e,t,n,i){var r=at(t,n=f(n),i);return ge(e,r),r}function _(e,t,n){return w(e,t,n,5)}function E(e,t,n){n=f(n);var i=Me("path",{...n,d:t});return ge(e,i),i}function k(e,t,n,i){return E(t,n,z({"data-marker":e},i))}function O(e){return te[e]}function S(e){return function(t,n,i){return O(e)(t,n,i)}}var C=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:r?zo(t,a,n.fill):Io(t,l,n.stroke),strokeWidth:1})},P=function(e,t,n={}){var r=b(e,t.width,t.height,.2*t.height,{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:2});E(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:Io(t,l,n.stroke),strokeWidth:2});for(var o=0;o<12;o++){var s=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),c=t.width/2,h=t.height/2;E(e,s,{strokeWidth:1,stroke:Io(t,l,n.stroke),transform:"rotate("+30*o+","+h+","+c+")"})}return r},A=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},M=function(e,t,n={}){return E(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},T=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},R=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},D=function(e,t,n={},r){var o=E(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?Io(t,l,n.stroke):"none",stroke:Io(t,l,n.stroke),strokeWidth:1});return Ci(o,45),o},B=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},L=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},N=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),strokeWidth:1})},I=function(e,t,n={}){return E(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},j=function(e,t,n={}){return b(e,t.width,t.height,8,{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:4})};function $(e,t,n={}){var i=no(e),r=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(i);return i.get("eventDefinitions")&&i.get("eventDefinitions").length>1?i.get("parallelMultiple")?I(t,e,n,r):N(t,e,n,r):No(i,"bpmn:MessageEventDefinition")?C(t,e,n,r):No(i,"bpmn:TimerEventDefinition")?P(t,e,n,r):No(i,"bpmn:ConditionalEventDefinition")?M(t,e,n,r):No(i,"bpmn:SignalEventDefinition")?L(t,e,n,r):No(i,"bpmn:EscalationEventDefinition")?A(t,e,n,r):No(i,"bpmn:LinkEventDefinition")?T(t,e,n,r):No(i,"bpmn:ErrorEventDefinition")?R(t,e,n,r):No(i,"bpmn:CancelEventDefinition")?D(t,e,n,r):No(i,"bpmn:CompensateEventDefinition")?B(t,e,n,r):No(i,"bpmn:TerminateEventDefinition")?j(t,e,n,r):null}var F={ParticipantMultiplicityMarker:function(e,t,n={}){var r=Fo(t,n),o=Ho(t,n);k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},SubProcessMarker:function(e,t,n={}){Si(x(e,14,14,0,{strokeWidth:1,fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)}),t.width/2-7.5,t.height-20),k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},ParallelMarker:function(e,t,n){var r=Fo(t,n),o=Ho(t,n);k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},SequentialMarker:function(e,t,n){k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},CompensationMarker:function(e,t,n){k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},LoopMarker:function(e,t,n){var r=Fo(t,n),o=Ho(t,n);k("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:Io(t,l,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=Fo(t,n),o=Ho(t,n);k("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:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke)})}};function H(e,t,n,i){F[e](t,n,i)}function V(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:Fo(t,i),height:Ho(t,i)};var r=no(t),o=n&&n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},y(n,(function(n){H(n,e,t,i)})),r.get("isForCompensation")&&H("CompensationMarker",e,t,i),eo(r,"bpmn:AdHocSubProcess")&&H("AdhocMarker",e,t,i);var s=r.get("loopCharacteristics"),a=s&&s.get("isSequential");s&&(void 0===a&&H("LoopMarker",e,t,i),!1===a&&H("ParallelMarker",e,t,i),!0===a&&H("SequentialMarker",e,t,i))}function q(e,t,n={}){n=z({size:{width:100}},n);var i=o.createText(t||"",n);return _e(i).add("djs-label"),ge(e,i),i}function W(e,t,n,i={}){var r=no(t),o=$o({x:t.x,y:t.y,width:t.width,height:t.height},i);return q(e,r.name,{align:n,box:o,padding:7,style:{fill:jo(t,c,l,i.stroke)}})}function Q(e,t,n,i={}){var r=_o(n),o=q(e,t,{box:{height:30,width:r?Ho(n,i):Fo(n,i)},align:"center-middle",style:{fill:jo(n,c,l,i.stroke)}});r&&Oi(o,0,-(-1*Ho(n,i)),270)}function X(e,t,n={}){var{width:i,height:r}=$o(t,n);return x(e,i,r,10,{...n,fill:zo(t,a,n.fill),fillOpacity:qo,stroke:Io(t,l,n.stroke)})}function G(e,t,n={}){var i=no(t),r=zo(t,a,n.fill),o=Io(t,l,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=v("association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=v("association-start",r,o)),n=Qo(n,["markerStart","markerEnd"]),_(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function U(e,t,n={}){var r=zo(t,a,n.fill),o=Io(t,l,n.stroke),s=E(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:qo,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(no(t))&&E(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 s}function Y(e,t,n={}){return b(e,t.width,t.height,{fillOpacity:qo,...n,fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})}function K(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,s=[{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=d(i);var a=Me("polygon",{...i,points:s});return ge(e,a),a}(e,t.width,t.height,{fill:zo(t,a,n.fill),fillOpacity:qo,stroke:Io(t,l,n.stroke)})}function Z(e,t,n={}){var i=x(e,Fo(t,n),Ho(t,n),0,{fill:zo(t,a,n.fill),fillOpacity:n.fillOpacity||qo,stroke:Io(t,l,n.stroke),strokeWidth:1.5}),r=no(t);eo(r,"bpmn:Lane")&&Q(e,r.get("name"),t,n);return i}function J(e,t,n={}){var i=X(e,t,n);ko(t)&&xe(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=wo(t);return W(e,t,r?"center-top":"center-middle",n),V(e,t,r?void 0:["SubProcessMarker"],n),i}function ee(e,t,n={}){var i=X(e,t,n);return W(e,t,"center-middle",n),V(e,t,void 0,n),i}var te=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return J(e,t,n=wo(t)?Qo(n,["fill","stroke","width","height"]):Qo(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return G(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]);var r=no(t).get("cancelActivity");n={strokeWidth:1.5,fill:zo(t,a,n.fill),fillOpacity:1,stroke:Io(t,l,n.stroke)},r||(n.strokeDasharray="6");var o=Y(e,t,n);return b(e,t.width,t.height,3,{...n,fill:"none"}),i&&$(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return xe(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),xe(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),J(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=K(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return E(e,r,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),G(e,t,{...n,markerEnd:v("association-end",zo(t,a,n.fill),Io(t,l,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return U(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:DataObjectReference":S("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return E(e,r,{strokeWidth:1,fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),G(e,t,{...n,markerEnd:v("association-end",zo(t,a,n.fill),Io(t,l,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),E(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:zo(t,a,n.fill),fillOpacity:qo,stroke:Io(t,l,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]);var r=Y(e,t,{...n,strokeWidth:4});return i&&$(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=no(t),o=K(e,t,n);b(e,t.width,t.height,.2*t.height,{fill:zo(t,"none",n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1});var s=r.get("eventGatewayType"),a=!!r.get("instantiate");if("Parallel"===s){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});E(e,c,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:1})}else"Exclusive"===s&&(a||b(e,t.width,t.height,.26*t.height,{fill:"none",stroke:Io(t,l,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}});E(e,r,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=K(e,t,n=Qo(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return io(t).get("isMarkerVisible")&&E(e,o,{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return K(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=Qo(n,["fill","stroke","width","height"]),x(e,t.width,t.height,10,{stroke:Io(t,l,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Fo(t,n),height:Ho(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=K(e,t,n=Qo(n,["fill","stroke"]));return b(e,t.width,t.height,.24*t.height,{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]);var r=Y(e,t,{...n,strokeWidth:1.5});return b(e,t.width,t.height,3,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:1.5}),i&&$(t,e,n),r},"bpmn:IntermediateCatchEvent":S("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":S("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=Qo(n,["fill","stroke","width","height"]),Z(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=no(t),o=io(t),s=zo(t,a,n.fill),c=Io(t,l,n.stroke),h=_(e,t.waypoints,{markerEnd:v("messageflow-end",s,c),markerStart:v("messageflow-start",s,c),stroke:c,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=h.getPointAtLength(h.getTotalLength()/2),p=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),d={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(d.fill=s,d.stroke=c):(d.fill=c,d.stroke=s);var f=E(e,p,d),m=q(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:c}}),g=f.getBBox(),y=m.getBBox();Oi(m,u.x-y.width/2,u.y+g.height/2+10,0)}return h},"bpmn:ParallelGateway":function(e,t,n={}){var r=K(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=Z(e,t,n=Qo(n,["fill","stroke","width","height"])),r=wo(t),o=_o(t),s=no(t),a=s.get("name");if(r){w(e,o?[{x:30,y:0},{x:30,y:Ho(t,n)}]:[{x:0,y:30},{x:Fo(t,n),y:30}],{stroke:Io(t,l,n.stroke),strokeWidth:1.5}),Q(e,a,t,n)}else{var h=$o(t,n);o||(h.height=Fo(t,n),h.width=Ho(t,n));var u=q(e,a,{box:h,align:"center-middle",style:{fill:jo(t,c,l,n.stroke)}});if(!o)Oi(u,0,-(-1*Ho(t,n)),270)}return s.get("participantMultiplicity")&&H("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r,o=no(t),s=ee(e,t,n);return o.get("instantiate")?(b(e,28,28,4.4,{fill:zo(t,a,n.fill),stroke:Io(t,l,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}}),E(e,r,{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),s},"bpmn:ScriptTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:Io(t,l,n.stroke),stroke:zo(t,a,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var i=zo(t,a,n.fill),r=Io(t,l,n.stroke),o=_(e,t.waypoints,{markerEnd:v("sequenceflow-end",i,r),stroke:r}),s=no(t),{source:c}=t;if(c){var h=no(c);s.get("conditionExpression")&&eo(h,"bpmn:Activity")&&xe(o,{markerStart:v("conditional-flow-marker",i,r)}),h.get("default")&&(eo(h,"bpmn:Gateway")||eo(h,"bpmn:Activity"))&&h.get("default")===s&&xe(o,{markerStart:v("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return b(e,10,10,{fill:zo(t,a,n.fill),stroke:"none",transform:"translate(6, 6)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),b(e,10,10,{fill:zo(t,a,n.fill),stroke:"none",transform:"translate(11, 10)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]),no(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=Y(e,t,n);return i&&$(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return J(e,t,n=wo(t)?Qo(n,["fill","stroke","width","height"]):Qo(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return ee(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=Qo(n,["fill","stroke","width","height"]);var{width:r,height:o}=$o(t,n),s=x(e,r,o,0,0,{fill:"none",stroke:"none"});return E(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:Io(t,l,n.stroke)}),q(e,no(t).get("text")||"",{align:"left-top",box:$o(t,n),padding:7,style:{fill:jo(t,c,l,n.stroke)}}),s},"bpmn:Transaction":function(e,t,i={}){i=wo(t)?Qo(i,["fill","stroke","width","height"]):Qo(i,["fill","stroke"]);var r=J(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:Io(t,l,i.stroke),strokeWidth:1.5});return wo(t)||(i={}),x(e,Fo(t,i),Ho(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return q(e,Do(t),{box:i,fitBox:!0,style:z({},o.getExternalStyle(),{fill:jo(t,c,l,n.stroke)})})}(e,t,n)}};this._drawPath=E,this._renderer=O}function Qo(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(Wo,tt),Wo.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Wo.prototype.canRender=function(e){return eo(e,"bpmn:BaseElement")},Wo.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Wo.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Wo.prototype.getShapePath=function(e){return eo(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,nt([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):eo(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return nt([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):eo(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return nt([["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 nt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var Xo=0,Go={width:150,height:50};function Uo(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function Yo(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=Uo(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return Ko(e,o,r,i);o=Jo(o,i.width,t)}}function Ko(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 Zo="­";function Jo(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!==Zo||r.pop();break}r.push(n),o+=n.length}var s=r[r.length-1];return s&&s===Zo&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function es(e){this._config=z({},{size:Go,padding:Xo,style:{},align:"center-top"},e||{})}es.prototype.createText=function(e,t){return this.layoutText(e,t).element},es.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},es.prototype.layoutText=function(e,t){var n=z({},this._config.size,t.box),i=z({},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 h(e)?z({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),s=t.fitBox||!1,a=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),l=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,p=Me("text");for(xe(p,{x:0,y:0}),xe(p,i),ge(function(){var e=document.getElementById("helper-svg");return e||(xe(e=Me("svg"),{id:"helper-svg"}),Ct(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),p);l.length;)c.push(Yo(l,u,p));"middle"===r.vertical&&(o.top=o.bottom=0);var d=x(c,(function(e,t,n){return e+(a||t.height)}),0)+o.top+o.bottom,f=x(c,(function(e,t,n){return t.width>e?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-d)/2),m-=(a||c[0].height)/4;var g=Me("text");return xe(g,i),y(c,(function(e){var t;switch(m+=a||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?f:u)-o.right-e.width;break;default:t=Math.max(((s?f:u)-e.width)/2+o.left,0)}var n=Me("tspan");xe(n,{x:t,y:m}),n.textContent=e.text,ge(g,n)})),ke(p),{dimensions:{width:f,height:d},element:g}};function ts(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new es({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}ts.$inject=["config.textRenderer"];var ns=/\{([^{}]+)\}/g,is=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var rs={__init__:["bpmnRenderer"],bpmnRenderer:["type",Wo],textRenderer:["type",ts],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var s=t.containerHeight/r.height*t.yScaleFactor,a=t.containerWidth/r.width*t.xScaleFactor,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*s;for(var c=0;c<r.widthElements.length;c++)o["x"+c]=r.widthElements[c]*a}var h,u,p=(h=r.d,u={mx:n,my:i,e:o},String(h).replace(ns,(function(e,t){return function(e,t,n){var i=n;return t.replace(is,(function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?e:i)+""}(e,t,u)})));return p}}]};var os={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function ss(e,t,n){return z({id:e.id,type:e.$type,businessObject:e,di:t},n)}function as(e,t,n){var i=e.waypoint;return!i||i.length<2?[Un(t),Un(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function ls(e,t,n){return new Error(`element ${Ur(t)} referenced by ${Ur(e)}#${n} not yet drawn`)}function cs(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}cs.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],cs.prototype.add=function(e,t,n){var i,r,o;if(eo(t,"bpmndi:BPMNPlane")){var s=eo(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(ss(e,t,s)),this._canvas.addRootElement(i)}else if(eo(t,"bpmndi:BPMNShape")){var a=!wo(e,t),l=function(e){return eo(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var c=t.bounds;i=this._elementFactory.createShape(ss(e,t,{collapsed:a,hidden:r,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height),isFrame:l})),eo(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),eo(e,"bpmn:Lane")&&(o=0),eo(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,Un(c))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!eo(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${Ur(t)} for element ${Ur(e)}`);var h=this._getSource(e),u=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(ss(e,t,{hidden:r,source:h,target:u,waypoints:as(t,h,u)})),eo(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Po(e)&&Do(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},cs.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Ur(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw ls(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},cs.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(So.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=To(t),i=So),z({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=Do(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(ss(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Do(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},cs.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?ls(e,i,t+"Ref"):new Error(`${Ur(e)}#${t} Ref not specified`)},cs.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},cs.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},cs.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var hs={__depends__:[rs,{__depends__:[os],bpmnImporter:["type",cs]}]};function us(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}us.prototype.next=function(){return this._prefix+ ++this._counter};var ps=new us("ov");function ds(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=ps,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),Ct(o=Ut('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function fs(e,t,n){Ct(e,{left:t+"px",top:n+"px"})}function ms(e,t){e.style.display=!1===t?"none":""}function gs(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}ds.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ds.prototype.get=function(e){if(d(e)&&(e={id:e}),d(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?v(t.overlays,M({type:e.type})):t.overlays.slice():[]}return e.type?v(this._overlays,M({type:e.type})):e.id?this._overlays[e.id]:null},ds.prototype.add=function(e,t,n){if(h(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ds.prototype.remove=function(e){var t=this.get(e)||[];c(t)||(t=[t]);var n=this;y(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Zt(e.html),Zt(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}}))},ds.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},ds.prototype.show=function(){ms(this._overlayRoot)},ds.prototype.hide=function(){ms(this._overlayRoot,!1)},ds.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Rt(this._overlayRoot)},ds.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=ft(t);i=o.x,r=o.y}fs(n,i,r),Pt(e.html,"data-container-id",t.id)},ds.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,s=i.left,a=i.top;void 0!==i.right&&(t=o.waypoints?ft(o).width:o.width,s=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?ft(o).height:o.height,a=-1*i.bottom+n);fs(r,s||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ds.prototype._createOverlayContainer=function(e){var t=Ut('<div class="djs-overlays" />');Ct(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ds.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";gs(this._overlayRoot,n)},ds.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},ds.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),d(o)&&(o=Ut(o)),n=this._getOverlayContainer(r),Ct(t=Ut('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&Mt(t).add("djs-overlay-"+e.type),ms(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ds.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,l=!0;(i!==this._canvas.getRootElement()||n&&(a(r)&&r>t.scale||a(o)&&o<t.scale))&&(l=!1),ms(s,l),this._updateOverlayScale(e,t)},ds.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,s=e.htmlContainer,l="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),a(n)&&t.scale<n&&(r=(1/t.scale||1)*n),a(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),a(r)&&(l="scale("+r+","+r+")"),gs(s,l)},ds.prototype._updateOverlaysVisibilty=function(e){var t=this;y(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},ds.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element;y(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Zt(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}})),e.on("element.changed",500,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(y(i.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(i))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&Mt(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var vs={__init__:["overlays"],overlays:["type",ds]};function ys(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(mt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}ys.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var bs={__init__:["changeSupport"],changeSupport:["type",ys]};function xs(e){this._eventBus=e}function ws(e){return function(t,n,i,r,o){(p(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function _s(e,t){t.invoke(xs,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}xs.$inject=["eventBus"],xs.prototype.on=function(e,t,n,i,r,o){if((p(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),p(n)&&(o=r,r=i,i=n,n=1e3),h(r)&&(o=r,r=!1),!p(i))throw new Error("handlerFn must be a function");c(e)||(e=[e]);var s=this._eventBus;y(e,(function(e){var a=["commandStack",e,t].filter((function(e){return e})).join(".");s.on(a,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))},xs.prototype.canExecute=ws("canExecute"),xs.prototype.preExecute=ws("preExecute"),xs.prototype.preExecuted=ws("preExecuted"),xs.prototype.execute=ws("execute"),xs.prototype.executed=ws("executed"),xs.prototype.postExecute=ws("postExecute"),xs.prototype.postExecuted=ws("postExecuted"),xs.prototype.revert=ws("revert"),xs.prototype.reverted=ws("reverted"),e(_s,xs),_s.$inject=["canvas","injector"];var Es={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",_s]};function ks(e){return CSS.escape(e)}var Os={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ss(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return Os[e]}))}var Cs="_plane";function Ps(e){return function(e){return e.replace(new RegExp(Cs+"$"),"")}(e.id)}function As(e){var t=e.id;return eo(e,"bpmn:SubProcess")?Rs(t):t}function Ms(e){return Rs(e)}function Ts(e){return eo(io(e),"bpmndi:BPMNPlane")}function Rs(e){return e+Cs}function Ds(e,t,n){var i=de('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Y(r);r.appendChild(i);var s=[];function a(e){e&&(s=function(e){for(var t=no(e),n=[],i=t;i;i=i.$parent)(eo(i,"bpmn:SubProcess")||eo(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=s.map((function(e){var i=Ss(e.name||e.id),r=de('<li><span class="bjs-crumb"><a title="'+i+'">'+i+"</a></span></li>"),o=n.findRoot(As(e))||n.findRoot(e.id);if(!o&&eo(e,"bpmn:Process")){var s=t.find((function(t){var n=no(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(s.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));i.innerHTML="";var a=r.length>1;o.toggle("bjs-breadcrumbs-shown",a),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=no(e.element);m(s,(function(e){return e===t}))&&a()})),e.on("root.set",(function(e){a(e.element)}))}function Bs(e,t){var n=null,i=new Ls;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),s=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!eo(r,"bpmn:Collaboration")||s){s=s||{x:0,y:0,zoom:1};var a=(o.x-s.x)*o.scale,l=(o.y-s.y)*o.scale;0===a&&0===l||t.scroll({dx:a,dy:l}),s.zoom!==o.scale&&t.zoom(s.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function Ls(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}Ds.$inject=["eventBus","elementRegistry","canvas"],Bs.$inject=["eventBus","canvas"];var Ns=180,zs=160;function Is(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n._handleImport(t.definitions)}))}function js(e){return eo(e,"bpmndi:BPMNDiagram")?e:js(e.$parent)}Is.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},Is.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;eo(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!eo(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(to(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}})),r},Is.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=Qn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),Xn(t)}(e),i=n.x-Ns,r=n.y-zs;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},Is.prototype._moveToDiPlane=function(e,t){var n=js(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Is.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Is.$inject=["eventBus","moddle"];var $s=250;function Fs(e,t,n,i){xs.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",$s,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",$s,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],$s,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],$s,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r._canDrillDown(e)})).map((function(e){r._addOverlay(e)}))}))}e(Fs,xs),Fs.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Fs.prototype._canDrillDown=function(e){var t=this._canvas;return eo(e,"bpmn:SubProcess")&&t.findRoot(As(e))},Fs.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=no(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Y(i.html).toggle("bjs-drilldown-empty",!r)}},Fs.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=de('<button class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(As(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Fs.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Fs.$inject=["canvas","eventBus","elementRegistry","overlays"];var Hs={__depends__:[vs,bs,Es],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ds],drilldownCentering:["type",Bs],drilldownOverlayBehavior:["type",Fs],subprocessCompatibility:["type",Is]};function Vs(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=Me("rect");return xe(t,z({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=Yt(".djs-outline",n);o||ge(n,o=i.getOutline(t)||r()),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=Yt(".djs-outline",n);o||ge(n,o=r()),i.updateConnectionOutline(o,t)}))}Vs.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&y(i,(function(i){n=n||i.updateOutline(t,e)})),n||xe(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Vs.prototype.updateConnectionOutline=function(e,t){var n=ft(t);xe(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Vs.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},Vs.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Vs.prototype.getOutline=function(e){var t;return y(this._getProviders(),(function(n){p(n.getOutline)&&(t=t||n.getOutline(e))})),t},Vs.$inject=["eventBus","styles","elementRegistry"];var qs={__init__:["outline"],outline:["type",Vs]};const Ws={width:36,height:50},Qs={width:50,height:50};function Xs(e,t,n){return Me("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function Gs(e,t){this._styles=t,e.registerProvider(this)}function Us(e,t){var n;return"bpmn:DataObjectReference"===t?n=Ws:"bpmn:DataStoreReference"===t&&(n=Qs),e.width===n.width&&e.height===n.height}Gs.$inject=["outline","styles"],Gs.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!Vn(e))return eo(e,"bpmn:Gateway")?(z((n=Me("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),xe(n,z({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):to(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group"])?xe(n=Me("rect"),z({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t)):eo(e,"bpmn:EndEvent")?xe(n=Me("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t)):eo(e,"bpmn:Event")?xe(n=Me("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t)):eo(e,"bpmn:DataObjectReference")&&Us(e,"bpmn:DataObjectReference")?n=Xs("M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",{x:-6,y:-6},t):eo(e,"bpmn:DataStoreReference")&&Us(e,"bpmn:DataStoreReference")&&(n=Xs("M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",{x:-6,y:-6},t)),n},Gs.prototype.updateOutline=function(e,t){if(!Vn(e))return to(e,["bpmn:SubProcess","bpmn:Group"])?(xe(t,{width:e.width+10,height:e.height+10}),!0):!!to(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};var Ys={__depends__:[qs],__init__:["outlineProvider"],outlineProvider:["type",Gs]};function Ks(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Zs(e){return e.originalEvent||e.srcEvent}function Js(e){Ks(e),Ks(Zs(e))}function ea(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function ta(){return/mac/i.test(navigator.platform)}function na(e,t){return(Zs(e)||e).button===t}function ia(e){return na(e,0)}function ra(e){var t=Zs(e)||e;return!!ia(e)&&(ta()?t.metaKey:t.ctrlKey)}function oa(e){var t=Zs(e)||e;return ia(e)&&t.shiftKey}function sa(e){return!0}function aa(e){return ia(e)||function(e){return na(e,1)}(e)}function la(e,t,n){var i=this;function r(n,i,r){var o,s;(function(e,t){var n=l[e]||ia;return!n(t)})(n,i)||(r?s=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(s=o,r=t.get(s)),s&&r&&!1===e.fire(n,{element:r,gfx:s,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function s(e){return o[e]}var a={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":sa,"element.mousedown":aa,"element.mouseup":aa,"element.click":aa,"element.dblclick":aa};var c="svg, .djs-element";function h(e,t,n,i){var s=o[n]=function(e){r(n,e)};i&&(l[n]=i),s.$delegate=Wt.bind(e,c,t,s)}function u(e,t,n){var i=s(n);i&&Wt.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){!function(e){y(a,(function(t,n){u(e,n,t)}))}(e.svg)})),e.on("canvas.init",(function(e){!function(e){y(a,(function(t,n){h(e,n,t)}))}(e.svg)})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var p=m("djs-hit djs-hit-stroke"),d=m("djs-hit djs-hit-click-stroke"),f={all:m("djs-hit djs-hit-all"),"click-stroke":d,stroke:p,"no-move":m("djs-hit djs-hit-no-move")};function m(e,t){return t=z({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function g(e,t){var n=f[t];if(!n)throw new Error("invalid hit type <"+t+">");return xe(e,n),e}function v(e,t){ge(e,t)}this.removeHits=function(e){y(Kt(".djs-hit",e),ke)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=at(t);return g(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=z({x:0,y:0},n);var i=Me("rect");return g(i,t),xe(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=Yt(".djs-hit",t);if(n)return e.waypoints?lt(n,e.waypoints):xe(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=a[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=s,this.registerEvent=h,this.unregisterEvent=u}la.$inject=["eventBus","elementRegistry","styles"];var ca={__init__:["interactionEvents"],interactionEvents:["type",la]};function ha(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}ha.$inject=["eventBus","canvas"],ha.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},ha.prototype.get=function(){return this._selectedElements},ha.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},ha.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();c(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?y(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var ua="hover",pa="selected";function da(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,ua)})),t.on("element.out",(function(e){o(e.element,ua)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;y(t,(function(e){-1===n.indexOf(e)&&function(e){o(e,pa)}(e)})),y(n,(function(e){-1===t.indexOf(e)&&function(e){r(e,pa)}(e)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function fa(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;c(o)?t.select(o):t.select(r.filter(ma))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);m(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(ia(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,s=oa(e);if(r&&o)return s?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,s)}}))}function ma(e){return!e.hidden}da.$inject=["canvas","eventBus","selection"],da.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Oe(t);var n=e.length>1;if(_e(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(ft(e)),r=Me("rect");xe(r,z({rx:3},i)),_e(r).add("djs-selection-outline"),ge(t,r)}},fa.$inject=["eventBus","selection","canvas","elementRegistry"];var ga={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ca,qs],selection:["type",ha],selectionVisuals:["type",da],selectionBehavior:["type",fa]};function va(e){go.call(this,e)}e(va,go),va.prototype._modules=[hs,Hs,Ys,vs,ga,os],va.prototype._moddleExtensions={};var ya=["c","C"],ba=["v","V"],xa=["y","Y"],wa=["z","Z"];function _a(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Ea(e,t){return-1!==(e=c(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function ka(e){return e.shiftKey}function Oa(e){return _a(e)&&!ka(e)&&Ea(wa,e)}function Sa(e){return _a(e)&&(Ea(xa,e)||Ea(wa,e)&&ka(e))}var Ca="keyboard.keydown",Pa="input-handle-modified-keys";function Aa(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}Aa.$inject=["config.keyboard","eventBus"],Aa.prototype._keydownHandler=function(e){this._keyHandler(e,Ca)},Aa.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Aa.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ca,n)&&e.preventDefault()}},Aa.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||((t=e.target)&&(Dt(t,"input, textarea")||"true"===t.contentEditable)||function(e){return e&&Dt(e,"button, input[type=submit], input[type=button], a[href], [aria-role=button]")}(e.target)&&Ea([" ","Enter"],e))&&this._isModifiedKeyIgnored(e);var t},Aa.prototype._isModifiedKeyIgnored=function(e){return!_a(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},Aa.prototype._getAllowedModifiers=function(e){var t=Bt(e,"["+Pa+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Pa).split(",")},Aa.prototype.bind=function(e){this.unbind(),this._node=e,Ht.bind(e,"keydown",this._keydownHandler),Ht.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Aa.prototype.getBinding=function(){return this._node},Aa.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Ht.unbind(e,"keydown",this._keydownHandler),Ht.unbind(e,"keyup",this._keyupHandler)),this._node=null},Aa.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Aa.prototype.addListener=function(e,t,n){p(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ca,e,t)},Aa.prototype.removeListener=function(e,t){this._eventBus.off(t||Ca,e)},Aa.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Aa.prototype.isCmd=_a,Aa.prototype.isShift=ka,Aa.prototype.isKey=Ea;var Ma=500;function Ta(e,t){var n=this;e.on("editorActions.init",Ma,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}Ta.$inject=["eventBus","keyboard"],Ta.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(Oa(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(Sa(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return _a(e)&&Ea(ya,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return _a(e)&&Ea(ba,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ea(["+","Add","="],n)&&_a(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ea(["-","Subtract"],n)&&_a(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Ea("0",n)&&_a(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Ea(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Ra={__init__:["keyboard","keyboardBindings"],keyboard:["type",Aa],keyboardBindings:["type",Ta]},Da={moveSpeed:50,moveSpeedAccelerated:200};function Ba(e,t,n){var i=this;this._config=z({},Da,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,s=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:s,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Ba.$inject=["config.keyboardMove","keyboard","canvas"];var La={__depends__:[Ra],__init__:["keyboardMove"],keyboardMove:["type",Ba]},Na=/^djs-cursor-.*$/;function za(e){var t=Mt(document.body);t.removeMatching(Na),e&&t.add("djs-cursor-"+e)}function Ia(){za(null)}var ja=5e3;function $a(e,t){function n(){return!1}return t=t||"element.click",e.once(t,ja,n),function(){e.off(t,n)}}function Fa(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Ha(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Va(e,t){var n;function i(i){var r,o=n.start,s=n.button,a=ea(i),l=Ha(a,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===s&&$a(e),za("grab")),n.dragging)&&(l=Ha(a,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=a);i.preventDefault()}function r(e){Ht.unbind(document,"mousemove",i),Ht.unbind(document,"mouseup",r),n=null,Ia()}e.on("element.mousedown",500,(function(e){return function(e){if(Bt(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:ea(e)},Ht.bind(document,"mousemove",i),Ht.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Va.$inject=["eventBus","canvas"];var qa={__init__:["moveCanvas"],moveCanvas:["type",Va]};function Wa(e){return Math.log(e)/Math.log(10)}function Qa(e,t){var n=Wa(e.min),i=Wa(e.max);return(Math.abs(n)+Math.abs(i))/t}var Xa=Math.sign||function(e){return e>=0?1:-1},Ga={min:.2,max:4};function Ua(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=N(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}Ua.$inject=["config.zoomScroll","eventBus","canvas"],Ua.prototype.scroll=function(e){this._canvas.scroll(e)},Ua.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Ua.prototype.zoom=function(e,t){var n=Qa(Ga,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Ua.prototype._handleWheel=function(e){if(!Bt(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||ta()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var s=t.getBoundingClientRect(),a={x:e.clientX-s.left,y:e.clientY-s.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Xa(e.deltaY)*o,this.zoom(n,a)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},Ua.prototype.stepZoom=function(e,t){var n=Qa(Ga,10);this._zoom(e,t,n)},Ua.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Wa(i.zoom()),s=Math.round(o/n)*n;s+=n*r;var a,l,c=Math.pow(10,s);i.zoom((a=Ga,l=c,Math.max(a.min,Math.min(a.max,l))),t)},Ua.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Ht[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Ua.prototype._init=function(e){this.toggle(e)};var Ya={__init__:["zoomScroll"],zoomScroll:["type",Ua]};function Ka(e){va.call(this,e)}function Za(e){return e&&e[e.length-1]}function Ja(e){return e.y}function el(e){return e.x}e(Ka,va),Ka.prototype._navigationModules=[La,qa,Ya],Ka.prototype._modules=[].concat(va.prototype._modules,Ka.prototype._navigationModules);var tl={left:el,center:el,right:function(e){return e.x+e.width},top:Ja,middle:Ja,bottom:function(e){return e.y+e.height}};function nl(e,t){this._modeling=e,this._rules=t}nl.$inject=["modeling","rules"],nl.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},nl.prototype._isType=function(e,t){return-1!==t.indexOf(e)},nl.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),s=o.axis,a=o.dimension,l={},c={},h=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))r=Za(t),l[e]=r[s]+r[a];else if(this._isType(e,["center","middle"])){if(y(t,(function(e){var t=e[s]+Math.round(e[a]/2);c[t]?c[t].elements.push(e):c[t]={elements:[e],center:t}})),n=A(c,(function(e){return e.elements.length>1&&(h=!0),e.elements.length})),h)return l[e]=Za(n).center,l;i=t[0],r=Za(t=A(t,(function(e){return e[s]+e[a]}))),l[e]=function(e,t){return Math.round((e[s]+t[s]+t[a])/2)}(i,r)}return l},nl.prototype.trigger=function(e,t){var n,i=this._modeling,r=v(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(c(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=A(r,tl[t]),s=this._alignmentPosition(t,o);i.alignElements(o,s)}};var il={__init__:["alignElements"],alignElements:["type",nl]},rl=".entry";function ol(e,t,n){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._current=null,this._init()}function sl(e,t){return-1!==e.indexOf(t)}ol.$inject=["canvas","elementRegistry","eventBus"],ol.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,i=e._current;if(i){var{target:r}=i,o=c(r)?r:[r];if(o.filter((function(e){return sl(n,e)})).length){e.close();var s=o.filter((function(t){return e._elementRegistry.get(t.id)}));s.length&&e._updateAndOpen(s.length>1?s:s[0])}}})),this._eventBus.on("canvas.viewbox.changed",(()=>{this.isOpen()&&this._updatePosition()})),this._container=this._createContainer()},ol.prototype._createContainer=function(){const e=Ut('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},ol.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},ol.prototype.getEntries=function(e){var t=this._getProviders(),n=c(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return y(t,(function(t){if(p(t[n])){var r=t[n](e);p(r)?i=r(i):y(r,(function(e,t){i[t]=e}))}})),i},ol.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=Pt(o,"data-action"),r=t.originalEvent||t,"mouseover"!==e?"mouseout"===e?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(i,e,r,n):void(this._timeout=setTimeout((()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)}),300))):t.preventDefault()},ol.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var s=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(p(s)){if("click"===t)return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},ol.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},ol.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ol.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this._createHtml(e);y(n,(function(e,n){var r,o=e.group||"default",s=Ut(e.html||'<div class="entry" draggable="true"></div>');Pt(s,"data-action",n),(r=Yt("[data-group="+ks(o)+"]",i))||(Pt(r=Ut('<div class="group"></div>'),"data-group",o),i.appendChild(r)),r.appendChild(s),e.className&&function(e,t){var n=Mt(e);(t=c(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(s,e.className),e.title&&Pt(s,"title",e.title),e.imageUrl&&(Pt(t=Ut("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",s.appendChild(t))})),Mt(i).add("open"),this._current={entries:n,html:i,target:e},this._updatePosition(),this._eventBus.fire("contextPad.open",{current:this._current})},ol.prototype._createHtml=function(e){var t=this,n=Ut('<div class="djs-context-pad"></div>');return Wt.bind(n,rl,"click",(function(e){t.trigger("click",e)})),Wt.bind(n,rl,"dragstart",(function(e){t.trigger("dragstart",e)})),Wt.bind(n,rl,"mouseover",(function(e){t.trigger("mouseover",e)})),Wt.bind(n,rl,"mouseout",(function(e){t.trigger("mouseout",e)})),Ht.bind(n,"mousedown",(function(e){e.stopPropagation()})),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},ol.prototype.getPad=function(e){let t;return console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888")),t=this.isOpen()&&function(e,t){return e=c(e)?e:[e],t=c(t)?t:[t],e.length===t.length&&w(e,(function(e){return t.includes(e)}))}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},ol.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ol.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return c(e)===c(n)&&(c(e)?e.length===n.length&&w(e,(function(e){return sl(n,e)})):n===e)},ol.prototype.isShown=function(){return this.isOpen()&&Mt(this._current.html).has("open")},ol.prototype.show=function(){this.isOpen()&&(Mt(this._current.html).add("open"),this._eventBus.fire("contextPad.show",{current:this._current}))},ol.prototype.hide=function(){this.isOpen()&&(Mt(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},ol.prototype._getPosition=function(e){if(!c(e)&&Hn(e)){const n=this._canvas.viewbox(),i=(t=e).waypoints[t.waypoints.length-1],r=i.x*n.scale-n.x*n.scale,o=i.y*n.scale-n.y*n.scale;return{left:r+8*this._canvas.zoom(),top:o}}var t,n=this._canvas.getContainer().getBoundingClientRect(),i=this._getTargetBounds(e);return{left:i.right-n.left+8*this._canvas.zoom(),top:i.top-n.top}},ol.prototype._updatePosition=function(){if(this.isOpen()){var e=this._current.html,t=this._getPosition(this._current.target);"x"in t&&"y"in t?(e.style.left=t.x+"px",e.style.top=t.y+"px"):["top","right","bottom","left"].forEach((function(n){n in t&&(e.style[n]=t[n]+"px")}))}},ol.prototype._getTargetBounds=function(e){return(c(e)?e:[e]).map((e=>this._canvas.getGraphics(e))).reduce(((e,t)=>{const n=t.getBoundingClientRect();return e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom),e.left=Math.min(e.left,n.left),e.x=e.left,e.y=e.top,e.width=e.right-e.left,e.height=e.bottom-e.top,e}),{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};var al,ll,cl,hl,ul,pl={__depends__:[ca,vs],contextPad:["type",ol]},dl={},fl=[],ml=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function gl(e,t){for(var n in t)e[n]=t[n];return e}function vl(e){var t=e.parentNode;t&&t.removeChild(e)}function yl(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?al.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return bl(e,s,i,r,null)}function bl(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++cl:r};return null==r&&null!=ll.vnode&&ll.vnode(o),o}function xl(e){return e.children}function wl(e,t){this.props=e,this.context=t}function _l(e,t){if(null==t)return e.__?_l(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?_l(e):null}function El(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return El(e)}}function kl(e){(!e.__d&&(e.__d=!0)&&hl.push(e)&&!Ol.__r++||ul!==ll.debounceRendering)&&((ul=ll.debounceRendering)||setTimeout)(Ol)}function Ol(){for(var e;Ol.__r=hl.length;)e=hl.sort((function(e,t){return e.__v.__b-t.__v.__b})),hl=[],e.some((function(e){var t,n,i,r,o,s;e.__d&&(o=(r=(t=e).__v).__e,(s=t.__P)&&(n=[],(i=gl({},r)).__v=r.__v+1,Dl(s,r,i,t.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?_l(r):o,r.__h),Bl(n,r),r.__e!=o&&El(r)))}))}function Sl(e,t,n,i,r,o,s,a,l,c){var h,u,p,d,f,m,g,v=i&&i.__k||fl,y=v.length;for(n.__k=[],h=0;h<t.length;h++)if(null!=(d=n.__k[h]=null==(d=t[h])||"boolean"==typeof d?null:"string"==typeof d||"number"==typeof d||"bigint"==typeof d?bl(null,d,null,null,d):Array.isArray(d)?bl(xl,{children:d},null,null,null):d.__b>0?bl(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(p=v[h])||p&&d.key==p.key&&d.type===p.type)v[h]=void 0;else for(u=0;u<y;u++){if((p=v[u])&&d.key==p.key&&d.type===p.type){v[u]=void 0;break}p=null}Dl(e,d,p=p||dl,r,o,s,a,l,c),f=d.__e,(u=d.ref)&&p.ref!=u&&(g||(g=[]),p.ref&&g.push(p.ref,null,d),g.push(u,d.__c||f,d)),null!=f?(null==m&&(m=f),"function"==typeof d.type&&d.__k===p.__k?d.__d=l=Cl(d,l,e):l=Pl(e,d,p,v,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=_l(p))}for(n.__e=m,h=y;h--;)null!=v[h]&&Nl(v[h],v[h]);if(g)for(h=0;h<g.length;h++)Ll(g[h],g[++h],g[++h])}function Cl(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?Cl(i,t,n):Pl(n,i,i,r,i.__e,t));return t}function Pl(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=1)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function Al(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||ml.test(t)?n:n+"px"}function Ml(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Al(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Al(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?Rl:Tl,o):e.removeEventListener(t,o?Rl:Tl,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function Tl(e){this.l[e.type+!1](ll.event?ll.event(e):e)}function Rl(e){this.l[e.type+!0](ll.event?ll.event(e):e)}function Dl(e,t,n,i,r,o,s,a,l){var c,h,u,p,d,f,m,g,v,y,b,x,w,_,E,k=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=ll.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,v=(c=k.contextType)&&i[c.__c],y=c?v?v.props.value:c.__:i,n.__c?m=(h=t.__c=n.__c).__=h.__E:("prototype"in k&&k.prototype.render?t.__c=h=new k(g,y):(t.__c=h=new wl(g,y),h.constructor=k,h.render=zl),v&&v.sub(h),h.props=g,h.state||(h.state={}),h.context=y,h.__n=i,u=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=k.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=gl({},h.__s)),gl(h.__s,k.getDerivedStateFromProps(g,h.__s))),p=h.props,d=h.state,u)null==k.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,y),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,y)||t.__v===n.__v){for(h.props=g,h.state=h.__s,t.__v!==n.__v&&(h.__d=!1),h.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<h._sb.length;b++)h.__h.push(h._sb[b]);h._sb=[],h.__h.length&&s.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,y),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,d,f)}))}if(h.context=y,h.props=g,h.__v=t,h.__P=e,x=ll.__r,w=0,"prototype"in k&&k.prototype.render){for(h.state=h.__s,h.__d=!1,x&&x(t),c=h.render(h.props,h.state,h.context),_=0;_<h._sb.length;_++)h.__h.push(h._sb[_]);h._sb=[]}else do{h.__d=!1,x&&x(t),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++w<25);h.state=h.__s,null!=h.getChildContext&&(i=gl(gl({},i),h.getChildContext())),u||null==h.getSnapshotBeforeUpdate||(f=h.getSnapshotBeforeUpdate(p,d)),E=null!=c&&c.type===xl&&null==c.key?c.props.children:c,Sl(e,Array.isArray(E)?E:[E],t,n,i,r,o,s,a,l),h.base=t.__e,t.__h=null,h.__h.length&&s.push(h),m&&(h.__E=h.__=null),h.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,o,s,a){var l,c,h,u=n.props,p=t.props,d=t.type,f=0;if("svg"===d&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!d&&(d?l.localName===d:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===d)return document.createTextNode(p);e=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,a=!1}if(null===d)u===p||a&&e.data===p||(e.data=p);else{if(o=o&&al.call(e.childNodes),c=(u=n.props||dl).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!a){if(null!=o)for(u={},f=0;f<e.attributes.length;f++)u[e.attributes[f].name]=e.attributes[f].value;(h||c)&&(h&&(c&&h.__html==c.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||Ml(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Ml(e,o,t[o],n[o],i)}(e,p,u,r,a),h)t.__k=[];else if(f=t.props.children,Sl(e,Array.isArray(f)?f:[f],t,n,i,r&&"foreignObject"!==d,o,s,o?o[0]:n.__k&&_l(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&vl(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==e.value||"progress"===d&&!f||"option"===d&&f!==u.value)&&Ml(e,"value",f,u.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&Ml(e,"checked",f,u.checked,!1))}return e}(n.__e,t,n,i,r,o,s,l);(c=ll.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),ll.__e(e,t,n)}}function Bl(e,t){ll.__c&&ll.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ll.__e(e,t.__v)}}))}function Ll(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){ll.__e(e,n)}}function Nl(e,t,n){var i,r;if(ll.unmount&&ll.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Ll(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ll.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Nl(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||vl(e.__e),e.__=e.__e=e.__d=void 0}function zl(e,t,n){return this.constructor(e,n)}function Il(e,t,n){var i,r,o;ll.__&&ll.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Dl(t,e=(!i&&n||t).__k=yl(xl,null,[e]),r||dl,dl,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?al.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Bl(o,e)}al=fl.slice,ll={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},cl=0,wl.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=gl({},this.state),"function"==typeof e&&(e=e(gl({},n),this.props)),e&&gl(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),kl(this))},wl.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),kl(this))},wl.prototype.render=xl,hl=[],Ol.__r=0;var jl=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var s=t[o++],a=t[o]?(t[0]|=s?1:2,n[t[o++]]):t[++o];3===s?i[0]=a:4===s?i[1]=Object.assign(i[1]||{},a):5===s?(i[1]=i[1]||{})[t[++o]]=a:6===s?i[1][t[++o]]+=a+"":s?(r=e.apply(a,jl(e,a,n,["",null])),i.push(r),a[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(a)}return i},$l=new Map;var Fl,Hl,Vl,ql,Wl=function(e){var t=$l.get(this);return t||(t=new Map,$l.set(this,t)),(t=jl(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,i=1,r="",o="",s=[0],a=function(e){1===i&&(e||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(0,e,r):3===i&&(e||r)?(s.push(3,e,r),i=2):2===i&&"..."===r&&e?s.push(4,e,0):2===i&&r&&!e?s.push(5,0,!0,r):i>=5&&((r||!e&&5===i)&&(s.push(i,0,r,n),i=6),e&&(s.push(i,e,0,n),i=6)),r=""},l=0;l<e.length;l++){l&&(1===i&&a(),a(l));for(var c=0;c<e[l].length;c++)t=e[l][c],1===i?"<"===t?(a(),s=[s],i=3):r+=t:4===i?"--"===r&&">"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(a(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[l][c+1])?(a(),3===i&&(s=s[0]),i=s,(s=s[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),i=2):r+=t),3===i&&"!--"===r&&(i=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}.bind(yl),Ql=0,Xl=[],Gl=[],Ul=ll.__b,Yl=ll.__r,Kl=ll.diffed,Zl=ll.__c,Jl=ll.unmount;function ec(e,t){ll.__h&&ll.__h(Hl,e,Ql||t),Ql=0;var n=Hl.__H||(Hl.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Gl}),n.__[e]}function tc(e){return Ql=1,function(e,t,n){var i=ec(Fl++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):dc(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Hl,!Hl.u)){Hl.u=!0;var r=Hl.shouldComponentUpdate;Hl.shouldComponentUpdate=function(e,t,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!r||r.call(this,e,t,n))}}return i.__N||i.__}(dc,e)}function nc(e,t){var n=ec(Fl++,3);!ll.__s&&pc(n.__H,t)&&(n.__=e,n.i=t,Hl.__H.__h.push(n))}function ic(e,t){var n=ec(Fl++,4);!ll.__s&&pc(n.__H,t)&&(n.__=e,n.i=t,Hl.__h.push(n))}function rc(e){return Ql=5,oc((function(){return{current:e}}),[])}function oc(e,t){var n=ec(Fl++,7);return pc(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function sc(e,t){return Ql=8,oc((function(){return e}),t)}function ac(){for(var e;e=Xl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(hc),e.__H.__h.forEach(uc),e.__H.__h=[]}catch(t){e.__H.__h=[],ll.__e(t,e.__v)}}ll.__b=function(e){Hl=null,Ul&&Ul(e)},ll.__r=function(e){Yl&&Yl(e),Fl=0;var t=(Hl=e.__c).__H;t&&(Vl===Hl?(t.__h=[],Hl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Gl,e.__N=e.i=void 0}))):(t.__h.forEach(hc),t.__h.forEach(uc),t.__h=[])),Vl=Hl},ll.diffed=function(e){Kl&&Kl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Xl.push(t)&&ql===ll.requestAnimationFrame||((ql=ll.requestAnimationFrame)||cc)(ac)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Gl&&(e.__=e.__V),e.i=void 0,e.__V=Gl}))),Vl=Hl=null},ll.__c=function(e,t){t.some((function(e){try{e.__h.forEach(hc),e.__h=e.__h.filter((function(e){return!e.__||uc(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ll.__e(n,e.__v)}})),Zl&&Zl(e,t)},ll.unmount=function(e){Jl&&Jl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{hc(e)}catch(e){t=e}})),n.__H=void 0,t&&ll.__e(t,n.__v))};var lc="function"==typeof requestAnimationFrame;function cc(e){var t,n=function(){clearTimeout(i),lc&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);lc&&(t=requestAnimationFrame(n))}function hc(e){var t=Hl,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Hl=t}function uc(e){var t=Hl;e.__c=e.__(),Hl=t}function pc(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function dc(e,t){return"function"==typeof t?t(e):t}function fc(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=fc(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function mc(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=fc(e))&&(i&&(i+=" "),i+=t);return i}function gc(e){const{entry:t,selected:n,onMouseEnter:i,onMouseLeave:r,onAction:o}=e;return Wl`
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnModeler=t()}(this,(function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var t=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),s="";for(r=0;r<Math.floor(i);r++){s=Math.floor(Math.random()*n).toString(n)+s}if(o){var a=Math.pow(n,o);s=Math.floor(Math.random()*a).toString(n)+s}var l=parseInt(s,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):s};t.rack=function(e,n,i){var r=function(r){var s=0;do{if(s++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var a=t(e,n)}while(Object.hasOwnProperty.call(o,a));return o[a]=r,a},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function n(e){if(!(this instanceof n))return new n(e);e=e||[128,36,1],this._seed=e.length?t.rack(e[0],e[1],e[2]):e}function i(e){return Array.prototype.concat.apply([],e)}n.prototype.next=function(e){return this._seed(e||!0)},n.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},n.prototype.claim=function(e,t){this._seed.set(e,t||!0)},n.prototype.assigned=function(e){return this._seed.get(e)||!1},n.prototype.unclaim=function(e){delete this._seed.hats[e]},n.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;function s(e){return void 0===e}function a(e){return void 0!==e}function l(e){return null==e}function c(e){return"[object Array]"===r.call(e)}function h(e){return"[object Object]"===r.call(e)}function u(e){return"[object Number]"===r.call(e)}function p(e){const t=r.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function d(e){return"[object String]"===r.call(e)}function f(e,t){return o.call(e,t)}function m(e,t){const n=R(t);let i;return y(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function g(e,t){const n=R(t);let i=c(e)?-1:void 0;return y(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function v(e,t){const n=R(t);let i=[];return y(e,(function(e,t){n(e,t)&&i.push(e)})),i}function y(e,t){let n,i;if(s(e))return;const r=c(e)?B:D;for(let o in e)if(f(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function b(e,t){if(s(e))return[];!function(e){if(!c(e))throw new Error("must supply array")}(e);const n=R(t);return e.filter((function(e,t){return!n(e,t)}))}function x(e,t,n){return y(e,(function(e,i){n=t(n,e,i)})),n}function w(e,t){return!!x(e,(function(e,n,i){return e&&t(n,i)}),!0)}function _(e,t){return!!m(e,t)}function E(e,t){let n=[];return y(e,(function(e,i){n.push(t(e,i))})),n}function k(e){return e&&Object.keys(e)||[]}function O(e){return E(e,(e=>e))}function S(e,t,n={}){return t=T(t),y(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function C(e,...t){e=T(e);let n={};return y(t,(t=>S(t,e,n))),E(n,(function(e,t){return e[0]}))}const P=C;function A(e,t){t=T(t);let n=[];return y(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var s=0;s<n.length;s++){let{d:e}=n[s];if(r<e)return void n.splice(s,0,o)}n.push(o)})),E(n,(e=>e.v))}function M(e){return function(t){return w(e,(function(e,n){return t[n]===e}))}}function T(e){return p(e)?e:t=>t[e]}function R(e){return p(e)?e:t=>t===e}function D(e){return e}function B(e){return Number(e)}function L(e,t){let n,i,r,o;function s(n){let s=Date.now(),c=n?0:o+t-s;if(c>0)return a(c);e.apply(r,i),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function c(...e){o=Date.now(),i=e,r=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function N(e,t){return e.bind(t)}function z(e,...t){return Object.assign(e,...t)}function I(e,t,n){let i=e;return y(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],c=i[e];a(o)&&l(c)&&(c=i[e]=isNaN(+o)?{}:[]),s(o)?s(n)?delete i[e]:i[e]=n:i=c})),e}function j(e,t){let n={},i=Object(e);return y(t,(function(t){t in i&&(n[t]=e[t])})),n}function $(e,t){let n={};return y(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}function F(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)}const H=Object.prototype.toString,V=Object.prototype.hasOwnProperty;function q(e,t){return V.call(e,t)}function W(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===H.call(e)}(e)?X:Q;for(let o in e)if(q(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function Q(e){return e}function X(e){return Number(e)}function G(e,...t){const n=e.style;return W(t,(function(e){e&&W(e,(function(e,t){n[t]=e}))})),e}const U=Object.prototype.toString;function Y(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}function Z(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}K.prototype.add=function(e){return this.list.add(e),this},K.prototype.remove=function(e){return"[object RegExp]"==U.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 J,ee,te,ne={};function ie(){J=window.addEventListener?"addEventListener":"attachEvent",ee=window.removeEventListener?"removeEventListener":"detachEvent",te="addEventListener"!==J?"on":""}var re=ne.bind=function(e,t,n,i){return J||ie(),e[J](te+t,n,i||!1),n},oe=ne.unbind=function(e,t,n,i){return ee||ie(),e[ee](te+t,n,i||!1),n},se=F({__proto__:null,bind:re,unbind:oe,default:ne},[ne]),ae=["focus","blur"];var le,ce={bind:function(e,t,n,i,r){return-1!==ae.indexOf(n)&&(r=!0),se.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Z(i,t))return i;i=i.parentNode}return Z(i,t)?i:null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==ae.indexOf(t)&&(i=!0),se.unbind(e,t,n,i)}},he=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(l=t.createElement("html")).innerHTML=e,l.removeChild(l.lastChild)}var r=Object.prototype.hasOwnProperty.call(pe,i)?pe[i]:pe._default,o=r[0],s=r[1],a=r[2],l=t.createElement("div");l.innerHTML=s+e+a;for(;o--;)l=l.lastChild;if(l.firstChild==l.lastChild)return l.removeChild(l.firstChild);var c=t.createDocumentFragment();for(;l.firstChild;)c.appendChild(l.removeChild(l.firstChild));return c},ue=!1;"undefined"!=typeof document&&((le=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',ue=!le.getElementsByTagName("link").length,le=void 0);var pe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:ue?[1,"X<div>","</div>"]:[0,"",""]};pe.td=pe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],pe.option=pe.optgroup=[1,'<select multiple="multiple">',"</select>"],pe.thead=pe.tbody=pe.colgroup=pe.caption=pe.tfoot=[1,"<table>","</table>"],pe.polyline=pe.ellipse=pe.polygon=pe.circle=pe.text=pe.line=pe.path=pe.rect=pe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var de=he;function fe(e,t){return(t=t||document).querySelector(e)}function me(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function ge(e,t){return me(t,e),e}var ve=2,ye={"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 be(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=ye[i];r?(r===ve&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function xe(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return ye[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);be(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)be(e,i,t[i])}(e,t);return e}const we=Object.prototype.toString;function _e(e){return new Ee(e)}function Ee(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ke(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Oe(e){for(var t;t=e.firstChild;)ke(t);return e}function Se(e){return e.cloneNode(!0)}Ee.prototype.add=function(e){return this.list.add(e),this},Ee.prototype.remove=function(e){return"[object RegExp]"==we.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ee.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},Ee.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ee.prototype.array=function(){return Array.from(this.list)},Ee.prototype.has=Ee.prototype.contains=function(e){return this.list.contains(e)};var Ce={svg:"http://www.w3.org/2000/svg"},Pe='<svg xmlns="'+Ce.svg+'"';function Ae(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Ce.svg)&&(e=Pe+e.substring(4)):(e=Pe+">"+e+"</svg>",t=!0);var n=function(e){var t;return t=new DOMParser,t.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 Me(e,t){var n;return"<"===e.charAt(0)?(n=Ae(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ce.svg,e),t&&xe(n,t),n}var Te=null;function Re(){return null===Te&&(Te=Me("svg")),Te}function De(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Be(e){return e?Re().createSVGTransformFromMatrix(e):Re().createSVGTransform()}var Le=/([&<>]{1})/g,Ne=/([\n\r"]{1})/g,ze={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Ie(e,t){return e.replace(t,(function(e,t){return ze[t]||t}))}function je(e,t){var n,i,r,o,s;switch(e.nodeType){case 3:t.push(Ie(e.textContent,Le));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,'="',Ie(o.value,Ne),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(s=e.childNodes).length;n<i;++n)je(s.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Ie(e.nodeValue,Le),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function $e(e,t){var n=Ae(t);if(Oe(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)me(r[o],e)}}function Fe(e,t){if(void 0!==t){try{$e(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)je(t,n),t=t.nextSibling;return n.join("")}(e)}function He(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ve(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(He(e,i))}(n,t)),n.consolidate()}const qe=/^class[ {]/;function We(e){return Array.isArray(e)}function Qe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xe(...e){1===e.length&&We(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Ge=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Ue=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Ye=/\/\*([^*]*)\*\//m;function Ke(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return qe.test(e.toString())}(e)?Ge:Ue);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(Ye);return(t&&t[1]||e).trim()}))||[]}function Ze(e,t){const n=t||{get:function(e,t){if(i.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),s=o.injector=this,a=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){if(!r[e]&&e.includes(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Qe(o,e))return o[e];if(Qe(r,e)){if(-1!==i.indexOf(e))throw i.push(e),a("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!We(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Xe(e.slice())}return{fn:e,dependencies:(e.$inject||Ke(e)).map((e=>Qe(t,e)?t[e]:l(e)))}}function h(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:i,dependencies:r}=c(e,n);return i.apply(t,r)}function p(e){return Xe((t=>e.get(t)))}function d(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],s=[],a=[];let l,c,h,u;for(let e in r)l=r[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(h=l[3].createChild([],t),u=p(h),o.push(l[3]),s.push(h),a.push(u),n[e]=[u,e,"private",h]):n[e]=[a[c],e,"private",s[c]]):n[e]=[l[2],l[1]],i[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],i[t]=!0)}));t.forEach((e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new Ze(e,s)}const f={factory:u,type:h,value:function(e){return e}};function m(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function g(e){const t=e.__exports__;if(t){const n=e.__modules__,i=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=d((n||[]).concat(i)),s=Xe((function(e){return o.get(e)}));t.forEach((function(e){r[e]=[s,e,"private",o]}));const a=(e.__init__||[]).slice();return a.unshift((function(){o.init()})),m(e=Object.assign({},e,{__init__:a}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],Je(i,o),i]})),m(e,s)}function v(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(v,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=h,this.createChild=d,this.init=function(e){const t=e.reduce(v,[]).map(g);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function Je(e,t){return"value"!==e&&We(t)&&(t=Xe(t.slice())),t}var et=1e3;function tt(e,t){var n=this;t=t||et,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,s=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,s):n.drawConnection(o,r,s)})),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 nt(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function it(e){return["L",e.x,e.y]}function rt(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,s,a;for(let r=1;r<n;r++){const n=e[r-1],l=e[r],c=e[r+1];if(!c||!t){i.push(it(l));continue}const h=Math.min(t,st(l.x-n.x,l.y-n.y),st(c.x-l.x,c.y-l.y));if(!h){i.push(it(l));continue}const u=ot(l,n,h),p=ot(l,n,.5*h),d=ot(l,c,h),f=ot(l,c,.5*h);i.push(it(u)),i.push((s=f,a=d,["C",(o=p).x,o.y,s.x,s.y,a.x,a.y]))}return i}function ot(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/st(i,r);return{x:e.x+i*o,y:e.y+r*o}}function st(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function at(e,t,n){u(t)&&(n=t,t=null),t||(t={});const i=Me("path",t);return u(n)&&(i.dataset.cornerRadius=String(n)),lt(i,e)}function lt(e,t){return xe(e,{d:nt(rt(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function ct(e){return v(e,(function(t){return!m(e,(function(e){return e!==t&&ht(t,e)}))}))}function ht(e,t){if(t){if(e===t)return t;if(e.parent)return ht(e.parent,t)}}function ut(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function pt(e,t,n){n=n||0,c(e)||(e=[e]),y(e,(function(e,i){var r=t(e,i,n);c(r)&&r.length&&pt(r,t,n+1)}))}function dt(e,t){return function(e,t,n){var i=[],r=[];return pt(e,(function(e,o,s){ut(i,e,t);var a=e.children;if((-1===n||s<n)&&a&&ut(r,a,t))return a})),i}(e,!t,-1)}function ft(e,t){var n,i,r,o;return t=!!t,c(e)||(e=[e]),y(e,(function(e){var s=e;e.waypoints&&!t&&(s=ft(e.waypoints,!0));var a=s.x,l=s.y,c=s.height||0,h=s.width||0;(a<n||void 0===n)&&(n=a),(l<i||void 0===i)&&(i=l),(a+h>r||void 0===r)&&(r=a+h),(l+c>o||void 0===o)&&(o=l+c)})),{x:n,y:i,height:o-i,width:r-n}}function mt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function gt(e){return!(!e||!e.isFrame)}function vt(e,t){return z({},e||{},t||{})}tt.prototype.canRender=function(e){},tt.prototype.drawShape=function(e,t){},tt.prototype.drawConnection=function(e,t){},tt.prototype.getShapePath=function(e){},tt.prototype.getConnectionPath=function(e){};function yt(e,t){tt.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(yt,tt),yt.prototype.canRender=function(){return!0},yt.prototype.drawShape=function(e,t,n){var i=Me("rect");return xe(i,{x:0,y:0,width:t.width||0,height:t.height||0}),gt(t)?xe(i,z({},this.FRAME_STYLE,n||{})):xe(i,z({},this.SHAPE_STYLE,n||{})),ge(e,i),i},yt.prototype.drawConnection=function(e,t,n){var i=at(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return ge(e,i),i},yt.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return nt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},yt.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return nt(r)},yt.$inject=["eventBus","styles"];var bt={__init__:["defaultRenderer"],defaultRenderer:["type",yt],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return z(this.style(t,n),{class:e})},this.style=function(t,n){c(t)||n||(n=t,t=[]);var i=x(t,(function(t,n){return z(t,e[n]||{})}),{});return n?z(i,n):i},this.computeStyle=function(e,n,i){return c(n)||(i=n,n=[]),t.style(n||[],z({},i,e||{}))}}]};function xt(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)}const wt=Object.prototype.toString,_t=Object.prototype.hasOwnProperty;function Et(e,t){return _t.call(e,t)}function kt(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===wt.call(e)}(e)?St:Ot;for(let o in e)if(Et(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function Ot(e){return e}function St(e){return Number(e)}function Ct(e,...t){const n=e.style;return kt(t,(function(e){e&&kt(e,(function(e,t){n[t]=e}))})),e}function Pt(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const At=Object.prototype.toString;function Mt(e){return new Tt(e)}function Tt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Rt(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function Dt(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function Bt(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Dt(i,t))return i;i=i.parentNode}return Dt(i,t)?i:null}Tt.prototype.add=function(e){return this.list.add(e),this},Tt.prototype.remove=function(e){return"[object RegExp]"==At.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Tt.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},Tt.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Tt.prototype.array=function(){return Array.from(this.list)},Tt.prototype.has=Tt.prototype.contains=function(e){return this.list.contains(e)};var Lt,Nt,zt,It={};function jt(){Lt=window.addEventListener?"addEventListener":"attachEvent",Nt=window.removeEventListener?"removeEventListener":"detachEvent",zt="addEventListener"!==Lt?"on":""}var $t=It.bind=function(e,t,n,i){return Lt||jt(),e[Lt](zt+t,n,i||!1),n},Ft=It.unbind=function(e,t,n,i){return Nt||jt(),e[Nt](zt+t,n,i||!1),n},Ht=xt({__proto__:null,bind:$t,unbind:Ft,default:It},[It]),Vt=["focus","blur"];var qt,Wt={bind:function(e,t,n,i,r){return-1!==Vt.indexOf(n)&&(r=!0),Ht.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=Bt(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==Vt.indexOf(t)&&(i=!0),Ht.unbind(e,t,n,i)}},Qt=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(l=t.createElement("html")).innerHTML=e,l.removeChild(l.lastChild)}var r=Object.prototype.hasOwnProperty.call(Gt,i)?Gt[i]:Gt._default,o=r[0],s=r[1],a=r[2],l=t.createElement("div");l.innerHTML=s+e+a;for(;o--;)l=l.lastChild;if(l.firstChild==l.lastChild)return l.removeChild(l.firstChild);var c=t.createDocumentFragment();for(;l.firstChild;)c.appendChild(l.removeChild(l.firstChild));return c},Xt=!1;"undefined"!=typeof document&&((qt=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Xt=!qt.getElementsByTagName("link").length,qt=void 0);var Gt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Xt?[1,"X<div>","</div>"]:[0,"",""]};Gt.td=Gt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Gt.option=Gt.optgroup=[1,'<select multiple="multiple">',"</select>"],Gt.thead=Gt.tbody=Gt.colgroup=Gt.caption=Gt.tfoot=[1,"<table>","</table>"],Gt.polyline=Gt.ellipse=Gt.polygon=Gt.circle=Gt.text=Gt.line=Gt.path=Gt.rect=Gt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ut=Qt;function Yt(e,t){return(t=t||document).querySelector(e)}function Kt(e,t){return(t=t||document).querySelectorAll(e)}function Zt(e){e.parentNode&&e.parentNode.removeChild(e)}function Jt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function en(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function tn(e,t){return e&&t?e.indexOf(t):-1}function nn(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function rn(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=nn(e,t);return Math.abs(r/o)<=i}var on=2;function sn(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(an(e,n))return t;return!1}function an(e,t){const n=t[0];return w(t,(function(t){return Math.abs(n[e]-t[e])<=on}))}function ln(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function cn(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var hn=/,?([a-z]),?/gi,un=parseFloat,pn=Math,dn=pn.PI,fn=pn.min,mn=pn.max,gn=pn.pow,vn=pn.abs,yn=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,bn=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,xn=Array.isArray||function(e){return e instanceof Array};function wn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)wn(e,n)&&(t[n]=_n(e[n]));return t}function En(e){var t=En.ps=En.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout((function(){for(var n in t)wn(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])})),t[e]}function kn(e,t,n,i){return 1===arguments.length&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function On(){return this.join(",").replace(hn,"$1")}function Sn(e){var t=_n(e);return t.toString=On,t}function Cn(e,t,n,i,r,o,s,a,l){var c=1-l,h=gn(c,3),u=gn(c,2),p=l*l*l,d=h*t+3*u*l*i+3*c*l*l*o+p*a;return{x:Dn(h*e+3*u*l*n+3*c*l*l*r+p*s),y:Dn(d)}}function Pn(e){var t=function(e,t,n,i,r,o,s,a){for(var l,c,h,u,p,d,f,m,g=[],v=[[],[]],y=0;y<2;++y)if(0==y?(c=6*e-12*n+6*r,l=-3*e+9*n-9*r+3*s,h=3*n-3*e):(c=6*t-12*i+6*o,l=-3*t+9*i-9*o+3*a,h=3*i-3*t),vn(l)<1e-12){if(vn(c)<1e-12)continue;0<(u=-h/c)&&u<1&&g.push(u)}else f=c*c-4*h*l,m=pn.sqrt(f),f<0||(0<(p=(-c+m)/(2*l))&&p<1&&g.push(p),0<(d=(-c-m)/(2*l))&&d<1&&g.push(d));var b,x=g.length,w=x;for(;x--;)b=1-(u=g[x]),v[0][x]=b*b*b*e+3*b*b*u*n+3*b*u*u*r+u*u*u*s,v[1][x]=b*b*b*t+3*b*b*u*i+3*b*u*u*o+u*u*u*a;return v[0][w]=e,v[1][w]=t,v[0][w+1]=s,v[1][w+1]=a,v[0].length=v[1].length=w+2,{x0:fn(...v[0]),y0:fn(...v[1]),x1:mn(...v[0]),y1:mn(...v[1])}}(...e);return kn(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function An(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Mn(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Tn(e,t,n,i,r,o,s,a,l){null==l&&(l=1);for(var c=(l=l>1?1:l<0?0:l)/2,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],u=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,d=0;d<12;d++){var f=c*h[d]+c,m=Mn(f,e,n,r,s),g=Mn(f,t,i,o,a),v=m*m+g*g;p+=u[d]*pn.sqrt(v)}return c*p}function Rn(e,t,n,i,r,o,s,a){if(!(mn(e,n)<fn(r,s)||fn(e,n)>mn(r,s)||mn(t,i)<fn(o,a)||fn(t,i)>mn(o,a))){var l=(e*i-t*n)*(o-a)-(t-i)*(r*a-o*s),c=(e-n)*(o-a)-(t-i)*(r-s);if(c){var h=Dn(((e*i-t*n)*(r-s)-(e-n)*(r*a-o*s))/c),u=Dn(l/c),p=+h.toFixed(2),d=+u.toFixed(2);if(!(p<+fn(e,n).toFixed(2)||p>+mn(e,n).toFixed(2)||p<+fn(r,s).toFixed(2)||p>+mn(r,s).toFixed(2)||d<+fn(t,i).toFixed(2)||d>+mn(t,i).toFixed(2)||d<+fn(o,a).toFixed(2)||d>+mn(o,a).toFixed(2)))return{x:h,y:u}}}}function Dn(e){return Math.round(1e11*e)/1e11}function Bn(e,t,n){if(!function(e,t){return e=kn(e),An(t=kn(t),e.x,e.y)||An(t,e.x2,e.y)||An(t,e.x,e.y2)||An(t,e.x2,e.y2)||An(e,t.x,t.y)||An(e,t.x2,t.y)||An(e,t.x,t.y2)||An(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}(Pn(e),Pn(t)))return n?0:[];for(var i=Tn(...e),r=Tn(...t),o=zn(e)?1:~~(i/5)||1,s=zn(t)?1:~~(r/5)||1,a=[],l=[],c={},h=n?0:[],u=0;u<o+1;u++){var p=Cn(...e,u/o);a.push({x:p.x,y:p.y,t:u/o})}for(u=0;u<s+1;u++)p=Cn(...t,u/s),l.push({x:p.x,y:p.y,t:u/s});for(u=0;u<o;u++)for(var d=0;d<s;d++){var f,m=a[u],g=a[u+1],v=l[d],y=l[d+1],b=vn(g.x-m.x)<.01?"y":"x",x=vn(y.x-v.x)<.01?"y":"x",w=Rn(m.x,m.y,g.x,g.y,v.x,v.y,y.x,y.y);if(w){if(c[f=w.x.toFixed(9)+"#"+w.y.toFixed(9)])continue;c[f]=!0;var _=m.t+vn((w[b]-m[b])/(g[b]-m[b]))*(g.t-m.t),E=v.t+vn((w[x]-v[x])/(y[x]-v[x]))*(y.t-v.t);_>=0&&_<=1&&E>=0&&E<=1&&(n?h++:h.push({x:w.x,y:w.y,t1:_,t2:E}))}}return h}function Ln(e,t,n){e=Fn(e),t=Fn(t);for(var i,r,o,s,a,l,c,h,u,p,d=n?0:[],f=0,m=e.length;f<m;f++){var g=e[f];if("M"==g[0])i=a=g[1],r=l=g[2];else{"C"==g[0]?(i=(u=[i,r,...g.slice(1)])[6],r=u[7]):(u=[i,r,i,r,a,l,a,l],i=a,r=l);for(var v=0,y=t.length;v<y;v++){var b=t[v];if("M"==b[0])o=c=b[1],s=h=b[2];else{"C"==b[0]?(o=(p=[o,s,...b.slice(1)])[6],s=p[7]):(p=[o,s,o,s,c,h,c,h],o=c,s=h);var x=Bn(u,p,n);if(n)d+=x;else{for(var w=0,_=x.length;w<_;w++)x[w].segment1=f,x[w].segment2=v,x[w].bez1=u,x[w].bez2=p;d=d.concat(x)}}}}}return d}function Nn(e){var t=En(e);if(t.abs)return Sn(t.abs);if(xn(e)&&xn(e&&e[0])||(e=function(e){if(!e)return null;var t=En(e);if(t.arr)return _n(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return xn(e)&&xn(e[0])&&(i=_n(e)),i.length||String(e).replace(yn,(function(e,t,r){var o=[],s=t.toLowerCase();for(r.replace(bn,(function(e,t){t&&o.push(+t)})),"m"==s&&o.length>2&&(i.push([t,...o.splice(0,2)]),s="l",t="m"==t?"l":"L");o.length>=n[s]&&(i.push([t,...o.splice(0,n[s])]),n[s]););})),i.toString=En.toString,t.arr=_n(i),i}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,s=0,a=0,l=0;"M"==e[0][0]&&(s=r=+e[0][1],a=o=+e[0][2],l++,i[0]=["M",r,o]);for(var c,h,u=l,p=e.length;u<p;u++){if(i.push(c=[]),(n=(h=e[u])[0])!=n.toUpperCase())switch(c[0]=n.toUpperCase(),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+h[6]+r,c[7]=+h[7]+o;break;case"V":c[1]=+h[1]+o;break;case"H":c[1]=+h[1]+r;break;case"M":s=+h[1]+r,a=+h[2]+o;default:for(var d=1,f=h.length;d<f;d++)c[d]=+h[d]+(d%2?r:o)}else for(var m=0,g=h.length;m<g;m++)c[m]=h[m];switch(n=n.toUpperCase(),c[0]){case"Z":r=+s,o=+a;break;case"H":r=c[1];break;case"V":o=c[1];break;case"M":s=c[c.length-2],a=c[c.length-1];default:r=c[c.length-2],o=c[c.length-1]}}return i.toString=On,t.abs=Sn(i),i}function zn(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function In(e,t,n,i){return[e,t,n,i,n,i]}function jn(e,t,n,i,r,o){var s=1/3,a=2/3;return[s*e+a*n,s*t+a*i,s*r+a*n,s*o+a*i,r,o]}function $n(e,t,n,i,r,o,s,a,l,c){var h,u=120*dn/180,p=dn/180*(+r||0),d=[],f=function(e){return function t(){var n=Array.prototype.slice.call(arguments,0).join("␀"),i=t.cache=t.cache||{},r=t.count=t.count||[];return wn(i,n)?(function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(r,n),i[n]):(r.length>=1e3&&delete i[r.shift()],r.push(n),i[n]=e(...arguments),i[n])}}((function(e,t,n){return{x:e*pn.cos(n)-t*pn.sin(n),y:e*pn.sin(n)+t*pn.cos(n)}}));if(c)E=c[0],k=c[1],w=c[2],_=c[3];else{e=(h=f(e,t,-p)).x,t=h.y;var m=(e-(a=(h=f(a,l,-p)).x))/2,g=(t-(l=h.y))/2,v=m*m/(n*n)+g*g/(i*i);v>1&&(n*=v=pn.sqrt(v),i*=v);var y=n*n,b=i*i,x=(o==s?-1:1)*pn.sqrt(vn((y*b-y*g*g-b*m*m)/(y*g*g+b*m*m))),w=x*n*g/i+(e+a)/2,_=x*-i*m/n+(t+l)/2,E=pn.asin(((t-_)/i).toFixed(9)),k=pn.asin(((l-_)/i).toFixed(9));(E=e<w?dn-E:E)<0&&(E=2*dn+E),(k=a<w?dn-k:k)<0&&(k=2*dn+k),s&&E>k&&(E-=2*dn),!s&&k>E&&(k-=2*dn)}var O=k-E;if(vn(O)>u){var S=k,C=a,P=l;k=E+u*(s&&k>E?1:-1),d=$n(a=w+n*pn.cos(k),l=_+i*pn.sin(k),n,i,r,0,s,C,P,[k,S,w,_])}O=k-E;var A=pn.cos(E),M=pn.sin(E),T=pn.cos(k),R=pn.sin(k),D=pn.tan(O/4),B=4/3*n*D,L=4/3*i*D,N=[e,t],z=[e+B*M,t-L*A],I=[a+B*R,l-L*T],j=[a,l];if(z[0]=2*N[0]-z[0],z[1]=2*N[1]-z[1],c)return[z,I,j].concat(d);for(var $=[],F=0,H=(d=[z,I,j].concat(d).join().split(",")).length;F<H;F++)$[F]=F%2?f(d[F-1],d[F],p).y:f(d[F],d[F+1],p).x;return $}function Fn(e){var t=En(e);if(t.curve)return Sn(t.curve);for(var n=Nn(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(e,t,n){var i,r;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C",...$n(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(i=2*t.x-t.bx,r=2*t.y-t.by):(i=t.x,r=t.y),e=["C",i,r,...e.slice(1)];break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C",...jn(t.x,t.y,t.qx,t.qy,e[1],e[2])];break;case"Q":t.qx=e[1],t.qy=e[2],e=["C",...jn(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...In(t.x,t.y,e[1],e[2])];break;case"H":e=["C",...In(t.x,t.y,e[1],t.y)];break;case"V":e=["C",...In(t.x,t.y,t.x,e[1])];break;case"Z":e=["C",...In(t.x,t.y,t.X,t.Y)]}return e},o=function(e,t){if(e[t].length>7){e[t].shift();for(var i=e[t];i.length;)s[t]="A",e.splice(t++,0,["C",...i.splice(0,6)]);e.splice(t,1),h=n.length}},s=[],a="",l="",c=0,h=n.length;c<h;c++){n[c]&&(a=n[c][0]),"C"!=a&&(s[c]=a,c&&(l=s[c-1])),n[c]=r(n[c],i,l),"A"!=s[c]&&"C"==a&&(s[c]="C"),o(n,c);var u=n[c],p=u.length;i.x=u[p-2],i.y=u[p-1],i.bx=un(u[p-4])||i.x,i.by=un(u[p-3])||i.y}return t.curve=Sn(n),n}function Hn(e){return h(e)&&f(e,"waypoints")}function Vn(e){return h(e)&&f(e,"labelTarget")}function qn(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Wn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Qn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Xn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function Gn(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r=t[i-1];if(r){var o=e[e.length-1],s=o&&o.endLength||0,a=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}(r,n);e.push({start:r,end:n,startLength:s,endLength:s+a,length:a})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0),r=i/2,o=0,s=n[o];s.endLength<r;)s=n[++o];var a=(r-s.startLength)/s.length;return{x:s.start.x+(s.end.x-s.start.x)*a,y:s.start.y+(s.end.y-s.start.y)*a}}function Un(e){return Hn(e)?Gn(e):Wn({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function Yn(e,t,n){h(n=n||0)||(n={x:n,y:n});var i=Qn(e),r=Qn(t),o=i.bottom+n.y<=r.top,s=i.left-n.x>=r.right,a=i.top-n.y>=r.bottom,l=o?"top":a?"bottom":null,c=i.right+n.x<=r.left?"left":s?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function Kn(e,t,n){var i=function(e,t){return Ln(e,t)}(e,t);return 1===i.length||2===i.length&&nn(i[0],i[1])<1?Wn(i[0]):i.length>1?(i=A(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),Wn(i[n?0:i.length-1])):null}function Zn(e,t){return Math.round(e*t)/t}function Jn(e){return u(e)?e+"px":e}function ei(e,t,n){const i=Me("g");_e(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const ti={shape:["x","y","width","height"],connection:["waypoints"]};function ni(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function ii(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ni.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ni.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=z({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Ct(n,{position:"relative",overflow:"hidden",width:Jn(e.width),height:Jn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Me("svg");xe(i,{width:"100%",height:"100%"}),ge(n,i);const r=this._viewport=ei(i,"viewport");e.deferUpdate&&(this._viewboxChanged=L(N(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(()=>{delete this._cachedViewbox})),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ni.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},ni.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=mt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ni.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},ni.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ni.prototype._getChildIndex=function(e){return x(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},ni.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:ei(this._viewport,"layer-"+e,n),index:t,visible:!0}},ni.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},ni.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(ke(n),t.visible=!1,n):n},ni.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],ke(t.group))},ni.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ni.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},ni.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},ni.prototype._findPlaneForRoot=function(e){return m(this._planes,(function(t){return t.rootElement===e}))},ni.prototype.getContainer=function(){return this._container},ni.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(y([i.gfx,i.secondaryGfx],(function(e){e&&(n?_e(e).add(t):_e(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ni.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ni.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ni.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return _e(this.getGraphics(e)).has(t)},ni.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ni.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ni.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ni.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},ni.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},ni.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},ni.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},ni.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},ni.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=ti[e],i=w(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},ni.prototype._setParent=function(e,t,n){en(t.children,e,n),e.parent=t},ni.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const s=o.create(e,t,i);return this._elementRegistry.add(t,s),o.update(e,t,s),r.fire(e+".added",{element:t,gfx:s}),t},ni.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ni.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ni.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Jt(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ni.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ni.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ni.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ni.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ni.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ni.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,s,a,l,c;return e?(this._changeViewbox((function(){a=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);Ve(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},s=Ve(t),r=s?s.matrix:function(e,t,n,i,r,o){var s=Re().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return De(s,e);case 6:return De(s,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),a=Zn(r.a,1e3),l=Zn(-r.e||0,1e3),c=Zn(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/a:0,y:c?c/a:0,width:n.width/a,height:n.height/a,scale:a,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},ni.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),ii(t,n)})),{x:n.e,y:n.f}},ni.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=ft(e),o=Qn(r),s=this.viewbox(),a=this.zoom();let l,c;s.y+=t.top/a,s.x+=t.left/a,s.width-=(t.right+t.left)/a,s.height-=(t.bottom+t.top)/a;const h=Qn(s);if(r.width<s.width&&r.height<s.height){const e=Math.max(0,o.right-h.right),t=Math.min(0,o.left-h.left),n=Math.max(0,o.bottom-h.bottom),i=Math.min(0,o.top-h.top);l=e||t,c=n||i}else l=r.x-s.x,c=r.y-s.y;this.scroll({dx:-l*a,dy:-c*a})},ni.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Zn(i.a,1e3)},ni.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},ni.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let s,a,l,c,h;l=i.getCTM();const u=l.a;return t?(s=z(o,t),a=s.matrixTransform(l.inverse()),c=r.translate(a.x,a.y).scale(1/u*e).translate(-a.x,-a.y),h=l.multiply(c)):h=r.scale(e),ii(this._viewport,h),h},ni.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ni.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},ni.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var ri="data-element-id";function oi(e){this._elements={},this._eventBus=e}function si(e,t,n){var i=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function ai(e,t){if(!(this instanceof ai))return new ai(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}oi.$inject=["eventBus"],oi.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),xe(t,ri,i),n&&xe(n,ri,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},oi.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(xe(i.gfx,ri,""),i.secondaryGfx&&xe(i.secondaryGfx,ri,""),delete t[n])},oi.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},oi.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&xe(t,ri,i),t},oi.prototype.get=function(e){var t;t="string"==typeof e?e:e&&xe(e,ri);var n=this._elements[t];return n&&n.element},oi.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},oi.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},oi.prototype.getAll=function(){return this.filter((function(e){return e}))},oi.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},oi.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},oi.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")},ai.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?si(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},ai.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||si(this,t,e),n},ai.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},ai.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},ai.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var li=new ai({name:"children",enumerable:!0,collection:!0},{name:"parent"}),ci=new ai({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),hi=new ai({name:"attachers",collection:!0},{name:"host"}),ui=new ai({name:"outgoing",collection:!0},{name:"source"}),pi=new ai({name:"incoming",collection:!0},{name:"target"});function di(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),li.bind(this,"parent"),ci.bind(this,"labels"),ui.bind(this,"outgoing"),pi.bind(this,"incoming")}function fi(){di.call(this),li.bind(this,"children"),hi.bind(this,"host"),hi.bind(this,"attachers")}function mi(){di.call(this),li.bind(this,"children")}function gi(){fi.call(this),ci.bind(this,"labelTarget")}function vi(){di.call(this),ui.bind(this,"source"),pi.bind(this,"target")}e(fi,di),e(mi,fi),e(gi,fi),e(vi,di);var yi={connection:vi,shape:fi,label:gi,root:mi};function bi(){this._uid=12}bi.prototype.createRoot=function(e){return this.create("root",e)},bi.prototype.createLabel=function(e){return this.create("label",e)},bi.prototype.createShape=function(e){return this.create("shape",e)},bi.prototype.createConnection=function(e){return this.create("connection",e)},bi.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=yi[e];if(!n)throw new Error("unknown type: <"+e+">");return z(new n,t)}(e,t)};var xi="__fn",wi=Array.prototype.slice;function _i(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Ei(){}function ki(e){return e.childNodes[0]}function Oi(e,t,n,i,r){var o=Be();o.setTranslate(t,n);var s=Be();s.setRotate(i||0,0,0);var a=Be();a.setScale(r||1,r||1),Ve(e,[o,s,a])}function Si(e,t,n){var i=Be();i.setTranslate(t,n),Ve(e,i)}function Ci(e,t){var n=Be();n.setRotate(t,0,0),Ve(e,n)}function Pi(e,t){this._eventBus=e,this._elementRegistry=t}function Ai(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}_i.prototype.on=function(e,t,n,i){if(e=c(e)?e:[e],p(t)&&(i=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");var r=n;i&&((r=N(n,i))[xi]=n[xi]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},_i.prototype.once=function(e,t,n,i){var r=this;if(p(t)&&(i=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[xi]=n,this.on(e,t,o)},_i.prototype.off=function(e,t){e=c(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},_i.prototype.createEvent=function(e){var t=new Ei;return t.init(e),t},_i.prototype.fire=function(e,t){var n,i,r,o;if(o=wi.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Ei?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==s&&(n.type=s)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},_i.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},_i.prototype._destroy=function(){this._listeners={}},_i.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},_i.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},_i.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},_i.prototype._getListeners=function(e){return this._listeners[e]},_i.prototype._setListeners=function(e,t){this._listeners[e]=t},_i.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[xi]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Ei.prototype.stopPropagation=function(){this.cancelBubble=!0},Ei.prototype.preventDefault=function(){this.defaultPrevented=!0},Ei.prototype.init=function(e){z(this,e||{})},Pi.$inject=["eventBus","elementRegistry"],Pi.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(_e(t=Me("g")).add("djs-children"),ge(n.parentNode,t))):t=n,t},Pi.prototype._clear=function(e){var t=ki(e);return Rt(t),t},Pi.prototype._createContainer=function(e,t,n,i){var r=Me("g");_e(r).add("djs-group"),void 0!==n?Ai(r,t,t.childNodes[n]):ge(t,r);var o=Me("g");_e(o).add("djs-element"),_e(o).add("djs-"+e),i&&_e(o).add("djs-frame"),ge(r,o);var s=Me("g");return _e(s).add("djs-visual"),ge(o,s),o},Pi.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,gt(t))},Pi.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=x(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),y(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);y(t.slice().reverse(),(function(e){Ai(i.getGraphics(e).parentNode,r)}))}}))},Pi.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Pi.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Pi.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Pi.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Pi.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),Si(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?xe(n,"display","none"):xe(n,"display","block")}},Pi.prototype.remove=function(e){ke(this._elementRegistry.getGraphics(e).parentNode)};var Mi={__depends__:[bt],__init__:["canvas"],canvas:["type",ni],elementRegistry:["type",oi],elementFactory:["type",bi],eventBus:["type",_i],graphicsFactory:["type",Pi]};function Ti(e){return function(e){var t=new Ze(e);return t.init(),t}([{config:["value",e=e||{}]},Mi].concat(e.modules||[]))}function Ri(e,t){this._injector=t||Ti(e),this.get("eventBus").fire("diagram.init")}function Di(){}function Bi(e,t){this.model=e,this.properties=t}Ri.prototype.get=function(e,t){return this._injector.get(e,t)},Ri.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Ri.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ri.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Di.prototype.get=function(e){return this.$model.properties.get(this,e)},Di.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Bi.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Di.prototype);y(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),y(e,N((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Li={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ni={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function zi(e,t){var n=Ni[e];return n?n(t):t}function Ii(e){return!!Li[e]}function ji(e){return!!Ni[e]}function $i(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Fi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Hi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,y(e,N(this.registerPackage,this))}function Vi(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function qi(e){this.model=e}function Wi(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Qi(e){return e.replace(/^:/,"")}function Xi(e,t={}){this.properties=new qi(this),this.factory=new Bi(this,this.properties),this.registry=new Hi(e,this.properties),this.typeCache={},this.config=t}Fi.prototype.build=function(){return j(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Fi.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Fi.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,s=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var a=r.indexOf(e);if(-1===a)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(t,n?void 0:a,s),o[i.name]=o[i.localName]=t},Fi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=$i(r[0],i),s=$i(r[1],o.prefix).name,a=this.propertiesByName[s];if(!a)throw new Error("refined property <"+s+"> not found");this.replaceProperty(a,e,n),delete e.redefines},Fi.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Fi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Fi.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Fi.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Fi.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Fi.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Fi.prototype.hasProperty=function(e){return this.propertiesByName[e]},Fi.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(y(e.properties,N((function(n){n=z({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Hi.prototype.getPackage=function(e){return this.packageMap[e]},Hi.prototype.getPackages=function(){return this.packages},Hi.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Vi(t,e,"prefix"),Vi(t,e,"uri"),y(e.types,N((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Hi.prototype.registerType=function(e,t){var n=$i((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};y(e.properties,N((function(e){var t=$i(e.name,n.prefix),i=t.name;Ii(e.type)||(e.type=$i(e.type,t.prefix).name),z(e,{ns:t,name:i}),r[i]=e}),this)),z(e,{ns:n,name:i,propertiesByName:r}),y(e.extends,N((function(e){var t=$i(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Hi.prototype.mapTypes=function(e,t,n){var i=Ii(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=$i(n,Ii(n)?"":e.prefix);r.mapTypes(o,t,i)}function s(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");y(i.superClass,n?s:function(e){return o(e,!1)}),t(i,!n),y(i.traits,s)},Hi.prototype.getEffectiveDescriptor=function(e){var t=$i(e),n=new Fi(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Hi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},qi.prototype.set=function(e,t,n){if(!d(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[Qi(t)]:i?r in e?e[r]=n:Wi(e,i,n):e.$attrs[Qi(t)]=n},qi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Qi(t)];var i=n.name;return!e[i]&&n.isMany&&Wi(e,n,[]),e[i]},qi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},qi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},qi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},qi.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},Xi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Xi.prototype.getType=function(e){var t=this.typeCache,n=d(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Xi.prototype.createAny=function(e,t,n){var i=$i(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){I(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),y(n,(function(e,t){h(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Xi.prototype.getPackage=function(e){return this.registry.getPackage(e)},Xi.prototype.getPackages=function(){return this.registry.getPackages()},Xi.prototype.getElementDescriptor=function(e){return e.$descriptor},Xi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Xi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Xi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Gi=String.fromCharCode,Ui=Object.prototype.hasOwnProperty,Yi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Ki={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Zi(e,t,n,i){return i?Ui.call(Ki,i)?Ki[i]:"&"+i+";":Gi(t||parseInt(n,16))}function Ji(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Yi,Zi):e}Object.keys(Ki).forEach((function(e){Ki[e.toUpperCase()]=Ki[e]}));var er="xsi:type",tr="non-whitespace outside of root node";function nr(e){return new Error(e)}function ir(e){return"missing namespace for prefix <"+e+">"}function rr(e){return{get:e,enumerable:!0}}function or(e){var t,n={};for(t in e)n[t]=e[t];return n}function sr(e){return e+"$uri"}function ar(){return{line:0,column:0}}function lr(e){throw e}function cr(e){if(!this)return new cr(e);var t,n,i,r,o,s,a,l,c,h=e&&e.proxy,u=lr,p=ar,d=!1,f=!1,m=null,g=!1;function v(e){e instanceof Error||(e=nr(e)),m=e,u(e,p)}function y(e){o&&(e instanceof Error||(e=nr(e)),o(e,p))}this.on=function(e,c){if("function"!=typeof c)throw nr("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw nr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw nr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw nr("required args <xml=string>");return m=null,function(e){var o,u,m,b,x,w,_,E,k,O,S,C=f?[]:null,P=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[sr(n)]=t;return i}(c):null,A=[],M=0,T=!1,R=!1,D=0,B=0,L="",N=0;function z(){if(null!==S)return S;var e,t,n,i,r,o,s,a,l,h,u,p=f&&P.xmlns,m=f&&d?[]:null,g=N,v=L,b=v.length,x={},w={};e:for(;g<b;g++)if(l=!1,!(32===(h=v.charCodeAt(g))||h<14&&h>8)){for((h<65||h>122||h>90&&h<97)&&95!==h&&58!==h&&(y("illegal first char attribute name"),l=!0),u=g+1;u<b;u++)if(!((h=v.charCodeAt(u))>96&&h<123||h>64&&h<91||h>47&&h<59||46===h||45===h||95===h)){if(32===h||h<14&&h>8){y("missing attribute value"),g=u;continue e}if(61===h)break;y("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(a=v.substring(g,u))&&(y("illegal declaration of xmlns"),l=!0),34===(h=v.charCodeAt(u+1)))-1===(u=v.indexOf('"',g=u+2))&&-1!==(u=v.indexOf("'",g))&&(y("attribute value quote missmatch"),l=!0);else if(39===h)-1===(u=v.indexOf("'",g=u+2))&&-1!==(u=v.indexOf('"',g))&&(y("attribute value quote missmatch"),l=!0);else for(y("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(h=v.charCodeAt(u+1))||h<14&&h>8);u++);for(-1===u&&(y("missing closing quotes"),u=b,l=!0),l||(o=v.substring(g,u)),g=u;u+1<b&&!(32===(h=v.charCodeAt(u+1))||h<14&&h>8);u++)g===u&&(y("illegal character after attribute end"),l=!0);if(g=u+1,!l)if(a in w)y("attribute <"+a+"> already defined");else if(w[a]=!0,f)if(d){if(null!==(r="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=Ji(o),t=sr(r),!(s=c[e])){if("xmlns"===r||t in P&&P[t]!==e)do{s="ns"+M++}while(void 0!==P[s]);else s=r;c[e]=s}P[r]!==s&&(i||(P=or(P),i=!0),P[r]=s,"xmlns"===r&&(P[sr(s)]=e,p=s),P[t]=e),x[a]=o;continue}m.push(a,o)}else-1!==(h=a.indexOf(":"))?(n=P[a.substring(0,h)])?((a=p===n?a.substr(h+1):n+a.substr(h))===er&&(-1!==(h=o.indexOf(":"))?(n=o.substring(0,h),o=(n=P[n]||n)+o.substring(h)):o=p+":"+o),x[a]=o):y(ir(a.substring(0,h))):x[a]=o;else x[a]=o}if(d)for(g=0,b=m.length;g<b;g++){if(a=m[g++],o=m[g],-1!==(h=a.indexOf(":"))){if(!(n=P[a.substring(0,h)])){y(ir(a.substring(0,h)));continue}(a=p===n?a.substr(h+1):n+a.substr(h))===er&&(-1!==(h=o.indexOf(":"))?(n=o.substring(0,h),o=(n=P[n]||n)+o.substring(h)):o=p+":"+o)}x[a]=o}return S=x}function I(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,s=0,a=B;D>=s&&(t=i.exec(e))&&!((a=t[0].length+t.index)>D);)r+=1,s=a;return-1==D?(o=a,n=e.substring(B)):0===B?n=e.substring(B,D):(o=D-s,n=-1==B?e.substring(D):e.substring(D,B+1)),{data:n,line:r,column:o}}p=I,h&&(O=Object.create({},{name:rr((function(){return E})),originalName:rr((function(){return k})),attrs:rr(z),ns:rr((function(){return P}))}));for(;-1!==B;){if(-1===(D=60===e.charCodeAt(B)?B:e.indexOf("<",B)))return A.length?v("unexpected end of file"):0===B?v("missing start tag"):void(B<e.length&&e.substring(B).trim()&&y(tr));if(B!==D)if(A.length){if(t&&(t(e.substring(B,D),Ji,p),g))return}else if(e.substring(B,D).trim()&&(y(tr),g))return;if(33===(x=e.charCodeAt(D+1))){if(91===(b=e.charCodeAt(D+2))&&"CDATA["===e.substr(D+3,6)){if(-1===(B=e.indexOf("]]>",D)))return v("unclosed cdata");if(r&&(r(e.substring(D+9,B),p),g))return;B+=3;continue}if(45===b&&45===e.charCodeAt(D+3)){if(-1===(B=e.indexOf("--\x3e",D)))return v("unclosed comment");if(s&&(s(e.substring(D+4,B),Ji,p),g))return;B+=3;continue}}if(63!==x){for(u=D+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return B=-1,v("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){B=u;break}}if(33!==x){if(S={},47===x){if(T=!1,R=!0,!A.length)return v("missing open tag");if(u=E=A.pop(),b=D+2+u.length,e.substring(D+2,b)!==u)return v("closing tag mismatch");for(;b<B;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return v("close tag")}else{if(47===e.charCodeAt(B-1)?(u=E=e.substring(D+1,B-1),T=!0,R=!0):(u=E=e.substring(D+1,B),T=!0,R=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return v("illegal first char nodeName");for(b=1,m=u.length;b<m;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){E=u.substring(0,b),S=null;break}return v("invalid nodeName")}R||A.push(E)}if(f){if(o=P,T&&(R||C.push(o),null===S&&(d=-1!==u.indexOf("xmlns",b))&&(N=b,L=u,z(),d=!1)),k=E,-1!==(x=E.indexOf(":"))){if(!(_=P[E.substring(0,x)]))return v("missing namespace on <"+k+">");E=E.substr(x+1)}else _=P.xmlns;_&&(E=_+":"+E)}if(T&&(N=b,L=u,n&&(h?n(O,Ji,R,p):n(E,z,Ji,R,p),g)))return;if(R){if(i&&(i(h?O:E,Ji,T,p),g))return;f&&(P=T?o:C.pop())}B+=1}else{if(l&&(l(e.substring(D,B+1),Ji,p),g))return;B+=1}}else{if(-1===(B=e.indexOf("?>",D)))return v("unclosed question");if(a&&(a(e.substring(D,B+2),p),g))return;B+=2}}}(e),p=ar,g=!1,m},this.stop=function(){g=!0}}function hr(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var ur={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},pr="xsi:type";function dr(e){return e.xml&&e.xml.serialize}function fr(e){return dr(e)===pr}function mr(e,t){return hr(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function gr(e){return new Error(e)}function vr(e){return e.$descriptor}function yr(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw gr("expected element");var t,n=this.elementsById,i=vr(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw gr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function br(){}function xr(){}function wr(){}function _r(e,t){this.property=e,this.context=t}function Er(e,t){this.element=t,this.propertyDesc=e}function kr(){}function Or(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Sr(e,t,n){Or.call(this,e,t,n)}function Cr(e,t,n){this.model=e,this.context=n}function Pr(e){e instanceof Xi&&(e={model:e}),z(this,{lax:!1},e)}br.prototype.handleEnd=function(){},br.prototype.handleText=function(){},br.prototype.handleNode=function(){},xr.prototype=Object.create(br.prototype),xr.prototype.handleNode=function(){return this},wr.prototype=Object.create(br.prototype),wr.prototype.handleText=function(e){this.body=(this.body||"")+e},_r.prototype=Object.create(wr.prototype),_r.prototype.handleNode=function(e){if(this.element)throw gr("expected no sub nodes");return this.element=this.createReference(e),this},_r.prototype.handleEnd=function(){this.element.id=this.body},_r.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Er.prototype=Object.create(wr.prototype),Er.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=zi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},kr.prototype=Object.create(wr.prototype),kr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Or.prototype=Object.create(kr.prototype),Or.prototype.addReference=function(e){this.context.addReference(e)},Or.prototype.handleText=function(e){if(!vr(this.element).bodyProperty)throw gr("unexpected body text <"+e+">");wr.prototype.handleText.call(this,e)},Or.prototype.handleEnd=function(){var e=this.body,t=this.element,n=vr(t).bodyProperty;n&&void 0!==e&&(e=zi(n.type,e),t.set(n.name,e))},Or.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=vr(i),o=this.context,s=new i({}),a=this.model;return y(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?y(e.split(" "),(function(e){o.addReference({element:s,property:i.ns.name,id:e})})):o.addReference({element:s,property:i.ns.name,id:e}):(i?e=zi(i.type,e):"xmlns"!==n&&(t=$i(n,r.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},Or.prototype.getPropertyForNode=function(e){var t,n,i=$i(e.name),r=this.type,o=this.model,s=vr(r),a=i.name,l=s.propertiesByName[a];if(l&&!l.isAttr)return fr(l)&&(t=e.attributes[pr])?(t=function(e,t){var n=$i(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),z({},l,{effectiveType:vr(n=o.getType(t)).name})):l;var c=o.getPackage(i.prefix);if(c){if(t=mr(i,c),n=o.getType(t),l=m(s.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),l)return z({},l,{effectiveType:vr(n).name})}else if(l=m(s.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),l)return l;throw gr("unrecognized element <"+i.name+">")},Or.prototype.toString=function(){return"ElementDescriptor["+vr(this.type).name+"]"},Or.prototype.valueHandler=function(e,t){return new Er(e,t)},Or.prototype.referenceHandler=function(e){return new _r(e,this.context)},Or.prototype.handler=function(e){return"Element"===e?new Cr(this.model,e,this.context):new Or(this.model,e,this.context)},Or.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,ji(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Sr.prototype=Object.create(Or.prototype),Sr.prototype.createElement=function(e){var t=e.name,n=$i(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),s=o&&mr(n,o)||t;if(!r.hasType(s))throw gr("unexpected element <"+e.originalName+">");return Or.prototype.createElement.call(this,e)},Cr.prototype=Object.create(kr.prototype),Cr.prototype.createElement=function(e){var t=e.name,n=$i(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Cr.prototype.handleChild=function(e){var t=new Cr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Cr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Pr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Or?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,s=new yr(z({},t,{rootHandler:i})),a=new cr({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw gr(l)}function h(e,t){return c(e,t,!0)}i.context=s,l.push(i);var u=/^<\?xml /i,p=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){h(e,t)}}var m=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return a.ns(m).on("openTag",(function(e,t,n,i){var r=e.attrs||{},s=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new xr)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=p.exec(e),n=t&&t[1];n&&!d.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",c).on("warn",h),new Promise((function(t,n){var r;try{a.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=vr(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var l=r.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(a.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=gr("failed to parse document as <"+i.type.$descriptor.name+">"));var l=s.warnings,c=s.references,h=s.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:h,references:c,warnings:l})}))},Pr.prototype.handler=function(e){return new Sr(this.model,e)};var Ar=/<|>|'|"|&|\n\r|\n/g,Mr=/<|>|&/g;function Tr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function Rr(e,t){return hr(t)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(e):e}function Dr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Br(e){return d(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Lr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Nr={"<":"lt",">":"gt","&":"amp"};function zr(e,t,n){return(e=d(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Ir(e){this.tagName=e}function jr(){}function $r(e){this.tagName=e}function Fr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Hr(e,t){Fr.call(this,e,t)}function Vr(){this.value="",this.write=function(e){this.value+=e}}function qr(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Wr(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Vr,r=new qr(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Fr).build(t).serializeTo(r),!n)return i.value}}}function Qr(e,t){Xi.call(this,e,t)}Ir.prototype.build=function(e){return this.element=e,this},Ir.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},jr.prototype.serializeValue=jr.prototype.serializeTo=function(e){e.append(this.escape?zr(this.value,Mr,Nr):this.value)},jr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Mr)&&(this.escape=!0),this},Dr($r,jr),$r.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Fr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return v(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!f(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(v(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return v(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Fr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?z({localName:t.ns.localName},e):z({localName:Rr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Fr.prototype.nsPropertyTagName=function(e){return function(e,t){return z({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Fr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Fr.prototype.nsAttributeName=function(e){var t;if(t=d(e)?$i(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},Fr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return y(e,(function(r,o){"$body"===o?n.push((new jr).build({type:"String"},r)):"$children"===o?y(r,(function(e){n.push(new Fr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Fr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=$i(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var s=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(s)}},Fr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return y(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Fr.prototype.parseGenericAttributes=function(e,t){var n=this;y(t,(function(t){if(t.name!==pr)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Fr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;y(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new jr).build(e,r[0]));else if(ji(e.type))y(r,(function(i){n.push(new $r(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)y(r,(function(i){n.push(new Ir(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var s=fr(e),a=function(e){return"property"===dr(e)}(e);y(r,(function(i){var r;r=s?new Hr(t,e):a?new Fr(t,e):new Fr(t),n.push(r.build(i))}))}}))},Fr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Tr(t):n=t),n},Fr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Fr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,s=this.getNamespaces(t),a=e.prefix,l=e.uri;if(!a&&!l)return{localName:e.localName};if(r=ur[a]||o&&(o.getPackage(a)||{}).uri,!(l=l||r||s.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=s.byUri(l))){for(n=a,i=1;s.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return a&&s.mapPrefix(a,l),e},Fr.prototype.parseAttributes=function(e){var t=this,n=this.element;y(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];y(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Fr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Br(e)},Fr.prototype.addAttribute=function(e,t){var n=this.attrs;d(t)&&(t=zr(t,Ar,Lr));var i=g(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Fr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),y(t,(function(t){e.append(" ").append(Br(t.name)).append('="').append(t.value).append('"')}))},Fr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==jr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),y(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Dr(Hr,Fr),Hr.prototype.parseNsAttributes=function(e){var t=Fr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(pr),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Hr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Qr.prototype=Object.create(Xi.prototype),Qr.prototype.fromXML=function(e,t,n){d(t)||(n=t,t="bpmn:Definitions");var i=new Pr(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Qr.prototype.toXML=function(e,t){var n=new Wr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Xr={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Gr(e,t){return new Qr(z({},Xr,e),t)}function Ur(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var Yr="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function Kr(e){f(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(Yr)}})}function Zr(e,t){return e.$instanceOf(t)}function Jr(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function s(t,n){try{var r=i[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${Ur(t)}`);return e.element(t,i[t.id],n)}(t,n);return o(t),r}catch(e){a(e.message,{element:t,error:e}),console.error(`failed to import ${Ur(t)}`,e)}}function a(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t=e.bpmnElement;t?i[t.id]?a(`multiple DI elements defined for ${Ur(t)}`,{element:t}):(i[t.id]=e,Kr(t)):a(`no bpmnElement referenced in ${Ur(e)}`,{element:e})};function c(e){var t;t=e.plane,l(t),y(t.planeElement,h)}function h(e){l(e)}this.handleDefinitions=function(o,s){var h=o.diagrams;if(s&&-1===h.indexOf(s))throw new Error("diagram not part of <bpmn:Definitions />");if(!s&&h&&h.length&&(s=h[0]),!s)throw new Error("no diagram to display");i={},c(s);var f=s.plane;if(!f)throw new Error(`no plane for ${Ur(s)}`);var g=f.bpmnElement;if(!g){if(g=function(e){return m(e.rootElements,(function(e){return Zr(e,"bpmn:Process")||Zr(e,"bpmn:Collaboration")}))}(o),!g)throw new Error("no process or collaboration to display");a(`correcting missing bpmnElement on ${Ur(f)} to ${Ur(g)}`),f.bpmnElement=g,l(f)}var b,x,_=function(t,n){return e.root(t,i[t.id],n)}(g,f);if(Zr(g,"bpmn:Process")||Zr(g,"bpmn:SubProcess"))p(g,_);else{if(!Zr(g,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${Ur(f)}: ${Ur(g)}`);x=_,y((b=g).participants,r(A,x)),w(b.artifacts,x),n.push((function(){!function(e,t){y(e,r(d,t))}(b.messageFlows,x)})),function(e,n){var i=v(e,(function(e){return!t[e.id]&&Zr(e,"bpmn:Process")&&e.laneSets}));i.forEach(r(p,n))}(o.rootElements,_)}u(n)};var u=this.handleDeferred=function(){for(;n.length;)n.shift()()};function p(e,t){P(e,t),_(e.ioSpecification,t),w(e.artifacts,t),o(e)}function d(e,t){s(e,t)}function f(e,t){s(e,t)}function g(e,t){s(e,t)}function b(e,t){s(e,t)}function x(e,t){s(e,t)}function w(e,t){y(e,(function(e){Zr(e,"bpmn:Association")?n.push((function(){x(e,t)})):x(e,t)}))}function _(e,t){e&&(y(e.dataInputs,r(g,t)),y(e.dataOutputs,r(b,t)))}var E=this.handleSubProcess=function(e,t){P(e,t),w(e.artifacts,t)};function k(e,t){var i=s(e,t);Zr(e,"bpmn:SubProcess")&&E(e,i||t),Zr(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){y(e.dataInputAssociations,r(f,t)),y(e.dataOutputAssociations,r(f,t))}))}function O(e,t){s(e,t)}function S(e,t){n.push((function(){var n=s(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){y(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function C(e,t){y(e.lanes,r(S,t))}function P(e,t){!function(e,t){y(e,(function(e){Zr(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){s(e,t)}(e,t)})):Zr(e,"bpmn:BoundaryEvent")?n.unshift((function(){k(e,t)})):Zr(e,"bpmn:FlowNode")?k(e,t):Zr(e,"bpmn:DataObject")||(Zr(e,"bpmn:DataStoreReference")||Zr(e,"bpmn:DataObjectReference")?O(e,t):a(`unrecognized flowElement ${Ur(e)} in context ${Ur(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){y(e,r(C,t))}(e.laneSets,t)}function A(e,t){var n=s(e,t),i=e.processRef;i&&p(i,n||t)}}function eo(e,t){var n=no(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function to(e,t){return _(t,(function(t){return eo(e,t)}))}function no(e){return e&&e.businessObject||e}function io(e){return e&&e.di}function ro(e,t,n){var i,r,o,s=[];function a(e,t){var n=new Jr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;eo(i,"bpmn:Process")||eo(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(eo(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=eo(r,"bpmn:Collaboration")?r:m(e.rootElements,(function(e){if(eo(e,"bpmn:Collaboration"))return m(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=E(n.participants,(function(e){return e.processRef}))).push(n);var s=oo(o),a=[t],l=[i];return y(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===l.indexOf(t)&&(a.push(e),l.push(t))})),a}(e,t);if(!r)throw new Error("no diagram to display");y(r,(function(t){n.handleDefinitions(e,t)}));var a=t.plane.bpmnElement.id;o.setRootElement(o.findRoot(a+"_plane")||o.findRoot(a))}return new Promise((function(l,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),a(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),l({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function oo(e){var t=[];return y(e,(function(e){e&&(t.push(e),t=t.concat(oo(e.flowElements)))})),t}var so,ao='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',lo={verticalAlign:"middle"},co={color:"#404040"},ho={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},uo={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},po={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},fo='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ao+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function mo(){so||(G(so=de(fo),ho),G(fe("svg",so),lo),G(fe(".backdrop",so),uo),G(fe(".notice",so),po),G(fe(".link",so),co,{margin:"15px 20px 15px 10px",alignSelf:"center"}),ce.bind(so,".backdrop","click",(function(e){document.body.removeChild(so)}))),document.body.appendChild(so)}function go(e){e=z({},yo,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=de('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ao+"</a>");G(fe("svg",t),lo),G(t,co,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),se.bind(t,"click",(function(e){mo(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function vo(e,t){return e.warnings=t,e}e(go,Ri),go.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let s=o.rootElement;const a=o.references,l=o.warnings,c=o.elementsById;i=i.concat(l),s=this._emit("import.parse.complete",(r={error:null,definitions:s,elementsById:c,references:a,warnings:i},n.get("eventBus").createEvent(r)))||s;const h=await this.importDefinitions(s,t);return i=i.concat(h.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),vo(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},go.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},go.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw vo(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return m(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw vo(t,[]),t}try{this.clear()}catch(e){throw vo(e,[]),e}const{warnings:i}=await ro(this,t,n);return{warnings:i}},go.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},go.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=fe("defs",t._svg),r=Fe(n),o=i?"<defs>"+Fe(i)+"</defs>":"",s=n.getBBox();e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},go.prototype._setDefinitions=function(e){this._definitions=e},go.prototype.getModules=function(){return this._modules},go.prototype.clear=function(){this.getDefinitions()&&Ri.prototype.clear.call(this)},go.prototype.destroy=function(){var e;Ri.prototype.destroy.call(this),(e=this._container).parentNode&&e.parentNode.removeChild(e)},go.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},go.prototype.off=function(e,t){this.get("eventBus").off(e,t)},go.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=fe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},go.prototype.getDefinitions=function(){return this._definitions},go.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},go.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),s=z($(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Ri.call(this,s),n&&n.container&&this.attachTo(n.container)},go.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},go.prototype._createContainer=function(e){const t=de('<div class="bjs-container"></div>');return G(t,{width:bo(e.width),height:bo(e.height),position:e.position}),t},go.prototype._createModdle=function(e){return new Gr(z({},this._moddleExtensions,e.moddleExtensions))},go.prototype._modules=[];const yo={width:"100%",height:"100%",position:"relative"};function bo(e){return e+(u(e)?"px":"")}function xo(e){go.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function wo(e,t){return!eo(e,"bpmn:CallActivity")&&(eo(e,"bpmn:SubProcess")?!(!(t=t||io(e))||!eo(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!eo(e,"bpmn:Participant")||!!no(e).processRef)}function _o(e){if(eo(e,"bpmn:Participant")||eo(e,"bpmn:Lane")){var t=io(e).isHorizontal;return void 0===t||t}}function Eo(e){return e&&!1!==no(e).isInterrupting}function ko(e){return e&&!!no(e).triggeredByEvent}function Oo(e,t){return _(no(e).eventDefinitions,(function(e){return eo(e,t)}))}e(xo,go),xo.prototype._createModdle=function(e){var t=go.prototype._createModdle.call(this,e);return t.ids=new n([32,36,1]),t},xo.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var So={width:90,height:20},Co=15;function Po(e){return eo(e,"bpmn:Event")||eo(e,"bpmn:Gateway")||eo(e,"bpmn:DataStoreReference")||eo(e,"bpmn:DataObjectReference")||eo(e,"bpmn:DataInput")||eo(e,"bpmn:DataOutput")||eo(e,"bpmn:SequenceFlow")||eo(e,"bpmn:MessageFlow")||eo(e,"bpmn:Group")}function Ao(e){return Vn(e.label)}function Mo(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)),s=r.x,a=r.y;return Math.abs(o)<Math.PI/2?a-=Co:s+=Co,{x:s,y:a}}function To(e){return e.waypoints?Mo(e.waypoints):eo(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+So.height/2}:{x:e.x+e.width/2,y:e.y+e.height+So.height/2}}function Ro(e){return eo(e,"bpmn:FlowElement")||eo(e,"bpmn:Participant")||eo(e,"bpmn:Lane")||eo(e,"bpmn:SequenceFlow")||eo(e,"bpmn:MessageFlow")||eo(e,"bpmn:DataInput")||eo(e,"bpmn:DataOutput")?"name":eo(e,"bpmn:TextAnnotation")?"text":eo(e,"bpmn:Group")?"categoryValueRef":void 0}function Do(e){var t=e.businessObject,n=Ro(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}var Bo="hsl(225, 10%, 15%)",Lo="white";function No(e,t){return _(e.eventDefinitions,(function(e){return e.$type===t}))}function zo(e,t,n){var i=io(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||Lo}function Io(e,t,n){var i=io(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||Bo}function jo(e,t,n,i){var r=io(e).get("label");return i||r&&r.get("color:color")||t||Io(e,n)}function $o(e,t={}){return{width:Fo(e,t),height:Ho(e,t)}}function Fo(e,t={}){return f(t,"width")?t.width:e.width}function Ho(e,t={}){return f(t,"height")?t.height:e.height}var Vo=new n,qo=.95;function Wo(e,t,n,i,r,o,s){tt.call(this,t,s);var a=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=Vo.next(),p={};function d(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Bo,strokeWidth:2,fill:"white"})}function f(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Bo,strokeWidth:2})}function m(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o}=t,s=Me("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ge(s,o);var a=fe("defs",r._svg);a||(a=Me("defs"),ge(r._svg,a)),ge(a,s),p[e]=s}function g(e){return e.replace(/[^0-9a-zA-Z]+/g,"_")}function v(e,t,n){var i=e+"-"+g(t)+"-"+g(n)+"-"+u;return p[i]||function(e,t,n,i){if("sequenceflow-end"===t){m(e,{element:Me("path",{d:"M 1 5 L 11 10 L 1 15 Z",...d({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5})}if("messageflow-start"===t){m(e,{element:Me("circle",{cx:6,cy:6,r:3.5,...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6}})}if("messageflow-end"===t){m(e,{element:Me("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...d({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5}})}if("association-start"===t){m(e,{element:Me("path",{d:"M 11 5 L 1 10 L 11 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5})}if("association-end"===t){m(e,{element:Me("path",{d:"M 1 5 L 11 10 L 1 15",...f({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5})}if("conditional-flow-marker"===t){m(e,{element:Me("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...d({fill:n,stroke:i})}),ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){m(e,{element:Me("path",{d:"M 6 4 L 10 16",...d({stroke:i})}),ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function b(e,t,n,i,r={}){h(i)&&(r=i,i=0),i=i||0,r=d(r);var o=Me("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return ge(e,o),o}function x(e,t,n,i,r,o){h(r)&&(o=r,r=0),r=r||0,o=d(o);var s=Me("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return ge(e,s),s}function w(e,t,n,i){var r=at(t,n=f(n),i);return ge(e,r),r}function _(e,t,n){return w(e,t,n,5)}function E(e,t,n){n=f(n);var i=Me("path",{...n,d:t});return ge(e,i),i}function k(e,t,n,i){return E(t,n,z({"data-marker":e},i))}function O(e){return te[e]}function S(e){return function(t,n,i){return O(e)(t,n,i)}}var C=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:r?zo(t,a,n.fill):Io(t,l,n.stroke),strokeWidth:1})},P=function(e,t,n={}){var r=b(e,t.width,t.height,.2*t.height,{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:2});E(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:Io(t,l,n.stroke),strokeWidth:2});for(var o=0;o<12;o++){var s=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),c=t.width/2,h=t.height/2;E(e,s,{strokeWidth:1,stroke:Io(t,l,n.stroke),transform:"rotate("+30*o+","+h+","+c+")"})}return r},A=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},M=function(e,t,n={}){return E(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},T=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},R=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},D=function(e,t,n={},r){var o=E(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?Io(t,l,n.stroke):"none",stroke:Io(t,l,n.stroke),strokeWidth:1});return Ci(o,45),o},B=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},L=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},N=function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:r?Io(t,l,n.stroke):zo(t,a,n.fill),strokeWidth:1})},I=function(e,t,n={}){return E(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1})},j=function(e,t,n={}){return b(e,t.width,t.height,8,{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:4})};function $(e,t,n={}){var i=no(e),r=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(i);return i.get("eventDefinitions")&&i.get("eventDefinitions").length>1?i.get("parallelMultiple")?I(t,e,n,r):N(t,e,n,r):No(i,"bpmn:MessageEventDefinition")?C(t,e,n,r):No(i,"bpmn:TimerEventDefinition")?P(t,e,n,r):No(i,"bpmn:ConditionalEventDefinition")?M(t,e,n,r):No(i,"bpmn:SignalEventDefinition")?L(t,e,n,r):No(i,"bpmn:EscalationEventDefinition")?A(t,e,n,r):No(i,"bpmn:LinkEventDefinition")?T(t,e,n,r):No(i,"bpmn:ErrorEventDefinition")?R(t,e,n,r):No(i,"bpmn:CancelEventDefinition")?D(t,e,n,r):No(i,"bpmn:CompensateEventDefinition")?B(t,e,n,r):No(i,"bpmn:TerminateEventDefinition")?j(t,e,n,r):null}var F={ParticipantMultiplicityMarker:function(e,t,n={}){var r=Fo(t,n),o=Ho(t,n);k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},SubProcessMarker:function(e,t,n={}){Si(x(e,14,14,0,{strokeWidth:1,fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)}),t.width/2-7.5,t.height-20),k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},ParallelMarker:function(e,t,n){var r=Fo(t,n),o=Ho(t,n);k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},SequentialMarker:function(e,t,n){k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},CompensationMarker:function(e,t,n){k("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:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})},LoopMarker:function(e,t,n){var r=Fo(t,n),o=Ho(t,n);k("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:Io(t,l,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=Fo(t,n),o=Ho(t,n);k("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:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke)})}};function H(e,t,n,i){F[e](t,n,i)}function V(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:Fo(t,i),height:Ho(t,i)};var r=no(t),o=n&&n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},y(n,(function(n){H(n,e,t,i)})),r.get("isForCompensation")&&H("CompensationMarker",e,t,i),eo(r,"bpmn:AdHocSubProcess")&&H("AdhocMarker",e,t,i);var s=r.get("loopCharacteristics"),a=s&&s.get("isSequential");s&&(void 0===a&&H("LoopMarker",e,t,i),!1===a&&H("ParallelMarker",e,t,i),!0===a&&H("SequentialMarker",e,t,i))}function q(e,t,n={}){n=z({size:{width:100}},n);var i=o.createText(t||"",n);return _e(i).add("djs-label"),ge(e,i),i}function W(e,t,n,i={}){var r=no(t),o=$o({x:t.x,y:t.y,width:t.width,height:t.height},i);return q(e,r.name,{align:n,box:o,padding:7,style:{fill:jo(t,c,l,i.stroke)}})}function Q(e,t,n,i={}){var r=_o(n),o=q(e,t,{box:{height:30,width:r?Ho(n,i):Fo(n,i)},align:"center-middle",style:{fill:jo(n,c,l,i.stroke)}});r&&Oi(o,0,-(-1*Ho(n,i)),270)}function X(e,t,n={}){var{width:i,height:r}=$o(t,n);return x(e,i,r,10,{...n,fill:zo(t,a,n.fill),fillOpacity:qo,stroke:Io(t,l,n.stroke)})}function G(e,t,n={}){var i=no(t),r=zo(t,a,n.fill),o=Io(t,l,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=v("association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=v("association-start",r,o)),n=Qo(n,["markerStart","markerEnd"]),_(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function U(e,t,n={}){var r=zo(t,a,n.fill),o=Io(t,l,n.stroke),s=E(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:qo,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(no(t))&&E(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 s}function Y(e,t,n={}){return b(e,t.width,t.height,{fillOpacity:qo,...n,fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)})}function K(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,s=[{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=d(i);var a=Me("polygon",{...i,points:s});return ge(e,a),a}(e,t.width,t.height,{fill:zo(t,a,n.fill),fillOpacity:qo,stroke:Io(t,l,n.stroke)})}function Z(e,t,n={}){var i=x(e,Fo(t,n),Ho(t,n),0,{fill:zo(t,a,n.fill),fillOpacity:n.fillOpacity||qo,stroke:Io(t,l,n.stroke),strokeWidth:1.5}),r=no(t);eo(r,"bpmn:Lane")&&Q(e,r.get("name"),t,n);return i}function J(e,t,n={}){var i=X(e,t,n);ko(t)&&xe(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=wo(t);return W(e,t,r?"center-top":"center-middle",n),V(e,t,r?void 0:["SubProcessMarker"],n),i}function ee(e,t,n={}){var i=X(e,t,n);return W(e,t,"center-middle",n),V(e,t,void 0,n),i}var te=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return J(e,t,n=wo(t)?Qo(n,["fill","stroke","width","height"]):Qo(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return G(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]);var r=no(t).get("cancelActivity");n={strokeWidth:1.5,fill:zo(t,a,n.fill),fillOpacity:1,stroke:Io(t,l,n.stroke)},r||(n.strokeDasharray="6");var o=Y(e,t,n);return b(e,t.width,t.height,3,{...n,fill:"none"}),i&&$(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return xe(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),xe(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),J(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=K(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return E(e,r,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),G(e,t,{...n,markerEnd:v("association-end",zo(t,a,n.fill),Io(t,l,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return U(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:DataObjectReference":S("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return E(e,r,{strokeWidth:1,fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),G(e,t,{...n,markerEnd:v("association-end",zo(t,a,n.fill),Io(t,l,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=Qo(n,["fill","stroke"]),E(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:zo(t,a,n.fill),fillOpacity:qo,stroke:Io(t,l,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]);var r=Y(e,t,{...n,strokeWidth:4});return i&&$(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=no(t),o=K(e,t,n);b(e,t.width,t.height,.2*t.height,{fill:zo(t,"none",n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1});var s=r.get("eventGatewayType"),a=!!r.get("instantiate");if("Parallel"===s){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});E(e,c,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:1})}else"Exclusive"===s&&(a||b(e,t.width,t.height,.26*t.height,{fill:"none",stroke:Io(t,l,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}});E(e,r,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=K(e,t,n=Qo(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return io(t).get("isMarkerVisible")&&E(e,o,{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return K(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=Qo(n,["fill","stroke","width","height"]),x(e,t.width,t.height,10,{stroke:Io(t,l,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Fo(t,n),height:Ho(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=K(e,t,n=Qo(n,["fill","stroke"]));return b(e,t.width,t.height,.24*t.height,{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]);var r=Y(e,t,{...n,strokeWidth:1.5});return b(e,t.width,t.height,3,{fill:"none",stroke:Io(t,l,n.stroke),strokeWidth:1.5}),i&&$(t,e,n),r},"bpmn:IntermediateCatchEvent":S("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":S("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=Qo(n,["fill","stroke","width","height"]),Z(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r=no(t),o=io(t),s=zo(t,a,n.fill),c=Io(t,l,n.stroke),h=_(e,t.waypoints,{markerEnd:v("messageflow-end",s,c),markerStart:v("messageflow-start",s,c),stroke:c,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=h.getPointAtLength(h.getTotalLength()/2),p=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),d={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(d.fill=s,d.stroke=c):(d.fill=c,d.stroke=s);var f=E(e,p,d),m=q(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:c}}),g=f.getBBox(),y=m.getBBox();Oi(m,u.x-y.width/2,u.y+g.height/2+10,0)}return h},"bpmn:ParallelGateway":function(e,t,n={}){var r=K(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=Z(e,t,n=Qo(n,["fill","stroke","width","height"])),r=wo(t),o=_o(t),s=no(t),a=s.get("name");if(r){w(e,o?[{x:30,y:0},{x:30,y:Ho(t,n)}]:[{x:0,y:30},{x:Fo(t,n),y:30}],{stroke:Io(t,l,n.stroke),strokeWidth:1.5}),Q(e,a,t,n)}else{var h=$o(t,n);o||(h.height=Fo(t,n),h.width=Ho(t,n));var u=q(e,a,{box:h,align:"center-middle",style:{fill:jo(t,c,l,n.stroke)}});if(!o)Oi(u,0,-(-1*Ho(t,n)),270)}return s.get("participantMultiplicity")&&H("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var r,o=no(t),s=ee(e,t,n);return o.get("instantiate")?(b(e,28,28,4.4,{fill:zo(t,a,n.fill),stroke:Io(t,l,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}}),E(e,r,{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),s},"bpmn:ScriptTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:Io(t,l,n.stroke),stroke:zo(t,a,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=Qo(n,["fill","stroke"]);var i=zo(t,a,n.fill),r=Io(t,l,n.stroke),o=_(e,t.waypoints,{markerEnd:v("sequenceflow-end",i,r),stroke:r}),s=no(t),{source:c}=t;if(c){var h=no(c);s.get("conditionExpression")&&eo(h,"bpmn:Activity")&&xe(o,{markerStart:v("conditional-flow-marker",i,r)}),h.get("default")&&(eo(h,"bpmn:Gateway")||eo(h,"bpmn:Activity"))&&h.get("default")===s&&xe(o,{markerStart:v("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return b(e,10,10,{fill:zo(t,a,n.fill),stroke:"none",transform:"translate(6, 6)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),b(e,10,10,{fill:zo(t,a,n.fill),stroke:"none",transform:"translate(11, 10)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Qo(n,["fill","stroke"]),no(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=Y(e,t,n);return i&&$(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return J(e,t,n=wo(t)?Qo(n,["fill","stroke","width","height"]):Qo(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return ee(e,t,n=Qo(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=Qo(n,["fill","stroke","width","height"]);var{width:r,height:o}=$o(t,n),s=x(e,r,o,0,0,{fill:"none",stroke:"none"});return E(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:Io(t,l,n.stroke)}),q(e,no(t).get("text")||"",{align:"left-top",box:$o(t,n),padding:7,style:{fill:jo(t,c,l,n.stroke)}}),s},"bpmn:Transaction":function(e,t,i={}){i=wo(t)?Qo(i,["fill","stroke","width","height"]):Qo(i,["fill","stroke"]);var r=J(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:Io(t,l,i.stroke),strokeWidth:1.5});return wo(t)||(i={}),x(e,Fo(t,i),Ho(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=ee(e,t,n=Qo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:zo(t,a,n.fill),stroke:Io(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:Io(t,l,n.stroke),stroke:Io(t,l,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return q(e,Do(t),{box:i,fitBox:!0,style:z({},o.getExternalStyle(),{fill:jo(t,c,l,n.stroke)})})}(e,t,n)}};this._drawPath=E,this._renderer=O}function Qo(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(Wo,tt),Wo.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Wo.prototype.canRender=function(e){return eo(e,"bpmn:BaseElement")},Wo.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Wo.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Wo.prototype.getShapePath=function(e){return eo(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,nt([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):eo(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return nt([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):eo(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return nt([["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 nt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var Xo=0,Go={width:150,height:50};function Uo(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function Yo(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=Uo(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return Ko(e,o,r,i);o=Jo(o,i.width,t)}}function Ko(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 Zo="­";function Jo(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!==Zo||r.pop();break}r.push(n),o+=n.length}var s=r[r.length-1];return s&&s===Zo&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function es(e){this._config=z({},{size:Go,padding:Xo,style:{},align:"center-top"},e||{})}es.prototype.createText=function(e,t){return this.layoutText(e,t).element},es.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},es.prototype.layoutText=function(e,t){var n=z({},this._config.size,t.box),i=z({},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 h(e)?z({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),s=t.fitBox||!1,a=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),l=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,p=Me("text");for(xe(p,{x:0,y:0}),xe(p,i),ge(function(){var e=document.getElementById("helper-svg");return e||(xe(e=Me("svg"),{id:"helper-svg"}),Ct(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),p);l.length;)c.push(Yo(l,u,p));"middle"===r.vertical&&(o.top=o.bottom=0);var d=x(c,(function(e,t,n){return e+(a||t.height)}),0)+o.top+o.bottom,f=x(c,(function(e,t,n){return t.width>e?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-d)/2),m-=(a||c[0].height)/4;var g=Me("text");return xe(g,i),y(c,(function(e){var t;switch(m+=a||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?f:u)-o.right-e.width;break;default:t=Math.max(((s?f:u)-e.width)/2+o.left,0)}var n=Me("tspan");xe(n,{x:t,y:m}),n.textContent=e.text,ge(g,n)})),ke(p),{dimensions:{width:f,height:d},element:g}};function ts(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new es({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}ts.$inject=["config.textRenderer"];var ns=/\{([^{}]+)\}/g,is=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var rs={__init__:["bpmnRenderer"],bpmnRenderer:["type",Wo],textRenderer:["type",ts],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var s=t.containerHeight/r.height*t.yScaleFactor,a=t.containerWidth/r.width*t.xScaleFactor,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*s;for(var c=0;c<r.widthElements.length;c++)o["x"+c]=r.widthElements[c]*a}var h,u,p=(h=r.d,u={mx:n,my:i,e:o},String(h).replace(ns,(function(e,t){return function(e,t,n){var i=n;return t.replace(is,(function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?e:i)+""}(e,t,u)})));return p}}]};var os={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function ss(e,t,n){return z({id:e.id,type:e.$type,businessObject:e,di:t},n)}function as(e,t,n){var i=e.waypoint;return!i||i.length<2?[Un(t),Un(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function ls(e,t,n){return new Error(`element ${Ur(t)} referenced by ${Ur(e)}#${n} not yet drawn`)}function cs(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}cs.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],cs.prototype.add=function(e,t,n){var i,r,o;if(eo(t,"bpmndi:BPMNPlane")){var s=eo(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(ss(e,t,s)),this._canvas.addRootElement(i)}else if(eo(t,"bpmndi:BPMNShape")){var a=!wo(e,t),l=function(e){return eo(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var c=t.bounds;i=this._elementFactory.createShape(ss(e,t,{collapsed:a,hidden:r,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height),isFrame:l})),eo(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),eo(e,"bpmn:Lane")&&(o=0),eo(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,Un(c))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!eo(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${Ur(t)} for element ${Ur(e)}`);var h=this._getSource(e),u=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(ss(e,t,{hidden:r,source:h,target:u,waypoints:as(t,h,u)})),eo(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Po(e)&&Do(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},cs.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Ur(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw ls(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},cs.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(So.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=To(t),i=So),z({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=Do(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(ss(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Do(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},cs.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?ls(e,i,t+"Ref"):new Error(`${Ur(e)}#${t} Ref not specified`)},cs.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},cs.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},cs.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var hs={__depends__:[rs,{__depends__:[os],bpmnImporter:["type",cs]}]};function us(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}us.prototype.next=function(){return this._prefix+ ++this._counter};var ps=new us("ov");function ds(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=ps,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),Ct(o=Ut('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function fs(e,t,n){Ct(e,{left:t+"px",top:n+"px"})}function ms(e,t){e.style.display=!1===t?"none":""}function gs(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}ds.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ds.prototype.get=function(e){if(d(e)&&(e={id:e}),d(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?v(t.overlays,M({type:e.type})):t.overlays.slice():[]}return e.type?v(this._overlays,M({type:e.type})):e.id?this._overlays[e.id]:null},ds.prototype.add=function(e,t,n){if(h(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ds.prototype.remove=function(e){var t=this.get(e)||[];c(t)||(t=[t]);var n=this;y(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Zt(e.html),Zt(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}}))},ds.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},ds.prototype.show=function(){ms(this._overlayRoot)},ds.prototype.hide=function(){ms(this._overlayRoot,!1)},ds.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Rt(this._overlayRoot)},ds.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=ft(t);i=o.x,r=o.y}fs(n,i,r),Pt(e.html,"data-container-id",t.id)},ds.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,s=i.left,a=i.top;void 0!==i.right&&(t=o.waypoints?ft(o).width:o.width,s=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?ft(o).height:o.height,a=-1*i.bottom+n);fs(r,s||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ds.prototype._createOverlayContainer=function(e){var t=Ut('<div class="djs-overlays" />');Ct(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ds.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";gs(this._overlayRoot,n)},ds.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},ds.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),d(o)&&(o=Ut(o)),n=this._getOverlayContainer(r),Ct(t=Ut('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&Mt(t).add("djs-overlay-"+e.type),ms(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ds.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,l=!0;(i!==this._canvas.getRootElement()||n&&(a(r)&&r>t.scale||a(o)&&o<t.scale))&&(l=!1),ms(s,l),this._updateOverlayScale(e,t)},ds.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,s=e.htmlContainer,l="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),a(n)&&t.scale<n&&(r=(1/t.scale||1)*n),a(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),a(r)&&(l="scale("+r+","+r+")"),gs(s,l)},ds.prototype._updateOverlaysVisibilty=function(e){var t=this;y(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},ds.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element;y(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Zt(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}})),e.on("element.changed",500,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(y(i.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(i))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&Mt(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var vs={__init__:["overlays"],overlays:["type",ds]};function ys(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(mt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}ys.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var bs={__init__:["changeSupport"],changeSupport:["type",ys]};function xs(e){this._eventBus=e}function ws(e){return function(t,n,i,r,o){(p(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function _s(e,t){t.invoke(xs,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}xs.$inject=["eventBus"],xs.prototype.on=function(e,t,n,i,r,o){if((p(t)||u(t))&&(o=r,r=i,i=n,n=t,t=null),p(n)&&(o=r,r=i,i=n,n=1e3),h(r)&&(o=r,r=!1),!p(i))throw new Error("handlerFn must be a function");c(e)||(e=[e]);var s=this._eventBus;y(e,(function(e){var a=["commandStack",e,t].filter((function(e){return e})).join(".");s.on(a,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))},xs.prototype.canExecute=ws("canExecute"),xs.prototype.preExecute=ws("preExecute"),xs.prototype.preExecuted=ws("preExecuted"),xs.prototype.execute=ws("execute"),xs.prototype.executed=ws("executed"),xs.prototype.postExecute=ws("postExecute"),xs.prototype.postExecuted=ws("postExecuted"),xs.prototype.revert=ws("revert"),xs.prototype.reverted=ws("reverted"),e(_s,xs),_s.$inject=["canvas","injector"];var Es={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",_s]};function ks(e){return CSS.escape(e)}var Os={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ss(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return Os[e]}))}var Cs="_plane";function Ps(e){return function(e){return e.replace(new RegExp(Cs+"$"),"")}(e.id)}function As(e){var t=e.id;return eo(e,"bpmn:SubProcess")?Rs(t):t}function Ms(e){return Rs(e)}function Ts(e){return eo(io(e),"bpmndi:BPMNPlane")}function Rs(e){return e+Cs}function Ds(e,t,n){var i=de('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Y(r);r.appendChild(i);var s=[];function a(e){e&&(s=function(e){for(var t=no(e),n=[],i=t;i;i=i.$parent)(eo(i,"bpmn:SubProcess")||eo(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=s.map((function(e){var i=Ss(e.name||e.id),r=de('<li><span class="bjs-crumb"><a title="'+i+'">'+i+"</a></span></li>"),o=n.findRoot(As(e))||n.findRoot(e.id);if(!o&&eo(e,"bpmn:Process")){var s=t.find((function(t){var n=no(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(s.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));i.innerHTML="";var a=r.length>1;o.toggle("bjs-breadcrumbs-shown",a),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=no(e.element);m(s,(function(e){return e===t}))&&a()})),e.on("root.set",(function(e){a(e.element)}))}function Bs(e,t){var n=null,i=new Ls;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),s=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!eo(r,"bpmn:Collaboration")||s){s=s||{x:0,y:0,zoom:1};var a=(o.x-s.x)*o.scale,l=(o.y-s.y)*o.scale;0===a&&0===l||t.scroll({dx:a,dy:l}),s.zoom!==o.scale&&t.zoom(s.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function Ls(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}Ds.$inject=["eventBus","elementRegistry","canvas"],Bs.$inject=["eventBus","canvas"];var Ns=180,zs=160;function Is(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n._handleImport(t.definitions)}))}function js(e){return eo(e,"bpmndi:BPMNDiagram")?e:js(e.$parent)}Is.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},Is.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;eo(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!eo(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(to(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}})),r},Is.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=Qn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),Xn(t)}(e),i=n.x-Ns,r=n.y-zs;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},Is.prototype._moveToDiPlane=function(e,t){var n=js(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Is.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Is.$inject=["eventBus","moddle"];var $s=250;function Fs(e,t,n,i){xs.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",$s,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",$s,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],$s,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],$s,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r._canDrillDown(e)})).map((function(e){r._addOverlay(e)}))}))}e(Fs,xs),Fs.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Fs.prototype._canDrillDown=function(e){var t=this._canvas;return eo(e,"bpmn:SubProcess")&&t.findRoot(As(e))},Fs.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=no(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Y(i.html).toggle("bjs-drilldown-empty",!r)}},Fs.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=de('<button class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(As(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Fs.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Fs.$inject=["canvas","eventBus","elementRegistry","overlays"];var Hs={__depends__:[vs,bs,Es],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ds],drilldownCentering:["type",Bs],drilldownOverlayBehavior:["type",Fs],subprocessCompatibility:["type",Is]};function Vs(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=Me("rect");return xe(t,z({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=Yt(".djs-outline",n);o||ge(n,o=i.getOutline(t)||r()),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=Yt(".djs-outline",n);o||ge(n,o=r()),i.updateConnectionOutline(o,t)}))}Vs.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&y(i,(function(i){n=n||i.updateOutline(t,e)})),n||xe(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Vs.prototype.updateConnectionOutline=function(e,t){var n=ft(t);xe(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Vs.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},Vs.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Vs.prototype.getOutline=function(e){var t;return y(this._getProviders(),(function(n){p(n.getOutline)&&(t=t||n.getOutline(e))})),t},Vs.$inject=["eventBus","styles","elementRegistry"];var qs={__init__:["outline"],outline:["type",Vs]};const Ws={width:36,height:50},Qs={width:50,height:50};function Xs(e,t,n){return Me("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function Gs(e,t){this._styles=t,e.registerProvider(this)}function Us(e,t){var n;return"bpmn:DataObjectReference"===t?n=Ws:"bpmn:DataStoreReference"===t&&(n=Qs),e.width===n.width&&e.height===n.height}Gs.$inject=["outline","styles"],Gs.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!Vn(e))return eo(e,"bpmn:Gateway")?(z((n=Me("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),xe(n,z({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):to(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group"])?xe(n=Me("rect"),z({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t)):eo(e,"bpmn:EndEvent")?xe(n=Me("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t)):eo(e,"bpmn:Event")?xe(n=Me("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t)):eo(e,"bpmn:DataObjectReference")&&Us(e,"bpmn:DataObjectReference")?n=Xs("M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",{x:-6,y:-6},t):eo(e,"bpmn:DataStoreReference")&&Us(e,"bpmn:DataStoreReference")&&(n=Xs("M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",{x:-6,y:-6},t)),n},Gs.prototype.updateOutline=function(e,t){if(!Vn(e))return to(e,["bpmn:SubProcess","bpmn:Group"])?(xe(t,{width:e.width+10,height:e.height+10}),!0):!!to(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};var Ys={__depends__:[qs],__init__:["outlineProvider"],outlineProvider:["type",Gs]};function Ks(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Zs(e){return e.originalEvent||e.srcEvent}function Js(e){Ks(e),Ks(Zs(e))}function ea(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function ta(){return/mac/i.test(navigator.platform)}function na(e,t){return(Zs(e)||e).button===t}function ia(e){return na(e,0)}function ra(e){var t=Zs(e)||e;return!!ia(e)&&(ta()?t.metaKey:t.ctrlKey)}function oa(e){var t=Zs(e)||e;return ia(e)&&t.shiftKey}function sa(e){return!0}function aa(e){return ia(e)||function(e){return na(e,1)}(e)}function la(e,t,n){var i=this;function r(n,i,r){var o,s;(function(e,t){var n=l[e]||ia;return!n(t)})(n,i)||(r?s=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(s=o,r=t.get(s)),s&&r&&!1===e.fire(n,{element:r,gfx:s,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function s(e){return o[e]}var a={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":sa,"element.mousedown":aa,"element.mouseup":aa,"element.click":aa,"element.dblclick":aa};var c="svg, .djs-element";function h(e,t,n,i){var s=o[n]=function(e){r(n,e)};i&&(l[n]=i),s.$delegate=Wt.bind(e,c,t,s)}function u(e,t,n){var i=s(n);i&&Wt.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){!function(e){y(a,(function(t,n){u(e,n,t)}))}(e.svg)})),e.on("canvas.init",(function(e){!function(e){y(a,(function(t,n){h(e,n,t)}))}(e.svg)})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var p=m("djs-hit djs-hit-stroke"),d=m("djs-hit djs-hit-click-stroke"),f={all:m("djs-hit djs-hit-all"),"click-stroke":d,stroke:p,"no-move":m("djs-hit djs-hit-no-move")};function m(e,t){return t=z({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function g(e,t){var n=f[t];if(!n)throw new Error("invalid hit type <"+t+">");return xe(e,n),e}function v(e,t){ge(e,t)}this.removeHits=function(e){y(Kt(".djs-hit",e),ke)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=at(t);return g(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=z({x:0,y:0},n);var i=Me("rect");return g(i,t),xe(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=Yt(".djs-hit",t);if(n)return e.waypoints?lt(n,e.waypoints):xe(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=a[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=s,this.registerEvent=h,this.unregisterEvent=u}la.$inject=["eventBus","elementRegistry","styles"];var ca={__init__:["interactionEvents"],interactionEvents:["type",la]};function ha(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}ha.$inject=["eventBus","canvas"],ha.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},ha.prototype.get=function(){return this._selectedElements},ha.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},ha.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();c(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?y(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var ua="hover",pa="selected";function da(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,ua)})),t.on("element.out",(function(e){o(e.element,ua)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;y(t,(function(e){-1===n.indexOf(e)&&function(e){o(e,pa)}(e)})),y(n,(function(e){-1===t.indexOf(e)&&function(e){r(e,pa)}(e)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function fa(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;c(o)?t.select(o):t.select(r.filter(ma))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);m(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(ia(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,s=oa(e);if(r&&o)return s?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,s)}}))}function ma(e){return!e.hidden}da.$inject=["canvas","eventBus","selection"],da.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Oe(t);var n=e.length>1;if(_e(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(ft(e)),r=Me("rect");xe(r,z({rx:3},i)),_e(r).add("djs-selection-outline"),ge(t,r)}},fa.$inject=["eventBus","selection","canvas","elementRegistry"];var ga={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ca,qs],selection:["type",ha],selectionVisuals:["type",da],selectionBehavior:["type",fa]};function va(e){go.call(this,e)}e(va,go),va.prototype._modules=[hs,Hs,Ys,vs,ga,os],va.prototype._moddleExtensions={};var ya=["c","C"],ba=["v","V"],xa=["y","Y"],wa=["z","Z"];function _a(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Ea(e,t){return-1!==(e=c(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function ka(e){return e.shiftKey}function Oa(e){return _a(e)&&!ka(e)&&Ea(wa,e)}function Sa(e){return _a(e)&&(Ea(xa,e)||Ea(wa,e)&&ka(e))}var Ca="keyboard.keydown",Pa="input-handle-modified-keys";function Aa(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}Aa.$inject=["config.keyboard","eventBus"],Aa.prototype._keydownHandler=function(e){this._keyHandler(e,Ca)},Aa.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Aa.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ca,n)&&e.preventDefault()}},Aa.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||((t=e.target)&&(Dt(t,"input, textarea")||"true"===t.contentEditable)||function(e){return e&&Dt(e,"button, input[type=submit], input[type=button], a[href], [aria-role=button]")}(e.target)&&Ea([" ","Enter"],e))&&this._isModifiedKeyIgnored(e);var t},Aa.prototype._isModifiedKeyIgnored=function(e){return!_a(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},Aa.prototype._getAllowedModifiers=function(e){var t=Bt(e,"["+Pa+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Pa).split(",")},Aa.prototype.bind=function(e){this.unbind(),this._node=e,Ht.bind(e,"keydown",this._keydownHandler),Ht.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Aa.prototype.getBinding=function(){return this._node},Aa.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Ht.unbind(e,"keydown",this._keydownHandler),Ht.unbind(e,"keyup",this._keyupHandler)),this._node=null},Aa.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Aa.prototype.addListener=function(e,t,n){p(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ca,e,t)},Aa.prototype.removeListener=function(e,t){this._eventBus.off(t||Ca,e)},Aa.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Aa.prototype.isCmd=_a,Aa.prototype.isShift=ka,Aa.prototype.isKey=Ea;var Ma=500;function Ta(e,t){var n=this;e.on("editorActions.init",Ma,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}Ta.$inject=["eventBus","keyboard"],Ta.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(Oa(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(Sa(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return _a(e)&&Ea(ya,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return _a(e)&&Ea(ba,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ea(["+","Add","="],n)&&_a(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ea(["-","Subtract"],n)&&_a(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Ea("0",n)&&_a(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Ea(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Ra={__init__:["keyboard","keyboardBindings"],keyboard:["type",Aa],keyboardBindings:["type",Ta]},Da={moveSpeed:50,moveSpeedAccelerated:200};function Ba(e,t,n){var i=this;this._config=z({},Da,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,s=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:s,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Ba.$inject=["config.keyboardMove","keyboard","canvas"];var La={__depends__:[Ra],__init__:["keyboardMove"],keyboardMove:["type",Ba]},Na=/^djs-cursor-.*$/;function za(e){var t=Mt(document.body);t.removeMatching(Na),e&&t.add("djs-cursor-"+e)}function Ia(){za(null)}var ja=5e3;function $a(e,t){function n(){return!1}return t=t||"element.click",e.once(t,ja,n),function(){e.off(t,n)}}function Fa(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Ha(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Va(e,t){var n;function i(i){var r,o=n.start,s=n.button,a=ea(i),l=Ha(a,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===s&&$a(e),za("grab")),n.dragging)&&(l=Ha(a,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=a);i.preventDefault()}function r(e){Ht.unbind(document,"mousemove",i),Ht.unbind(document,"mouseup",r),n=null,Ia()}e.on("element.mousedown",500,(function(e){return function(e){if(Bt(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:ea(e)},Ht.bind(document,"mousemove",i),Ht.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Va.$inject=["eventBus","canvas"];var qa={__init__:["moveCanvas"],moveCanvas:["type",Va]};function Wa(e){return Math.log(e)/Math.log(10)}function Qa(e,t){var n=Wa(e.min),i=Wa(e.max);return(Math.abs(n)+Math.abs(i))/t}var Xa=Math.sign||function(e){return e>=0?1:-1},Ga={min:.2,max:4};function Ua(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=N(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}Ua.$inject=["config.zoomScroll","eventBus","canvas"],Ua.prototype.scroll=function(e){this._canvas.scroll(e)},Ua.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Ua.prototype.zoom=function(e,t){var n=Qa(Ga,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Ua.prototype._handleWheel=function(e){if(!Bt(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||ta()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var s=t.getBoundingClientRect(),a={x:e.clientX-s.left,y:e.clientY-s.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Xa(e.deltaY)*o,this.zoom(n,a)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},Ua.prototype.stepZoom=function(e,t){var n=Qa(Ga,10);this._zoom(e,t,n)},Ua.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Wa(i.zoom()),s=Math.round(o/n)*n;s+=n*r;var a,l,c=Math.pow(10,s);i.zoom((a=Ga,l=c,Math.max(a.min,Math.min(a.max,l))),t)},Ua.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Ht[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Ua.prototype._init=function(e){this.toggle(e)};var Ya={__init__:["zoomScroll"],zoomScroll:["type",Ua]};function Ka(e){va.call(this,e)}function Za(e){return e&&e[e.length-1]}function Ja(e){return e.y}function el(e){return e.x}e(Ka,va),Ka.prototype._navigationModules=[La,qa,Ya],Ka.prototype._modules=[].concat(va.prototype._modules,Ka.prototype._navigationModules);var tl={left:el,center:el,right:function(e){return e.x+e.width},top:Ja,middle:Ja,bottom:function(e){return e.y+e.height}};function nl(e,t){this._modeling=e,this._rules=t}nl.$inject=["modeling","rules"],nl.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},nl.prototype._isType=function(e,t){return-1!==t.indexOf(e)},nl.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),s=o.axis,a=o.dimension,l={},c={},h=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))r=Za(t),l[e]=r[s]+r[a];else if(this._isType(e,["center","middle"])){if(y(t,(function(e){var t=e[s]+Math.round(e[a]/2);c[t]?c[t].elements.push(e):c[t]={elements:[e],center:t}})),n=A(c,(function(e){return e.elements.length>1&&(h=!0),e.elements.length})),h)return l[e]=Za(n).center,l;i=t[0],r=Za(t=A(t,(function(e){return e[s]+e[a]}))),l[e]=function(e,t){return Math.round((e[s]+t[s]+t[a])/2)}(i,r)}return l},nl.prototype.trigger=function(e,t){var n,i=this._modeling,r=v(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(c(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=A(r,tl[t]),s=this._alignmentPosition(t,o);i.alignElements(o,s)}};var il={__init__:["alignElements"],alignElements:["type",nl]},rl=".entry";function ol(e,t,n){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._current=null,this._init()}function sl(e,t){return-1!==e.indexOf(t)}ol.$inject=["canvas","elementRegistry","eventBus"],ol.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,i=e._current;if(i){var{target:r}=i,o=c(r)?r:[r];if(o.filter((function(e){return sl(n,e)})).length){e.close();var s=o.filter((function(t){return e._elementRegistry.get(t.id)}));s.length&&e._updateAndOpen(s.length>1?s:s[0])}}})),this._eventBus.on("canvas.viewbox.changed",(()=>{this._updatePosition()})),this._eventBus.on("element.marker.update",(function(t){e._updateVisibility()})),this._container=this._createContainer()},ol.prototype._createContainer=function(){const e=Ut('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},ol.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},ol.prototype.getEntries=function(e){var t=this._getProviders(),n=c(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return y(t,(function(t){if(p(t[n])){var r=t[n](e);p(r)?i=r(i):y(r,(function(e,t){i[t]=e}))}})),i},ol.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=Pt(o,"data-action"),r=t.originalEvent||t,"mouseover"!==e?"mouseout"===e?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(i,e,r,n):void(this._timeout=setTimeout((()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)}),300))):t.preventDefault()},ol.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var s=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(p(s)){if("click"===t)return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},ol.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},ol.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ol.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this._createHtml(e);y(n,(function(e,n){var r,o=e.group||"default",s=Ut(e.html||'<div class="entry" draggable="true"></div>');Pt(s,"data-action",n),(r=Yt("[data-group="+ks(o)+"]",i))||(Pt(r=Ut('<div class="group"></div>'),"data-group",o),i.appendChild(r)),r.appendChild(s),e.className&&function(e,t){var n=Mt(e);(t=c(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(s,e.className),e.title&&Pt(s,"title",e.title),e.imageUrl&&(Pt(t=Ut("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",s.appendChild(t))})),Mt(i).add("open"),this._current={entries:n,html:i,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},ol.prototype._createHtml=function(e){var t=this,n=Ut('<div class="djs-context-pad"></div>');return Wt.bind(n,rl,"click",(function(e){t.trigger("click",e)})),Wt.bind(n,rl,"dragstart",(function(e){t.trigger("dragstart",e)})),Wt.bind(n,rl,"mouseover",(function(e){t.trigger("mouseover",e)})),Wt.bind(n,rl,"mouseout",(function(e){t.trigger("mouseout",e)})),Ht.bind(n,"mousedown",(function(e){e.stopPropagation()})),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},ol.prototype.getPad=function(e){let t;return console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888")),t=this.isOpen()&&function(e,t){return e=c(e)?e:[e],t=c(t)?t:[t],e.length===t.length&&w(e,(function(e){return t.includes(e)}))}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},ol.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ol.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return c(e)===c(n)&&(c(e)?e.length===n.length&&w(e,(function(e){return sl(n,e)})):n===e)},ol.prototype.isShown=function(){return this.isOpen()&&Mt(this._current.html).has("open")},ol.prototype.show=function(){this.isOpen()&&(Mt(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},ol.prototype.hide=function(){this.isOpen()&&(Mt(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},ol.prototype._getPosition=function(e){if(!c(e)&&Hn(e)){const n=this._canvas.viewbox(),i=(t=e).waypoints[t.waypoints.length-1],r=i.x*n.scale-n.x*n.scale,o=i.y*n.scale-n.y*n.scale;return{left:r+8*this._canvas.zoom(),top:o}}var t,n=this._canvas.getContainer().getBoundingClientRect(),i=this._getTargetBounds(e);return{left:i.right-n.left+8*this._canvas.zoom(),top:i.top-n.top}},ol.prototype._updatePosition=function(){if(this.isOpen()){var e=this._current.html,t=this._getPosition(this._current.target);"x"in t&&"y"in t?(e.style.left=t.x+"px",e.style.top=t.y+"px"):["top","right","bottom","left"].forEach((function(n){n in t&&(e.style[n]=t[n]+"px")}))}},ol.prototype._updateVisibility=function(){if(this.isOpen()){var e=this,t=this._current.target;(c(t)?t:[t]).some((function(t){return e._canvas.hasMarker(t,"djs-element-hidden")}))?e.hide():e.show()}},ol.prototype._getTargetBounds=function(e){return(c(e)?e:[e]).map((e=>this._canvas.getGraphics(e))).reduce(((e,t)=>{const n=t.getBoundingClientRect();return e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom),e.left=Math.min(e.left,n.left),e.x=e.left,e.y=e.top,e.width=e.right-e.left,e.height=e.bottom-e.top,e}),{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};var al,ll,cl,hl,ul,pl={__depends__:[ca,vs],contextPad:["type",ol]},dl={},fl=[],ml=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function gl(e,t){for(var n in t)e[n]=t[n];return e}function vl(e){var t=e.parentNode;t&&t.removeChild(e)}function yl(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?al.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return bl(e,s,i,r,null)}function bl(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++cl:r};return null==r&&null!=ll.vnode&&ll.vnode(o),o}function xl(e){return e.children}function wl(e,t){this.props=e,this.context=t}function _l(e,t){if(null==t)return e.__?_l(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?_l(e):null}function El(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return El(e)}}function kl(e){(!e.__d&&(e.__d=!0)&&hl.push(e)&&!Ol.__r++||ul!==ll.debounceRendering)&&((ul=ll.debounceRendering)||setTimeout)(Ol)}function Ol(){for(var e;Ol.__r=hl.length;)e=hl.sort((function(e,t){return e.__v.__b-t.__v.__b})),hl=[],e.some((function(e){var t,n,i,r,o,s;e.__d&&(o=(r=(t=e).__v).__e,(s=t.__P)&&(n=[],(i=gl({},r)).__v=r.__v+1,Dl(s,r,i,t.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?_l(r):o,r.__h),Bl(n,r),r.__e!=o&&El(r)))}))}function Sl(e,t,n,i,r,o,s,a,l,c){var h,u,p,d,f,m,g,v=i&&i.__k||fl,y=v.length;for(n.__k=[],h=0;h<t.length;h++)if(null!=(d=n.__k[h]=null==(d=t[h])||"boolean"==typeof d?null:"string"==typeof d||"number"==typeof d||"bigint"==typeof d?bl(null,d,null,null,d):Array.isArray(d)?bl(xl,{children:d},null,null,null):d.__b>0?bl(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(p=v[h])||p&&d.key==p.key&&d.type===p.type)v[h]=void 0;else for(u=0;u<y;u++){if((p=v[u])&&d.key==p.key&&d.type===p.type){v[u]=void 0;break}p=null}Dl(e,d,p=p||dl,r,o,s,a,l,c),f=d.__e,(u=d.ref)&&p.ref!=u&&(g||(g=[]),p.ref&&g.push(p.ref,null,d),g.push(u,d.__c||f,d)),null!=f?(null==m&&(m=f),"function"==typeof d.type&&d.__k===p.__k?d.__d=l=Cl(d,l,e):l=Pl(e,d,p,v,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=_l(p))}for(n.__e=m,h=y;h--;)null!=v[h]&&Nl(v[h],v[h]);if(g)for(h=0;h<g.length;h++)Ll(g[h],g[++h],g[++h])}function Cl(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?Cl(i,t,n):Pl(n,i,i,r,i.__e,t));return t}function Pl(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=1)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function Al(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||ml.test(t)?n:n+"px"}function Ml(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Al(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Al(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?Rl:Tl,o):e.removeEventListener(t,o?Rl:Tl,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function Tl(e){this.l[e.type+!1](ll.event?ll.event(e):e)}function Rl(e){this.l[e.type+!0](ll.event?ll.event(e):e)}function Dl(e,t,n,i,r,o,s,a,l){var c,h,u,p,d,f,m,g,v,y,b,x,w,_,E,k=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=ll.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,v=(c=k.contextType)&&i[c.__c],y=c?v?v.props.value:c.__:i,n.__c?m=(h=t.__c=n.__c).__=h.__E:("prototype"in k&&k.prototype.render?t.__c=h=new k(g,y):(t.__c=h=new wl(g,y),h.constructor=k,h.render=zl),v&&v.sub(h),h.props=g,h.state||(h.state={}),h.context=y,h.__n=i,u=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=k.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=gl({},h.__s)),gl(h.__s,k.getDerivedStateFromProps(g,h.__s))),p=h.props,d=h.state,u)null==k.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,y),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,y)||t.__v===n.__v){for(h.props=g,h.state=h.__s,t.__v!==n.__v&&(h.__d=!1),h.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<h._sb.length;b++)h.__h.push(h._sb[b]);h._sb=[],h.__h.length&&s.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,y),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,d,f)}))}if(h.context=y,h.props=g,h.__v=t,h.__P=e,x=ll.__r,w=0,"prototype"in k&&k.prototype.render){for(h.state=h.__s,h.__d=!1,x&&x(t),c=h.render(h.props,h.state,h.context),_=0;_<h._sb.length;_++)h.__h.push(h._sb[_]);h._sb=[]}else do{h.__d=!1,x&&x(t),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++w<25);h.state=h.__s,null!=h.getChildContext&&(i=gl(gl({},i),h.getChildContext())),u||null==h.getSnapshotBeforeUpdate||(f=h.getSnapshotBeforeUpdate(p,d)),E=null!=c&&c.type===xl&&null==c.key?c.props.children:c,Sl(e,Array.isArray(E)?E:[E],t,n,i,r,o,s,a,l),h.base=t.__e,t.__h=null,h.__h.length&&s.push(h),m&&(h.__E=h.__=null),h.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,o,s,a){var l,c,h,u=n.props,p=t.props,d=t.type,f=0;if("svg"===d&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!d&&(d?l.localName===d:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===d)return document.createTextNode(p);e=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,a=!1}if(null===d)u===p||a&&e.data===p||(e.data=p);else{if(o=o&&al.call(e.childNodes),c=(u=n.props||dl).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!a){if(null!=o)for(u={},f=0;f<e.attributes.length;f++)u[e.attributes[f].name]=e.attributes[f].value;(h||c)&&(h&&(c&&h.__html==c.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||Ml(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Ml(e,o,t[o],n[o],i)}(e,p,u,r,a),h)t.__k=[];else if(f=t.props.children,Sl(e,Array.isArray(f)?f:[f],t,n,i,r&&"foreignObject"!==d,o,s,o?o[0]:n.__k&&_l(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&vl(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==e.value||"progress"===d&&!f||"option"===d&&f!==u.value)&&Ml(e,"value",f,u.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&Ml(e,"checked",f,u.checked,!1))}return e}(n.__e,t,n,i,r,o,s,l);(c=ll.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),ll.__e(e,t,n)}}function Bl(e,t){ll.__c&&ll.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ll.__e(e,t.__v)}}))}function Ll(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){ll.__e(e,n)}}function Nl(e,t,n){var i,r;if(ll.unmount&&ll.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Ll(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ll.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Nl(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||vl(e.__e),e.__=e.__e=e.__d=void 0}function zl(e,t,n){return this.constructor(e,n)}function Il(e,t,n){var i,r,o;ll.__&&ll.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Dl(t,e=(!i&&n||t).__k=yl(xl,null,[e]),r||dl,dl,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?al.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Bl(o,e)}al=fl.slice,ll={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},cl=0,wl.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=gl({},this.state),"function"==typeof e&&(e=e(gl({},n),this.props)),e&&gl(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),kl(this))},wl.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),kl(this))},wl.prototype.render=xl,hl=[],Ol.__r=0;var jl=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var s=t[o++],a=t[o]?(t[0]|=s?1:2,n[t[o++]]):t[++o];3===s?i[0]=a:4===s?i[1]=Object.assign(i[1]||{},a):5===s?(i[1]=i[1]||{})[t[++o]]=a:6===s?i[1][t[++o]]+=a+"":s?(r=e.apply(a,jl(e,a,n,["",null])),i.push(r),a[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(a)}return i},$l=new Map;var Fl,Hl,Vl,ql,Wl=function(e){var t=$l.get(this);return t||(t=new Map,$l.set(this,t)),(t=jl(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,i=1,r="",o="",s=[0],a=function(e){1===i&&(e||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(0,e,r):3===i&&(e||r)?(s.push(3,e,r),i=2):2===i&&"..."===r&&e?s.push(4,e,0):2===i&&r&&!e?s.push(5,0,!0,r):i>=5&&((r||!e&&5===i)&&(s.push(i,0,r,n),i=6),e&&(s.push(i,e,0,n),i=6)),r=""},l=0;l<e.length;l++){l&&(1===i&&a(),a(l));for(var c=0;c<e[l].length;c++)t=e[l][c],1===i?"<"===t?(a(),s=[s],i=3):r+=t:4===i?"--"===r&&">"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(a(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[l][c+1])?(a(),3===i&&(s=s[0]),i=s,(s=s[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),i=2):r+=t),3===i&&"!--"===r&&(i=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}.bind(yl),Ql=0,Xl=[],Gl=[],Ul=ll.__b,Yl=ll.__r,Kl=ll.diffed,Zl=ll.__c,Jl=ll.unmount;function ec(e,t){ll.__h&&ll.__h(Hl,e,Ql||t),Ql=0;var n=Hl.__H||(Hl.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Gl}),n.__[e]}function tc(e){return Ql=1,function(e,t,n){var i=ec(Fl++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):dc(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Hl,!Hl.u)){Hl.u=!0;var r=Hl.shouldComponentUpdate;Hl.shouldComponentUpdate=function(e,t,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!r||r.call(this,e,t,n))}}return i.__N||i.__}(dc,e)}function nc(e,t){var n=ec(Fl++,3);!ll.__s&&pc(n.__H,t)&&(n.__=e,n.i=t,Hl.__H.__h.push(n))}function ic(e,t){var n=ec(Fl++,4);!ll.__s&&pc(n.__H,t)&&(n.__=e,n.i=t,Hl.__h.push(n))}function rc(e){return Ql=5,oc((function(){return{current:e}}),[])}function oc(e,t){var n=ec(Fl++,7);return pc(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function sc(e,t){return Ql=8,oc((function(){return e}),t)}function ac(){for(var e;e=Xl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(hc),e.__H.__h.forEach(uc),e.__H.__h=[]}catch(t){e.__H.__h=[],ll.__e(t,e.__v)}}ll.__b=function(e){Hl=null,Ul&&Ul(e)},ll.__r=function(e){Yl&&Yl(e),Fl=0;var t=(Hl=e.__c).__H;t&&(Vl===Hl?(t.__h=[],Hl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Gl,e.__N=e.i=void 0}))):(t.__h.forEach(hc),t.__h.forEach(uc),t.__h=[])),Vl=Hl},ll.diffed=function(e){Kl&&Kl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Xl.push(t)&&ql===ll.requestAnimationFrame||((ql=ll.requestAnimationFrame)||cc)(ac)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Gl&&(e.__=e.__V),e.i=void 0,e.__V=Gl}))),Vl=Hl=null},ll.__c=function(e,t){t.some((function(e){try{e.__h.forEach(hc),e.__h=e.__h.filter((function(e){return!e.__||uc(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ll.__e(n,e.__v)}})),Zl&&Zl(e,t)},ll.unmount=function(e){Jl&&Jl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{hc(e)}catch(e){t=e}})),n.__H=void 0,t&&ll.__e(t,n.__v))};var lc="function"==typeof requestAnimationFrame;function cc(e){var t,n=function(){clearTimeout(i),lc&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);lc&&(t=requestAnimationFrame(n))}function hc(e){var t=Hl,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Hl=t}function uc(e){var t=Hl;e.__c=e.__(),Hl=t}function pc(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function dc(e,t){return"function"==typeof t?t(e):t}function fc(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=fc(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function mc(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=fc(e))&&(i&&(i+=" "),i+=t);return i}function gc(e){const{entry:t,selected:n,onMouseEnter:i,onMouseLeave:r,onAction:o}=e;return Wl`
2
2
  <li
3
3
  class=${mc("entry",{selected:n})}
4
4
  data-id=${t.id}