camunda-bpmn-js 5.4.1 → 5.4.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.
- package/dist/base-modeler.development.js +35 -13
- package/dist/base-modeler.production.min.js +1 -1
- package/dist/base-navigated-viewer.development.js +35 -13
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +23 -7
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +35 -13
- package/dist/camunda-cloud-modeler.production.min.js +1 -1
- package/dist/camunda-cloud-navigated-viewer.development.js +35 -13
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +23 -7
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +35 -13
- package/dist/camunda-platform-modeler.production.min.js +1 -1
- package/dist/camunda-platform-navigated-viewer.development.js +35 -13
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +23 -7
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/package.json +4 -4
|
@@ -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 r=Math.log(Math.pow(2,e))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,e/i))/Math.log(n)*i;var o=r-Math.floor(r),s="";for(i=0;i<Math.floor(r);i++){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,r){var i=function(i){var s=0;do{if(s++>10){if(!r)throw new Error("too many ID collisions, use more bits");e+=r}var a=t(e,n)}while(Object.hasOwnProperty.call(o,a));return o[a]=i,a},o=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=n||16,i}}));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 r(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 i=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]"===i.call(e)}function p(e){return"[object Object]"===i.call(e)}function u(e){return"[object Number]"===i.call(e)}function d(e){const t=i.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function h(e){return"[object String]"===i.call(e)}function f(e,t){return!l(e)&&o.call(e,t)}function m(e,t){const n=D(t);let r;return v(e,(function(e,t){if(n(e,t))return r=e,!1})),r}function g(e,t){const n=D(t);let r=c(e)?-1:void 0;return v(e,(function(e,t){if(n(e,t))return r=t,!1})),r}function y(e,t){const n=D(t);let r=[];return v(e,(function(e,t){n(e,t)&&r.push(e)})),r}function v(e,t){let n,r;if(s(e))return;const i=c(e)?N:R;for(let o in e)if(f(e,o)&&(n=e[o],r=t(n,i(o)),!1===r))return n}function b(e,t){if(s(e))return[];!function(e){if(!c(e))throw new Error("must supply array")}(e);const n=D(t);return e.filter((function(e,t){return!n(e,t)}))}function w(e,t,n){return v(e,(function(e,r){n=t(n,e,r)})),n}function x(e,t){return!!w(e,(function(e,n,r){return e&&t(n,r)}),!0)}function _(e,t){return!!m(e,t)}function E(e,t){let n=[];return v(e,(function(e,r){n.push(t(e,r))})),n}function k(e){return e&&Object.keys(e)||[]}function O(e){return E(e,(e=>e))}function P(e,t,n={}){return t=A(t),v(e,(function(e){let r=t(e)||"_",i=n[r];i||(i=n[r]=[]),i.push(e)})),n}function S(e,...t){e=A(e);let n={};return v(t,(t=>P(t,e,n))),E(n,(function(e,t){return e[0]}))}const C=S;function T(e,t){t=A(t);let n=[];return v(e,(function(e,r){let i=t(e,r),o={d:i,v:e};for(var s=0;s<n.length;s++){let{d:e}=n[s];if(i<e)return void n.splice(s,0,o)}n.push(o)})),E(n,(e=>e.v))}function M(e){return function(t){return x(e,(function(e,n){return t[n]===e}))}}function A(e){return d(e)?e:t=>t[e]}function D(e){return d(e)?e:t=>t===e}function R(e){return e}function N(e){return Number(e)}function j(e,t){let n,r,i,o;function s(n){let s=Date.now(),c=n?0:o+t-s;if(c>0)return a(c);e.apply(i,r),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=o=r=i=void 0}function c(...e){o=Date.now(),r=e,i=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function I(e,t){return e.bind(t)}function L(e,...t){return Object.assign(e,...t)}function $(e,t,n){let r=e;return v(t,(function(e,i){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[i+1],c=r[e];a(o)&&l(c)&&(c=r[e]=isNaN(+o)?{}:[]),s(o)?s(n)?delete r[e]:r[e]=n:r=c})),e}function z(e,t,n){let r=e;return v(t,(function(e){if(l(r))return r=void 0,!1;r=r[e]})),s(r)?n:r}function B(e,t){let n={},r=Object(e);return v(t,(function(t){t in r&&(n[t]=e[t])})),n}function q(e,t){let n={};return v(Object(e),(function(e,r){-1===t.indexOf(r)&&(n[r]=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 r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const V=Object.prototype.toString,H=Object.prototype.hasOwnProperty;function U(e,t){return H.call(e,t)}function W(e,t){let n,r;if(void 0===e)return;const i=function(e){return"[object Array]"===V.call(e)}(e)?Q:G;for(let o in e)if(U(e,o)&&(n=e[o],r=t(n,i(o)),!1===r))return n}function G(e){return e}function Q(e){return Number(e)}function Y(e,...t){const n=e.style;return W(t,(function(e){e&&W(e,(function(e,t){n[t]=e}))})),e}function X(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const Z=Object.prototype.toString;function K(e){return new J(e)}function J(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ee(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function te(e,t,n){var r=n?e:e.parentNode;return r&&"function"==typeof r.closest&&r.closest(t)||null}J.prototype.add=function(e){return this.list.add(e),this},J.prototype.remove=function(e){return"[object RegExp]"==Z.call(e)?this.removeMatching(e):(this.list.remove(e),this)},J.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},J.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},J.prototype.array=function(){return Array.from(this.list)},J.prototype.has=J.prototype.contains=function(e){return this.list.contains(e)};var ne,re,ie,oe={};function se(){ne=window.addEventListener?"addEventListener":"attachEvent",re=window.removeEventListener?"removeEventListener":"detachEvent",ie="addEventListener"!==ne?"on":""}var ae=oe.bind=function(e,t,n,r){return ne||se(),e[ne](ie+t,n,r||!1),n},le=oe.unbind=function(e,t,n,r){return re||se(),e[re](ie+t,n,r||!1),n},ce=F({__proto__:null,bind:ae,unbind:le,default:oe},[oe]),pe=["focus","blur"];var ue,de={bind:function(e,t,n,r,i){return-1!==pe.indexOf(n)&&(i=!0),ce.bind(e,n,(function(n){var i=n.target||n.srcElement;n.delegateTarget=te(i,t,!0),n.delegateTarget&&r.call(e,n)}),i)},unbind:function(e,t,n,r){return-1!==pe.indexOf(t)&&(r=!0),ce.unbind(e,t,n,r)}},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 r=n[1];if("body"==r){return(l=t.createElement("html")).innerHTML=e,l.removeChild(l.lastChild)}var i=Object.prototype.hasOwnProperty.call(me,r)?me[r]:me._default,o=i[0],s=i[1],a=i[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},fe=!1;"undefined"!=typeof document&&((ue=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',fe=!ue.getElementsByTagName("link").length,ue=void 0);var me={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:fe?[1,"X<div>","</div>"]:[0,"",""]};me.td=me.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],me.option=me.optgroup=[1,'<select multiple="multiple">',"</select>"],me.thead=me.tbody=me.colgroup=me.caption=me.tfoot=[1,"<table>","</table>"],me.polyline=me.ellipse=me.polygon=me.circle=me.text=me.line=me.path=me.rect=me.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var ge=he;function ye(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function ve(e,t){return(t=t||document).querySelector(e)}function be(e,t){return(t=t||document).querySelectorAll(e)}function we(e){e.parentNode&&e.parentNode.removeChild(e)}function xe(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}var _e=2,Ee={"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":_e,"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":_e,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function ke(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Ee[r];i?(i===_e&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function Oe(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Ee[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);ke(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)ke(e,r,t[r])}(e,t);return e}const Pe=Object.prototype.toString;function Se(e){return new Ce(e)}function Ce(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Te(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Me(e){return e.cloneNode(!0)}Ce.prototype.add=function(e){return this.list.add(e),this},Ce.prototype.remove=function(e){return"[object RegExp]"==Pe.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ce.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ce.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ce.prototype.array=function(){return Array.from(this.list)},Ce.prototype.has=Ce.prototype.contains=function(e){return this.list.contains(e)};var Ae={svg:"http://www.w3.org/2000/svg"},De='<svg xmlns="'+Ae.svg+'"';function Re(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Ae.svg)&&(e=De+e.substring(4)):(e=De+">"+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 r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function Ne(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=Re(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ae.svg,e),t&&Oe(n,t),n}var je=null;function Ie(){return null===je&&(je=Ne("svg")),je}function Le(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function $e(e){return Ie().createSVGTransform()}var ze=/([&<>]{1})/g,Be=/([\n\r"]{1})/g,qe={"&":"&","<":"<",">":">",'"':"'"};function Fe(e,t){return e.replace(t,(function(e,t){return qe[t]||t}))}function Ve(e,t){var n,r,i,o,s;switch(e.nodeType){case 3:t.push(Fe(e.textContent,ze));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',Fe(o.value,Be),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(s=e.childNodes).length;n<r;++n)Ve(s.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Fe(e.nodeValue,ze),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function He(e,t){return function(e){for(var t=e.firstChild,n=[];t;)Ve(t,n),t=t.nextSibling;return n.join("")}(e)}function Ue(e){var t=e.parentNode;return t&&t.removeChild(e),e}function We(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ge(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(We(e,r))}(n,t)),n.consolidate()}const Qe=/^class[ {]/;function Ye(e){return Array.isArray(e)}function Xe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ze(...e){1===e.length&&Ye(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Ke=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Je=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,et=/\/\*([^*]*)\*\//m;function tt(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)?Ke:Je);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(et);return(t&&t[1]||e).trim()}))||[]}function nt(e,t){const n=t||{get:function(e,t){if(r.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),s=o.injector=this,a=function(e){const t=r.join(" -> ");return r.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){if(!i[e]&&e.includes(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Xe(o,e))return o[e];if(Xe(i,e)){if(-1!==r.indexOf(e))throw r.push(e),a("Cannot resolve circular dependency!");return r.push(e),o[e]=i[e][0](i[e][1]),r.pop(),o[e]}return n.get(e,t)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Ye(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Ze(e.slice())}return{fn:e,dependencies:(e.$inject||tt(e)).map((e=>Xe(t,e)?t[e]:l(e)))}}function p(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:r,dependencies:i}=c(e,n);return r.apply(t,i)}function d(e){return Ze((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],s=[],a=[];let l,c,p,u;for(let e in i)l=i[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(p=l[3].createChild([],t),u=d(p),o.push(l[3]),s.push(p),a.push(u),n[e]=[u,e,"private",p]):n[e]=[a[c],e,"private",s[c]]):n[e]=[l[2],l[1]],r[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new nt(e,s)}const f={factory:u,type:p,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__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(r)),s=Ze((function(e){return o.get(e)}));t.forEach((function(e){i[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(i[t]=n);const r=n[0],o=n[1];i[t]=[f[r],rt(r,o),r]})),m(e,s)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=p,this.createChild=h,this.init=function(e){const t=e.reduce(y,[]).map(g);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function rt(e,t){return"value"!==e&&Ye(t)&&(t=Ze(t.slice())),t}var it=1e3;function ot(e,t){var n=this;t=t||it,e.on(["render.shape","render.connection"],t,(function(e,t){var r=e.type,i=t.element,o=t.gfx,s=t.attrs;if(n.canRender(i))return"render.shape"===r?n.drawShape(o,i,s):n.drawConnection(o,i,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 st(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function at(e){return["L",e.x,e.y]}function lt(e,t){const n=e.length,r=[(i=e[0],["M",i.x,i.y])];var i,o,s,a;for(let i=1;i<n;i++){const n=e[i-1],l=e[i],c=e[i+1];if(!c||!t){r.push(at(l));continue}const p=Math.min(t,pt(l.x-n.x,l.y-n.y),pt(c.x-l.x,c.y-l.y));if(!p){r.push(at(l));continue}const u=ct(l,n,p),d=ct(l,n,.5*p),h=ct(l,c,p),f=ct(l,c,.5*p);r.push(at(u)),r.push((s=f,a=h,["C",(o=d).x,o.y,s.x,s.y,a.x,a.y]))}return r}function ct(e,t,n){const r=t.x-e.x,i=t.y-e.y,o=n/pt(r,i);return{x:e.x+r*o,y:e.y+i*o}}function pt(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ut(e,t,n){u(t)&&(n=t,t=null),t||(t={});const r=Ne("path",t);return u(n)&&(r.dataset.cornerRadius=String(n)),dt(r,e)}function dt(e,t){return Oe(e,{d:st(lt(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function ht(e){return y(e,(function(t){return!m(e,(function(e){return e!==t&&ft(t,e)}))}))}function ft(e,t){if(t){if(e===t)return t;if(e.parent)return ft(e.parent,t)}}function mt(e,t,n){var r=!n||-1===e.indexOf(t);return r&&e.push(t),r}function gt(e,t,n){n=n||0,c(e)||(e=[e]),v(e,(function(e,r){var i=t(e,r,n);c(i)&&i.length&>(i,t,n+1)}))}function yt(e,t){return function(e,t,n){var r=[],i=[];return gt(e,(function(e,n,o){mt(r,e,t);var s=e.children;if(s&&mt(i,s,t))return s})),r}(e,!t)}function vt(e,t){var n,r,i,o;return t=!!t,c(e)||(e=[e]),v(e,(function(e){var s=e;e.waypoints&&!t&&(s=vt(e.waypoints,!0));var a=s.x,l=s.y,c=s.height||0,p=s.width||0;(a<n||void 0===n)&&(n=a),(l<r||void 0===r)&&(r=l),(a+p>i||void 0===i)&&(i=a+p),(l+c>o||void 0===o)&&(o=l+c)})),{x:n,y:r,height:o-r,width:i-n}}function bt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function wt(e){return!(!e||!e.isFrame)}function xt(e,t){return L({},e||{},t||{})}ot.prototype.canRender=function(e){},ot.prototype.drawShape=function(e,t){},ot.prototype.drawConnection=function(e,t){},ot.prototype.getShapePath=function(e){},ot.prototype.getConnectionPath=function(e){};function _t(e,t){ot.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(_t,ot),_t.prototype.canRender=function(){return!0},_t.prototype.drawShape=function(e,t,n){var r=Ne("rect");return Oe(r,{x:0,y:0,width:t.width||0,height:t.height||0}),wt(t)?Oe(r,L({},this.FRAME_STYLE,n||{})):Oe(r,L({},this.SHAPE_STYLE,n||{})),xe(e,r),r},_t.prototype.drawConnection=function(e,t,n){var r=ut(t.waypoints,L({},this.CONNECTION_STYLE,n||{}));return xe(e,r),r},_t.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return st([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},_t.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,i=[];for(t=0;n=r[t];t++)n=n.original||n,i.push([0===t?"M":"L",n.x,n.y]);return st(i)},_t.$inject=["eventBus","styles"];var Et={__init__:["defaultRenderer"],defaultRenderer:["type",_t],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 L(this.style(t,n),{class:e})},this.style=function(t,n){c(t)||n||(n=t,t=[]);var r=w(t,(function(t,n){return L(t,e[n]||{})}),{});return n?L(r,n):r},this.computeStyle=function(e,n,r){return c(n)||(r=n,n=[]),t.style(n||[],L({},r,e||{}))}}]};function kt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function Ot(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Pt(e,t){return e&&t?e.indexOf(t):-1}function St(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Ct(e,t,n,r){if(void 0===r&&(r=5),!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=St(e,t);return Math.abs(i/o)<=r}var Tt=2;function Mt(e,t){var n=Array.from(arguments).flat();const r={x:"v",y:"h"};for(const[e,t]of Object.entries(r))if(At(e,n))return t;return!1}function At(e,t){const n=t[0];return x(t,(function(t){return Math.abs(n[e]-t[e])<=Tt}))}function Dt(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 Rt(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Nt=/,?([a-z]),?/gi,jt=parseFloat,It=Math,Lt=It.PI,$t=It.min,zt=It.max,Bt=It.pow,qt=It.abs,Ft=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Vt=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Ht=Array.isArray||function(e){return e instanceof Array};function Ut(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Wt(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)Ut(e,n)&&(t[n]=Wt(e[n]));return t}function Gt(e){var t=Gt.ps=Gt.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout((function(){for(var n in t)Ut(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])})),t[e]}function Qt(e,t,n,r){return 1===arguments.length&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function Yt(){return this.join(",").replace(Nt,"$1")}function Xt(e){var t=Wt(e);return t.toString=Yt,t}function Zt(e,t,n,r,i,o,s,a,l){var c=1-l,p=Bt(c,3),u=Bt(c,2),d=l*l*l,h=p*t+3*u*l*r+3*c*l*l*o+d*a;return{x:rn(p*e+3*u*l*n+3*c*l*l*i+d*s),y:rn(h)}}function Kt(e){var t=function(e,t,n,r,i,o,s,a){for(var l,c,p,u,d,h,f,m,g=[],y=[[],[]],v=0;v<2;++v)if(0==v?(c=6*e-12*n+6*i,l=-3*e+9*n-9*i+3*s,p=3*n-3*e):(c=6*t-12*r+6*o,l=-3*t+9*r-9*o+3*a,p=3*r-3*t),qt(l)<1e-12){if(qt(c)<1e-12)continue;0<(u=-p/c)&&u<1&&g.push(u)}else f=c*c-4*p*l,m=It.sqrt(f),f<0||(0<(d=(-c+m)/(2*l))&&d<1&&g.push(d),0<(h=(-c-m)/(2*l))&&h<1&&g.push(h));var b,w=g.length,x=w;for(;w--;)b=1-(u=g[w]),y[0][w]=b*b*b*e+3*b*b*u*n+3*b*u*u*i+u*u*u*s,y[1][w]=b*b*b*t+3*b*b*u*r+3*b*u*u*o+u*u*u*a;return y[0][x]=e,y[1][x]=t,y[0][x+1]=s,y[1][x+1]=a,y[0].length=y[1].length=x+2,{x0:$t(...y[0]),y0:$t(...y[1]),x1:zt(...y[0]),y1:zt(...y[1])}}(...e);return Qt(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Jt(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function en(e,t,n,r,i){return e*(e*(-3*t+9*n-9*r+3*i)+6*t-12*n+6*r)-3*t+3*n}function tn(e,t,n,r,i,o,s,a,l){null==l&&(l=1);for(var c=(l=l>1?1:l<0?0:l)/2,p=[-.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],d=0,h=0;h<12;h++){var f=c*p[h]+c,m=en(f,e,n,i,s),g=en(f,t,r,o,a),y=m*m+g*g;d+=u[h]*It.sqrt(y)}return c*d}function nn(e,t,n,r,i,o,s,a){if(!(zt(e,n)<$t(i,s)||$t(e,n)>zt(i,s)||zt(t,r)<$t(o,a)||$t(t,r)>zt(o,a))){var l=(e*r-t*n)*(o-a)-(t-r)*(i*a-o*s),c=(e-n)*(o-a)-(t-r)*(i-s);if(c){var p=rn(((e*r-t*n)*(i-s)-(e-n)*(i*a-o*s))/c),u=rn(l/c),d=+p.toFixed(2),h=+u.toFixed(2);if(!(d<+$t(e,n).toFixed(2)||d>+zt(e,n).toFixed(2)||d<+$t(i,s).toFixed(2)||d>+zt(i,s).toFixed(2)||h<+$t(t,r).toFixed(2)||h>+zt(t,r).toFixed(2)||h<+$t(o,a).toFixed(2)||h>+zt(o,a).toFixed(2)))return{x:p,y:u}}}}function rn(e){return Math.round(1e11*e)/1e11}function on(e,t,n){if(!function(e,t){return e=Qt(e),Jt(t=Qt(t),e.x,e.y)||Jt(t,e.x2,e.y)||Jt(t,e.x,e.y2)||Jt(t,e.x2,e.y2)||Jt(e,t.x,t.y)||Jt(e,t.x2,t.y)||Jt(e,t.x,t.y2)||Jt(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)}(Kt(e),Kt(t)))return n?0:[];for(var r=tn(...e),i=tn(...t),o=ln(e)?1:~~(r/5)||1,s=ln(t)?1:~~(i/5)||1,a=[],l=[],c={},p=n?0:[],u=0;u<o+1;u++){var d=Zt(...e,u/o);a.push({x:d.x,y:d.y,t:u/o})}for(u=0;u<s+1;u++)d=Zt(...t,u/s),l.push({x:d.x,y:d.y,t:u/s});for(u=0;u<o;u++)for(var h=0;h<s;h++){var f,m=a[u],g=a[u+1],y=l[h],v=l[h+1],b=qt(g.x-m.x)<.01?"y":"x",w=qt(v.x-y.x)<.01?"y":"x",x=nn(m.x,m.y,g.x,g.y,y.x,y.y,v.x,v.y);if(x){if(c[f=x.x.toFixed(9)+"#"+x.y.toFixed(9)])continue;c[f]=!0;var _=m.t+qt((x[b]-m[b])/(g[b]-m[b]))*(g.t-m.t),E=y.t+qt((x[w]-y[w])/(v[w]-y[w]))*(v.t-y.t);_>=0&&_<=1&&E>=0&&E<=1&&(n?p++:p.push({x:x.x,y:x.y,t1:_,t2:E}))}}return p}function sn(e,t,n){e=dn(e),t=dn(t);for(var r,i,o,s,a,l,c,p,u,d,h=n?0:[],f=0,m=e.length;f<m;f++){var g=e[f];if("M"==g[0])r=a=g[1],i=l=g[2];else{"C"==g[0]?(r=(u=[r,i,...g.slice(1)])[6],i=u[7]):(u=[r,i,r,i,a,l,a,l],r=a,i=l);for(var y=0,v=t.length;y<v;y++){var b=t[y];if("M"==b[0])o=c=b[1],s=p=b[2];else{"C"==b[0]?(o=(d=[o,s,...b.slice(1)])[6],s=d[7]):(d=[o,s,o,s,c,p,c,p],o=c,s=p);var w=on(u,d,n);if(n)h+=w;else{for(var x=0,_=w.length;x<_;x++)w[x].segment1=f,w[x].segment2=y,w[x].bez1=u,w[x].bez2=d;h=h.concat(w)}}}}}return h}function an(e){var t=Gt(e);if(t.abs)return Xt(t.abs);if(Ht(e)&&Ht(e&&e[0])||(e=function(e){if(!e)return null;var t=Gt(e);if(t.arr)return Wt(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=[];return Ht(e)&&Ht(e[0])&&(r=Wt(e)),r.length||String(e).replace(Ft,(function(e,t,i){var o=[],s=t.toLowerCase();for(i.replace(Vt,(function(e,t){t&&o.push(+t)})),"m"==s&&o.length>2&&(r.push([t,...o.splice(0,2)]),s="l",t="m"==t?"l":"L");o.length>=n[s]&&(r.push([t,...o.splice(0,n[s])]),n[s]););})),r.toString=Gt.toString,t.arr=Wt(r),r}(e)),!e||!e.length)return[["M",0,0]];var n,r=[],i=0,o=0,s=0,a=0,l=0;"M"==e[0][0]&&(s=i=+e[0][1],a=o=+e[0][2],l++,r[0]=["M",i,o]);for(var c,p,u=l,d=e.length;u<d;u++){if(r.push(c=[]),(n=(p=e[u])[0])!=n.toUpperCase())switch(c[0]=n.toUpperCase(),c[0]){case"A":c[1]=p[1],c[2]=p[2],c[3]=p[3],c[4]=p[4],c[5]=p[5],c[6]=+p[6]+i,c[7]=+p[7]+o;break;case"V":c[1]=+p[1]+o;break;case"H":c[1]=+p[1]+i;break;case"M":s=+p[1]+i,a=+p[2]+o;default:for(var h=1,f=p.length;h<f;h++)c[h]=+p[h]+(h%2?i:o)}else for(var m=0,g=p.length;m<g;m++)c[m]=p[m];switch(n=n.toUpperCase(),c[0]){case"Z":i=+s,o=+a;break;case"H":i=c[1];break;case"V":o=c[1];break;case"M":s=c[c.length-2],a=c[c.length-1];default:i=c[c.length-2],o=c[c.length-1]}}return r.toString=Yt,t.abs=Xt(r),r}function ln(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function cn(e,t,n,r){return[e,t,n,r,n,r]}function pn(e,t,n,r,i,o){var s=1/3,a=2/3;return[s*e+a*n,s*t+a*r,s*i+a*n,s*o+a*r,i,o]}function un(e,t,n,r,i,o,s,a,l,c){var p,u=120*Lt/180,d=Lt/180*(+i||0),h=[],f=function(e){return function t(){var n=Array.prototype.slice.call(arguments,0).join("␀"),r=t.cache=t.cache||{},i=t.count=t.count||[];return Ut(r,n)?(function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(i,n),r[n]):(i.length>=1e3&&delete r[i.shift()],i.push(n),r[n]=e(...arguments),r[n])}}((function(e,t,n){return{x:e*It.cos(n)-t*It.sin(n),y:e*It.sin(n)+t*It.cos(n)}}));if(c)E=c[0],k=c[1],x=c[2],_=c[3];else{e=(p=f(e,t,-d)).x,t=p.y;var m=(e-(a=(p=f(a,l,-d)).x))/2,g=(t-(l=p.y))/2,y=m*m/(n*n)+g*g/(r*r);y>1&&(n*=y=It.sqrt(y),r*=y);var v=n*n,b=r*r,w=(o==s?-1:1)*It.sqrt(qt((v*b-v*g*g-b*m*m)/(v*g*g+b*m*m))),x=w*n*g/r+(e+a)/2,_=w*-r*m/n+(t+l)/2,E=It.asin(((t-_)/r).toFixed(9)),k=It.asin(((l-_)/r).toFixed(9));(E=e<x?Lt-E:E)<0&&(E=2*Lt+E),(k=a<x?Lt-k:k)<0&&(k=2*Lt+k),s&&E>k&&(E-=2*Lt),!s&&k>E&&(k-=2*Lt)}var O=k-E;if(qt(O)>u){var P=k,S=a,C=l;k=E+u*(s&&k>E?1:-1),h=un(a=x+n*It.cos(k),l=_+r*It.sin(k),n,r,i,0,s,S,C,[k,P,x,_])}O=k-E;var T=It.cos(E),M=It.sin(E),A=It.cos(k),D=It.sin(k),R=It.tan(O/4),N=4/3*n*R,j=4/3*r*R,I=[e,t],L=[e+N*M,t-j*T],$=[a+N*D,l-j*A],z=[a,l];if(L[0]=2*I[0]-L[0],L[1]=2*I[1]-L[1],c)return[L,$,z].concat(h);for(var B=[],q=0,F=(h=[L,$,z].concat(h).join().split(",")).length;q<F;q++)B[q]=q%2?f(h[q-1],h[q],d).y:f(h[q],h[q+1],d).x;return B}function dn(e){var t=Gt(e);if(t.curve)return Xt(t.curve);for(var n=an(e),r={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(e,t,n){var r,i;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",...un(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),e=["C",r,i,...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",...pn(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",...pn(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...cn(t.x,t.y,e[1],e[2])];break;case"H":e=["C",...cn(t.x,t.y,e[1],t.y)];break;case"V":e=["C",...cn(t.x,t.y,t.x,e[1])];break;case"Z":e=["C",...cn(t.x,t.y,t.X,t.Y)]}return e},o=function(e,t){if(e[t].length>7){e[t].shift();for(var r=e[t];r.length;)s[t]="A",e.splice(t++,0,["C",...r.splice(0,6)]);e.splice(t,1),p=n.length}},s=[],a="",l="",c=0,p=n.length;c<p;c++){n[c]&&(a=n[c][0]),"C"!=a&&(s[c]=a,c&&(l=s[c-1])),n[c]=i(n[c],r,l),"A"!=s[c]&&"C"==a&&(s[c]="C"),o(n,c);var u=n[c],d=u.length;r.x=u[d-2],r.y=u[d-1],r.bx=jt(u[d-4])||r.x,r.by=jt(u[d-3])||r.y}return t.curve=Xt(n),n}function hn(e){return p(e)&&f(e,"waypoints")}function fn(e){return p(e)&&f(e,"labelTarget")}function mn(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function gn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function yn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function vn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function bn(e){for(var t=e.waypoints,n=t.reduce((function(e,n,r){var i=t[r-1];if(i){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))}(i,n);e.push({start:i,end:n,startLength:s,endLength:s+a,length:a})}return e}),[]),r=n.reduce((function(e,t){return e+t.length}),0),i=r/2,o=0,s=n[o];s.endLength<i;)s=n[++o];var a=(i-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 wn(e){return hn(e)?bn(e):gn({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function xn(e,t,n){p(n=n||0)||(n={x:n,y:n});var r=yn(e),i=yn(t),o=r.bottom+n.y<=i.top,s=r.left-n.x>=i.right,a=r.top-n.y>=i.bottom,l=o?"top":a?"bottom":null,c=r.right+n.x<=i.left?"left":s?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function _n(e,t,n){var r=function(e,t){return sn(e,t)}(e,t);return 1===r.length||2===r.length&&St(r[0],r[1])<1?gn(r[0]):r.length>1?(r=T(r,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),gn(r[n?0:r.length-1])):null}function En(e,t){return Math.round(e*t)/t}function kn(e){return u(e)?e+"px":e}function On(e,t,n){const r=Ne("g");Se(r).add(t);const i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}const Pn={shape:["x","y","width","height"],connection:["waypoints"]};function Sn(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}function Cn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Sn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Sn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=L({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Y(n,{position:"relative",overflow:"hidden",width:kn(e.width),height:kn(e.height)}),t.appendChild(n),n}(e),r=this._svg=Ne("svg");Oe(r,{width:"100%",height:"100%"}),X(r,"tabindex",0),t.on("element.hover",(()=>{this.restoreFocus()})),r.addEventListener("focusin",(()=>{this._focused=!0,t.fire("canvas.focus.changed",{focused:!0})})),r.addEventListener("focusout",(()=>{this._focused=!1,t.fire("canvas.focus.changed",{focused:!1})})),xe(n,r);const i=this._viewport=On(r,"viewport");e.deferUpdate&&(this._viewboxChanged=j(I(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:r,viewport:i})})),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)},Sn.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},Sn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=bt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Sn.prototype.focus=function(){this._svg.focus({preventScroll:!0})},Sn.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},Sn.prototype.isFocused=function(){return this._focused},Sn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Sn.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},Sn.prototype._getChildIndex=function(e){return w(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Sn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:On(this._viewport,"layer-"+e,n),index:t,visible:!0}},Sn.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,r=t.group,i=t.index;if(t.visible)return r;const o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r},Sn.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?(Ue(n),t.visible=!1,n):n},Sn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Ue(t.group))},Sn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Sn.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},Sn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Sn.prototype._findPlaneForRoot=function(e){return m(this._planes,(function(t){return t.rootElement===e}))},Sn.prototype.getContainer=function(){return this._container},Sn.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(v([r.gfx,r.secondaryGfx],(function(r){r&&(n?(e.markers.add(t),Se(r).add(t)):(e.markers.delete(t),Se(r).remove(t)))})),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},Sn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Sn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Sn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),!!e.markers&&e.markers.has(t)},Sn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Sn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Sn.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 r=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},Sn.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},Sn.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},Sn.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)},Sn.prototype._addRoot=function(e,t){const n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},Sn.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})},Sn.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=Pn[e],r=x(n,(function(e){return void 0!==t[e]}));if(!r)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Sn.prototype._setParent=function(e,t,n){Ot(t.children,e,n),e.parent=t},Sn.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();const i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);const s=o.create(e,t,r);return this._elementRegistry.add(t,s),o.update(e,t,s),i.fire(e+".added",{element:t,gfx:s}),t},Sn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Sn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Sn.prototype._removeElement=function(e,t){const n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e))return i.fire(t+".remove",{element:e}),r.remove(e),kt(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},Sn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Sn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Sn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Sn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Sn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Sn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let r,i,o,s,a,l,c;return e?(this._changeViewbox((function(){a=Math.min(n.width/e.width,n.height/e.height);const r=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);Ge(t,r)})),e):(o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},s=Ge(t),i=s?s.matrix:function(e,t,n,r,i,o){var s=Ie().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return Le(s,e);case 6:return Le(s,{a:e,b:t,c:n,d:r,e:i,f:o})}}(),a=En(i.a,1e3),l=En(-i.e||0,1e3),c=En(-i.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:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n})},Sn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=L({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Cn(t,n)})),{x:n.e,y:n.f}},Sn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===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 i=vt(e),o=yn(i),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 p=yn(s);if(i.width<s.width&&i.height<s.height){const e=Math.max(0,o.right-p.right),t=Math.min(0,o.left-p.left),n=Math.max(0,o.bottom-p.bottom),r=Math.min(0,o.top-p.top);l=e||t,c=n||r}else l=i.x-s.x,c=i.y-s.y;this.scroll({dx:-l*a,dy:-c*a})},Sn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,r;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)})),En(r.a,1e3)},Sn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,r=t.inner;let i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale},Sn.prototype._setZoom=function(e,t){const n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint();let s,a,l,c,p;l=r.getCTM();const u=l.a;return t?(s=L(o,t),a=s.matrixTransform(l.inverse()),c=i.translate(a.x,a.y).scale(1/u*e).translate(-a.x,-a.y),p=l.multiply(c)):p=i.scale(e),Cn(this._viewport,p),p},Sn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Sn.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}},Sn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Tn="data-element-id";function Mn(e){this._elements={},this._eventBus=e}function An(e,t,n){var r=function(e,t,n,r){var i=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,i,r)),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,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach((function(r){e.set(r,t.inverse,n)}))}function Dn(e,t){if(!(this instanceof Dn))return new Dn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Mn.$inject=["eventBus"],Mn.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),Oe(t,Tn,r),n&&Oe(n,Tn,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},Mn.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(Oe(r.gfx,Tn,""),r.secondaryGfx&&Oe(r.secondaryGfx,Tn,""),delete t[n])},Mn.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),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},Mn.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&Oe(t,Tn,r),t},Mn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Oe(e,Tn);var n=this._elements[t];return n&&n.element},Mn.prototype.filter=function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(n)})),t},Mn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=t[n[r]],o=i.element;if(e(o,i.gfx))return o}},Mn.prototype.getAll=function(){return this.filter((function(e){return e}))},Mn.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)}))},Mn.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},Mn.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")},Dn.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?An(this,t,e):function(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}(this,t,e)},Dn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||An(this,t,e),n},Dn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Dn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Dn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Rn=new Dn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Nn=new Dn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),jn=new Dn({name:"attachers",collection:!0},{name:"host"}),In=new Dn({name:"outgoing",collection:!0},{name:"source"}),Ln=new Dn({name:"incoming",collection:!0},{name:"target"});function $n(){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)}}),Rn.bind(this,"parent"),Nn.bind(this,"labels"),In.bind(this,"outgoing"),Ln.bind(this,"incoming")}function zn(){$n.call(this),Rn.bind(this,"children"),jn.bind(this,"host"),jn.bind(this,"attachers")}function Bn(){$n.call(this),Rn.bind(this,"children")}function qn(){zn.call(this),Nn.bind(this,"labelTarget")}function Fn(){$n.call(this),In.bind(this,"source"),Ln.bind(this,"target")}e(zn,$n),e(Bn,zn),e(qn,zn),e(Fn,$n);var Vn={connection:Fn,shape:zn,label:qn,root:Bn};function Hn(){this._uid=12}Hn.prototype.createRoot=function(e){return this.create("root",e)},Hn.prototype.createLabel=function(e){return this.create("label",e)},Hn.prototype.createShape=function(e){return this.create("shape",e)},Hn.prototype.createConnection=function(e){return this.create("connection",e)},Hn.prototype.create=function(e,t){return(t=L({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Vn[e];if(!n)throw new Error("unknown type: <"+e+">");return L(new n,t)}(e,t)};var Un="__fn",Wn=Array.prototype.slice;function Gn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Qn(){}function Yn(e){return e.childNodes[0]}function Xn(e,t,n,r,i){var o=$e();o.setTranslate(t,n);var s=$e();s.setRotate(r||0,0,0);var a=$e();a.setScale(1,1),Ge(e,[o,s,a])}function Zn(e,t,n){var r=$e();r.setTranslate(t,n),Ge(e,r)}function Kn(e,t){var n=$e();n.setRotate(t,0,0),Ge(e,n)}function Jn(e,t){this._eventBus=e,this._elementRegistry=t}function er(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}Gn.prototype.on=function(e,t,n,r){if(e=c(e)?e:[e],d(t)&&(r=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");var i=n;r&&((i=I(n,r))[Un]=n[Un]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:i,next:null})}))},Gn.prototype.once=function(e,t,n,r){var i=this;if(d(t)&&(r=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(r,arguments);return i.off(e,o),t}o[Un]=n,this.on(e,t,o)},Gn.prototype.off=function(e,t){e=c(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Gn.prototype.createEvent=function(e){var t=new Qn;return t.init(e),t},Gn.prototype.fire=function(e,t){var n,r,i,o;if(o=Wn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(r=this._listeners[e]){n=t instanceof Qn?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==s&&(n.type=s)}return void 0===i&&n.defaultPrevented&&(i=!1),i}},Gn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Gn.prototype._destroy=function(){this._listeners={}},Gn.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},Gn.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==r&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return r},Gn.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));n=r,r=r.next}n.next=t}else this._setListeners(e,t)},Gn.prototype._getListeners=function(e){return this._listeners[e]},Gn.prototype._setListeners=function(e,t){this._listeners[e]=t},Gn.prototype._removeListener=function(e,t){var n,r,i,o=this._getListeners(e);if(t)for(;o;)n=o.next,(i=o.callback)!==t&&i[Un]!==t||(r?r.next=n:this._setListeners(e,n)),r=o,o=n;else this._setListeners(e,null)},Qn.prototype.stopPropagation=function(){this.cancelBubble=!0},Qn.prototype.preventDefault=function(){this.defaultPrevented=!0},Qn.prototype.init=function(e){L(this,e||{})},Jn.$inject=["eventBus","elementRegistry"],Jn.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(Se(t=Ne("g")).add("djs-children"),xe(n.parentNode,t))):t=n,t},Jn.prototype._clear=function(e){var t=Yn(e);return ee(t),t},Jn.prototype._createContainer=function(e,t,n,r){var i=Ne("g");Se(i).add("djs-group"),void 0!==n?er(i,t,t.childNodes[n]):xe(t,i);var o=Ne("g");Se(o).add("djs-element"),Se(o).add("djs-"+e),r&&Se(o).add("djs-frame"),xe(i,o);var s=Ne("g");return Se(s).add("djs-visual"),xe(o,s),o},Jn.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,wt(t))},Jn.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=w(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),v(t,(function(e){var t=e.children;if(t){var i=n._getChildrenContainer(e);v(t.slice().reverse(),(function(e){er(r.getGraphics(e).parentNode,i)}))}}))},Jn.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Jn.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Jn.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Jn.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Jn.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),Zn(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?Oe(n,"display","none"):Oe(n,"display","block")}},Jn.prototype.remove=function(e){Ue(this._elementRegistry.getGraphics(e).parentNode)};var tr={__depends__:[Et],__init__:["canvas"],canvas:["type",Sn],elementRegistry:["type",Mn],elementFactory:["type",Hn],eventBus:["type",Gn],graphicsFactory:["type",Jn]};function nr(e){return function(e){var t=new nt(e);return t.init(),t}([{config:["value",e=e||{}]},tr].concat(e.modules||[]))}function rr(e,t){this._injector=t||nr(e),this.get("eventBus").fire("diagram.init")}function ir(){}function or(e,t){this.model=e,this.properties=t}rr.prototype.get=function(e,t){return this._injector.get(e,t)},rr.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},rr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},rr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},ir.prototype.get=function(e){return this.$model.properties.get(this,e)},ir.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},or.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(ir.prototype);v(e.properties,(function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)})),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),v(e,I((function(e,t){this.set(t,e)}),this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var sr={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ar={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 lr(e,t){var n=ar[e];return n?n(t):t}function cr(e){return!!sr[e]}function pr(e){return!!ar[e]}function ur(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function dr(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function hr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,v(e,I(this.registerPackage,this))}function fr(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function mr(e){this.model=e}function gr(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function yr(e){return e.replace(/^:/,"")}function vr(e,t={}){this.properties=new mr(this),this.factory=new or(this,this.properties),this.registry=new hr(e,this.properties),this.typeCache={},this.config=t}dr.prototype.build=function(){return B(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},dr.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var r=this.properties;void 0!==t?r.splice(t,0,e):r.push(e)},dr.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=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=i.indexOf(e);if(-1===a)throw new Error("property <"+r.name+"> not found in property list");i.splice(a,1),this.addProperty(t,n?void 0:a,s),o[r.name]=o[r.localName]=t},dr.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=ur(i[0],r),s=ur(i[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},dr.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},dr.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},dr.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},dr.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},dr.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},dr.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},dr.prototype.hasProperty=function(e){return this.propertiesByName[e]},dr.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(v(e.properties,I((function(n){n=L({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),r.push(e),n[i]=e)},hr.prototype.getPackage=function(e){return this.packageMap[e]},hr.prototype.getPackages=function(){return this.packages},hr.prototype.registerPackage=function(e){e=L({},e);var t=this.packageMap;fr(t,e,"prefix"),fr(t,e,"uri"),v(e.types,I((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},hr.prototype.registerType=function(e,t){var n=ur((e=L({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:L(e.meta||{})})).name,t.prefix),r=n.name,i={};v(e.properties,I((function(e){var t=ur(e.name,n.prefix),r=t.name;cr(e.type)||(e.type=ur(e.type,t.prefix).name),L(e,{ns:t,name:r}),i[r]=e}),this)),L(e,{ns:n,name:r,propertiesByName:i}),v(e.extends,I((function(e){var t=ur(e,n.prefix),i=this.typeMap[t.name];i.traits=i.traits||[],i.traits.push(r)}),this)),this.definePackage(e,t),this.typeMap[r]=e},hr.prototype.mapTypes=function(e,t,n){var r=cr(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(n,r){var o=ur(n,cr(n)?"":e.prefix);i.mapTypes(o,t,r)}function s(e){return o(e,!0)}if(!r)throw new Error("unknown type <"+e.name+">");v(r.superClass,n?s:function(e){return o(e,!1)}),t(r,!n),v(r.traits,s)},hr.prototype.getEffectiveDescriptor=function(e){var t=ur(e),n=new dr(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},hr.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},mr.prototype.set=function(e,t,n){if(!h(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;void 0===n?r?delete e[i]:delete e.$attrs[yr(t)]:r?i in e?e[i]=n:gr(e,r,n):e.$attrs[yr(t)]=n},mr.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[yr(t)];var r=n.name;return!e[r]&&n.isMany&&gr(e,n,[]),e[r]},mr.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;delete(n=L({},n,{get:function(){return r}})).value}Object.defineProperty(e,t,n)},mr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},mr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},mr.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;const i=n.config.strict;if(void 0!==i){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw n;"undefined"!=typeof console&&console.warn(n)}return null},vr.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},vr.prototype.getType=function(e){var t=this.typeCache,n=h(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},vr.prototype.createAny=function(e,t,n){var r=ur(e),i={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){$(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),v(n,(function(e,t){p(e)&&void 0!==e.value?i[e.name]=e.value:i[t]=e})),i},vr.prototype.getPackage=function(e){return this.registry.getPackage(e)},vr.prototype.getPackages=function(){return this.registry.getPackages()},vr.prototype.getElementDescriptor=function(e){return e.$descriptor},vr.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},vr.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},vr.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var br=String.fromCharCode,wr=Object.prototype.hasOwnProperty,xr=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,_r={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Er(e,t,n,r){return r?wr.call(_r,r)?_r[r]:"&"+r+";":br(t||parseInt(n,16))}function kr(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(xr,Er):e}Object.keys(_r).forEach((function(e){_r[e.toUpperCase()]=_r[e]}));var Or="non-whitespace outside of root node";function Pr(e){return new Error(e)}function Sr(e){return"missing namespace for prefix <"+e+">"}function Cr(e){return{get:e,enumerable:!0}}function Tr(e){var t,n={};for(t in e)n[t]=e[t];return n}function Mr(e){return e+"$uri"}function Ar(){return{line:0,column:0}}function Dr(e){throw e}function Rr(e){if(!this)return new Rr(e);var t,n,r,i,o,s,a,l,c,p=e&&e.proxy,u=Dr,d=Ar,h=!1,f=!1,m=null,g=!1;function y(e){e instanceof Error||(e=Pr(e)),m=e,u(e,d)}function v(e){o&&(e instanceof Error||(e=Pr(e)),o(e,d))}this.on=function(e,c){if("function"!=typeof c)throw Pr("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":r=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":i=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw Pr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Pr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw Pr("required args <xml=string>");return m=null,function(e){var o,u,m,b,w,x,_,E,k,O,P,S=f?[]:null,C=f?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[Mr(n)]=t;return r}(c):null,T=[],M=0,A=!1,D=!1,R=0,N=0,j="",I=0;function L(){if(null!==P)return P;var e,t,n,r,i,o,s,a,l,p,u,d=f&&C.xmlns,m=f&&h?[]:null,g=I,y=j,b=y.length,w={},x={};e:for(;g<b;g++)if(l=!1,!(32===(p=y.charCodeAt(g))||p<14&&p>8)){for((p<65||p>122||p>90&&p<97)&&95!==p&&58!==p&&(v("illegal first char attribute name"),l=!0),u=g+1;u<b;u++)if(!((p=y.charCodeAt(u))>96&&p<123||p>64&&p<91||p>47&&p<59||46===p||45===p||95===p)){if(32===p||p<14&&p>8){v("missing attribute value"),g=u;continue e}if(61===p)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(a=y.substring(g,u))&&(v("illegal declaration of xmlns"),l=!0),34===(p=y.charCodeAt(u+1)))-1===(u=y.indexOf('"',g=u+2))&&-1!==(u=y.indexOf("'",g))&&(v("attribute value quote missmatch"),l=!0);else if(39===p)-1===(u=y.indexOf("'",g=u+2))&&-1!==(u=y.indexOf('"',g))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(p=y.charCodeAt(u+1))||p<14&&p>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=y.substring(g,u)),g=u;u+1<b&&!(32===(p=y.charCodeAt(u+1))||p<14&&p>8);u++)g===u&&(v("illegal character after attribute end"),l=!0);if(g=u+1,!l)if(a in x)v("attribute <"+a+"> already defined");else if(x[a]=!0,f)if(h){if(null!==(i="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=kr(o),t=Mr(i),!(s=c[e])){if("xmlns"===i||t in C&&C[t]!==e)do{s="ns"+M++}while(void 0!==C[s]);else s=i;c[e]=s}C[i]!==s&&(r||(C=Tr(C),r=!0),C[i]=s,"xmlns"===i&&(C[Mr(s)]=e,d=s),C[t]=e),w[a]=o;continue}m.push(a,o)}else-1!==(p=a.indexOf(":"))?(n=C[a.substring(0,p)])?w[a=d===n?a.substr(p+1):n+a.substr(p)]=o:v(Sr(a.substring(0,p))):w[a]=o;else w[a]=o}if(h)for(g=0,b=m.length;g<b;g++){if(a=m[g++],o=m[g],-1!==(p=a.indexOf(":"))){if(!(n=C[a.substring(0,p)])){v(Sr(a.substring(0,p)));continue}a=d===n?a.substr(p+1):n+a.substr(p)}w[a]=o}return P=w}function $(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,o=0,s=0,a=N;R>=s&&(t=r.exec(e))&&!((a=t[0].length+t.index)>R);)i+=1,s=a;return-1==R?(o=a,n=e.substring(N)):0===N?n=e.substring(N,R):(o=R-s,n=-1==N?e.substring(R):e.substring(R,N+1)),{data:n,line:i,column:o}}d=$,p&&(O=Object.create({},{name:Cr((function(){return E})),originalName:Cr((function(){return k})),attrs:Cr(L),ns:Cr((function(){return C}))}));for(;-1!==N;){if(-1===(R=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return T.length?y("unexpected end of file"):0===N?y("missing start tag"):void(N<e.length&&e.substring(N).trim()&&v(Or));if(N!==R)if(T.length){if(t&&(t(e.substring(N,R),kr,d),g))return}else if(e.substring(N,R).trim()&&(v(Or),g))return;if(33===(w=e.charCodeAt(R+1))){if(91===(b=e.charCodeAt(R+2))&&"CDATA["===e.substr(R+3,6)){if(-1===(N=e.indexOf("]]>",R)))return y("unclosed cdata");if(i&&(i(e.substring(R+9,N),d),g))return;N+=3;continue}if(45===b&&45===e.charCodeAt(R+3)){if(-1===(N=e.indexOf("--\x3e",R)))return y("unclosed comment");if(s&&(s(e.substring(R+4,N),kr,d),g))return;N+=3;continue}}if(63!==w){for(u=R+1;;u++){if(x=e.charCodeAt(u),isNaN(x))return N=-1,y("unclosed tag");if(34===x)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===x)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===x){N=u;break}}if(33!==w){if(P={},47===w){if(A=!1,D=!0,!T.length)return y("missing open tag");if(u=E=T.pop(),b=R+2+u.length,e.substring(R+2,b)!==u)return y("closing tag mismatch");for(;b<N;b++)if(!(32===(w=e.charCodeAt(b))||w>8&&w<14))return y("close tag")}else{if(47===e.charCodeAt(N-1)?(u=E=e.substring(R+1,N-1),A=!0,D=!0):(u=E=e.substring(R+1,N),A=!0,D=!1),!(w>96&&w<123||w>64&&w<91||95===w||58===w))return y("illegal first char nodeName");for(b=1,m=u.length;b<m;b++)if(!((w=u.charCodeAt(b))>96&&w<123||w>64&&w<91||w>47&&w<59||45===w||95===w||46==w)){if(32===w||w<14&&w>8){E=u.substring(0,b),P=null;break}return y("invalid nodeName")}D||T.push(E)}if(f){if(o=C,A&&(D||S.push(o),null===P&&(h=-1!==u.indexOf("xmlns",b))&&(I=b,j=u,L(),h=!1)),k=E,-1!==(w=E.indexOf(":"))){if(!(_=C[E.substring(0,w)]))return y("missing namespace on <"+k+">");E=E.substr(w+1)}else _=C.xmlns;_&&(E=_+":"+E)}if(A&&(I=b,j=u,n&&(p?n(O,kr,D,d):n(E,L,kr,D,d),g)))return;if(D){if(r&&(r(p?O:E,kr,A,d),g))return;f&&(C=A?o:S.pop())}N+=1}else{if(l&&(l(e.substring(R,N+1),kr,d),g))return;N+=1}}else{if(-1===(N=e.indexOf("?>",R)))return y("unclosed question");if(a&&(a(e.substring(R,N+2),d),g))return;N+=2}}}(e),d=Ar,g=!1,m},this.stop=function(){g=!0}}function Nr(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var jr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ir="property";function Lr(e){return e.xml&&e.xml.serialize}function $r(e,t){return Nr(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function zr(e){return new Error(e)}function Br(e){return e.$descriptor}function qr(e){L(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw zr("expected element");var t,n=this.elementsById,r=Br(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw zr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Fr(){}function Vr(){}function Hr(){}function Ur(e,t){this.property=e,this.context=t}function Wr(e,t){this.element=t,this.propertyDesc=e}function Gr(){}function Qr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Yr(e,t,n){Qr.call(this,e,t,n)}function Xr(e,t,n){this.model=e,this.context=n}function Zr(e){e instanceof vr&&(e={model:e}),L(this,{lax:!1},e)}Fr.prototype.handleEnd=function(){},Fr.prototype.handleText=function(){},Fr.prototype.handleNode=function(){},Vr.prototype=Object.create(Fr.prototype),Vr.prototype.handleNode=function(){return this},Hr.prototype=Object.create(Fr.prototype),Hr.prototype.handleText=function(e){this.body=(this.body||"")+e},Ur.prototype=Object.create(Hr.prototype),Ur.prototype.handleNode=function(e){if(this.element)throw zr("expected no sub nodes");return this.element=this.createReference(e),this},Ur.prototype.handleEnd=function(){this.element.id=this.body},Ur.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Wr.prototype=Object.create(Hr.prototype),Wr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=lr(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Gr.prototype=Object.create(Hr.prototype),Gr.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},Qr.prototype=Object.create(Gr.prototype),Qr.prototype.addReference=function(e){this.context.addReference(e)},Qr.prototype.handleText=function(e){if(!Br(this.element).bodyProperty)throw zr("unexpected body text <"+e+">");Hr.prototype.handleText.call(this,e)},Qr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Br(t).bodyProperty;n&&void 0!==e&&(e=lr(n.type,e),t.set(n.name,e))},Qr.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=Br(r),o=this.context,s=new r({}),a=this.model;return v(n,(function(e,n){var r=i.propertiesByName[n];r&&r.isReference?r.isMany?v(e.split(" "),(function(e){o.addReference({element:s,property:r.ns.name,id:e})})):o.addReference({element:s,property:r.ns.name,id:e}):(r?e=lr(r.type,e):"xmlns"===n?n=":"+n:(t=ur(n,i.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},Qr.prototype.getPropertyForNode=function(e){var t=ur(e.name),n=this.type,r=this.model,i=Br(n),o=t.name,s=i.propertiesByName[o];if(s&&!s.isAttr){const t=function(e){const t=Lr(e);return t!==Ir&&(t||null)}(s);if(t){const n=e.attributes[t];if(n){const t=function(e,t,n){const r=ur(e,t.xmlns),i=ur(`${t[r.prefix]||r.prefix}:${r.localName}`);return function(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(i,n.getPackage(i.prefix))}(n,e.ns,r);return L({},s,{effectiveType:Br(r.getType(t)).name})}}return s}var a=r.getPackage(t.prefix);if(a){const e=$r(t,a),n=r.getType(e);if(s=m(i.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),s)return L({},s,{effectiveType:Br(n).name})}else if(s=m(i.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),s)return s;throw zr("unrecognized element <"+t.name+">")},Qr.prototype.toString=function(){return"ElementDescriptor["+Br(this.type).name+"]"},Qr.prototype.valueHandler=function(e,t){return new Wr(e,t)},Qr.prototype.referenceHandler=function(e){return new Ur(e,this.context)},Qr.prototype.handler=function(e){return"Element"===e?new Xr(this.model,e,this.context):new Qr(this.model,e,this.context)},Qr.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,pr(n=t.effectiveType||t.type))return this.valueHandler(t,r);var o=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(L(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},Yr.prototype=Object.create(Qr.prototype),Yr.prototype.createElement=function(e){var t=e.name,n=ur(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),s=o&&$r(n,o)||t;if(!i.hasType(s))throw zr("unexpected element <"+e.originalName+">");return Qr.prototype.createElement.call(this,e)},Xr.prototype=Object.create(Gr.prototype),Xr.prototype.createElement=function(e){var t=e.name,n=ur(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},Xr.prototype.handleChild=function(e){var t=new Xr(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element;return void 0!==r&&((n.$children=n.$children||[]).push(r),r.$parent=n),t},Xr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Zr.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Qr?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,o=this.lax,s=new qr(L({},t,{rootHandler:r})),a=new Rr({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 r=t(),i=r.line,o=r.column,a=r.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw zr(l)}function p(e,t){return c(e,t,!0)}r.context=s,l.push(r);var u=/^<\?xml /i,d=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){p(e,t)}}var m=i.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),Object.entries(jr).reduce((function(e,[t,n]){return e[n]=t,e}),i.config&&i.config.nsMap||{}));return a.ns(m).on("openTag",(function(e,t,n,r){var i=e.attrs||{},s=Object.keys(i).reduce((function(e,n){var r=t(i[n]);return e[n]=r,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new Vr)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},r)})).on("question",(function(e){if(u.test(e)){var t=d.exec(e),n=t&&t[1];n&&!h.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",p),new Promise((function(t,n){var i;try{a.parse(e),function(){var e,t,n=s.elementsById,r=s.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],a=Br(i).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=i.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else i.set(a.name,o)}}()}catch(e){i=e}var o=r.element;i||o||(i=zr("failed to parse document as <"+r.type.$descriptor.name+">"));var l=s.warnings,c=s.references,p=s.elementsById;return i?(i.warnings=l,n(i)):t({rootElement:o,elementsById:p,references:c,warnings:l})}))},Zr.prototype.handler=function(e){return new Yr(this.model,e)};var Kr=/<|>|'|"|&|\n\r|\n/g,Jr=/<|>|&/g;function ei(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function ti(e,t){return Nr(t)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(e):e}function ni(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function ri(e){return h(e)?e:(e.prefix?e.prefix+":":"")+e.localName}ei.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},ei.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},ei.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)},ei.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},ei.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)},ei.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},ei.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},ei.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)},ei.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter((e=>{var t=this.getNSKey(e);return this.used[t]}))};var ii={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},oi={"<":"lt",">":"gt","&":"amp"};function si(e,t,n){return(e=h(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function ai(e){this.tagName=e}function li(){}function ci(e){this.tagName=e}function pi(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ui(e,t,n){pi.call(this,e,t),this.serialization=n}function di(){this.value="",this.write=function(e){this.value+=e}}function hi(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 fi(e){return e=L({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new di,i=new hi(r,e.format);e.preamble&&i.append('<?xml version="1.0" encoding="UTF-8"?>\n');var o=new pi,s=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){const t=e.config&&e.config.nsMap||{},n={};for(const e in jr)n[e]=jr[e];for(const e in t){n[t[e]]=e}for(const t of e.getPackages())n[t.prefix]=t.uri;return n}(s)),o.build(t).serializeTo(i),!n)return r.value}}}function mi(e,t){vr.call(this,e,t)}ai.prototype.build=function(e){return this.element=e,this},ai.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},li.prototype.serializeValue=li.prototype.serializeTo=function(e){e.append(this.escape?si(this.value,Jr,oi):this.value)},li.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Jr)&&(this.escape=!0),this},ni(ci,li),ci.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},pi.prototype.build=function(e){this.element=e;var t,n,r=e.$descriptor,i=this.propertyDescriptor,o=r.isGeneric;return t=o?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=i?this.nsPropertyTagName(i):this.nsTagName(r),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(n=function(e){return y(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!f(e,n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)}))}(e),this.parseAttributes(y(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return y(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},pi.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?L({localName:t.ns.localName},e):L({localName:ti(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},pi.prototype.nsPropertyTagName=function(e){return function(e,t){return L({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},pi.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},pi.prototype.nsAttributeName=function(e){var t;if(t=h(e)?ur(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}:L({localName:t.localName},n)},pi.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter((([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n))).map((([e,t])=>({name:e,value:t})))},pi.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push((new li).build({type:"String"},t));var n=e.$children;n&&v(n,(e=>{this.body.push(new pi(this).build(e))}))},pi.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,o=ur(t);if("xmlns"===o.prefix&&(r={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var s=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(s)}},pi.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return v(n,(function(n,i){var o=t.parseNsAttribute(e,i,n);o&&r.push(o)})),r},pi.prototype.parseGenericAttributes=function(e,t){var n=this;v(t,(function(t){try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){"undefined"!=typeof console&&console.warn(`missing namespace information for <${t.name}=${t.value}> on`,e,n)}}))},pi.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;v(e,(function(e){var i=r.get(e.name),o=e.isReference;if(e.isMany||(i=[i]),e.isBody)n.push((new li).build(e,i[0]));else if(pr(e.type))v(i,(function(r){n.push(new ci(t.addTagName(t.nsPropertyTagName(e))).build(e,r))}));else if(o)v(i,(function(r){n.push(new ai(t.addTagName(t.nsPropertyTagName(e))).build(r))}));else{var s=Lr(e);v(i,(function(r){var i;i=s?s===Ir?new pi(t,e):new ui(t,e,s):new pi(t),n.push(i.build(r))}))}}))},pi.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new ei(t):n=t),n},pi.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix;return r.byUri(i)&&!n||r.add(e,t),r.mapPrefix(o,i),e},pi.prototype.logNamespaceUsed=function(e,t){var n,r,i,o=this.getNamespaces(t),s=e.prefix,a=e.uri;if(!s&&!a)return{localName:e.localName};if(i=o.defaultUriByPrefix(s),!(a=a||i||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if((e=o.byUri(a))||s||(e=this.logNamespace({uri:a},i===a,!0)),!e){for(n=s,r=1;o.uriByPrefix(n);)n=s+"_"+r++;e=this.logNamespace({prefix:n,uri:a},i===a)}return s&&o.mapPrefix(s,a),e},pi.prototype.parseAttributes=function(e){var t=this,n=this.element;v(e,(function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];v(r,(function(e){i.push(e.id)})),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)}))},pi.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),ri(e)},pi.prototype.addAttribute=function(e,t){var n=this.attrs;h(t)&&(t=si(t,Kr,ii));var r=g(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),i={name:e,value:t};-1!==r?n.splice(r,1,i):n.push(i)},pi.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)),v(t,(function(t){e.append(" ").append(ri(t.name)).append('="').append(t.value).append('"')}))},pi.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==li;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),v(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},ni(ui,pi),ui.prototype.parseNsAttributes=function(e){var t=pi.prototype.parseNsAttributes.call(this,e).filter((e=>e.name!==this.serialization)),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},ui.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},mi.prototype=Object.create(vr.prototype),mi.prototype.fromXML=function(e,t,n){h(t)||(n=t,t="bpmn:Definitions");var r=new Zr(L({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)},mi.prototype.toXML=function(e,t){var n=new fi(t);return new Promise((function(t,r){try{return t({xml:n.toXML(e)})}catch(e){return r(e)}}))};const gi={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 yi(e,t){return new mi(L({},gi,e),t)}function vi(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var bi="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 wi(e){f(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(bi)}})}function xi(e,t){return e.$instanceOf(t)}function _i(e){var t={},n=[],r={};function i(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function s(t,n){try{var i=r[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${vi(t)}`);return e.element(t,r[t.id],n)}(t,n);return o(t),i}catch(e){a(e.message,{element:t,error:e}),console.error(`failed to import ${vi(t)}`,e)}}function a(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t=e.bpmnElement;t?r[t.id]?a(`multiple DI elements defined for ${vi(t)}`,{element:t}):(r[t.id]=e,wi(t)):a(`no bpmnElement referenced in ${vi(e)}`,{element:e})};function c(e){var t;t=e.plane,l(t),v(t.planeElement,p)}function p(e){l(e)}this.handleDefinitions=function(o,s){var p=o.diagrams;if(s&&-1===p.indexOf(s))throw new Error("diagram not part of <bpmn:Definitions />");if(!s&&p&&p.length&&(s=p[0]),!s)throw new Error("no diagram to display");r={},c(s);var f=s.plane;if(!f)throw new Error(`no plane for ${vi(s)}`);var g=f.bpmnElement;if(!g){if(g=function(e){return m(e.rootElements,(function(e){return xi(e,"bpmn:Process")||xi(e,"bpmn:Collaboration")}))}(o),!g)throw new Error("no process or collaboration to display");a(`correcting missing bpmnElement on ${vi(f)} to ${vi(g)}`),f.bpmnElement=g,l(f)}var b,w,_=function(t,n){return e.root(t,r[t.id],n)}(g,f);if(xi(g,"bpmn:Process")||xi(g,"bpmn:SubProcess"))d(g,_);else{if(!xi(g,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${vi(f)}: ${vi(g)}`);w=_,v((b=g).participants,i(T,w)),x(b.artifacts,w),n.push((function(){!function(e,t){v(e,i(h,t))}(b.messageFlows,w)})),function(e,n){var r=y(e,(function(e){return!t[e.id]&&xi(e,"bpmn:Process")&&e.laneSets}));r.forEach(i(d,n))}(o.rootElements,_)}u(n)};var u=this.handleDeferred=function(){for(;n.length;)n.shift()()};function d(e,t){C(e,t),_(e.ioSpecification,t),x(e.artifacts,t),o(e)}function h(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 w(e,t){s(e,t)}function x(e,t){v(e,(function(e){xi(e,"bpmn:Association")?n.push((function(){w(e,t)})):w(e,t)}))}function _(e,t){e&&(v(e.dataInputs,i(g,t)),v(e.dataOutputs,i(b,t)))}var E=this.handleSubProcess=function(e,t){C(e,t),x(e.artifacts,t)};function k(e,t){var r=s(e,t);xi(e,"bpmn:SubProcess")&&E(e,r||t),xi(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){v(e.dataInputAssociations,i(f,t)),v(e.dataOutputAssociations,i(f,t))}))}function O(e,t){s(e,t)}function P(e,t){n.push((function(){var n=s(e,t);e.childLaneSet&&S(e.childLaneSet,n||t),function(e){v(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function S(e,t){v(e.lanes,i(P,t))}function C(e,t){!function(e,t){v(e,(function(e){xi(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){s(e,t)}(e,t)})):xi(e,"bpmn:BoundaryEvent")?n.unshift((function(){k(e,t)})):xi(e,"bpmn:FlowNode")?k(e,t):xi(e,"bpmn:DataObject")||(xi(e,"bpmn:DataStoreReference")||xi(e,"bpmn:DataObjectReference")?O(e,t):a(`unrecognized flowElement ${vi(e)} in context ${vi(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){v(e,i(S,t))}(e.laneSets,t)}function T(e,t){var n=s(e,t),r=e.processRef;r&&d(r,n||t)}}function Ei(e,t){var n=Oi(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function ki(e,t){return _(t,(function(t){return Ei(e,t)}))}function Oi(e){return e&&e.businessObject||e}function Pi(e){return e&&e.di}function Si(e,t,n){var r,i,o,s=[];function a(e,t){var n=new _i({root:function(e,t){return r.add(e,t)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var i=function(e,t){if(!t||!t.plane)return;var n,r=t.plane.bpmnElement,i=r;Ei(r,"bpmn:Process")||Ei(r,"bpmn:Collaboration")||(i=function(e){var t=e;for(;t;){if(Ei(t,"bpmn:Process"))return t;t=t.$parent}}(r));n=Ei(i,"bpmn:Collaboration")?i:m(e.rootElements,(function(e){if(Ei(e,"bpmn:Collaboration"))return m(e.participants,(function(e){return e.processRef===i}))}));var o=[i];n&&(o=E(n.participants,(function(e){return e.processRef}))).push(n);var s=Ci(o),a=[t],l=[r];return v(e.diagrams,(function(e){if(e.plane){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===l.indexOf(t)&&(a.push(e),l.push(t))}})),a}(e,t);if(!i)throw new Error("no diagram to display");v(i,(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 r=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),a(t,n),i.fire("import.render.complete",{error:undefined,warnings:s}),l({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function Ci(e){var t=[];return v(e,(function(e){e&&(t.push(e),t=t.concat(Ci(e.flowElements)))})),t}var Ti,Mi='<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>',Ai={verticalAlign:"middle"},Di={color:"#404040"},Ri={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Ni={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},ji={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"},Ii='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+Mi+'</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 Li(){Ti||(Y(Ti=ge(Ii),Ri),Y(ve("svg",Ti),Ai),Y(ve(".backdrop",Ti),Ni),Y(ve(".notice",Ti),ji),Y(ve(".link",Ti),Di,{margin:"15px 20px 15px 10px",alignSelf:"center"}),de.bind(Ti,".backdrop","click",(function(e){document.body.removeChild(Ti)}))),document.body.appendChild(Ti)}function $i(e){e=L({},Bi,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=ge('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Mi+"</a>");Y(ve("svg",t),Ai),Y(t,Di,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),ce.bind(t,"click",(function(e){Li(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function zi(e,t){return e.warnings=t,e}e($i,rr),$i.prototype.importXML=async function(e,t){const n=this;let r=[];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;r=r.concat(l),s=this._emit("import.parse.complete",(i={error:null,definitions:s,elementsById:c,references:a,warnings:r},n.get("eventBus").createEvent(i)))||s;const p=await this.importDefinitions(s,t);return r=r.concat(p.warnings),this._emit("import.done",{error:null,warnings:r}),{warnings:r}}catch(e){let t=e;throw r=r.concat(t.warnings||[]),zi(t,r),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 i},$i.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},$i.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw zi(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 zi(t,[]),t}try{this.clear()}catch(e){throw zi(e,[]),e}const{warnings:r}=await Si(this,t,n);return{warnings:r}},$i.prototype.saveXML=async function(e){e=e||{};let t,n,r=this._definitions;try{if(!r)throw new Error("no definitions loaded");r=this._emit("saveXML.start",{definitions:r})||r;n=(await this._moddle.toXML(r,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const i=t?{error:t}:{xml:n};if(this._emit("saveXML.done",i),t)throw t;return i},$i.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),r=ve(":scope > defs",t._svg),i=He(n),o=r?"<defs>"+He(r)+"</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+i+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},$i.prototype._setDefinitions=function(e){this._definitions=e},$i.prototype.getModules=function(){return this._modules},$i.prototype.clear=function(){this.getDefinitions()&&rr.prototype.clear.call(this)},$i.prototype.destroy=function(){rr.prototype.destroy.call(this),we(this._container)},$i.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},$i.prototype.off=function(e,t){this.get("eventBus").off(e,t)},$i.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=ve(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},$i.prototype.getDefinitions=function(){return this._definitions},$i.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},$i.prototype._init=function(e,t,n){const r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],r,i),s=L(q(n,["additionalModules"]),{canvas:L({},n.canvas,{container:e}),modules:o});rr.call(this,s),n&&n.container&&this.attachTo(n.container)},$i.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},$i.prototype._createContainer=function(e){const t=ge('<div class="bjs-container"></div>');return Y(t,{width:qi(e.width),height:qi(e.height),position:e.position}),t},$i.prototype._createModdle=function(e){return new yi(L({},this._moddleExtensions,e.moddleExtensions))},$i.prototype._modules=[];const Bi={width:"100%",height:"100%",position:"relative"};function qi(e){return e+(u(e)?"px":"")}function Fi(e){$i.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 Vi(e,t){return!Ei(e,"bpmn:CallActivity")&&(Ei(e,"bpmn:SubProcess")?!(!(t=t||Pi(e))||!Ei(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!Ei(e,"bpmn:Participant")||!!Oi(e).processRef)}function Hi(e){if(Ei(e,"bpmn:Participant")||Ei(e,"bpmn:Lane")){var t=Pi(e).isHorizontal;return void 0===t||t}}function Ui(e){return e&&!1!==Oi(e).isInterrupting}function Wi(e){return e&&!!Oi(e).triggeredByEvent}function Gi(e,t){return _(Oi(e).eventDefinitions,(function(e){return Ei(e,t)}))}e(Fi,$i),Fi.prototype._createModdle=function(e){var t=$i.prototype._createModdle.call(this,e);return t.ids=new n([32,36,1]),t},Fi.prototype._collectIds=function(e,t){var n,r=e.$model.ids;for(n in r.clear(),t)r.claim(n,t[n])};var Qi={width:90,height:20},Yi=15;function Xi(e){return Ei(e,"bpmn:Event")||Ei(e,"bpmn:Gateway")||Ei(e,"bpmn:DataStoreReference")||Ei(e,"bpmn:DataObjectReference")||Ei(e,"bpmn:DataInput")||Ei(e,"bpmn:DataOutput")||Ei(e,"bpmn:SequenceFlow")||Ei(e,"bpmn:MessageFlow")||Ei(e,"bpmn:Group")}function Zi(e){return fn(e.label)}function Ki(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=function(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}}(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),s=i.x,a=i.y;return Math.abs(o)<Math.PI/2?a-=Yi:s+=Yi,{x:s,y:a}}function Ji(e){return e.waypoints?Ki(e.waypoints):Ei(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Qi.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Qi.height/2}}function eo(e){return Ei(e,"bpmn:FlowElement")||Ei(e,"bpmn:Participant")||Ei(e,"bpmn:Lane")||Ei(e,"bpmn:SequenceFlow")||Ei(e,"bpmn:MessageFlow")||Ei(e,"bpmn:DataInput")||Ei(e,"bpmn:DataOutput")?"name":Ei(e,"bpmn:TextAnnotation")?"text":Ei(e,"bpmn:Group")?"categoryValueRef":void 0}function to(e){var t=e.businessObject,n=eo(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function no(e,t){var n=e.businessObject,r=eo(n);if(r)if("categoryValueRef"===r){if(!n[r])return e;n[r].value=t}else n[r]=t;return e}var ro="hsl(225, 10%, 15%)",io="white";function oo(e,t){return _(e.eventDefinitions,(function(e){return e.$type===t}))}function so(e,t,n){var r=Pi(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||io}function ao(e,t,n){var r=Pi(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||ro}function lo(e,t,n,r){var i=Pi(e).get("label");return r||i&&i.get("color:color")||t||ao(e,n)}function co(e,t={}){return{width:po(e,t),height:uo(e,t)}}function po(e,t={}){return f(t,"width")?t.width:e.width}function uo(e,t={}){return f(t,"height")?t.height:e.height}var ho=new n,fo=.95;function mo(e,t,n,r,i,o,s){ot.call(this,t,s);var a=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor;function u(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ro,strokeWidth:2,fill:"white"})}function d(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ro,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:r=1,element:o,parentGfx:s=i._svg}=t,a=Ne("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*r,markerHeight:20*r,orient:"auto"});xe(a,o);var l=ve(":scope > defs",s);l||xe(s,l=Ne("defs")),xe(l,a)}function f(e,t,n,r){var i=ho.nextPrefixed("marker-");return function(e,t,n,r,i){if("sequenceflow-end"===n){h(t,{element:Ne("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){h(t,{element:Ne("circle",{cx:6,cy:6,r:3.5,...u({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){h(t,{element:Ne("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){h(t,{element:Ne("path",{d:"M 11 5 L 1 10 L 11 15",...d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){h(t,{element:Ne("path",{d:"M 1 5 L 11 10 L 1 15",...d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){h(t,{element:Ne("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:r,stroke:i})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){h(t,{element:Ne("path",{d:"M 6 4 L 10 16",...u({stroke:i,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,i,t,n,r),"url(#"+i+")"}function m(e,t,n,r,i={}){p(r)&&(i=r,r=0),r=r||0,i=u(i);var o=Ne("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-r),...i});return xe(e,o),o}function g(e,t,n,r,i,o){p(i)&&(o=i,i=0),i=i||0,o=u(o);var s=Ne("rect",{x:i,y:i,width:t-2*i,height:n-2*i,rx:r,ry:r,...o});return xe(e,s),s}function y(e,t,n,r){var i=ut(t,n=d(n),r);return xe(e,i),i}function b(e,t,n){return y(e,t,n,5)}function w(e,t,n){n=d(n);var r=Ne("path",{...n,d:t});return xe(e,r),r}function x(e,t,n,r){return w(t,n,L({"data-marker":e},r))}function _(e){return K[e]}function E(e){return function(t,n,r){return _(e)(t,n,r)}}var k=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:i?so(t,a,n.fill):ao(t,l,n.stroke),strokeWidth:1})},O=function(e,t,n={}){var i=m(e,t.width,t.height,.2*t.height,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:2});w(e,r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:ao(t,l,n.stroke),strokeWidth:2});for(var o=0;o<12;o++){var s=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),c=t.width/2,p=t.height/2;w(e,s,{strokeWidth:1,stroke:ao(t,l,n.stroke),transform:"rotate("+30*o+","+p+","+c+")"})}return i},P=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},S=function(e,t,n={}){return w(e,r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},C=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},T=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},M=function(e,t,n={},i){var o=w(e,r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:i?ao(t,l,n.stroke):"none",stroke:ao(t,l,n.stroke),strokeWidth:1});return Kn(o,45),o},A=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},D=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},R=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),strokeWidth:1})},N=function(e,t,n={}){return w(e,r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},j=function(e,t,n={}){return m(e,t.width,t.height,8,{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:4})};function I(e,t,n={}){var r=Oi(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(r);return r.get("eventDefinitions")&&r.get("eventDefinitions").length>1?r.get("parallelMultiple")?N(t,e,n,i):R(t,e,n,i):oo(r,"bpmn:MessageEventDefinition")?k(t,e,n,i):oo(r,"bpmn:TimerEventDefinition")?O(t,e,n,i):oo(r,"bpmn:ConditionalEventDefinition")?S(t,e,n,i):oo(r,"bpmn:SignalEventDefinition")?D(t,e,n,i):oo(r,"bpmn:EscalationEventDefinition")?P(t,e,n,i):oo(r,"bpmn:LinkEventDefinition")?C(t,e,n,i):oo(r,"bpmn:ErrorEventDefinition")?T(t,e,n,i):oo(r,"bpmn:CancelEventDefinition")?M(t,e,n,i):oo(r,"bpmn:CompensateEventDefinition")?A(t,e,n,i):oo(r,"bpmn:TerminateEventDefinition")?j(t,e,n,i):null}var $={ParticipantMultiplicityMarker:function(e,t,n={}){var i=po(t,n),o=uo(t,n);x("participant-multiplicity",e,r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2-6)/i,my:(o-15)/o}}),{strokeWidth:2,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},SubProcessMarker:function(e,t,n={}){Zn(g(e,14,14,0,{strokeWidth:1,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)}),t.width/2-7.5,t.height-20),x("sub-process",e,r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},ParallelMarker:function(e,t,n){var i=po(t,n),o=uo(t,n);x("parallel",e,r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.parallel)/i,my:(o-20)/o}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},SequentialMarker:function(e,t,n){x("sequential",e,r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},CompensationMarker:function(e,t,n){x("compensation",e,r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},LoopMarker:function(e,t,n){var i=po(t,n),o=uo(t,n);x("loop",e,r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.loop)/i,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:ao(t,l,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var i=po(t,n),o=uo(t,n);x("adhoc",e,r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.adhoc)/i,my:(o-15)/o}}),{strokeWidth:1,fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke)})}};function z(e,t,n,r){$[e](t,n,r)}function B(e,t,n,r={}){r={fill:r.fill,stroke:r.stroke,width:po(t,r),height:uo(t,r)};var i=Oi(t),o=n&&n.includes("SubProcessMarker");r=o?{...r,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...r,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},v(n,(function(n){z(n,e,t,r)})),i.get("isForCompensation")&&z("CompensationMarker",e,t,r),Ei(i,"bpmn:AdHocSubProcess")&&z("AdhocMarker",e,t,r);var s=i.get("loopCharacteristics"),a=s&&s.get("isSequential");s&&(void 0===a&&z("LoopMarker",e,t,r),!1===a&&z("ParallelMarker",e,t,r),!0===a&&z("SequentialMarker",e,t,r))}function q(e,t,n={}){n=L({size:{width:100}},n);var r=o.createText(t||"",n);return Se(r).add("djs-label"),xe(e,r),r}function F(e,t,n,r={}){var i=Oi(t),o=co({x:t.x,y:t.y,width:t.width,height:t.height},r);return q(e,i.name,{align:n,box:o,padding:7,style:{fill:lo(t,c,l,r.stroke)}})}function V(e,t,n,r={}){var i=Hi(n),o=q(e,t,{box:{height:30,width:i?uo(n,r):po(n,r)},align:"center-middle",style:{fill:lo(n,c,l,r.stroke)}});i&&Xn(o,0,-(-1*uo(n,r)),270)}function H(e,t,n={}){var{width:r,height:i}=co(t,n);return g(e,r,i,10,{...n,fill:so(t,a,n.fill),fillOpacity:fo,stroke:ao(t,l,n.stroke)})}function U(e,t,n={}){var r=Oi(t),i=so(t,a,n.fill),o=ao(t,l,n.stroke);return"One"!==r.get("associationDirection")&&"Both"!==r.get("associationDirection")||(n.markerEnd=f(e,"association-end",i,o)),"Both"===r.get("associationDirection")&&(n.markerStart=f(e,"association-start",i,o)),n=go(n,["markerStart","markerEnd"]),b(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function W(e,t,n={}){var i=so(t,a,n.fill),o=ao(t,l,n.stroke),s=w(e,r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:i,fillOpacity:fo,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(Oi(t))&&w(e,r.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:i,stroke:o});return s}function G(e,t,n={}){return m(e,t.width,t.height,{fillOpacity:fo,...n,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})}function Q(e,t,n={}){return function(e,t,n,r){var i=t/2,o=n/2,s=[{x:i,y:0},{x:t,y:o},{x:i,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");r=u(r);var a=Ne("polygon",{...r,points:s});return xe(e,a),a}(e,t.width,t.height,{fill:so(t,a,n.fill),fillOpacity:fo,stroke:ao(t,l,n.stroke)})}function Y(e,t,n={}){var r=g(e,po(t,n),uo(t,n),0,{fill:so(t,a,n.fill),fillOpacity:n.fillOpacity||fo,stroke:ao(t,l,n.stroke),strokeWidth:1.5}),i=Oi(t);Ei(i,"bpmn:Lane")&&V(e,i.get("name"),t,n);return r}function X(e,t,n={}){var r=H(e,t,n);Wi(t)&&Oe(r,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var i=Vi(t);return F(e,t,i?"center-top":"center-middle",n),B(e,t,i?void 0:["SubProcessMarker"],n),r}function Z(e,t,n={}){var r=H(e,t,n);return F(e,t,"center-middle",n),B(e,t,void 0,n),r}var K=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return X(e,t,n=Vi(t)?go(n,["fill","stroke","width","height"]):go(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return U(e,t,n=go(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]);var i=Oi(t).get("cancelActivity");n={strokeWidth:1.5,fill:so(t,a,n.fill),fillOpacity:1,stroke:ao(t,l,n.stroke)},i||(n.strokeDasharray="6");var o=G(e,t,n);return m(e,t.width,t.height,3,{...n,fill:"none"}),r&&I(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return Oe(w(e,r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),Oe(w(e,r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:CallActivity":function(e,t,n={}){return n=go(n,["fill","stroke"]),X(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var i=Q(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:DataInput":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=r.getRawPath("DATA_ARROW"),o=W(e,t,n);return w(e,i,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=go(n,["fill","stroke"]),U(e,t,{...n,markerEnd:f(e,"association-end",so(t,a,n.fill),ao(t,l,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return W(e,t,n=go(n,["fill","stroke"]))},"bpmn:DataObjectReference":E("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=r.getRawPath("DATA_ARROW"),o=W(e,t,n);return w(e,i,{strokeWidth:1,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=go(n,["fill","stroke"]),U(e,t,{...n,markerEnd:f(e,"association-end",so(t,a,n.fill),ao(t,l,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=go(n,["fill","stroke"]),w(e,r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:so(t,a,n.fill),fillOpacity:fo,stroke:ao(t,l,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]);var i=G(e,t,{...n,strokeWidth:4});return r&&I(t,e,n),i},"bpmn:EventBasedGateway":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=Oi(t),o=Q(e,t,n);m(e,t.width,t.height,.2*t.height,{fill:so(t,"none",n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1});var s=i.get("eventGatewayType"),a=!!i.get("instantiate");if("Parallel"===s){var c=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});w(e,c,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1})}else"Exclusive"===s&&(a||m(e,t.width,t.height,.26*t.height,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1}),function(){var i=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});w(e,i,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var i=Q(e,t,n=go(n,["fill","stroke"])),o=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Pi(t).get("isMarkerVisible")&&w(e,o,{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:Gateway":function(e,t,n={}){return Q(e,t,n=go(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=go(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:ao(t,l,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:po(t,n),height:uo(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var r=Q(e,t,n=go(n,["fill","stroke"]));return m(e,t.width,t.height,.24*t.height,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:2.5}),r},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]);var i=G(e,t,{...n,strokeWidth:1.5});return m(e,t.width,t.height,3,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1.5}),r&&I(t,e,n),i},"bpmn:IntermediateCatchEvent":E("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":E("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=go(n,["fill","stroke","width","height"]),Y(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:.5}),i},"bpmn:MessageFlow":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=Oi(t),o=Pi(t),s=so(t,a,n.fill),c=ao(t,l,n.stroke),p=b(e,t.waypoints,{markerEnd:f(e,"messageflow-end",s,c),markerStart:f(e,"messageflow-start",s,c),stroke:c,strokeDasharray:"10, 11",strokeWidth:1.5});if(i.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),d=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(h.fill=s,h.stroke=c):(h.fill=c,h.stroke=s);var m=w(e,d,h),g=q(e,i.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:c}}),y=m.getBBox(),v=g.getBBox();Xn(g,u.x-v.width/2,u.y+y.height/2+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var i=Q(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:Participant":function(e,t,n={}){var r=Y(e,t,n=go(n,["fill","stroke","width","height"])),i=Vi(t),o=Hi(t),s=Oi(t),a=s.get("name");if(i){y(e,o?[{x:30,y:0},{x:30,y:uo(t,n)}]:[{x:0,y:30},{x:po(t,n),y:30}],{stroke:ao(t,l,n.stroke),strokeWidth:1.5}),V(e,a,t,n)}else{var p=co(t,n);o||(p.height=po(t,n),p.width=uo(t,n));var u=q(e,a,{box:p,align:"center-middle",style:{fill:lo(t,c,l,n.stroke)}});if(!o)Xn(u,0,-(-1*uo(t,n)),270)}return s.get("participantMultiplicity")&&z("ParticipantMultiplicityMarker",e,t,n),r},"bpmn:ReceiveTask":function(e,t,n={}){n=go(n,["fill","stroke"]);var i,o=Oi(t),s=Z(e,t,n);return o.get("instantiate")?(m(e,28,28,4.4,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),i=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,i,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),s},"bpmn:ScriptTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:SendTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:ao(t,l,n.stroke),stroke:so(t,a,n.fill),strokeWidth:1}),i},"bpmn:SequenceFlow":function(e,t,n={}){n=go(n,["fill","stroke"]);var r=so(t,a,n.fill),i=ao(t,l,n.stroke),o=b(e,t.waypoints,{markerEnd:f(e,"sequenceflow-end",r,i),stroke:i}),s=Oi(t),{source:c}=t;if(c){var p=Oi(c);s.get("conditionExpression")&&Ei(p,"bpmn:Activity")&&Oe(o,{markerStart:f(e,"conditional-flow-marker",r,i)}),p.get("default")&&(Ei(p,"bpmn:Gateway")||Ei(p,"bpmn:Activity"))&&p.get("default")===s&&Oe(o,{markerStart:f(e,"conditional-default-flow-marker",r,i)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return m(e,10,10,{fill:so(t,a,n.fill),stroke:"none",transform:"translate(6, 6)"}),w(e,r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),m(e,10,10,{fill:so(t,a,n.fill),stroke:"none",transform:"translate(11, 10)"}),w(e,r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]),Oi(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var i=G(e,t,n);return r&&I(t,e,n),i},"bpmn:SubProcess":function(e,t,n={}){return X(e,t,n=Vi(t)?go(n,["fill","stroke","width","height"]):go(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return Z(e,t,n=go(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=go(n,["fill","stroke","width","height"]);var{width:i,height:o}=co(t,n),s=g(e,i,o,0,0,{fill:"none",stroke:"none"});return w(e,r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:0,my:0}}),{stroke:ao(t,l,n.stroke)}),q(e,Oi(t).get("text")||"",{align:"left-top",box:co(t,n),padding:7,style:{fill:lo(t,c,l,n.stroke)}}),s},"bpmn:Transaction":function(e,t,r={}){r=Vi(t)?go(r,["fill","stroke","width","height"]):go(r,["fill","stroke"]);var i=X(e,t,{strokeWidth:1.5,...r}),o=n.style(["no-fill","no-events"],{stroke:ao(t,l,r.stroke),strokeWidth:1.5});return Vi(t)||(r={}),g(e,po(t,r),uo(t,r),7,3,o),i},"bpmn:UserTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:.5}),w(e,r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:.5}),w(e,r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:.5}),i},label:function(e,t,n={}){return function(e,t,n={}){var r={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return q(e,to(t),{box:r,fitBox:!0,style:L({},o.getExternalStyle(),{fill:lo(t,c,l,n.stroke)})})}(e,t,n)}};this._drawPath=w,this._renderer=_}function go(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(mo,ot),mo.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],mo.prototype.canRender=function(e){return Ei(e,"bpmn:BaseElement")},mo.prototype.drawShape=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},mo.prototype.drawConnection=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},mo.prototype.getShapePath=function(e){return Ei(e,"bpmn:Event")?function(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2;return st([["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])}(e):Ei(e,"bpmn:Activity")?function(e,t){var n=e.x,r=e.y,i=e.width,o=e.height;return st([["M",n+t,r],["l",i-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-i,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):Ei(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return st([["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,r=e.width;return st([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])}(e)};var yo=0,vo={width:150,height:50};function bo(e,t){var n;t.textContent=e;try{var r,i=""===e;return t.textContent=i?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},i&&(r.width=0),r}catch(e){return console.log(e),{width:0,height:0}}}function wo(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=bo(o,n)).width=o?r.width:0," "===o||""===o||r.width<Math.round(t)||o.length<2)return xo(e,o,i,r);o=Eo(o,r.width,t)}}function xo(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}var _o="";function Eo(e,t,n){var r=Math.max(e.length*(n/t),1),i=function(e,t){var n,r=e.split(/(\s|-|\u00AD)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"!==n&&n!==_o||i.pop();break}i.push(n),o+=n.length}var s=i[i.length-1];return s&&s===_o&&(i[i.length-1]="-"),i.join("")}(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function ko(e){this._config=L({},{size:vo,padding:yo,style:{},align:"center-top"},e||{})}ko.prototype.createText=function(e,t){return this.layoutText(e,t).element},ko.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},ko.prototype.layoutText=function(e,t){var n=L({},this._config.size,t.box),r=L({},this._config.style,t.style),i=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return p(e)?L({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)}(r),l=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,d=Ne("text");for(Oe(d,{x:0,y:0}),Oe(d,r),xe(function(){var e=document.getElementById("helper-svg");return e||(Oe(e=Ne("svg"),{id:"helper-svg"}),Y(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),d);l.length;)c.push(wo(l,u,d));"middle"===i.vertical&&(o.top=o.bottom=0);var h=w(c,(function(e,t,n){return e+(a||t.height)}),0)+o.top+o.bottom,f=w(c,(function(e,t,n){return t.width>e?t.width:e}),0),m=o.top;"middle"===i.vertical&&(m+=(n.height-h)/2),m-=(a||c[0].height)/4;var g=Ne("text");return Oe(g,r),v(c,(function(e){var t;switch(m+=a||e.height,i.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=Ne("tspan");Oe(n,{x:t,y:m}),n.textContent=e.text,xe(g,n)})),Ue(d),{dimensions:{width:f,height:h},element:g}};function Oo(e){var t=L({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=L({},t,{fontSize:n},e&&e.externalStyle||{}),i=new ko({style:t});this.getExternalLabelBounds=function(e,t){var n=i.getDimensions(t,{box:{width:90,height:30},style:r});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 r=i.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(r.height))}},this.createText=function(e,t){return i.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Oo.$inject=["config.textRenderer"];var Po=/\{([^{}]+)\}/g,So=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Co={__init__:["bpmnRenderer"],bpmnRenderer:["type",mo],textRenderer:["type",Oo],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,r,i=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o={};if(t.position){for(var s=t.containerHeight/i.height*t.yScaleFactor,a=t.containerWidth/i.width*t.xScaleFactor,l=0;l<i.heightElements.length;l++)o["y"+l]=i.heightElements[l]*s;for(var c=0;c<i.widthElements.length;c++)o["x"+c]=i.widthElements[c]*a}var p,u,d=(p=i.d,u={mx:n,my:r,e:o},String(p).replace(Po,(function(e,t){return function(e,t,n){var r=n;return t.replace(So,(function(e,t,n,i,o){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&o&&(r=r()))})),r=(null==r||r==n?e:r)+""}(e,t,u)})));return d}}]};var To={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function Mo(e,t,n){return L({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Ao(e,t,n){var r=e.waypoint;return!r||r.length<2?[wn(t),wn(n)]:r.map((function(e){return{x:e.x,y:e.y}}))}function Do(e,t,n){return new Error(`element ${vi(t)} referenced by ${vi(e)}#${n} not yet drawn`)}function Ro(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}Ro.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Ro.prototype.add=function(e,t,n){var r,i,o;if(Ei(t,"bpmndi:BPMNPlane")){var s=Ei(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(Mo(e,t,s)),this._canvas.addRootElement(r)}else if(Ei(t,"bpmndi:BPMNShape")){var a=!Vi(e,t),l=function(e){return Ei(e,"bpmn:Group")}(e);i=n&&(n.hidden||n.collapsed);var c=t.bounds;r=this._elementFactory.createShape(Mo(e,t,{collapsed:a,hidden:i,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height),isFrame:l})),Ei(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),Ei(e,"bpmn:Lane")&&(o=0),Ei(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}(n,wn(c))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else{if(!Ei(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${vi(t)} for element ${vi(e)}`);var p=this._getSource(e),u=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Mo(e,t,{hidden:i,source:p,target:u,waypoints:Ao(t,p,u)})),Ei(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}return Xi(e)&&to(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r},Ro.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${vi(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw Do(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),-1===i.indexOf(t)&&i.push(t)},Ro.prototype.addLabel=function(e,t,n){var r,i,o;return r=function(e,t){var n,r,i,o=e.label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(Qi.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=Ji(t),r=Qi),L({x:n.x-r.width/2,y:n.y-r.height/2},r)}(t,n),(i=to(n))&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(Mo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!to(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(o,n.parent)},Ro.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===i&&(r=r&&r[0]),("source"===t&&"bpmn:DataOutputAssociation"===i||"target"===t&&"bpmn:DataInputAssociation"===i)&&(r=e.$parent),n=r&&this._getElement(r))return n;throw r?Do(e,r,t+"Ref"):new Error(`${vi(e)}#${t} Ref not specified`)},Ro.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Ro.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Ro.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var No={__depends__:[Co,{__depends__:[To],bpmnImporter:["type",Ro]}]};function jo(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}jo.prototype.next=function(){return this._prefix+ ++this._counter};var Io=new jo("ov");function Lo(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Io,this._overlayDefaults=L({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),Y(o=ge('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),i.insertBefore(o,i.firstChild),o),this._init()}function $o(e,t,n){Y(e,{left:t+"px",top:n+"px"})}function zo(e,t){e.style.display=!1===t?"none":""}function Bo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Lo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Lo.prototype.get=function(e){if(h(e)&&(e={id:e}),h(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?y(t.overlays,M({type:e.type})):t.overlays.slice():[]}return e.type?y(this._overlays,M({type:e.type})):e.id?this._overlays[e.id]:null},Lo.prototype.add=function(e,t,n){if(p(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 r=this._ids.next();return n=L({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Lo.prototype.remove=function(e){var t=this.get(e)||[];c(t)||(t=[t]);var n=this;v(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(we(e.html),we(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}}))},Lo.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Lo.prototype.show=function(){zo(this._overlayRoot)},Lo.prototype.hide=function(){zo(this._overlayRoot,!1)},Lo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ee(this._overlayRoot)},Lo.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=vt(t);r=o.x,i=o.y}$o(n,r,i),X(e.html,"data-container-id",t.id)},Lo.prototype._updateOverlay=function(e){var t,n,r=e.position,i=e.htmlContainer,o=e.element,s=r.left,a=r.top;void 0!==r.right&&(t=o.waypoints?vt(o).width:o.width,s=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?vt(o).height:o.height,a=-1*r.bottom+n);$o(i,s||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Lo.prototype._createOverlayContainer=function(e){var t=ge('<div class="djs-overlays" />');Y(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Lo.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Bo(this._overlayRoot,n)},Lo.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Lo.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),h(o)&&(o=ge(o)),n=this._getOverlayContainer(i),Y(t=ge('<div class="djs-overlay" data-overlay-id="'+r+'">'),{position:"absolute"}),t.appendChild(o),e.type&&K(t).add("djs-overlay-"+e.type),zo(t,this._canvas.findRoot(i)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Lo.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,l=!0;(r!==this._canvas.getRootElement()||n&&(a(i)&&i>t.scale||a(o)&&o<t.scale))&&(l=!1),zo(s,l),this._updateOverlayScale(e,t)},Lo.prototype._updateOverlayScale=function(e,t){var n,r,i,o=e.scale,s=e.htmlContainer,l="";!0!==o&&(!1===o?(n=1,r=1):(n=o.min,r=o.max),a(n)&&t.scale<n&&(i=(1/t.scale||1)*n),a(r)&&t.scale>r&&(i=(1/t.scale||1)*r)),a(i)&&(l="scale("+i+","+i+")"),Bo(s,l)},Lo.prototype._updateOverlaysVisibilty=function(e){var t=this;v(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Lo.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;v(t.get({element:n}),(function(e){t.remove(e.id)}));var r=t._getOverlayContainer(n);if(r){we(r.html);var i=t._overlayContainers.indexOf(r);-1!==i&&t._overlayContainers.splice(i,1)}})),e.on("element.changed",500,(function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&(v(r.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(r))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&K(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 qo={__init__:["overlays"],overlays:["type",Lo]};function Fo(e,t,n,r){e.on("element.changed",(function(r){var i=r.element;(i.parent||i===t.getRootElement())&&(r.gfx=n.getGraphics(i)),r.gfx&&e.fire(bt(i)+".changed",r)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),r.updateContainments(n)})),e.on("shape.changed",(function(e){r.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){r.update("connection",e.element,e.gfx)}))}Fo.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Vo={__init__:["changeSupport"],changeSupport:["type",Fo]};function Ho(e){this._eventBus=e}function Uo(e){return function(t,n,r,i,o){(d(t)||u(t))&&(o=i,i=r,r=n,n=t,t=null),this.on(t,e,n,r,i,o)}}function Wo(e,t){t.invoke(Ho,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)}))}Ho.$inject=["eventBus"],Ho.prototype.on=function(e,t,n,r,i,o){if((d(t)||u(t))&&(o=i,i=r,r=n,n=t,t=null),d(n)&&(o=i,i=r,r=n,n=1e3),p(i)&&(o=i,i=!1),!d(r))throw new Error("handlerFn must be a function");c(e)||(e=[e]);var s=this._eventBus;v(e,(function(e){var a=["commandStack",e,t].filter((function(e){return e})).join(".");s.on(a,n,i?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(r,o):r,o)}))},Ho.prototype.canExecute=Uo("canExecute"),Ho.prototype.preExecute=Uo("preExecute"),Ho.prototype.preExecuted=Uo("preExecuted"),Ho.prototype.execute=Uo("execute"),Ho.prototype.executed=Uo("executed"),Ho.prototype.postExecute=Uo("postExecute"),Ho.prototype.postExecuted=Uo("postExecuted"),Ho.prototype.revert=Uo("revert"),Ho.prototype.reverted=Uo("reverted"),e(Wo,Ho),Wo.$inject=["canvas","injector"];var Go={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Wo]};function Qo(e){return CSS.escape(e)}var Yo={"&":"&","<":"<",">":">",'"':""","'":"'"};function Xo(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return Yo[e]}))}var Zo="_plane";function Ko(e){return function(e){return e.replace(new RegExp(Zo+"$"),"")}(e.id)}function Jo(e){var t=e.id;return Ei(e,"bpmn:SubProcess")?ns(t):t}function es(e){return ns(e)}function ts(e){return Ei(Pi(e),"bpmndi:BPMNPlane")}function ns(e){return e+Zo}function rs(e,t,n){var r=ge('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=K(i);i.appendChild(r);var s=[];function a(e){e&&(s=function(e){for(var t=Oi(e),n=[],r=t;r;r=r.$parent)(Ei(r,"bpmn:SubProcess")||Ei(r,"bpmn:Process"))&&n.push(r);return n.reverse()}(e));var i=s.flatMap((function(e){var r=n.findRoot(Jo(e))||n.findRoot(e.id);if(!r&&Ei(e,"bpmn:Process")){var i=t.find((function(t){var n=Oi(t);return n&&n.get("processRef")===e}));r=i&&n.findRoot(i.id)}if(!r)return[];var o=Xo(e.name||e.id),s=ge('<li><span class="bjs-crumb"><a title="'+o+'">'+o+"</a></span></li>");return s.addEventListener("click",(function(){n.setRootElement(r)})),s}));r.innerHTML="";var a=i.length>1;o.toggle("bjs-breadcrumbs-shown",a),i.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=Oi(e.element);m(s,(function(e){return e===t}))&&a()})),e.on("root.set",(function(e){a(e.element)}))}function is(e,t){var n=null,r=new os;e.on("root.set",(function(e){var i=e.element,o=t.viewbox(),s=r.get(i);if(r.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=i,Ei(i,"bpmn:SubProcess")||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(){r.clear(),n=null}))}function os(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][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)}}rs.$inject=["eventBus","elementRegistry","canvas"],is.$inject=["eventBus","canvas"];var ss=180,as=160;function ls(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 cs(e){return Ei(e,"bpmndi:BPMNDiagram")?e:cs(e.$parent)}ls.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)})),e.diagrams.filter((e=>e.plane)).flatMap((e=>t._createNewDiagrams(e.plane))).forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},ls.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach((function(t){var i=t.bpmnElement;if(i){var o=i.$parent;Ei(i,"bpmn:SubProcess")&&!t.isExpanded&&n.push(i),function(e,t){var n=e.$parent;if(!Ei(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(ki(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(i,e)&&r.push({diElement:t,parent:o})}}));var i=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,i.push(n)}})),r.forEach((function(e){for(var r=e.diElement,i=e.parent;i&&-1===n.indexOf(i);)i=i.$parent;if(i){var o=t._processToDiagramMap[i.id];t._moveToDiPlane(r,o.plane)}})),i},ls.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=yn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),vn(t)}(e),r=n.x-ss,i=n.y-as;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-r,e.y=e.y-i})):e.bounds&&(e.bounds.x=e.bounds.x-r,e.bounds.y=e.bounds.y-i)}))},ls.prototype._moveToDiPlane=function(e,t){var n=cs(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},ls.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},ls.$inject=["eventBus","moddle"];var ps=250;function us(e,t,n,r,i){Ho.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",ps,(function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",ps,(function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],ps,(function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;o._canDrillDown(r)&&o._addOverlay(r),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],ps,(function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;o._canDrillDown(r)&&o._addOverlay(r),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return o._canDrillDown(e)})).map((function(e){o._addOverlay(e)}))}))}e(us,Ho),us.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},us.prototype._canDrillDown=function(e){var t=this._canvas;return Ei(e,"bpmn:SubProcess")&&t.findRoot(Jo(e))},us.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Oi(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;K(r.html).toggle("bjs-drilldown-empty",!i)}},us.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=Oi(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=ge('<button type="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>'),o=r.get("name")||r.get("id"),s=this._translate("Open {element}",{element:o});i.setAttribute("title",s),i.addEventListener("click",(function(){t.setRootElement(t.findRoot(Jo(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},us.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},us.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var ds={__depends__:[qo,Vo,Go],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",rs],drilldownCentering:["type",is],drilldownOverlayBehavior:["type",us],subprocessCompatibility:["type",ls]};function hs(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function fs(e){return e.originalEvent||e.srcEvent}function ms(e){hs(e),hs(fs(e))}function gs(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 ys(){return/mac/i.test(navigator.platform)}function vs(e,t){return(fs(e)||e).button===t}function bs(e){return vs(e,0)}function ws(e){var t=fs(e)||e;return!!bs(e)&&(ys()?t.metaKey:t.ctrlKey)}function xs(e){var t=fs(e)||e;return bs(e)&&t.shiftKey}function _s(e){return!0}function Es(e){return bs(e)||function(e){return vs(e,1)}(e)}function ks(e,t,n){var r=this;function i(n,r,i){var o,s;(function(e,t){var n=l[e]||bs;return!n(t)})(n,r)||(i?s=t.getGraphics(i):(o=r.delegateTarget||r.target)&&(s=o,i=t.get(s)),s&&i&&!1===e.fire(n,{element:i,gfx:s,originalEvent:r})&&(r.stopPropagation(),r.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":_s,"element.mousedown":Es,"element.mouseup":Es,"element.click":Es,"element.dblclick":Es};var c="svg, .djs-element";function p(e,t,n,r){var s=o[n]=function(e){i(n,e)};r&&(l[n]=r),s.$delegate=de.bind(e,c,t,s)}function u(e,t,n){var r=s(n);r&&de.unbind(e,t,r.$delegate)}e.on("canvas.destroy",(function(e){!function(e){v(a,(function(t,n){u(e,n,t)}))}(e.svg)})),e.on("canvas.init",(function(e){!function(e){v(a,(function(t,n){p(e,n,t)}))}(e.svg)})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:r})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:r})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;r.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;r.updateDefaultHit(t,n)}));var d=m("djs-hit djs-hit-stroke"),h=m("djs-hit djs-hit-click-stroke"),f={all:m("djs-hit djs-hit-all"),"click-stroke":h,stroke:d,"no-move":m("djs-hit djs-hit-no-move")};function m(e,t){return t=L({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 Oe(e,n),e}function y(e,t){xe(e,t)}this.removeHits=function(e){v(be(".djs-hit",e),Ue)},this.createDefaultHit=function(e,t){var n,r=e.waypoints,i=e.isFrame;return r?this.createWaypointsHit(t,r):(n=i?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=ut(t);return g(n,"stroke"),y(e,n),n},this.createBoxHit=function(e,t,n){n=L({x:0,y:0},n);var r=Ne("rect");return g(r,t),Oe(r,n),y(e,r),r},this.updateDefaultHit=function(e,t){var n=ve(".djs-hit",t);if(n)return e.waypoints?dt(n,e.waypoints):Oe(n,{width:e.width,height:e.height}),n},this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=a[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=s,this.registerEvent=p,this.unregisterEvent=u}ks.$inject=["eventBus","elementRegistry","styles"];var Os={__init__:["interactionEvents"],interactionEvents:["type",ks]};function Ps(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)}))}Ps.$inject=["eventBus","canvas"],Ps.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},Ps.prototype.get=function(){return this._selectedElements},Ps.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Ps.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();c(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter((function(e){var t=i.findRoot(e);return o===t})),t?v(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Ss="hover",Cs="selected";function Ts(e,t){function n(t,n){e.addMarker(t,n)}function r(t,n){e.removeMarker(t,n)}this._canvas=e,t.on("element.hover",(function(e){n(e.element,Ss)})),t.on("element.out",(function(e){r(e.element,Ss)})),t.on("selection.changed",(function(e){var t=e.oldSelection,i=e.newSelection;v(t,(function(e){-1===i.indexOf(e)&&function(e){r(e,Cs)}(e)})),v(i,(function(e){-1===t.indexOf(e)&&function(e){n(e,Cs)}(e)}))}))}function Ms(e,t,n,r){e.on("create.end",500,(function(e){var n=e.context,r=n.canExecute,i=n.elements,o=(n.hints||{}).autoSelect;if(r){if(!1===o)return;c(o)?t.select(o):t.select(i.filter(As))}})),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||[],i=r.get(e.context.shape.id);m(n,(function(e){return i.id===e.id}))||t.select(i)})),e.on("element.click",(function(e){if(bs(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,s=xs(e);if(i&&o)return s?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,s)}}))}function As(e){return!e.hidden}Ts.$inject=["canvas","eventBus"],Ms.$inject=["eventBus","selection","canvas","elementRegistry"];var Ds={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Os],selection:["type",Ps],selectionVisuals:["type",Ts],selectionBehavior:["type",Ms]};function Rs(e){$i.call(this,e)}e(Rs,$i),Rs.prototype._modules=[No,ds,qo,Ds,To],Rs.prototype._moddleExtensions={};var Ns=["c","C"],js=["v","V"],Is=["y","Y"],Ls=["z","Z"];function $s(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function zs(e,t){return-1!==(e=c(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Bs(e){return e.shiftKey}function qs(e){return $s(e)&&!Bs(e)&&zs(Ls,e)}function Fs(e){return $s(e)&&(zs(Is,e)||zs(Ls,e)&&Bs(e))}var Vs="keyboard.keydown",Hs="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Us(e,t){var n=this;this._config=e=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()})),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Hs));var r=e&&!1!==e.bind;t.on("canvas.init",(function(e){n._target=e.svg,r&&n.bind(),n._fire("init")}))}Us.$inject=["config.keyboard","eventBus"],Us.prototype._keydownHandler=function(e){this._keyHandler(e,Vs)},Us.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Us.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Vs,n)&&e.preventDefault()}},Us.prototype._isEventIgnored=function(e){return!1},Us.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Hs)),this.unbind(),e=this._node=this._target,ce.bind(e,"keydown",this._keydownHandler),ce.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Us.prototype.getBinding=function(){return this._node},Us.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ce.unbind(e,"keydown",this._keydownHandler),ce.unbind(e,"keyup",this._keyupHandler)),this._node=null},Us.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Us.prototype.addListener=function(e,t,n){d(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Vs,e,t)},Us.prototype.removeListener=function(e,t){this._eventBus.off(t||Vs,e)},Us.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Us.prototype.isCmd=$s,Us.prototype.isShift=Bs,Us.prototype.isKey=zs;var Ws=500;function Gs(e,t){var n=this;e.on("editorActions.init",Ws,(function(e){var r=e.editorActions;n.registerBindings(t,r)}))}Gs.$inject=["eventBus","keyboard"],Gs.prototype.registerBindings=function(e,t){function n(n,r){t.isRegistered(n)&&e.addListener(r)}n("undo",(function(e){if(qs(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(Fs(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return $s(e)&&zs(Ns,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return $s(e)&&zs(js,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(zs(["+","Add","="],n)&&$s(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(zs(["-","Subtract"],n)&&$s(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(zs("0",n)&&$s(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(zs(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Qs={__init__:["keyboard","keyboardBindings"],keyboard:["type",Us],keyboardBindings:["type",Gs]},Ys={moveSpeed:50,moveSpeedAccelerated:200};function Xs(e,t,n){var r=this;this._config=L({},Ys,e||{}),t.addListener((function(e){var n=e.keyEvent,i=r._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,s=t.isShift(n)?i.moveSpeedAccelerated:i.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 r.moveCanvas({speed:s,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,r=0,i=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=i;break;case"up":r=i;break;case"right":t=-i;break;case"down":r=-i}n.scroll({dx:t,dy:r})}}Xs.$inject=["config.keyboardMove","keyboard","canvas"];var Zs={__depends__:[Qs],__init__:["keyboardMove"],keyboardMove:["type",Xs]},Ks=/^djs-cursor-.*$/;function Js(e){var t=K(document.body);t.removeMatching(Ks),e&&t.add("djs-cursor-"+e)}function ea(){Js(null)}var ta=5e3;function na(e,t){function n(){return!1}return t=t||"element.click",e.once(t,ta,n),function(){e.off(t,n)}}function ra(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ia(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oa(e,t){var n;function r(r){var i,o=n.start,s=n.button,a=gs(r),l=ia(a,o);(!n.dragging&&(i=l,Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))>15)&&(n.dragging=!0,0===s&&na(e),Js("grab")),n.dragging)&&(l=ia(a,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=a);r.preventDefault()}function i(e){ce.unbind(document,"mousemove",r),ce.unbind(document,"mouseup",i),n=null,ea()}e.on("element.mousedown",500,(function(e){return function(e){if(te(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:gs(e)},ce.bind(document,"mousemove",r),ce.bind(document,"mouseup",i),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}oa.$inject=["eventBus","canvas"];var sa={__init__:["moveCanvas"],moveCanvas:["type",oa]};function aa(e){return Math.log(e)/Math.log(10)}function la(e,t){var n=aa(e.min),r=aa(e.max);return(Math.abs(n)+Math.abs(r))/t}var ca=Math.sign||function(e){return e>=0?1:-1},pa={min:.2,max:4};function ua(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=I(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var r=this;t.on("canvas.init",(function(t){r._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=la(pa,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},ua.prototype._handleWheel=function(e){if(!te(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,r=e.ctrlKey||ys()&&e.metaKey,i=e.shiftKey,o=-1*this._scale;if(o*=r?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,r){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))*ca(e.deltaY)*o,this.zoom(n,a)}else n=i?{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=la(pa,10);this._zoom(e,t,n)},ua.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=aa(r.zoom()),s=Math.round(o/n)*n;s+=n*i;var a=Math.pow(10,s);r.zoom(function(e,t){return Math.max(e.min,Math.min(e.max,t))}(pa,a),t)},ua.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,r=this._enabled;return void 0===e&&(e=!r),r!==e&&ce[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},ua.prototype._init=function(e){this.toggle(e)};var da={__init__:["zoomScroll"],zoomScroll:["type",ua]};function ha(e){Rs.call(this,e)}function fa(e){return e&&e[e.length-1]}function ma(e){return e.y}function ga(e){return e.x}e(ha,Rs),ha.prototype._navigationModules=[Zs,sa,da],ha.prototype._modules=[].concat(Rs.prototype._modules,ha.prototype._navigationModules);var ya={left:ga,center:ga,right:function(e){return e.x+e.width},top:ma,middle:ma,bottom:function(e){return e.y+e.height}};function va(e,t){this._modeling=e,this._rules=t}va.$inject=["modeling","rules"],va.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},va.prototype._isType=function(e,t){return-1!==t.indexOf(e)},va.prototype._alignmentPosition=function(e,t){var n,r,i,o=this._getOrientationDetails(e),s=o.axis,a=o.dimension,l={},c={},p=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))i=fa(t),l[e]=i[s]+i[a];else if(this._isType(e,["center","middle"])){if(v(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=T(c,(function(e){return e.elements.length>1&&(p=!0),e.elements.length})),p)return l[e]=fa(n).center,l;r=t[0],i=fa(t=T(t,(function(e){return e[s]+e[a]}))),l[e]=function(e,t){return Math.round((e[s]+t[s]+t[a])/2)}(r,i)}return l},va.prototype.trigger=function(e,t){var n,r=this._modeling,i=y(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(c(n=this._rules.allowed("elements.align",{elements:i}))&&(i=n),!(i.length<2)&&n){var o=T(i,ya[t]),s=this._alignmentPosition(t,o);r.alignElements(o,s)}};var ba={__init__:["alignElements"],alignElements:["type",va]};const wa=new jo;function xa(e){this._scheduled={},e.on("diagram.destroy",(()=>{Object.keys(this._scheduled).forEach((e=>{this.cancel(e)}))}))}xa.$inject=["eventBus"],xa.prototype.schedule=function(e,t=wa.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},xa.prototype._schedule=function(e,t){const n=function(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}(),r=setTimeout((()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(e){n.reject(e)}}catch(e){console.error("Scheduler#_schedule execution failed",e)}}));return{executionId:r,promise:n.promise}},xa.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},xa.prototype._cancel=function(e){clearTimeout(e.executionId)};var _a={scheduler:["type",xa]},Ea=".entry";function ka(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}ka.$inject=["canvas","elementRegistry","eventBus","scheduler"],ka.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,r=n.length?1===n.length?n[0]:n:null;r?e.open(r,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,r=e._current;if(r){var i=r.target,o=c(i)?i:[i];if(o.filter((function(e){return n.includes(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",(function(){e._updatePosition()})),this._eventBus.on("element.marker.update",(function(t){if(e.isOpen()){var n=t.element,r=e._current;(c(r.target)?r.target:[r.target]).includes(n)&&e._updateVisibility()}})),this._container=this._createContainer()},ka.prototype._createContainer=function(){var e=ge('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},ka.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},ka.prototype.getEntries=function(e){var t=this._getProviders(),n=c(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return v(t,(function(t){if(d(t[n])){var i=t[n](e);d(i)?r=i(r):v(i,(function(e,t){r[t]=e}))}})),r},ka.prototype.trigger=function(e,t,n){var r,i,o=this,s=t.delegateTarget||t.target;return s?(r=X(s,"data-action"),i=t.originalEvent||t,"mouseover"!==e?"mouseout"===e?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(r,e,i,n):void(this._timeout=setTimeout((function(){o._mouseout=o.triggerEntry(r,"hover",i,n)}),300))):t.preventDefault()},ka.prototype.triggerEntry=function(e,t,n,r){if(this.isShown()){var i=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(d(s)){if("click"===t)return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}},ka.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},ka.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ka.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),r=this._createHtml(e);v(n,(function(e,n){var i,o=e.group||"default",s=ge(e.html||'<div class="entry" draggable="true"></div>');X(s,"data-action",n),(i=ve("[data-group="+Qo(o)+"]",r))||(X(i=ge('<div class="group"></div>'),"data-group",o),r.appendChild(i)),i.appendChild(s),e.className&&function(e,t){var n=K(e);t=c(t)?t:t.split(/\s+/g),t.forEach((function(e){n.add(e)}))}(s,e.className),e.title&&X(s,"title",e.title),e.imageUrl&&(X(t=ge("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",s.appendChild(t))})),K(r).add("open"),this._current={entries:n,html:r,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},ka.prototype._createHtml=function(e){var t=this,n=ge('<div class="djs-context-pad"></div>');return de.bind(n,Ea,"click",(function(e){t.trigger("click",e)})),de.bind(n,Ea,"dragstart",(function(e){t.trigger("dragstart",e)})),de.bind(n,Ea,"mouseover",(function(e){t.trigger("mouseover",e)})),de.bind(n,Ea,"mouseout",(function(e){t.trigger("mouseout",e)})),ce.bind(n,"mousedown",(function(e){e.stopPropagation()})),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},ka.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&&x(e,(function(e){return t.includes(e)}))}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},ka.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ka.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&&x(e,(function(e){return n.includes(e)})):n===e)},ka.prototype.isShown=function(){return this.isOpen()&&K(this._current.html).has("open")},ka.prototype.show=function(){this.isOpen()&&(K(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},ka.prototype.hide=function(){this.isOpen()&&(K(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},ka.prototype._getPosition=function(e){if(!c(e)&&hn(e)){var t=this._canvas.viewbox(),n=(o=e).waypoints[o.waypoints.length-1],r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:r+8*this._canvas.zoom(),top:i}}var o,s=this._canvas.getContainer().getBoundingClientRect(),a=this._getTargetBounds(e);return{left:a.right-s.left+8*this._canvas.zoom(),top:a.top-s.top}},ka.prototype._updatePosition=function(){this._scheduler.schedule((()=>{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")}))}}),"ContextPad#_updatePosition")},ka.prototype._updateVisibility=function(){this._scheduler.schedule((()=>{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()}}),"ContextPad#_updateVisibility")},ka.prototype._getTargetBounds=function(e){var t=this;return(c(e)?e:[e]).map((function(e){return t._canvas.getGraphics(e)})).reduce((function(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 Oa,Pa,Sa,Ca,Ta,Ma,Aa={__depends__:[Os,_a,qo],contextPad:["type",ka]},Da={},Ra=[],Na=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ja(e,t){for(var n in t)e[n]=t[n];return e}function Ia(e){var t=e.parentNode;t&&t.removeChild(e)}function La(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Oa.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 $a(e,s,r,i,null)}function $a(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Sa:i};return null==i&&null!=Pa.vnode&&Pa.vnode(o),o}function za(e){return e.children}function Ba(e,t){this.props=e,this.context=t}function qa(e,t){if(null==t)return e.__?qa(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?qa(e):null}function Fa(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 Fa(e)}}function Va(e){(!e.__d&&(e.__d=!0)&&Ca.push(e)&&!Ha.__r++||Ta!==Pa.debounceRendering)&&((Ta=Pa.debounceRendering)||setTimeout)(Ha)}function Ha(){for(var e;Ha.__r=Ca.length;)e=Ca.sort((function(e,t){return e.__v.__b-t.__v.__b})),Ca=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=ja({},i)).__v=i.__v+1,Ja(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?qa(i):o,i.__h),el(n,i),i.__e!=o&&Fa(i)))}))}function Ua(e,t,n,r,i,o,s,a,l,c){var p,u,d,h,f,m,g,y=r&&r.__k||Ra,v=y.length;for(n.__k=[],p=0;p<t.length;p++)if(null!=(h=n.__k[p]=null==(h=t[p])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?$a(null,h,null,null,h):Array.isArray(h)?$a(za,{children:h},null,null,null):h.__b>0?$a(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(d=y[p])||d&&h.key==d.key&&h.type===d.type)y[p]=void 0;else for(u=0;u<v;u++){if((d=y[u])&&h.key==d.key&&h.type===d.type){y[u]=void 0;break}d=null}Ja(e,h,d=d||Da,i,o,s,a,l,c),f=h.__e,(u=h.ref)&&d.ref!=u&&(g||(g=[]),d.ref&&g.push(d.ref,null,h),g.push(u,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===d.__k?h.__d=l=Wa(h,l,e):l=Qa(e,h,d,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=qa(d))}for(n.__e=m,p=v;p--;)null!=y[p]&&nl(y[p],y[p]);if(g)for(p=0;p<g.length;p++)tl(g[p],g[++p],g[++p])}function Wa(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Wa(r,t,n):Qa(n,r,r,i,r.__e,t));return t}function Ga(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){Ga(e,t)})):t.push(e)),t}function Qa(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function Ya(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Na.test(t)?n:n+"px"}function Xa(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ya(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ya(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?r||e.addEventListener(t,o?Ka:Za,o):e.removeEventListener(t,o?Ka:Za,o);else if("dangerouslySetInnerHTML"!==t){if(i)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 Za(e){this.l[e.type+!1](Pa.event?Pa.event(e):e)}function Ka(e){this.l[e.type+!0](Pa.event?Pa.event(e):e)}function Ja(e,t,n,r,i,o,s,a,l){var c,p,u,d,h,f,m,g,y,v,b,w,x,_,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=Pa.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,y=(c=k.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(p=t.__c=n.__c).__=p.__E:("prototype"in k&&k.prototype.render?t.__c=p=new k(g,v):(t.__c=p=new Ba(g,v),p.constructor=k,p.render=rl),y&&y.sub(p),p.props=g,p.state||(p.state={}),p.context=v,p.__n=r,u=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=k.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=ja({},p.__s)),ja(p.__s,k.getDerivedStateFromProps(g,p.__s))),d=p.props,h=p.state,u)null==k.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,v),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,v)||t.__v===n.__v){for(p.props=g,p.state=p.__s,t.__v!==n.__v&&(p.__d=!1),p.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<p._sb.length;b++)p.__h.push(p._sb[b]);p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,v),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(d,h,f)}))}if(p.context=v,p.props=g,p.__v=t,p.__P=e,w=Pa.__r,x=0,"prototype"in k&&k.prototype.render){for(p.state=p.__s,p.__d=!1,w&&w(t),c=p.render(p.props,p.state,p.context),_=0;_<p._sb.length;_++)p.__h.push(p._sb[_]);p._sb=[]}else do{p.__d=!1,w&&w(t),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++x<25);p.state=p.__s,null!=p.getChildContext&&(r=ja(ja({},r),p.getChildContext())),u||null==p.getSnapshotBeforeUpdate||(f=p.getSnapshotBeforeUpdate(d,h)),E=null!=c&&c.type===za&&null==c.key?c.props.children:c,Ua(e,Array.isArray(E)?E:[E],t,n,r,i,o,s,a,l),p.base=t.__e,t.__h=null,p.__h.length&&s.push(p),m&&(p.__E=p.__=null),p.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a){var l,c,p,u=n.props,d=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(d);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,d.is&&d),o=null,a=!1}if(null===h)u===d||a&&e.data===d||(e.data=d);else{if(o=o&&Oa.call(e.childNodes),c=(u=n.props||Da).dangerouslySetInnerHTML,p=d.dangerouslySetInnerHTML,!a){if(null!=o)for(u={},f=0;f<e.attributes.length;f++)u[e.attributes[f].name]=e.attributes[f].value;(p||c)&&(p&&(c&&p.__html==c.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Xa(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Xa(e,o,t[o],n[o],r)}(e,d,u,i,a),p)t.__k=[];else if(f=t.props.children,Ua(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&qa(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&Ia(o[f]);a||("value"in d&&void 0!==(f=d.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==u.value)&&Xa(e,"value",f,u.value,!1),"checked"in d&&void 0!==(f=d.checked)&&f!==e.checked&&Xa(e,"checked",f,u.checked,!1))}return e}(n.__e,t,n,r,i,o,s,l);(c=Pa.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),Pa.__e(e,t,n)}}function el(e,t){Pa.__c&&Pa.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Pa.__e(e,t.__v)}}))}function tl(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Pa.__e(e,n)}}function nl(e,t,n){var r,i;if(Pa.unmount&&Pa.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||tl(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Pa.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&nl(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Ia(e.__e),e.__=e.__e=e.__d=void 0}function rl(e,t,n){return this.constructor(e,n)}function il(e,t,n){var r,i,o;Pa.__&&Pa.__(e,t),i=(r="function"==typeof n)?null:t.__k,o=[],Ja(t,e=(!r&&n||t).__k=La(za,null,[e]),i||Da,Da,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Oa.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),el(o,e)}function ol(e,t){var n={__c:t="__cC"+Ma++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(Va)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}Oa=Ra.slice,Pa={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Sa=0,Ba.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ja({},this.state),"function"==typeof e&&(e=e(ja({},n),this.props)),e&&ja(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Va(this))},Ba.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Va(this))},Ba.prototype.render=za,Ca=[],Ha.__r=0,Ma=0;var sl=function(e,t,n,r){var i;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?r[0]=a:4===s?r[1]=Object.assign(r[1]||{},a):5===s?(r[1]=r[1]||{})[t[++o]]=a:6===s?r[1][t[++o]]+=a+"":s?(i=e.apply(a,sl(e,a,n,["",null])),r.push(i),a[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):r.push(a)}return r},al=new Map;var ll,cl,pl,ul,dl=function(e){var t=al.get(this);return t||(t=new Map,al.set(this,t)),(t=sl(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i="",o="",s=[0],a=function(e){1===r&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(0,e,i):3===r&&(e||i)?(s.push(3,e,i),r=2):2===r&&"..."===i&&e?s.push(4,e,0):2===r&&i&&!e?s.push(5,0,!0,i):r>=5&&((i||!e&&5===r)&&(s.push(r,0,i,n),r=6),e&&(s.push(r,e,0,n),r=6)),i=""},l=0;l<e.length;l++){l&&(1===r&&a(),a(l));for(var c=0;c<e[l].length;c++)t=e[l][c],1===r?"<"===t?(a(),s=[s],r=3):i+=t:4===r?"--"===i&&">"===t?(r=1,i=""):i=t+i[0]:o?t===o?o="":i+=t:'"'===t||"'"===t?o=t:">"===t?(a(),r=1):r&&("="===t?(r=5,n=i,i=""):"/"===t&&(r<5||">"===e[l][c+1])?(a(),3===r&&(s=s[0]),r=s,(s=s[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),r=2):i+=t),3===r&&"!--"===i&&(r=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}.bind(La),hl=0,fl=[],ml=[],gl=Pa.__b,yl=Pa.__r,vl=Pa.diffed,bl=Pa.__c,wl=Pa.unmount;function xl(e,t){Pa.__h&&Pa.__h(cl,e,hl||t),hl=0;var n=cl.__H||(cl.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:ml}),n.__[e]}function _l(e){return hl=1,function(e,t,n){var r=xl(ll++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):jl(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=cl,!cl.u)){cl.u=!0;var i=cl.shouldComponentUpdate;cl.shouldComponentUpdate=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.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&&r.__c.props===e)&&(!i||i.call(this,e,t,n))}}return r.__N||r.__}(jl,e)}function El(e,t){var n=xl(ll++,3);!Pa.__s&&Nl(n.__H,t)&&(n.__=e,n.i=t,cl.__H.__h.push(n))}function kl(e,t){var n=xl(ll++,4);!Pa.__s&&Nl(n.__H,t)&&(n.__=e,n.i=t,cl.__h.push(n))}function Ol(e){return hl=5,Pl((function(){return{current:e}}),[])}function Pl(e,t){var n=xl(ll++,7);return Nl(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Sl(e,t){return hl=8,Pl((function(){return e}),t)}function Cl(e){var t=cl.context[e.__c],n=xl(ll++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(cl)),t.props.value):e.__}function Tl(){for(var e;e=fl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dl),e.__H.__h.forEach(Rl),e.__H.__h=[]}catch(t){e.__H.__h=[],Pa.__e(t,e.__v)}}Pa.__b=function(e){cl=null,gl&&gl(e)},Pa.__r=function(e){yl&&yl(e),ll=0;var t=(cl=e.__c).__H;t&&(pl===cl?(t.__h=[],cl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ml,e.__N=e.i=void 0}))):(t.__h.forEach(Dl),t.__h.forEach(Rl),t.__h=[])),pl=cl},Pa.diffed=function(e){vl&&vl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==fl.push(t)&&ul===Pa.requestAnimationFrame||((ul=Pa.requestAnimationFrame)||Al)(Tl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ml&&(e.__=e.__V),e.i=void 0,e.__V=ml}))),pl=cl=null},Pa.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Dl),e.__h=e.__h.filter((function(e){return!e.__||Rl(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Pa.__e(n,e.__v)}})),bl&&bl(e,t)},Pa.unmount=function(e){wl&&wl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Dl(e)}catch(e){t=e}})),n.__H=void 0,t&&Pa.__e(t,n.__v))};var Ml="function"==typeof requestAnimationFrame;function Al(e){var t,n=function(){clearTimeout(r),Ml&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ml&&(t=requestAnimationFrame(n))}function Dl(e){var t=cl,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),cl=t}function Rl(e){var t=cl;e.__c=e.__(),cl=t}function Nl(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function jl(e,t){return"function"==typeof t?t(e):t}function Il(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Il(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ll(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Il(e))&&(r&&(r+=" "),r+=t);return r}function $l(e){const{headerEntries:t,onSelect:n,selectedEntry:r,setSelectedEntry:i,title:o}=e,s=Pl((()=>function(e){return e.reduce(((e,t)=>{const n=t.group||"default",r=e.find((e=>e.id===n));return r?r.entries.push(t):e.push({id:n,entries:[t]}),e}),[])}(t)),[t]);return dl`
|
|
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 r=Math.log(Math.pow(2,e))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,e/i))/Math.log(n)*i;var o=r-Math.floor(r),s="";for(i=0;i<Math.floor(r);i++){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,r){var i=function(i){var s=0;do{if(s++>10){if(!r)throw new Error("too many ID collisions, use more bits");e+=r}var a=t(e,n)}while(Object.hasOwnProperty.call(o,a));return o[a]=i,a},o=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=n||16,i}}));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 r(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 i=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]"===i.call(e)}function p(e){return"[object Object]"===i.call(e)}function u(e){return"[object Number]"===i.call(e)}function d(e){const t=i.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function h(e){return"[object String]"===i.call(e)}function f(e,t){return!l(e)&&o.call(e,t)}function m(e,t){const n=D(t);let r;return v(e,(function(e,t){if(n(e,t))return r=e,!1})),r}function g(e,t){const n=D(t);let r=c(e)?-1:void 0;return v(e,(function(e,t){if(n(e,t))return r=t,!1})),r}function y(e,t){const n=D(t);let r=[];return v(e,(function(e,t){n(e,t)&&r.push(e)})),r}function v(e,t){let n,r;if(s(e))return;const i=c(e)?N:R;for(let o in e)if(f(e,o)&&(n=e[o],r=t(n,i(o)),!1===r))return n}function b(e,t){if(s(e))return[];!function(e){if(!c(e))throw new Error("must supply array")}(e);const n=D(t);return e.filter((function(e,t){return!n(e,t)}))}function w(e,t,n){return v(e,(function(e,r){n=t(n,e,r)})),n}function x(e,t){return!!w(e,(function(e,n,r){return e&&t(n,r)}),!0)}function _(e,t){return!!m(e,t)}function E(e,t){let n=[];return v(e,(function(e,r){n.push(t(e,r))})),n}function k(e){return e&&Object.keys(e)||[]}function O(e){return E(e,(e=>e))}function P(e,t,n={}){return t=A(t),v(e,(function(e){let r=t(e)||"_",i=n[r];i||(i=n[r]=[]),i.push(e)})),n}function S(e,...t){e=A(e);let n={};return v(t,(t=>P(t,e,n))),E(n,(function(e,t){return e[0]}))}const C=S;function T(e,t){t=A(t);let n=[];return v(e,(function(e,r){let i=t(e,r),o={d:i,v:e};for(var s=0;s<n.length;s++){let{d:e}=n[s];if(i<e)return void n.splice(s,0,o)}n.push(o)})),E(n,(e=>e.v))}function M(e){return function(t){return x(e,(function(e,n){return t[n]===e}))}}function A(e){return d(e)?e:t=>t[e]}function D(e){return d(e)?e:t=>t===e}function R(e){return e}function N(e){return Number(e)}function j(e,t){let n,r,i,o;function s(n){let s=Date.now(),c=n?0:o+t-s;if(c>0)return a(c);e.apply(i,r),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=o=r=i=void 0}function c(...e){o=Date.now(),r=e,i=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function I(e,t){return e.bind(t)}function L(e,...t){return Object.assign(e,...t)}function $(e,t,n){let r=e;return v(t,(function(e,i){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[i+1],c=r[e];a(o)&&l(c)&&(c=r[e]=isNaN(+o)?{}:[]),s(o)?s(n)?delete r[e]:r[e]=n:r=c})),e}function z(e,t,n){let r=e;return v(t,(function(e){if(l(r))return r=void 0,!1;r=r[e]})),s(r)?n:r}function B(e,t){let n={},r=Object(e);return v(t,(function(t){t in r&&(n[t]=e[t])})),n}function q(e,t){let n={};return v(Object(e),(function(e,r){-1===t.indexOf(r)&&(n[r]=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 r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const V=Object.prototype.toString,H=Object.prototype.hasOwnProperty;function U(e,t){return H.call(e,t)}function W(e,t){let n,r;if(void 0===e)return;const i=function(e){return"[object Array]"===V.call(e)}(e)?Q:G;for(let o in e)if(U(e,o)&&(n=e[o],r=t(n,i(o)),!1===r))return n}function G(e){return e}function Q(e){return Number(e)}function Y(e,...t){const n=e.style;return W(t,(function(e){e&&W(e,(function(e,t){n[t]=e}))})),e}function X(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const Z=Object.prototype.toString;function K(e){return new J(e)}function J(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ee(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function te(e,t,n){var r=n?e:e.parentNode;return r&&"function"==typeof r.closest&&r.closest(t)||null}J.prototype.add=function(e){return this.list.add(e),this},J.prototype.remove=function(e){return"[object RegExp]"==Z.call(e)?this.removeMatching(e):(this.list.remove(e),this)},J.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},J.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},J.prototype.array=function(){return Array.from(this.list)},J.prototype.has=J.prototype.contains=function(e){return this.list.contains(e)};var ne,re,ie,oe={};function se(){ne=window.addEventListener?"addEventListener":"attachEvent",re=window.removeEventListener?"removeEventListener":"detachEvent",ie="addEventListener"!==ne?"on":""}var ae=oe.bind=function(e,t,n,r){return ne||se(),e[ne](ie+t,n,r||!1),n},le=oe.unbind=function(e,t,n,r){return re||se(),e[re](ie+t,n,r||!1),n},ce=F({__proto__:null,bind:ae,unbind:le,default:oe},[oe]),pe=["focus","blur"];var ue,de={bind:function(e,t,n,r,i){return-1!==pe.indexOf(n)&&(i=!0),ce.bind(e,n,(function(n){var i=n.target||n.srcElement;n.delegateTarget=te(i,t,!0),n.delegateTarget&&r.call(e,n)}),i)},unbind:function(e,t,n,r){return-1!==pe.indexOf(t)&&(r=!0),ce.unbind(e,t,n,r)}},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 r=n[1];if("body"==r){return(l=t.createElement("html")).innerHTML=e,l.removeChild(l.lastChild)}var i=Object.prototype.hasOwnProperty.call(me,r)?me[r]:me._default,o=i[0],s=i[1],a=i[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},fe=!1;"undefined"!=typeof document&&((ue=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',fe=!ue.getElementsByTagName("link").length,ue=void 0);var me={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:fe?[1,"X<div>","</div>"]:[0,"",""]};me.td=me.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],me.option=me.optgroup=[1,'<select multiple="multiple">',"</select>"],me.thead=me.tbody=me.colgroup=me.caption=me.tfoot=[1,"<table>","</table>"],me.polyline=me.ellipse=me.polygon=me.circle=me.text=me.line=me.path=me.rect=me.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var ge=he;function ye(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function ve(e,t){return(t=t||document).querySelector(e)}function be(e,t){return(t=t||document).querySelectorAll(e)}function we(e){e.parentNode&&e.parentNode.removeChild(e)}function xe(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}var _e=2,Ee={"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":_e,"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":_e,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function ke(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Ee[r];i?(i===_e&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function Oe(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Ee[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);ke(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)ke(e,r,t[r])}(e,t);return e}const Pe=Object.prototype.toString;function Se(e){return new Ce(e)}function Ce(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Te(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Me(e){return e.cloneNode(!0)}Ce.prototype.add=function(e){return this.list.add(e),this},Ce.prototype.remove=function(e){return"[object RegExp]"==Pe.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ce.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ce.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ce.prototype.array=function(){return Array.from(this.list)},Ce.prototype.has=Ce.prototype.contains=function(e){return this.list.contains(e)};var Ae={svg:"http://www.w3.org/2000/svg"},De='<svg xmlns="'+Ae.svg+'"';function Re(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Ae.svg)&&(e=De+e.substring(4)):(e=De+">"+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 r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function Ne(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=Re(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ae.svg,e),t&&Oe(n,t),n}var je=null;function Ie(){return null===je&&(je=Ne("svg")),je}function Le(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function $e(e){return Ie().createSVGTransform()}var ze=/([&<>]{1})/g,Be=/([\n\r"]{1})/g,qe={"&":"&","<":"<",">":">",'"':"'"};function Fe(e,t){return e.replace(t,(function(e,t){return qe[t]||t}))}function Ve(e,t){var n,r,i,o,s;switch(e.nodeType){case 3:t.push(Fe(e.textContent,ze));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',Fe(o.value,Be),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(s=e.childNodes).length;n<r;++n)Ve(s.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Fe(e.nodeValue,ze),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function He(e,t){return function(e){for(var t=e.firstChild,n=[];t;)Ve(t,n),t=t.nextSibling;return n.join("")}(e)}function Ue(e){var t=e.parentNode;return t&&t.removeChild(e),e}function We(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ge(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(We(e,r))}(n,t)),n.consolidate()}const Qe=/^class[ {]/;function Ye(e){return Array.isArray(e)}function Xe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ze(...e){1===e.length&&Ye(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Ke=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Je=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,et=/\/\*([^*]*)\*\//m;function tt(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)?Ke:Je);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(et);return(t&&t[1]||e).trim()}))||[]}function nt(e,t){const n=t||{get:function(e,t){if(r.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),s=o.injector=this,a=function(e){const t=r.join(" -> ");return r.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){if(!i[e]&&e.includes(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Xe(o,e))return o[e];if(Xe(i,e)){if(-1!==r.indexOf(e))throw r.push(e),a("Cannot resolve circular dependency!");return r.push(e),o[e]=i[e][0](i[e][1]),r.pop(),o[e]}return n.get(e,t)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Ye(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Ze(e.slice())}return{fn:e,dependencies:(e.$inject||tt(e)).map((e=>Xe(t,e)?t[e]:l(e)))}}function p(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:r,dependencies:i}=c(e,n);return r.apply(t,i)}function d(e){return Ze((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],s=[],a=[];let l,c,p,u;for(let e in i)l=i[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(p=l[3].createChild([],t),u=d(p),o.push(l[3]),s.push(p),a.push(u),n[e]=[u,e,"private",p]):n[e]=[a[c],e,"private",s[c]]):n[e]=[l[2],l[1]],r[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new nt(e,s)}const f={factory:u,type:p,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__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(r)),s=Ze((function(e){return o.get(e)}));t.forEach((function(e){i[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(i[t]=n);const r=n[0],o=n[1];i[t]=[f[r],rt(r,o),r]})),m(e,s)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=p,this.createChild=h,this.init=function(e){const t=e.reduce(y,[]).map(g);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function rt(e,t){return"value"!==e&&Ye(t)&&(t=Ze(t.slice())),t}var it=1e3;function ot(e,t){var n=this;t=t||it,e.on(["render.shape","render.connection"],t,(function(e,t){var r=e.type,i=t.element,o=t.gfx,s=t.attrs;if(n.canRender(i))return"render.shape"===r?n.drawShape(o,i,s):n.drawConnection(o,i,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 st(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function at(e){return["L",e.x,e.y]}function lt(e,t){const n=e.length,r=[(i=e[0],["M",i.x,i.y])];var i,o,s,a;for(let i=1;i<n;i++){const n=e[i-1],l=e[i],c=e[i+1];if(!c||!t){r.push(at(l));continue}const p=Math.min(t,pt(l.x-n.x,l.y-n.y),pt(c.x-l.x,c.y-l.y));if(!p){r.push(at(l));continue}const u=ct(l,n,p),d=ct(l,n,.5*p),h=ct(l,c,p),f=ct(l,c,.5*p);r.push(at(u)),r.push((s=f,a=h,["C",(o=d).x,o.y,s.x,s.y,a.x,a.y]))}return r}function ct(e,t,n){const r=t.x-e.x,i=t.y-e.y,o=n/pt(r,i);return{x:e.x+r*o,y:e.y+i*o}}function pt(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ut(e,t,n){u(t)&&(n=t,t=null),t||(t={});const r=Ne("path",t);return u(n)&&(r.dataset.cornerRadius=String(n)),dt(r,e)}function dt(e,t){return Oe(e,{d:st(lt(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function ht(e){return y(e,(function(t){return!m(e,(function(e){return e!==t&&ft(t,e)}))}))}function ft(e,t){if(t){if(e===t)return t;if(e.parent)return ft(e.parent,t)}}function mt(e,t,n){var r=!n||-1===e.indexOf(t);return r&&e.push(t),r}function gt(e,t,n){n=n||0,c(e)||(e=[e]),v(e,(function(e,r){var i=t(e,r,n);c(i)&&i.length&>(i,t,n+1)}))}function yt(e,t){return function(e,t,n){var r=[],i=[];return gt(e,(function(e,n,o){mt(r,e,t);var s=e.children;if(s&&mt(i,s,t))return s})),r}(e,!t)}function vt(e,t){var n,r,i,o;return t=!!t,c(e)||(e=[e]),v(e,(function(e){var s=e;e.waypoints&&!t&&(s=vt(e.waypoints,!0));var a=s.x,l=s.y,c=s.height||0,p=s.width||0;(a<n||void 0===n)&&(n=a),(l<r||void 0===r)&&(r=l),(a+p>i||void 0===i)&&(i=a+p),(l+c>o||void 0===o)&&(o=l+c)})),{x:n,y:r,height:o-r,width:i-n}}function bt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function wt(e){return!(!e||!e.isFrame)}function xt(e,t){return L({},e||{},t||{})}ot.prototype.canRender=function(e){},ot.prototype.drawShape=function(e,t){},ot.prototype.drawConnection=function(e,t){},ot.prototype.getShapePath=function(e){},ot.prototype.getConnectionPath=function(e){};function _t(e,t){ot.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(_t,ot),_t.prototype.canRender=function(){return!0},_t.prototype.drawShape=function(e,t,n){var r=Ne("rect");return Oe(r,{x:0,y:0,width:t.width||0,height:t.height||0}),wt(t)?Oe(r,L({},this.FRAME_STYLE,n||{})):Oe(r,L({},this.SHAPE_STYLE,n||{})),xe(e,r),r},_t.prototype.drawConnection=function(e,t,n){var r=ut(t.waypoints,L({},this.CONNECTION_STYLE,n||{}));return xe(e,r),r},_t.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return st([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},_t.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,i=[];for(t=0;n=r[t];t++)n=n.original||n,i.push([0===t?"M":"L",n.x,n.y]);return st(i)},_t.$inject=["eventBus","styles"];var Et={__init__:["defaultRenderer"],defaultRenderer:["type",_t],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 L(this.style(t,n),{class:e})},this.style=function(t,n){c(t)||n||(n=t,t=[]);var r=w(t,(function(t,n){return L(t,e[n]||{})}),{});return n?L(r,n):r},this.computeStyle=function(e,n,r){return c(n)||(r=n,n=[]),t.style(n||[],L({},r,e||{}))}}]};function kt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function Ot(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Pt(e,t){return e&&t?e.indexOf(t):-1}function St(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Ct(e,t,n,r){if(void 0===r&&(r=5),!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=St(e,t);return Math.abs(i/o)<=r}var Tt=2;function Mt(e,t){var n=Array.from(arguments).flat();const r={x:"v",y:"h"};for(const[e,t]of Object.entries(r))if(At(e,n))return t;return!1}function At(e,t){const n=t[0];return x(t,(function(t){return Math.abs(n[e]-t[e])<=Tt}))}function Dt(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 Rt(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Nt=/,?([a-z]),?/gi,jt=parseFloat,It=Math,Lt=It.PI,$t=It.min,zt=It.max,Bt=It.pow,qt=It.abs,Ft=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Vt=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Ht=Array.isArray||function(e){return e instanceof Array};function Ut(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Wt(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)Ut(e,n)&&(t[n]=Wt(e[n]));return t}function Gt(e){var t=Gt.ps=Gt.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout((function(){for(var n in t)Ut(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])})),t[e]}function Qt(e,t,n,r){return 1===arguments.length&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function Yt(){return this.join(",").replace(Nt,"$1")}function Xt(e){var t=Wt(e);return t.toString=Yt,t}function Zt(e,t,n,r,i,o,s,a,l){var c=1-l,p=Bt(c,3),u=Bt(c,2),d=l*l*l,h=p*t+3*u*l*r+3*c*l*l*o+d*a;return{x:rn(p*e+3*u*l*n+3*c*l*l*i+d*s),y:rn(h)}}function Kt(e){var t=function(e,t,n,r,i,o,s,a){for(var l,c,p,u,d,h,f,m,g=[],y=[[],[]],v=0;v<2;++v)if(0==v?(c=6*e-12*n+6*i,l=-3*e+9*n-9*i+3*s,p=3*n-3*e):(c=6*t-12*r+6*o,l=-3*t+9*r-9*o+3*a,p=3*r-3*t),qt(l)<1e-12){if(qt(c)<1e-12)continue;0<(u=-p/c)&&u<1&&g.push(u)}else f=c*c-4*p*l,m=It.sqrt(f),f<0||(0<(d=(-c+m)/(2*l))&&d<1&&g.push(d),0<(h=(-c-m)/(2*l))&&h<1&&g.push(h));var b,w=g.length,x=w;for(;w--;)b=1-(u=g[w]),y[0][w]=b*b*b*e+3*b*b*u*n+3*b*u*u*i+u*u*u*s,y[1][w]=b*b*b*t+3*b*b*u*r+3*b*u*u*o+u*u*u*a;return y[0][x]=e,y[1][x]=t,y[0][x+1]=s,y[1][x+1]=a,y[0].length=y[1].length=x+2,{x0:$t(...y[0]),y0:$t(...y[1]),x1:zt(...y[0]),y1:zt(...y[1])}}(...e);return Qt(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Jt(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function en(e,t,n,r,i){return e*(e*(-3*t+9*n-9*r+3*i)+6*t-12*n+6*r)-3*t+3*n}function tn(e,t,n,r,i,o,s,a,l){null==l&&(l=1);for(var c=(l=l>1?1:l<0?0:l)/2,p=[-.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],d=0,h=0;h<12;h++){var f=c*p[h]+c,m=en(f,e,n,i,s),g=en(f,t,r,o,a),y=m*m+g*g;d+=u[h]*It.sqrt(y)}return c*d}function nn(e,t,n,r,i,o,s,a){if(!(zt(e,n)<$t(i,s)||$t(e,n)>zt(i,s)||zt(t,r)<$t(o,a)||$t(t,r)>zt(o,a))){var l=(e*r-t*n)*(o-a)-(t-r)*(i*a-o*s),c=(e-n)*(o-a)-(t-r)*(i-s);if(c){var p=rn(((e*r-t*n)*(i-s)-(e-n)*(i*a-o*s))/c),u=rn(l/c),d=+p.toFixed(2),h=+u.toFixed(2);if(!(d<+$t(e,n).toFixed(2)||d>+zt(e,n).toFixed(2)||d<+$t(i,s).toFixed(2)||d>+zt(i,s).toFixed(2)||h<+$t(t,r).toFixed(2)||h>+zt(t,r).toFixed(2)||h<+$t(o,a).toFixed(2)||h>+zt(o,a).toFixed(2)))return{x:p,y:u}}}}function rn(e){return Math.round(1e11*e)/1e11}function on(e,t,n){if(!function(e,t){return e=Qt(e),Jt(t=Qt(t),e.x,e.y)||Jt(t,e.x2,e.y)||Jt(t,e.x,e.y2)||Jt(t,e.x2,e.y2)||Jt(e,t.x,t.y)||Jt(e,t.x2,t.y)||Jt(e,t.x,t.y2)||Jt(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)}(Kt(e),Kt(t)))return n?0:[];for(var r=tn(...e),i=tn(...t),o=ln(e)?1:~~(r/5)||1,s=ln(t)?1:~~(i/5)||1,a=[],l=[],c={},p=n?0:[],u=0;u<o+1;u++){var d=Zt(...e,u/o);a.push({x:d.x,y:d.y,t:u/o})}for(u=0;u<s+1;u++)d=Zt(...t,u/s),l.push({x:d.x,y:d.y,t:u/s});for(u=0;u<o;u++)for(var h=0;h<s;h++){var f,m=a[u],g=a[u+1],y=l[h],v=l[h+1],b=qt(g.x-m.x)<.01?"y":"x",w=qt(v.x-y.x)<.01?"y":"x",x=nn(m.x,m.y,g.x,g.y,y.x,y.y,v.x,v.y);if(x){if(c[f=x.x.toFixed(9)+"#"+x.y.toFixed(9)])continue;c[f]=!0;var _=m.t+qt((x[b]-m[b])/(g[b]-m[b]))*(g.t-m.t),E=y.t+qt((x[w]-y[w])/(v[w]-y[w]))*(v.t-y.t);_>=0&&_<=1&&E>=0&&E<=1&&(n?p++:p.push({x:x.x,y:x.y,t1:_,t2:E}))}}return p}function sn(e,t,n){e=dn(e),t=dn(t);for(var r,i,o,s,a,l,c,p,u,d,h=n?0:[],f=0,m=e.length;f<m;f++){var g=e[f];if("M"==g[0])r=a=g[1],i=l=g[2];else{"C"==g[0]?(r=(u=[r,i,...g.slice(1)])[6],i=u[7]):(u=[r,i,r,i,a,l,a,l],r=a,i=l);for(var y=0,v=t.length;y<v;y++){var b=t[y];if("M"==b[0])o=c=b[1],s=p=b[2];else{"C"==b[0]?(o=(d=[o,s,...b.slice(1)])[6],s=d[7]):(d=[o,s,o,s,c,p,c,p],o=c,s=p);var w=on(u,d,n);if(n)h+=w;else{for(var x=0,_=w.length;x<_;x++)w[x].segment1=f,w[x].segment2=y,w[x].bez1=u,w[x].bez2=d;h=h.concat(w)}}}}}return h}function an(e){var t=Gt(e);if(t.abs)return Xt(t.abs);if(Ht(e)&&Ht(e&&e[0])||(e=function(e){if(!e)return null;var t=Gt(e);if(t.arr)return Wt(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=[];return Ht(e)&&Ht(e[0])&&(r=Wt(e)),r.length||String(e).replace(Ft,(function(e,t,i){var o=[],s=t.toLowerCase();for(i.replace(Vt,(function(e,t){t&&o.push(+t)})),"m"==s&&o.length>2&&(r.push([t,...o.splice(0,2)]),s="l",t="m"==t?"l":"L");o.length>=n[s]&&(r.push([t,...o.splice(0,n[s])]),n[s]););})),r.toString=Gt.toString,t.arr=Wt(r),r}(e)),!e||!e.length)return[["M",0,0]];var n,r=[],i=0,o=0,s=0,a=0,l=0;"M"==e[0][0]&&(s=i=+e[0][1],a=o=+e[0][2],l++,r[0]=["M",i,o]);for(var c,p,u=l,d=e.length;u<d;u++){if(r.push(c=[]),(n=(p=e[u])[0])!=n.toUpperCase())switch(c[0]=n.toUpperCase(),c[0]){case"A":c[1]=p[1],c[2]=p[2],c[3]=p[3],c[4]=p[4],c[5]=p[5],c[6]=+p[6]+i,c[7]=+p[7]+o;break;case"V":c[1]=+p[1]+o;break;case"H":c[1]=+p[1]+i;break;case"M":s=+p[1]+i,a=+p[2]+o;default:for(var h=1,f=p.length;h<f;h++)c[h]=+p[h]+(h%2?i:o)}else for(var m=0,g=p.length;m<g;m++)c[m]=p[m];switch(n=n.toUpperCase(),c[0]){case"Z":i=+s,o=+a;break;case"H":i=c[1];break;case"V":o=c[1];break;case"M":s=c[c.length-2],a=c[c.length-1];default:i=c[c.length-2],o=c[c.length-1]}}return r.toString=Yt,t.abs=Xt(r),r}function ln(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function cn(e,t,n,r){return[e,t,n,r,n,r]}function pn(e,t,n,r,i,o){var s=1/3,a=2/3;return[s*e+a*n,s*t+a*r,s*i+a*n,s*o+a*r,i,o]}function un(e,t,n,r,i,o,s,a,l,c){var p,u=120*Lt/180,d=Lt/180*(+i||0),h=[],f=function(e){return function t(){var n=Array.prototype.slice.call(arguments,0).join("␀"),r=t.cache=t.cache||{},i=t.count=t.count||[];return Ut(r,n)?(function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(i,n),r[n]):(i.length>=1e3&&delete r[i.shift()],i.push(n),r[n]=e(...arguments),r[n])}}((function(e,t,n){return{x:e*It.cos(n)-t*It.sin(n),y:e*It.sin(n)+t*It.cos(n)}}));if(c)E=c[0],k=c[1],x=c[2],_=c[3];else{e=(p=f(e,t,-d)).x,t=p.y;var m=(e-(a=(p=f(a,l,-d)).x))/2,g=(t-(l=p.y))/2,y=m*m/(n*n)+g*g/(r*r);y>1&&(n*=y=It.sqrt(y),r*=y);var v=n*n,b=r*r,w=(o==s?-1:1)*It.sqrt(qt((v*b-v*g*g-b*m*m)/(v*g*g+b*m*m))),x=w*n*g/r+(e+a)/2,_=w*-r*m/n+(t+l)/2,E=It.asin(((t-_)/r).toFixed(9)),k=It.asin(((l-_)/r).toFixed(9));(E=e<x?Lt-E:E)<0&&(E=2*Lt+E),(k=a<x?Lt-k:k)<0&&(k=2*Lt+k),s&&E>k&&(E-=2*Lt),!s&&k>E&&(k-=2*Lt)}var O=k-E;if(qt(O)>u){var P=k,S=a,C=l;k=E+u*(s&&k>E?1:-1),h=un(a=x+n*It.cos(k),l=_+r*It.sin(k),n,r,i,0,s,S,C,[k,P,x,_])}O=k-E;var T=It.cos(E),M=It.sin(E),A=It.cos(k),D=It.sin(k),R=It.tan(O/4),N=4/3*n*R,j=4/3*r*R,I=[e,t],L=[e+N*M,t-j*T],$=[a+N*D,l-j*A],z=[a,l];if(L[0]=2*I[0]-L[0],L[1]=2*I[1]-L[1],c)return[L,$,z].concat(h);for(var B=[],q=0,F=(h=[L,$,z].concat(h).join().split(",")).length;q<F;q++)B[q]=q%2?f(h[q-1],h[q],d).y:f(h[q],h[q+1],d).x;return B}function dn(e){var t=Gt(e);if(t.curve)return Xt(t.curve);for(var n=an(e),r={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(e,t,n){var r,i;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",...un(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),e=["C",r,i,...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",...pn(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",...pn(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...cn(t.x,t.y,e[1],e[2])];break;case"H":e=["C",...cn(t.x,t.y,e[1],t.y)];break;case"V":e=["C",...cn(t.x,t.y,t.x,e[1])];break;case"Z":e=["C",...cn(t.x,t.y,t.X,t.Y)]}return e},o=function(e,t){if(e[t].length>7){e[t].shift();for(var r=e[t];r.length;)s[t]="A",e.splice(t++,0,["C",...r.splice(0,6)]);e.splice(t,1),p=n.length}},s=[],a="",l="",c=0,p=n.length;c<p;c++){n[c]&&(a=n[c][0]),"C"!=a&&(s[c]=a,c&&(l=s[c-1])),n[c]=i(n[c],r,l),"A"!=s[c]&&"C"==a&&(s[c]="C"),o(n,c);var u=n[c],d=u.length;r.x=u[d-2],r.y=u[d-1],r.bx=jt(u[d-4])||r.x,r.by=jt(u[d-3])||r.y}return t.curve=Xt(n),n}function hn(e){return p(e)&&f(e,"waypoints")}function fn(e){return p(e)&&f(e,"labelTarget")}function mn(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function gn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function yn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function vn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function bn(e){for(var t=e.waypoints,n=t.reduce((function(e,n,r){var i=t[r-1];if(i){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))}(i,n);e.push({start:i,end:n,startLength:s,endLength:s+a,length:a})}return e}),[]),r=n.reduce((function(e,t){return e+t.length}),0),i=r/2,o=0,s=n[o];s.endLength<i;)s=n[++o];var a=(i-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 wn(e){return hn(e)?bn(e):gn({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function xn(e,t,n){p(n=n||0)||(n={x:n,y:n});var r=yn(e),i=yn(t),o=r.bottom+n.y<=i.top,s=r.left-n.x>=i.right,a=r.top-n.y>=i.bottom,l=o?"top":a?"bottom":null,c=r.right+n.x<=i.left?"left":s?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function _n(e,t,n){var r=function(e,t){return sn(e,t)}(e,t);return 1===r.length||2===r.length&&St(r[0],r[1])<1?gn(r[0]):r.length>1?(r=T(r,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),gn(r[n?0:r.length-1])):null}function En(e,t){return Math.round(e*t)/t}function kn(e){return u(e)?e+"px":e}function On(e,t,n){const r=Ne("g");Se(r).add(t);const i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}const Pn={shape:["x","y","width","height"],connection:["waypoints"]};function Sn(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}function Cn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Sn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Sn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=L({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Y(n,{position:"relative",overflow:"hidden",width:kn(e.width),height:kn(e.height)}),t.appendChild(n),n}(e),r=this._svg=Ne("svg");Oe(r,{width:"100%",height:"100%"}),X(r,"tabindex",0),e.autoFocus&&t.on("element.hover",(()=>{this.restoreFocus()})),t.on("element.mousedown",500,(e=>{this.focus()})),r.addEventListener("focusin",(()=>{this._setFocused(!0)})),r.addEventListener("focusout",(()=>{this._setFocused(!1)})),xe(n,r);const i=this._viewport=On(r,"viewport");e.deferUpdate&&(this._viewboxChanged=j(I(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:r,viewport:i})})),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)},Sn.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},Sn.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},Sn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=bt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Sn.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},Sn.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},Sn.prototype.isFocused=function(){return this._focused},Sn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Sn.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},Sn.prototype._getChildIndex=function(e){return w(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Sn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:On(this._viewport,"layer-"+e,n),index:t,visible:!0}},Sn.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,r=t.group,i=t.index;if(t.visible)return r;const o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r},Sn.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?(Ue(n),t.visible=!1,n):n},Sn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Ue(t.group))},Sn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Sn.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},Sn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Sn.prototype._findPlaneForRoot=function(e){return m(this._planes,(function(t){return t.rootElement===e}))},Sn.prototype.getContainer=function(){return this._container},Sn.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(v([r.gfx,r.secondaryGfx],(function(r){r&&(n?(e.markers.add(t),Se(r).add(t)):(e.markers.delete(t),Se(r).remove(t)))})),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},Sn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Sn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Sn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),!!e.markers&&e.markers.has(t)},Sn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Sn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Sn.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 r=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},Sn.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},Sn.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},Sn.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)},Sn.prototype._addRoot=function(e,t){const n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},Sn.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})},Sn.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=Pn[e],r=x(n,(function(e){return void 0!==t[e]}));if(!r)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Sn.prototype._setParent=function(e,t,n){Ot(t.children,e,n),e.parent=t},Sn.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();const i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);const s=o.create(e,t,r);return this._elementRegistry.add(t,s),o.update(e,t,s),i.fire(e+".added",{element:t,gfx:s}),t},Sn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Sn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Sn.prototype._removeElement=function(e,t){const n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e))return i.fire(t+".remove",{element:e}),r.remove(e),kt(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},Sn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Sn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Sn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Sn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Sn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Sn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let r,i,o,s,a,l,c;return e?(this._changeViewbox((function(){a=Math.min(n.width/e.width,n.height/e.height);const r=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);Ge(t,r)})),e):(o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},s=Ge(t),i=s?s.matrix:function(e,t,n,r,i,o){var s=Ie().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return Le(s,e);case 6:return Le(s,{a:e,b:t,c:n,d:r,e:i,f:o})}}(),a=En(i.a,1e3),l=En(-i.e||0,1e3),c=En(-i.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:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n})},Sn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=L({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Cn(t,n)})),{x:n.e,y:n.f}},Sn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===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 i=vt(e),o=yn(i),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 p=yn(s);if(i.width<s.width&&i.height<s.height){const e=Math.max(0,o.right-p.right),t=Math.min(0,o.left-p.left),n=Math.max(0,o.bottom-p.bottom),r=Math.min(0,o.top-p.top);l=e||t,c=n||r}else l=i.x-s.x,c=i.y-s.y;this.scroll({dx:-l*a,dy:-c*a})},Sn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,r;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)})),En(r.a,1e3)},Sn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,r=t.inner;let i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale},Sn.prototype._setZoom=function(e,t){const n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint();let s,a,l,c,p;l=r.getCTM();const u=l.a;return t?(s=L(o,t),a=s.matrixTransform(l.inverse()),c=i.translate(a.x,a.y).scale(1/u*e).translate(-a.x,-a.y),p=l.multiply(c)):p=i.scale(e),Cn(this._viewport,p),p},Sn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Sn.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}},Sn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Tn="data-element-id";function Mn(e){this._elements={},this._eventBus=e}function An(e,t,n){var r=function(e,t,n,r){var i=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,i,r)),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,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach((function(r){e.set(r,t.inverse,n)}))}function Dn(e,t){if(!(this instanceof Dn))return new Dn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Mn.$inject=["eventBus"],Mn.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),Oe(t,Tn,r),n&&Oe(n,Tn,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},Mn.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(Oe(r.gfx,Tn,""),r.secondaryGfx&&Oe(r.secondaryGfx,Tn,""),delete t[n])},Mn.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),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},Mn.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&Oe(t,Tn,r),t},Mn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Oe(e,Tn);var n=this._elements[t];return n&&n.element},Mn.prototype.filter=function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(n)})),t},Mn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=t[n[r]],o=i.element;if(e(o,i.gfx))return o}},Mn.prototype.getAll=function(){return this.filter((function(e){return e}))},Mn.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)}))},Mn.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},Mn.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")},Dn.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?An(this,t,e):function(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}(this,t,e)},Dn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||An(this,t,e),n},Dn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Dn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Dn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Rn=new Dn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Nn=new Dn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),jn=new Dn({name:"attachers",collection:!0},{name:"host"}),In=new Dn({name:"outgoing",collection:!0},{name:"source"}),Ln=new Dn({name:"incoming",collection:!0},{name:"target"});function $n(){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)}}),Rn.bind(this,"parent"),Nn.bind(this,"labels"),In.bind(this,"outgoing"),Ln.bind(this,"incoming")}function zn(){$n.call(this),Rn.bind(this,"children"),jn.bind(this,"host"),jn.bind(this,"attachers")}function Bn(){$n.call(this),Rn.bind(this,"children")}function qn(){zn.call(this),Nn.bind(this,"labelTarget")}function Fn(){$n.call(this),In.bind(this,"source"),Ln.bind(this,"target")}e(zn,$n),e(Bn,zn),e(qn,zn),e(Fn,$n);var Vn={connection:Fn,shape:zn,label:qn,root:Bn};function Hn(){this._uid=12}Hn.prototype.createRoot=function(e){return this.create("root",e)},Hn.prototype.createLabel=function(e){return this.create("label",e)},Hn.prototype.createShape=function(e){return this.create("shape",e)},Hn.prototype.createConnection=function(e){return this.create("connection",e)},Hn.prototype.create=function(e,t){return(t=L({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Vn[e];if(!n)throw new Error("unknown type: <"+e+">");return L(new n,t)}(e,t)};var Un="__fn",Wn=Array.prototype.slice;function Gn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Qn(){}function Yn(e){return e.childNodes[0]}function Xn(e,t,n,r,i){var o=$e();o.setTranslate(t,n);var s=$e();s.setRotate(r||0,0,0);var a=$e();a.setScale(1,1),Ge(e,[o,s,a])}function Zn(e,t,n){var r=$e();r.setTranslate(t,n),Ge(e,r)}function Kn(e,t){var n=$e();n.setRotate(t,0,0),Ge(e,n)}function Jn(e,t){this._eventBus=e,this._elementRegistry=t}function er(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}Gn.prototype.on=function(e,t,n,r){if(e=c(e)?e:[e],d(t)&&(r=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");var i=n;r&&((i=I(n,r))[Un]=n[Un]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:i,next:null})}))},Gn.prototype.once=function(e,t,n,r){var i=this;if(d(t)&&(r=n,n=t,t=1e3),!u(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(r,arguments);return i.off(e,o),t}o[Un]=n,this.on(e,t,o)},Gn.prototype.off=function(e,t){e=c(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Gn.prototype.createEvent=function(e){var t=new Qn;return t.init(e),t},Gn.prototype.fire=function(e,t){var n,r,i,o;if(o=Wn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(r=this._listeners[e]){n=t instanceof Qn?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==s&&(n.type=s)}return void 0===i&&n.defaultPrevented&&(i=!1),i}},Gn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Gn.prototype._destroy=function(){this._listeners={}},Gn.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},Gn.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==r&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return r},Gn.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));n=r,r=r.next}n.next=t}else this._setListeners(e,t)},Gn.prototype._getListeners=function(e){return this._listeners[e]},Gn.prototype._setListeners=function(e,t){this._listeners[e]=t},Gn.prototype._removeListener=function(e,t){var n,r,i,o=this._getListeners(e);if(t)for(;o;)n=o.next,(i=o.callback)!==t&&i[Un]!==t||(r?r.next=n:this._setListeners(e,n)),r=o,o=n;else this._setListeners(e,null)},Qn.prototype.stopPropagation=function(){this.cancelBubble=!0},Qn.prototype.preventDefault=function(){this.defaultPrevented=!0},Qn.prototype.init=function(e){L(this,e||{})},Jn.$inject=["eventBus","elementRegistry"],Jn.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(Se(t=Ne("g")).add("djs-children"),xe(n.parentNode,t))):t=n,t},Jn.prototype._clear=function(e){var t=Yn(e);return ee(t),t},Jn.prototype._createContainer=function(e,t,n,r){var i=Ne("g");Se(i).add("djs-group"),void 0!==n?er(i,t,t.childNodes[n]):xe(t,i);var o=Ne("g");Se(o).add("djs-element"),Se(o).add("djs-"+e),r&&Se(o).add("djs-frame"),xe(i,o);var s=Ne("g");return Se(s).add("djs-visual"),xe(o,s),o},Jn.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,wt(t))},Jn.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=w(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),v(t,(function(e){var t=e.children;if(t){var i=n._getChildrenContainer(e);v(t.slice().reverse(),(function(e){er(r.getGraphics(e).parentNode,i)}))}}))},Jn.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Jn.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Jn.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Jn.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Jn.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),Zn(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?Oe(n,"display","none"):Oe(n,"display","block")}},Jn.prototype.remove=function(e){Ue(this._elementRegistry.getGraphics(e).parentNode)};var tr={__depends__:[Et],__init__:["canvas"],canvas:["type",Sn],elementRegistry:["type",Mn],elementFactory:["type",Hn],eventBus:["type",Gn],graphicsFactory:["type",Jn]};function nr(e){return function(e){var t=new nt(e);return t.init(),t}([{config:["value",e=e||{}]},tr].concat(e.modules||[]))}function rr(e,t){this._injector=t||nr(e),this.get("eventBus").fire("diagram.init")}function ir(){}function or(e,t){this.model=e,this.properties=t}rr.prototype.get=function(e,t){return this._injector.get(e,t)},rr.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},rr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},rr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},ir.prototype.get=function(e){return this.$model.properties.get(this,e)},ir.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},or.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(ir.prototype);v(e.properties,(function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)})),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),v(e,I((function(e,t){this.set(t,e)}),this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var sr={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ar={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 lr(e,t){var n=ar[e];return n?n(t):t}function cr(e){return!!sr[e]}function pr(e){return!!ar[e]}function ur(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function dr(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function hr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,v(e,I(this.registerPackage,this))}function fr(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function mr(e){this.model=e}function gr(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function yr(e){return e.replace(/^:/,"")}function vr(e,t={}){this.properties=new mr(this),this.factory=new or(this,this.properties),this.registry=new hr(e,this.properties),this.typeCache={},this.config=t}dr.prototype.build=function(){return B(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},dr.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var r=this.properties;void 0!==t?r.splice(t,0,e):r.push(e)},dr.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=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=i.indexOf(e);if(-1===a)throw new Error("property <"+r.name+"> not found in property list");i.splice(a,1),this.addProperty(t,n?void 0:a,s),o[r.name]=o[r.localName]=t},dr.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=ur(i[0],r),s=ur(i[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},dr.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},dr.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},dr.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},dr.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},dr.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},dr.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},dr.prototype.hasProperty=function(e){return this.propertiesByName[e]},dr.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(v(e.properties,I((function(n){n=L({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),r.push(e),n[i]=e)},hr.prototype.getPackage=function(e){return this.packageMap[e]},hr.prototype.getPackages=function(){return this.packages},hr.prototype.registerPackage=function(e){e=L({},e);var t=this.packageMap;fr(t,e,"prefix"),fr(t,e,"uri"),v(e.types,I((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},hr.prototype.registerType=function(e,t){var n=ur((e=L({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:L(e.meta||{})})).name,t.prefix),r=n.name,i={};v(e.properties,I((function(e){var t=ur(e.name,n.prefix),r=t.name;cr(e.type)||(e.type=ur(e.type,t.prefix).name),L(e,{ns:t,name:r}),i[r]=e}),this)),L(e,{ns:n,name:r,propertiesByName:i}),v(e.extends,I((function(e){var t=ur(e,n.prefix),i=this.typeMap[t.name];i.traits=i.traits||[],i.traits.push(r)}),this)),this.definePackage(e,t),this.typeMap[r]=e},hr.prototype.mapTypes=function(e,t,n){var r=cr(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(n,r){var o=ur(n,cr(n)?"":e.prefix);i.mapTypes(o,t,r)}function s(e){return o(e,!0)}if(!r)throw new Error("unknown type <"+e.name+">");v(r.superClass,n?s:function(e){return o(e,!1)}),t(r,!n),v(r.traits,s)},hr.prototype.getEffectiveDescriptor=function(e){var t=ur(e),n=new dr(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},hr.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},mr.prototype.set=function(e,t,n){if(!h(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;void 0===n?r?delete e[i]:delete e.$attrs[yr(t)]:r?i in e?e[i]=n:gr(e,r,n):e.$attrs[yr(t)]=n},mr.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[yr(t)];var r=n.name;return!e[r]&&n.isMany&&gr(e,n,[]),e[r]},mr.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;delete(n=L({},n,{get:function(){return r}})).value}Object.defineProperty(e,t,n)},mr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},mr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},mr.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;const i=n.config.strict;if(void 0!==i){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw n;"undefined"!=typeof console&&console.warn(n)}return null},vr.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},vr.prototype.getType=function(e){var t=this.typeCache,n=h(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},vr.prototype.createAny=function(e,t,n){var r=ur(e),i={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){$(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),v(n,(function(e,t){p(e)&&void 0!==e.value?i[e.name]=e.value:i[t]=e})),i},vr.prototype.getPackage=function(e){return this.registry.getPackage(e)},vr.prototype.getPackages=function(){return this.registry.getPackages()},vr.prototype.getElementDescriptor=function(e){return e.$descriptor},vr.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},vr.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},vr.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var br=String.fromCharCode,wr=Object.prototype.hasOwnProperty,xr=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,_r={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Er(e,t,n,r){return r?wr.call(_r,r)?_r[r]:"&"+r+";":br(t||parseInt(n,16))}function kr(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(xr,Er):e}Object.keys(_r).forEach((function(e){_r[e.toUpperCase()]=_r[e]}));var Or="non-whitespace outside of root node";function Pr(e){return new Error(e)}function Sr(e){return"missing namespace for prefix <"+e+">"}function Cr(e){return{get:e,enumerable:!0}}function Tr(e){var t,n={};for(t in e)n[t]=e[t];return n}function Mr(e){return e+"$uri"}function Ar(){return{line:0,column:0}}function Dr(e){throw e}function Rr(e){if(!this)return new Rr(e);var t,n,r,i,o,s,a,l,c,p=e&&e.proxy,u=Dr,d=Ar,h=!1,f=!1,m=null,g=!1;function y(e){e instanceof Error||(e=Pr(e)),m=e,u(e,d)}function v(e){o&&(e instanceof Error||(e=Pr(e)),o(e,d))}this.on=function(e,c){if("function"!=typeof c)throw Pr("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":r=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":i=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw Pr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Pr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw Pr("required args <xml=string>");return m=null,function(e){var o,u,m,b,w,x,_,E,k,O,P,S=f?[]:null,C=f?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[Mr(n)]=t;return r}(c):null,T=[],M=0,A=!1,D=!1,R=0,N=0,j="",I=0;function L(){if(null!==P)return P;var e,t,n,r,i,o,s,a,l,p,u,d=f&&C.xmlns,m=f&&h?[]:null,g=I,y=j,b=y.length,w={},x={};e:for(;g<b;g++)if(l=!1,!(32===(p=y.charCodeAt(g))||p<14&&p>8)){for((p<65||p>122||p>90&&p<97)&&95!==p&&58!==p&&(v("illegal first char attribute name"),l=!0),u=g+1;u<b;u++)if(!((p=y.charCodeAt(u))>96&&p<123||p>64&&p<91||p>47&&p<59||46===p||45===p||95===p)){if(32===p||p<14&&p>8){v("missing attribute value"),g=u;continue e}if(61===p)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(a=y.substring(g,u))&&(v("illegal declaration of xmlns"),l=!0),34===(p=y.charCodeAt(u+1)))-1===(u=y.indexOf('"',g=u+2))&&-1!==(u=y.indexOf("'",g))&&(v("attribute value quote missmatch"),l=!0);else if(39===p)-1===(u=y.indexOf("'",g=u+2))&&-1!==(u=y.indexOf('"',g))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(p=y.charCodeAt(u+1))||p<14&&p>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=y.substring(g,u)),g=u;u+1<b&&!(32===(p=y.charCodeAt(u+1))||p<14&&p>8);u++)g===u&&(v("illegal character after attribute end"),l=!0);if(g=u+1,!l)if(a in x)v("attribute <"+a+"> already defined");else if(x[a]=!0,f)if(h){if(null!==(i="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=kr(o),t=Mr(i),!(s=c[e])){if("xmlns"===i||t in C&&C[t]!==e)do{s="ns"+M++}while(void 0!==C[s]);else s=i;c[e]=s}C[i]!==s&&(r||(C=Tr(C),r=!0),C[i]=s,"xmlns"===i&&(C[Mr(s)]=e,d=s),C[t]=e),w[a]=o;continue}m.push(a,o)}else-1!==(p=a.indexOf(":"))?(n=C[a.substring(0,p)])?w[a=d===n?a.substr(p+1):n+a.substr(p)]=o:v(Sr(a.substring(0,p))):w[a]=o;else w[a]=o}if(h)for(g=0,b=m.length;g<b;g++){if(a=m[g++],o=m[g],-1!==(p=a.indexOf(":"))){if(!(n=C[a.substring(0,p)])){v(Sr(a.substring(0,p)));continue}a=d===n?a.substr(p+1):n+a.substr(p)}w[a]=o}return P=w}function $(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,o=0,s=0,a=N;R>=s&&(t=r.exec(e))&&!((a=t[0].length+t.index)>R);)i+=1,s=a;return-1==R?(o=a,n=e.substring(N)):0===N?n=e.substring(N,R):(o=R-s,n=-1==N?e.substring(R):e.substring(R,N+1)),{data:n,line:i,column:o}}d=$,p&&(O=Object.create({},{name:Cr((function(){return E})),originalName:Cr((function(){return k})),attrs:Cr(L),ns:Cr((function(){return C}))}));for(;-1!==N;){if(-1===(R=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return T.length?y("unexpected end of file"):0===N?y("missing start tag"):void(N<e.length&&e.substring(N).trim()&&v(Or));if(N!==R)if(T.length){if(t&&(t(e.substring(N,R),kr,d),g))return}else if(e.substring(N,R).trim()&&(v(Or),g))return;if(33===(w=e.charCodeAt(R+1))){if(91===(b=e.charCodeAt(R+2))&&"CDATA["===e.substr(R+3,6)){if(-1===(N=e.indexOf("]]>",R)))return y("unclosed cdata");if(i&&(i(e.substring(R+9,N),d),g))return;N+=3;continue}if(45===b&&45===e.charCodeAt(R+3)){if(-1===(N=e.indexOf("--\x3e",R)))return y("unclosed comment");if(s&&(s(e.substring(R+4,N),kr,d),g))return;N+=3;continue}}if(63!==w){for(u=R+1;;u++){if(x=e.charCodeAt(u),isNaN(x))return N=-1,y("unclosed tag");if(34===x)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===x)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===x){N=u;break}}if(33!==w){if(P={},47===w){if(A=!1,D=!0,!T.length)return y("missing open tag");if(u=E=T.pop(),b=R+2+u.length,e.substring(R+2,b)!==u)return y("closing tag mismatch");for(;b<N;b++)if(!(32===(w=e.charCodeAt(b))||w>8&&w<14))return y("close tag")}else{if(47===e.charCodeAt(N-1)?(u=E=e.substring(R+1,N-1),A=!0,D=!0):(u=E=e.substring(R+1,N),A=!0,D=!1),!(w>96&&w<123||w>64&&w<91||95===w||58===w))return y("illegal first char nodeName");for(b=1,m=u.length;b<m;b++)if(!((w=u.charCodeAt(b))>96&&w<123||w>64&&w<91||w>47&&w<59||45===w||95===w||46==w)){if(32===w||w<14&&w>8){E=u.substring(0,b),P=null;break}return y("invalid nodeName")}D||T.push(E)}if(f){if(o=C,A&&(D||S.push(o),null===P&&(h=-1!==u.indexOf("xmlns",b))&&(I=b,j=u,L(),h=!1)),k=E,-1!==(w=E.indexOf(":"))){if(!(_=C[E.substring(0,w)]))return y("missing namespace on <"+k+">");E=E.substr(w+1)}else _=C.xmlns;_&&(E=_+":"+E)}if(A&&(I=b,j=u,n&&(p?n(O,kr,D,d):n(E,L,kr,D,d),g)))return;if(D){if(r&&(r(p?O:E,kr,A,d),g))return;f&&(C=A?o:S.pop())}N+=1}else{if(l&&(l(e.substring(R,N+1),kr,d),g))return;N+=1}}else{if(-1===(N=e.indexOf("?>",R)))return y("unclosed question");if(a&&(a(e.substring(R,N+2),d),g))return;N+=2}}}(e),d=Ar,g=!1,m},this.stop=function(){g=!0}}function Nr(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var jr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ir="property";function Lr(e){return e.xml&&e.xml.serialize}function $r(e,t){return Nr(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function zr(e){return new Error(e)}function Br(e){return e.$descriptor}function qr(e){L(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw zr("expected element");var t,n=this.elementsById,r=Br(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw zr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Fr(){}function Vr(){}function Hr(){}function Ur(e,t){this.property=e,this.context=t}function Wr(e,t){this.element=t,this.propertyDesc=e}function Gr(){}function Qr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Yr(e,t,n){Qr.call(this,e,t,n)}function Xr(e,t,n){this.model=e,this.context=n}function Zr(e){e instanceof vr&&(e={model:e}),L(this,{lax:!1},e)}Fr.prototype.handleEnd=function(){},Fr.prototype.handleText=function(){},Fr.prototype.handleNode=function(){},Vr.prototype=Object.create(Fr.prototype),Vr.prototype.handleNode=function(){return this},Hr.prototype=Object.create(Fr.prototype),Hr.prototype.handleText=function(e){this.body=(this.body||"")+e},Ur.prototype=Object.create(Hr.prototype),Ur.prototype.handleNode=function(e){if(this.element)throw zr("expected no sub nodes");return this.element=this.createReference(e),this},Ur.prototype.handleEnd=function(){this.element.id=this.body},Ur.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Wr.prototype=Object.create(Hr.prototype),Wr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=lr(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Gr.prototype=Object.create(Hr.prototype),Gr.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},Qr.prototype=Object.create(Gr.prototype),Qr.prototype.addReference=function(e){this.context.addReference(e)},Qr.prototype.handleText=function(e){if(!Br(this.element).bodyProperty)throw zr("unexpected body text <"+e+">");Hr.prototype.handleText.call(this,e)},Qr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Br(t).bodyProperty;n&&void 0!==e&&(e=lr(n.type,e),t.set(n.name,e))},Qr.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=Br(r),o=this.context,s=new r({}),a=this.model;return v(n,(function(e,n){var r=i.propertiesByName[n];r&&r.isReference?r.isMany?v(e.split(" "),(function(e){o.addReference({element:s,property:r.ns.name,id:e})})):o.addReference({element:s,property:r.ns.name,id:e}):(r?e=lr(r.type,e):"xmlns"===n?n=":"+n:(t=ur(n,i.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},Qr.prototype.getPropertyForNode=function(e){var t=ur(e.name),n=this.type,r=this.model,i=Br(n),o=t.name,s=i.propertiesByName[o];if(s&&!s.isAttr){const t=function(e){const t=Lr(e);return t!==Ir&&(t||null)}(s);if(t){const n=e.attributes[t];if(n){const t=function(e,t,n){const r=ur(e,t.xmlns),i=ur(`${t[r.prefix]||r.prefix}:${r.localName}`);return function(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(i,n.getPackage(i.prefix))}(n,e.ns,r);return L({},s,{effectiveType:Br(r.getType(t)).name})}}return s}var a=r.getPackage(t.prefix);if(a){const e=$r(t,a),n=r.getType(e);if(s=m(i.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),s)return L({},s,{effectiveType:Br(n).name})}else if(s=m(i.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),s)return s;throw zr("unrecognized element <"+t.name+">")},Qr.prototype.toString=function(){return"ElementDescriptor["+Br(this.type).name+"]"},Qr.prototype.valueHandler=function(e,t){return new Wr(e,t)},Qr.prototype.referenceHandler=function(e){return new Ur(e,this.context)},Qr.prototype.handler=function(e){return"Element"===e?new Xr(this.model,e,this.context):new Qr(this.model,e,this.context)},Qr.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,pr(n=t.effectiveType||t.type))return this.valueHandler(t,r);var o=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(L(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},Yr.prototype=Object.create(Qr.prototype),Yr.prototype.createElement=function(e){var t=e.name,n=ur(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),s=o&&$r(n,o)||t;if(!i.hasType(s))throw zr("unexpected element <"+e.originalName+">");return Qr.prototype.createElement.call(this,e)},Xr.prototype=Object.create(Gr.prototype),Xr.prototype.createElement=function(e){var t=e.name,n=ur(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},Xr.prototype.handleChild=function(e){var t=new Xr(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element;return void 0!==r&&((n.$children=n.$children||[]).push(r),r.$parent=n),t},Xr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Zr.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Qr?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,o=this.lax,s=new qr(L({},t,{rootHandler:r})),a=new Rr({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 r=t(),i=r.line,o=r.column,a=r.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw zr(l)}function p(e,t){return c(e,t,!0)}r.context=s,l.push(r);var u=/^<\?xml /i,d=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){p(e,t)}}var m=i.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),Object.entries(jr).reduce((function(e,[t,n]){return e[n]=t,e}),i.config&&i.config.nsMap||{}));return a.ns(m).on("openTag",(function(e,t,n,r){var i=e.attrs||{},s=Object.keys(i).reduce((function(e,n){var r=t(i[n]);return e[n]=r,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new Vr)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},r)})).on("question",(function(e){if(u.test(e)){var t=d.exec(e),n=t&&t[1];n&&!h.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",p),new Promise((function(t,n){var i;try{a.parse(e),function(){var e,t,n=s.elementsById,r=s.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],a=Br(i).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=i.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else i.set(a.name,o)}}()}catch(e){i=e}var o=r.element;i||o||(i=zr("failed to parse document as <"+r.type.$descriptor.name+">"));var l=s.warnings,c=s.references,p=s.elementsById;return i?(i.warnings=l,n(i)):t({rootElement:o,elementsById:p,references:c,warnings:l})}))},Zr.prototype.handler=function(e){return new Yr(this.model,e)};var Kr=/<|>|'|"|&|\n\r|\n/g,Jr=/<|>|&/g;function ei(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function ti(e,t){return Nr(t)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(e):e}function ni(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function ri(e){return h(e)?e:(e.prefix?e.prefix+":":"")+e.localName}ei.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},ei.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},ei.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)},ei.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},ei.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)},ei.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},ei.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},ei.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)},ei.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter((e=>{var t=this.getNSKey(e);return this.used[t]}))};var ii={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},oi={"<":"lt",">":"gt","&":"amp"};function si(e,t,n){return(e=h(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function ai(e){this.tagName=e}function li(){}function ci(e){this.tagName=e}function pi(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ui(e,t,n){pi.call(this,e,t),this.serialization=n}function di(){this.value="",this.write=function(e){this.value+=e}}function hi(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 fi(e){return e=L({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new di,i=new hi(r,e.format);e.preamble&&i.append('<?xml version="1.0" encoding="UTF-8"?>\n');var o=new pi,s=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){const t=e.config&&e.config.nsMap||{},n={};for(const e in jr)n[e]=jr[e];for(const e in t){n[t[e]]=e}for(const t of e.getPackages())n[t.prefix]=t.uri;return n}(s)),o.build(t).serializeTo(i),!n)return r.value}}}function mi(e,t){vr.call(this,e,t)}ai.prototype.build=function(e){return this.element=e,this},ai.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},li.prototype.serializeValue=li.prototype.serializeTo=function(e){e.append(this.escape?si(this.value,Jr,oi):this.value)},li.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Jr)&&(this.escape=!0),this},ni(ci,li),ci.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},pi.prototype.build=function(e){this.element=e;var t,n,r=e.$descriptor,i=this.propertyDescriptor,o=r.isGeneric;return t=o?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=i?this.nsPropertyTagName(i):this.nsTagName(r),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(n=function(e){return y(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!f(e,n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)}))}(e),this.parseAttributes(y(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return y(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},pi.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?L({localName:t.ns.localName},e):L({localName:ti(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},pi.prototype.nsPropertyTagName=function(e){return function(e,t){return L({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},pi.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},pi.prototype.nsAttributeName=function(e){var t;if(t=h(e)?ur(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}:L({localName:t.localName},n)},pi.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter((([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n))).map((([e,t])=>({name:e,value:t})))},pi.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push((new li).build({type:"String"},t));var n=e.$children;n&&v(n,(e=>{this.body.push(new pi(this).build(e))}))},pi.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,o=ur(t);if("xmlns"===o.prefix&&(r={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var s=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(s)}},pi.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return v(n,(function(n,i){var o=t.parseNsAttribute(e,i,n);o&&r.push(o)})),r},pi.prototype.parseGenericAttributes=function(e,t){var n=this;v(t,(function(t){try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){"undefined"!=typeof console&&console.warn(`missing namespace information for <${t.name}=${t.value}> on`,e,n)}}))},pi.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;v(e,(function(e){var i=r.get(e.name),o=e.isReference;if(e.isMany||(i=[i]),e.isBody)n.push((new li).build(e,i[0]));else if(pr(e.type))v(i,(function(r){n.push(new ci(t.addTagName(t.nsPropertyTagName(e))).build(e,r))}));else if(o)v(i,(function(r){n.push(new ai(t.addTagName(t.nsPropertyTagName(e))).build(r))}));else{var s=Lr(e);v(i,(function(r){var i;i=s?s===Ir?new pi(t,e):new ui(t,e,s):new pi(t),n.push(i.build(r))}))}}))},pi.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new ei(t):n=t),n},pi.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix;return r.byUri(i)&&!n||r.add(e,t),r.mapPrefix(o,i),e},pi.prototype.logNamespaceUsed=function(e,t){var n,r,i,o=this.getNamespaces(t),s=e.prefix,a=e.uri;if(!s&&!a)return{localName:e.localName};if(i=o.defaultUriByPrefix(s),!(a=a||i||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if((e=o.byUri(a))||s||(e=this.logNamespace({uri:a},i===a,!0)),!e){for(n=s,r=1;o.uriByPrefix(n);)n=s+"_"+r++;e=this.logNamespace({prefix:n,uri:a},i===a)}return s&&o.mapPrefix(s,a),e},pi.prototype.parseAttributes=function(e){var t=this,n=this.element;v(e,(function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];v(r,(function(e){i.push(e.id)})),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)}))},pi.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),ri(e)},pi.prototype.addAttribute=function(e,t){var n=this.attrs;h(t)&&(t=si(t,Kr,ii));var r=g(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),i={name:e,value:t};-1!==r?n.splice(r,1,i):n.push(i)},pi.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)),v(t,(function(t){e.append(" ").append(ri(t.name)).append('="').append(t.value).append('"')}))},pi.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==li;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),v(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},ni(ui,pi),ui.prototype.parseNsAttributes=function(e){var t=pi.prototype.parseNsAttributes.call(this,e).filter((e=>e.name!==this.serialization)),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},ui.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},mi.prototype=Object.create(vr.prototype),mi.prototype.fromXML=function(e,t,n){h(t)||(n=t,t="bpmn:Definitions");var r=new Zr(L({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)},mi.prototype.toXML=function(e,t){var n=new fi(t);return new Promise((function(t,r){try{return t({xml:n.toXML(e)})}catch(e){return r(e)}}))};const gi={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 yi(e,t){return new mi(L({},gi,e),t)}function vi(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var bi="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 wi(e){f(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(bi)}})}function xi(e,t){return e.$instanceOf(t)}function _i(e){var t={},n=[],r={};function i(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function s(t,n){try{var i=r[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${vi(t)}`);return e.element(t,r[t.id],n)}(t,n);return o(t),i}catch(e){a(e.message,{element:t,error:e}),console.error(`failed to import ${vi(t)}`,e)}}function a(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t=e.bpmnElement;t?r[t.id]?a(`multiple DI elements defined for ${vi(t)}`,{element:t}):(r[t.id]=e,wi(t)):a(`no bpmnElement referenced in ${vi(e)}`,{element:e})};function c(e){var t;t=e.plane,l(t),v(t.planeElement,p)}function p(e){l(e)}this.handleDefinitions=function(o,s){var p=o.diagrams;if(s&&-1===p.indexOf(s))throw new Error("diagram not part of <bpmn:Definitions />");if(!s&&p&&p.length&&(s=p[0]),!s)throw new Error("no diagram to display");r={},c(s);var f=s.plane;if(!f)throw new Error(`no plane for ${vi(s)}`);var g=f.bpmnElement;if(!g){if(g=function(e){return m(e.rootElements,(function(e){return xi(e,"bpmn:Process")||xi(e,"bpmn:Collaboration")}))}(o),!g)throw new Error("no process or collaboration to display");a(`correcting missing bpmnElement on ${vi(f)} to ${vi(g)}`),f.bpmnElement=g,l(f)}var b,w,_=function(t,n){return e.root(t,r[t.id],n)}(g,f);if(xi(g,"bpmn:Process")||xi(g,"bpmn:SubProcess"))d(g,_);else{if(!xi(g,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${vi(f)}: ${vi(g)}`);w=_,v((b=g).participants,i(T,w)),x(b.artifacts,w),n.push((function(){!function(e,t){v(e,i(h,t))}(b.messageFlows,w)})),function(e,n){var r=y(e,(function(e){return!t[e.id]&&xi(e,"bpmn:Process")&&e.laneSets}));r.forEach(i(d,n))}(o.rootElements,_)}u(n)};var u=this.handleDeferred=function(){for(;n.length;)n.shift()()};function d(e,t){C(e,t),_(e.ioSpecification,t),x(e.artifacts,t),o(e)}function h(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 w(e,t){s(e,t)}function x(e,t){v(e,(function(e){xi(e,"bpmn:Association")?n.push((function(){w(e,t)})):w(e,t)}))}function _(e,t){e&&(v(e.dataInputs,i(g,t)),v(e.dataOutputs,i(b,t)))}var E=this.handleSubProcess=function(e,t){C(e,t),x(e.artifacts,t)};function k(e,t){var r=s(e,t);xi(e,"bpmn:SubProcess")&&E(e,r||t),xi(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){v(e.dataInputAssociations,i(f,t)),v(e.dataOutputAssociations,i(f,t))}))}function O(e,t){s(e,t)}function P(e,t){n.push((function(){var n=s(e,t);e.childLaneSet&&S(e.childLaneSet,n||t),function(e){v(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function S(e,t){v(e.lanes,i(P,t))}function C(e,t){!function(e,t){v(e,(function(e){xi(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){s(e,t)}(e,t)})):xi(e,"bpmn:BoundaryEvent")?n.unshift((function(){k(e,t)})):xi(e,"bpmn:FlowNode")?k(e,t):xi(e,"bpmn:DataObject")||(xi(e,"bpmn:DataStoreReference")||xi(e,"bpmn:DataObjectReference")?O(e,t):a(`unrecognized flowElement ${vi(e)} in context ${vi(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){v(e,i(S,t))}(e.laneSets,t)}function T(e,t){var n=s(e,t),r=e.processRef;r&&d(r,n||t)}}function Ei(e,t){var n=Oi(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function ki(e,t){return _(t,(function(t){return Ei(e,t)}))}function Oi(e){return e&&e.businessObject||e}function Pi(e){return e&&e.di}function Si(e,t,n){var r,i,o,s=[];function a(e,t){var n=new _i({root:function(e,t){return r.add(e,t)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var i=function(e,t){if(!t||!t.plane)return;var n,r=t.plane.bpmnElement,i=r;Ei(r,"bpmn:Process")||Ei(r,"bpmn:Collaboration")||(i=function(e){var t=e;for(;t;){if(Ei(t,"bpmn:Process"))return t;t=t.$parent}}(r));n=Ei(i,"bpmn:Collaboration")?i:m(e.rootElements,(function(e){if(Ei(e,"bpmn:Collaboration"))return m(e.participants,(function(e){return e.processRef===i}))}));var o=[i];n&&(o=E(n.participants,(function(e){return e.processRef}))).push(n);var s=Ci(o),a=[t],l=[r];return v(e.diagrams,(function(e){if(e.plane){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===l.indexOf(t)&&(a.push(e),l.push(t))}})),a}(e,t);if(!i)throw new Error("no diagram to display");v(i,(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 r=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),a(t,n),i.fire("import.render.complete",{error:undefined,warnings:s}),l({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function Ci(e){var t=[];return v(e,(function(e){e&&(t.push(e),t=t.concat(Ci(e.flowElements)))})),t}var Ti,Mi='<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>',Ai={verticalAlign:"middle"},Di={color:"#404040"},Ri={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Ni={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},ji={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"},Ii='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+Mi+'</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 Li(){Ti||(Y(Ti=ge(Ii),Ri),Y(ve("svg",Ti),Ai),Y(ve(".backdrop",Ti),Ni),Y(ve(".notice",Ti),ji),Y(ve(".link",Ti),Di,{margin:"15px 20px 15px 10px",alignSelf:"center"}),de.bind(Ti,".backdrop","click",(function(e){document.body.removeChild(Ti)}))),document.body.appendChild(Ti)}function $i(e){e=L({},Bi,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=ge('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Mi+"</a>");Y(ve("svg",t),Ai),Y(t,Di,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),ce.bind(t,"click",(function(e){Li(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function zi(e,t){return e.warnings=t,e}e($i,rr),$i.prototype.importXML=async function(e,t){const n=this;let r=[];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;r=r.concat(l),s=this._emit("import.parse.complete",(i={error:null,definitions:s,elementsById:c,references:a,warnings:r},n.get("eventBus").createEvent(i)))||s;const p=await this.importDefinitions(s,t);return r=r.concat(p.warnings),this._emit("import.done",{error:null,warnings:r}),{warnings:r}}catch(e){let t=e;throw r=r.concat(t.warnings||[]),zi(t,r),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 i},$i.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},$i.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw zi(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 zi(t,[]),t}try{this.clear()}catch(e){throw zi(e,[]),e}const{warnings:r}=await Si(this,t,n);return{warnings:r}},$i.prototype.saveXML=async function(e){e=e||{};let t,n,r=this._definitions;try{if(!r)throw new Error("no definitions loaded");r=this._emit("saveXML.start",{definitions:r})||r;n=(await this._moddle.toXML(r,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const i=t?{error:t}:{xml:n};if(this._emit("saveXML.done",i),t)throw t;return i},$i.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),r=ve(":scope > defs",t._svg),i=He(n),o=r?"<defs>"+He(r)+"</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+i+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},$i.prototype._setDefinitions=function(e){this._definitions=e},$i.prototype.getModules=function(){return this._modules},$i.prototype.clear=function(){this.getDefinitions()&&rr.prototype.clear.call(this)},$i.prototype.destroy=function(){rr.prototype.destroy.call(this),we(this._container)},$i.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},$i.prototype.off=function(e,t){this.get("eventBus").off(e,t)},$i.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=ve(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},$i.prototype.getDefinitions=function(){return this._definitions},$i.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},$i.prototype._init=function(e,t,n){const r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],r,i),s=L(q(n,["additionalModules"]),{canvas:L({},n.canvas,{container:e}),modules:o});rr.call(this,s),n&&n.container&&this.attachTo(n.container)},$i.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},$i.prototype._createContainer=function(e){const t=ge('<div class="bjs-container"></div>');return Y(t,{width:qi(e.width),height:qi(e.height),position:e.position}),t},$i.prototype._createModdle=function(e){return new yi(L({},this._moddleExtensions,e.moddleExtensions))},$i.prototype._modules=[];const Bi={width:"100%",height:"100%",position:"relative"};function qi(e){return e+(u(e)?"px":"")}function Fi(e){$i.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 Vi(e,t){return!Ei(e,"bpmn:CallActivity")&&(Ei(e,"bpmn:SubProcess")?!(!(t=t||Pi(e))||!Ei(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!Ei(e,"bpmn:Participant")||!!Oi(e).processRef)}function Hi(e){if(Ei(e,"bpmn:Participant")||Ei(e,"bpmn:Lane")){var t=Pi(e).isHorizontal;return void 0===t||t}}function Ui(e){return e&&!1!==Oi(e).isInterrupting}function Wi(e){return e&&!!Oi(e).triggeredByEvent}function Gi(e,t){return _(Oi(e).eventDefinitions,(function(e){return Ei(e,t)}))}e(Fi,$i),Fi.prototype._createModdle=function(e){var t=$i.prototype._createModdle.call(this,e);return t.ids=new n([32,36,1]),t},Fi.prototype._collectIds=function(e,t){var n,r=e.$model.ids;for(n in r.clear(),t)r.claim(n,t[n])};var Qi={width:90,height:20},Yi=15;function Xi(e){return Ei(e,"bpmn:Event")||Ei(e,"bpmn:Gateway")||Ei(e,"bpmn:DataStoreReference")||Ei(e,"bpmn:DataObjectReference")||Ei(e,"bpmn:DataInput")||Ei(e,"bpmn:DataOutput")||Ei(e,"bpmn:SequenceFlow")||Ei(e,"bpmn:MessageFlow")||Ei(e,"bpmn:Group")}function Zi(e){return fn(e.label)}function Ki(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=function(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}}(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),s=i.x,a=i.y;return Math.abs(o)<Math.PI/2?a-=Yi:s+=Yi,{x:s,y:a}}function Ji(e){return e.waypoints?Ki(e.waypoints):Ei(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Qi.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Qi.height/2}}function eo(e){return Ei(e,"bpmn:FlowElement")||Ei(e,"bpmn:Participant")||Ei(e,"bpmn:Lane")||Ei(e,"bpmn:SequenceFlow")||Ei(e,"bpmn:MessageFlow")||Ei(e,"bpmn:DataInput")||Ei(e,"bpmn:DataOutput")?"name":Ei(e,"bpmn:TextAnnotation")?"text":Ei(e,"bpmn:Group")?"categoryValueRef":void 0}function to(e){var t=e.businessObject,n=eo(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function no(e,t){var n=e.businessObject,r=eo(n);if(r)if("categoryValueRef"===r){if(!n[r])return e;n[r].value=t}else n[r]=t;return e}var ro="hsl(225, 10%, 15%)",io="white";function oo(e,t){return _(e.eventDefinitions,(function(e){return e.$type===t}))}function so(e,t,n){var r=Pi(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||io}function ao(e,t,n){var r=Pi(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||ro}function lo(e,t,n,r){var i=Pi(e).get("label");return r||i&&i.get("color:color")||t||ao(e,n)}function co(e,t={}){return{width:po(e,t),height:uo(e,t)}}function po(e,t={}){return f(t,"width")?t.width:e.width}function uo(e,t={}){return f(t,"height")?t.height:e.height}var ho=new n,fo=.95;function mo(e,t,n,r,i,o,s){ot.call(this,t,s);var a=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor;function u(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ro,strokeWidth:2,fill:"white"})}function d(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ro,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:r=1,element:o,parentGfx:s=i._svg}=t,a=Ne("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*r,markerHeight:20*r,orient:"auto"});xe(a,o);var l=ve(":scope > defs",s);l||xe(s,l=Ne("defs")),xe(l,a)}function f(e,t,n,r){var i=ho.nextPrefixed("marker-");return function(e,t,n,r,i){if("sequenceflow-end"===n){h(t,{element:Ne("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){h(t,{element:Ne("circle",{cx:6,cy:6,r:3.5,...u({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){h(t,{element:Ne("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){h(t,{element:Ne("path",{d:"M 11 5 L 1 10 L 11 15",...d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){h(t,{element:Ne("path",{d:"M 1 5 L 11 10 L 1 15",...d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){h(t,{element:Ne("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:r,stroke:i})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){h(t,{element:Ne("path",{d:"M 6 4 L 10 16",...u({stroke:i,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,i,t,n,r),"url(#"+i+")"}function m(e,t,n,r,i={}){p(r)&&(i=r,r=0),r=r||0,i=u(i);var o=Ne("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-r),...i});return xe(e,o),o}function g(e,t,n,r,i,o){p(i)&&(o=i,i=0),i=i||0,o=u(o);var s=Ne("rect",{x:i,y:i,width:t-2*i,height:n-2*i,rx:r,ry:r,...o});return xe(e,s),s}function y(e,t,n,r){var i=ut(t,n=d(n),r);return xe(e,i),i}function b(e,t,n){return y(e,t,n,5)}function w(e,t,n){n=d(n);var r=Ne("path",{...n,d:t});return xe(e,r),r}function x(e,t,n,r){return w(t,n,L({"data-marker":e},r))}function _(e){return K[e]}function E(e){return function(t,n,r){return _(e)(t,n,r)}}var k=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:i?so(t,a,n.fill):ao(t,l,n.stroke),strokeWidth:1})},O=function(e,t,n={}){var i=m(e,t.width,t.height,.2*t.height,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:2});w(e,r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:ao(t,l,n.stroke),strokeWidth:2});for(var o=0;o<12;o++){var s=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),c=t.width/2,p=t.height/2;w(e,s,{strokeWidth:1,stroke:ao(t,l,n.stroke),transform:"rotate("+30*o+","+p+","+c+")"})}return i},P=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},S=function(e,t,n={}){return w(e,r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},C=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},T=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},M=function(e,t,n={},i){var o=w(e,r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:i?ao(t,l,n.stroke):"none",stroke:ao(t,l,n.stroke),strokeWidth:1});return Kn(o,45),o},A=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},D=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?ao(t,l,n.stroke):so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},R=function(e,t,n={},i){return w(e,r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:i?ao(t,l,n.stroke):so(t,a,n.fill),strokeWidth:1})},N=function(e,t,n={}){return w(e,r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1})},j=function(e,t,n={}){return m(e,t.width,t.height,8,{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:4})};function I(e,t,n={}){var r=Oi(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(r);return r.get("eventDefinitions")&&r.get("eventDefinitions").length>1?r.get("parallelMultiple")?N(t,e,n,i):R(t,e,n,i):oo(r,"bpmn:MessageEventDefinition")?k(t,e,n,i):oo(r,"bpmn:TimerEventDefinition")?O(t,e,n,i):oo(r,"bpmn:ConditionalEventDefinition")?S(t,e,n,i):oo(r,"bpmn:SignalEventDefinition")?D(t,e,n,i):oo(r,"bpmn:EscalationEventDefinition")?P(t,e,n,i):oo(r,"bpmn:LinkEventDefinition")?C(t,e,n,i):oo(r,"bpmn:ErrorEventDefinition")?T(t,e,n,i):oo(r,"bpmn:CancelEventDefinition")?M(t,e,n,i):oo(r,"bpmn:CompensateEventDefinition")?A(t,e,n,i):oo(r,"bpmn:TerminateEventDefinition")?j(t,e,n,i):null}var $={ParticipantMultiplicityMarker:function(e,t,n={}){var i=po(t,n),o=uo(t,n);x("participant-multiplicity",e,r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2-6)/i,my:(o-15)/o}}),{strokeWidth:2,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},SubProcessMarker:function(e,t,n={}){Zn(g(e,14,14,0,{strokeWidth:1,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)}),t.width/2-7.5,t.height-20),x("sub-process",e,r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},ParallelMarker:function(e,t,n){var i=po(t,n),o=uo(t,n);x("parallel",e,r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.parallel)/i,my:(o-20)/o}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},SequentialMarker:function(e,t,n){x("sequential",e,r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},CompensationMarker:function(e,t,n){x("compensation",e,r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})},LoopMarker:function(e,t,n){var i=po(t,n),o=uo(t,n);x("loop",e,r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.loop)/i,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:ao(t,l,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var i=po(t,n),o=uo(t,n);x("adhoc",e,r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.adhoc)/i,my:(o-15)/o}}),{strokeWidth:1,fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke)})}};function z(e,t,n,r){$[e](t,n,r)}function B(e,t,n,r={}){r={fill:r.fill,stroke:r.stroke,width:po(t,r),height:uo(t,r)};var i=Oi(t),o=n&&n.includes("SubProcessMarker");r=o?{...r,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...r,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},v(n,(function(n){z(n,e,t,r)})),i.get("isForCompensation")&&z("CompensationMarker",e,t,r),Ei(i,"bpmn:AdHocSubProcess")&&z("AdhocMarker",e,t,r);var s=i.get("loopCharacteristics"),a=s&&s.get("isSequential");s&&(void 0===a&&z("LoopMarker",e,t,r),!1===a&&z("ParallelMarker",e,t,r),!0===a&&z("SequentialMarker",e,t,r))}function q(e,t,n={}){n=L({size:{width:100}},n);var r=o.createText(t||"",n);return Se(r).add("djs-label"),xe(e,r),r}function F(e,t,n,r={}){var i=Oi(t),o=co({x:t.x,y:t.y,width:t.width,height:t.height},r);return q(e,i.name,{align:n,box:o,padding:7,style:{fill:lo(t,c,l,r.stroke)}})}function V(e,t,n,r={}){var i=Hi(n),o=q(e,t,{box:{height:30,width:i?uo(n,r):po(n,r)},align:"center-middle",style:{fill:lo(n,c,l,r.stroke)}});i&&Xn(o,0,-(-1*uo(n,r)),270)}function H(e,t,n={}){var{width:r,height:i}=co(t,n);return g(e,r,i,10,{...n,fill:so(t,a,n.fill),fillOpacity:fo,stroke:ao(t,l,n.stroke)})}function U(e,t,n={}){var r=Oi(t),i=so(t,a,n.fill),o=ao(t,l,n.stroke);return"One"!==r.get("associationDirection")&&"Both"!==r.get("associationDirection")||(n.markerEnd=f(e,"association-end",i,o)),"Both"===r.get("associationDirection")&&(n.markerStart=f(e,"association-start",i,o)),n=go(n,["markerStart","markerEnd"]),b(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function W(e,t,n={}){var i=so(t,a,n.fill),o=ao(t,l,n.stroke),s=w(e,r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:i,fillOpacity:fo,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(Oi(t))&&w(e,r.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:i,stroke:o});return s}function G(e,t,n={}){return m(e,t.width,t.height,{fillOpacity:fo,...n,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)})}function Q(e,t,n={}){return function(e,t,n,r){var i=t/2,o=n/2,s=[{x:i,y:0},{x:t,y:o},{x:i,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");r=u(r);var a=Ne("polygon",{...r,points:s});return xe(e,a),a}(e,t.width,t.height,{fill:so(t,a,n.fill),fillOpacity:fo,stroke:ao(t,l,n.stroke)})}function Y(e,t,n={}){var r=g(e,po(t,n),uo(t,n),0,{fill:so(t,a,n.fill),fillOpacity:n.fillOpacity||fo,stroke:ao(t,l,n.stroke),strokeWidth:1.5}),i=Oi(t);Ei(i,"bpmn:Lane")&&V(e,i.get("name"),t,n);return r}function X(e,t,n={}){var r=H(e,t,n);Wi(t)&&Oe(r,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var i=Vi(t);return F(e,t,i?"center-top":"center-middle",n),B(e,t,i?void 0:["SubProcessMarker"],n),r}function Z(e,t,n={}){var r=H(e,t,n);return F(e,t,"center-middle",n),B(e,t,void 0,n),r}var K=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return X(e,t,n=Vi(t)?go(n,["fill","stroke","width","height"]):go(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return U(e,t,n=go(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]);var i=Oi(t).get("cancelActivity");n={strokeWidth:1.5,fill:so(t,a,n.fill),fillOpacity:1,stroke:ao(t,l,n.stroke)},i||(n.strokeDasharray="6");var o=G(e,t,n);return m(e,t.width,t.height,3,{...n,fill:"none"}),r&&I(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return Oe(w(e,r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),Oe(w(e,r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:CallActivity":function(e,t,n={}){return n=go(n,["fill","stroke"]),X(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var i=Q(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:DataInput":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=r.getRawPath("DATA_ARROW"),o=W(e,t,n);return w(e,i,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=go(n,["fill","stroke"]),U(e,t,{...n,markerEnd:f(e,"association-end",so(t,a,n.fill),ao(t,l,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return W(e,t,n=go(n,["fill","stroke"]))},"bpmn:DataObjectReference":E("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=r.getRawPath("DATA_ARROW"),o=W(e,t,n);return w(e,i,{strokeWidth:1,fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=go(n,["fill","stroke"]),U(e,t,{...n,markerEnd:f(e,"association-end",so(t,a,n.fill),ao(t,l,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=go(n,["fill","stroke"]),w(e,r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:so(t,a,n.fill),fillOpacity:fo,stroke:ao(t,l,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]);var i=G(e,t,{...n,strokeWidth:4});return r&&I(t,e,n),i},"bpmn:EventBasedGateway":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=Oi(t),o=Q(e,t,n);m(e,t.width,t.height,.2*t.height,{fill:so(t,"none",n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1});var s=i.get("eventGatewayType"),a=!!i.get("instantiate");if("Parallel"===s){var c=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});w(e,c,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1})}else"Exclusive"===s&&(a||m(e,t.width,t.height,.26*t.height,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1}),function(){var i=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});w(e,i,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var i=Q(e,t,n=go(n,["fill","stroke"])),o=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Pi(t).get("isMarkerVisible")&&w(e,o,{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:Gateway":function(e,t,n={}){return Q(e,t,n=go(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=go(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:ao(t,l,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:po(t,n),height:uo(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var r=Q(e,t,n=go(n,["fill","stroke"]));return m(e,t.width,t.height,.24*t.height,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:2.5}),r},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]);var i=G(e,t,{...n,strokeWidth:1.5});return m(e,t.width,t.height,3,{fill:"none",stroke:ao(t,l,n.stroke),strokeWidth:1.5}),r&&I(t,e,n),i},"bpmn:IntermediateCatchEvent":E("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":E("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=go(n,["fill","stroke","width","height"]),Y(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:.5}),i},"bpmn:MessageFlow":function(e,t,n={}){n=go(n,["fill","stroke"]);var i=Oi(t),o=Pi(t),s=so(t,a,n.fill),c=ao(t,l,n.stroke),p=b(e,t.waypoints,{markerEnd:f(e,"messageflow-end",s,c),markerStart:f(e,"messageflow-start",s,c),stroke:c,strokeDasharray:"10, 11",strokeWidth:1.5});if(i.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),d=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(h.fill=s,h.stroke=c):(h.fill=c,h.stroke=s);var m=w(e,d,h),g=q(e,i.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:c}}),y=m.getBBox(),v=g.getBBox();Xn(g,u.x-v.width/2,u.y+y.height/2+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var i=Q(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:Participant":function(e,t,n={}){var r=Y(e,t,n=go(n,["fill","stroke","width","height"])),i=Vi(t),o=Hi(t),s=Oi(t),a=s.get("name");if(i){y(e,o?[{x:30,y:0},{x:30,y:uo(t,n)}]:[{x:0,y:30},{x:po(t,n),y:30}],{stroke:ao(t,l,n.stroke),strokeWidth:1.5}),V(e,a,t,n)}else{var p=co(t,n);o||(p.height=po(t,n),p.width=uo(t,n));var u=q(e,a,{box:p,align:"center-middle",style:{fill:lo(t,c,l,n.stroke)}});if(!o)Xn(u,0,-(-1*uo(t,n)),270)}return s.get("participantMultiplicity")&&z("ParticipantMultiplicityMarker",e,t,n),r},"bpmn:ReceiveTask":function(e,t,n={}){n=go(n,["fill","stroke"]);var i,o=Oi(t),s=Z(e,t,n);return o.get("instantiate")?(m(e,28,28,4.4,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),i=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,i,{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),s},"bpmn:ScriptTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:SendTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:ao(t,l,n.stroke),stroke:so(t,a,n.fill),strokeWidth:1}),i},"bpmn:SequenceFlow":function(e,t,n={}){n=go(n,["fill","stroke"]);var r=so(t,a,n.fill),i=ao(t,l,n.stroke),o=b(e,t.waypoints,{markerEnd:f(e,"sequenceflow-end",r,i),stroke:i}),s=Oi(t),{source:c}=t;if(c){var p=Oi(c);s.get("conditionExpression")&&Ei(p,"bpmn:Activity")&&Oe(o,{markerStart:f(e,"conditional-flow-marker",r,i)}),p.get("default")&&(Ei(p,"bpmn:Gateway")||Ei(p,"bpmn:Activity"))&&p.get("default")===s&&Oe(o,{markerStart:f(e,"conditional-default-flow-marker",r,i)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return m(e,10,10,{fill:so(t,a,n.fill),stroke:"none",transform:"translate(6, 6)"}),w(e,r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),m(e,10,10,{fill:so(t,a,n.fill),stroke:"none",transform:"translate(11, 10)"}),w(e,r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:1}),i},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=go(n,["fill","stroke"]),Oi(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var i=G(e,t,n);return r&&I(t,e,n),i},"bpmn:SubProcess":function(e,t,n={}){return X(e,t,n=Vi(t)?go(n,["fill","stroke","width","height"]):go(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return Z(e,t,n=go(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=go(n,["fill","stroke","width","height"]);var{width:i,height:o}=co(t,n),s=g(e,i,o,0,0,{fill:"none",stroke:"none"});return w(e,r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:0,my:0}}),{stroke:ao(t,l,n.stroke)}),q(e,Oi(t).get("text")||"",{align:"left-top",box:co(t,n),padding:7,style:{fill:lo(t,c,l,n.stroke)}}),s},"bpmn:Transaction":function(e,t,r={}){r=Vi(t)?go(r,["fill","stroke","width","height"]):go(r,["fill","stroke"]);var i=X(e,t,{strokeWidth:1.5,...r}),o=n.style(["no-fill","no-events"],{stroke:ao(t,l,r.stroke),strokeWidth:1.5});return Vi(t)||(r={}),g(e,po(t,r),uo(t,r),7,3,o),i},"bpmn:UserTask":function(e,t,n={}){var i=Z(e,t,n=go(n,["fill","stroke"]));return w(e,r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:.5}),w(e,r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:so(t,a,n.fill),stroke:ao(t,l,n.stroke),strokeWidth:.5}),w(e,r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:ao(t,l,n.stroke),stroke:ao(t,l,n.stroke),strokeWidth:.5}),i},label:function(e,t,n={}){return function(e,t,n={}){var r={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return q(e,to(t),{box:r,fitBox:!0,style:L({},o.getExternalStyle(),{fill:lo(t,c,l,n.stroke)})})}(e,t,n)}};this._drawPath=w,this._renderer=_}function go(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(mo,ot),mo.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],mo.prototype.canRender=function(e){return Ei(e,"bpmn:BaseElement")},mo.prototype.drawShape=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},mo.prototype.drawConnection=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},mo.prototype.getShapePath=function(e){return Ei(e,"bpmn:Event")?function(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2;return st([["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])}(e):Ei(e,"bpmn:Activity")?function(e,t){var n=e.x,r=e.y,i=e.width,o=e.height;return st([["M",n+t,r],["l",i-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-i,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):Ei(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return st([["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,r=e.width;return st([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])}(e)};var yo=0,vo={width:150,height:50};function bo(e,t){var n;t.textContent=e;try{var r,i=""===e;return t.textContent=i?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},i&&(r.width=0),r}catch(e){return console.log(e),{width:0,height:0}}}function wo(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=bo(o,n)).width=o?r.width:0," "===o||""===o||r.width<Math.round(t)||o.length<2)return xo(e,o,i,r);o=Eo(o,r.width,t)}}function xo(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}var _o="";function Eo(e,t,n){var r=Math.max(e.length*(n/t),1),i=function(e,t){var n,r=e.split(/(\s|-|\u00AD)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"!==n&&n!==_o||i.pop();break}i.push(n),o+=n.length}var s=i[i.length-1];return s&&s===_o&&(i[i.length-1]="-"),i.join("")}(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function ko(e){this._config=L({},{size:vo,padding:yo,style:{},align:"center-top"},e||{})}ko.prototype.createText=function(e,t){return this.layoutText(e,t).element},ko.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},ko.prototype.layoutText=function(e,t){var n=L({},this._config.size,t.box),r=L({},this._config.style,t.style),i=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return p(e)?L({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)}(r),l=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,d=Ne("text");for(Oe(d,{x:0,y:0}),Oe(d,r),xe(function(){var e=document.getElementById("helper-svg");return e||(Oe(e=Ne("svg"),{id:"helper-svg"}),Y(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),d);l.length;)c.push(wo(l,u,d));"middle"===i.vertical&&(o.top=o.bottom=0);var h=w(c,(function(e,t,n){return e+(a||t.height)}),0)+o.top+o.bottom,f=w(c,(function(e,t,n){return t.width>e?t.width:e}),0),m=o.top;"middle"===i.vertical&&(m+=(n.height-h)/2),m-=(a||c[0].height)/4;var g=Ne("text");return Oe(g,r),v(c,(function(e){var t;switch(m+=a||e.height,i.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=Ne("tspan");Oe(n,{x:t,y:m}),n.textContent=e.text,xe(g,n)})),Ue(d),{dimensions:{width:f,height:h},element:g}};function Oo(e){var t=L({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=L({},t,{fontSize:n},e&&e.externalStyle||{}),i=new ko({style:t});this.getExternalLabelBounds=function(e,t){var n=i.getDimensions(t,{box:{width:90,height:30},style:r});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 r=i.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(r.height))}},this.createText=function(e,t){return i.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Oo.$inject=["config.textRenderer"];var Po=/\{([^{}]+)\}/g,So=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Co={__init__:["bpmnRenderer"],bpmnRenderer:["type",mo],textRenderer:["type",Oo],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,r,i=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o={};if(t.position){for(var s=t.containerHeight/i.height*t.yScaleFactor,a=t.containerWidth/i.width*t.xScaleFactor,l=0;l<i.heightElements.length;l++)o["y"+l]=i.heightElements[l]*s;for(var c=0;c<i.widthElements.length;c++)o["x"+c]=i.widthElements[c]*a}var p,u,d=(p=i.d,u={mx:n,my:r,e:o},String(p).replace(Po,(function(e,t){return function(e,t,n){var r=n;return t.replace(So,(function(e,t,n,i,o){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&o&&(r=r()))})),r=(null==r||r==n?e:r)+""}(e,t,u)})));return d}}]};var To={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function Mo(e,t,n){return L({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Ao(e,t,n){var r=e.waypoint;return!r||r.length<2?[wn(t),wn(n)]:r.map((function(e){return{x:e.x,y:e.y}}))}function Do(e,t,n){return new Error(`element ${vi(t)} referenced by ${vi(e)}#${n} not yet drawn`)}function Ro(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}Ro.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Ro.prototype.add=function(e,t,n){var r,i,o;if(Ei(t,"bpmndi:BPMNPlane")){var s=Ei(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(Mo(e,t,s)),this._canvas.addRootElement(r)}else if(Ei(t,"bpmndi:BPMNShape")){var a=!Vi(e,t),l=function(e){return Ei(e,"bpmn:Group")}(e);i=n&&(n.hidden||n.collapsed);var c=t.bounds;r=this._elementFactory.createShape(Mo(e,t,{collapsed:a,hidden:i,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height),isFrame:l})),Ei(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),Ei(e,"bpmn:Lane")&&(o=0),Ei(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}(n,wn(c))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else{if(!Ei(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${vi(t)} for element ${vi(e)}`);var p=this._getSource(e),u=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Mo(e,t,{hidden:i,source:p,target:u,waypoints:Ao(t,p,u)})),Ei(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}return Xi(e)&&to(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r},Ro.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${vi(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw Do(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),-1===i.indexOf(t)&&i.push(t)},Ro.prototype.addLabel=function(e,t,n){var r,i,o;return r=function(e,t){var n,r,i,o=e.label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(Qi.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=Ji(t),r=Qi),L({x:n.x-r.width/2,y:n.y-r.height/2},r)}(t,n),(i=to(n))&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(Mo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!to(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(o,n.parent)},Ro.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===i&&(r=r&&r[0]),("source"===t&&"bpmn:DataOutputAssociation"===i||"target"===t&&"bpmn:DataInputAssociation"===i)&&(r=e.$parent),n=r&&this._getElement(r))return n;throw r?Do(e,r,t+"Ref"):new Error(`${vi(e)}#${t} Ref not specified`)},Ro.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Ro.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Ro.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var No={__depends__:[Co,{__depends__:[To],bpmnImporter:["type",Ro]}]};function jo(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}jo.prototype.next=function(){return this._prefix+ ++this._counter};var Io=new jo("ov");function Lo(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Io,this._overlayDefaults=L({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),Y(o=ge('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),i.insertBefore(o,i.firstChild),o),this._init()}function $o(e,t,n){Y(e,{left:t+"px",top:n+"px"})}function zo(e,t){e.style.display=!1===t?"none":""}function Bo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Lo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Lo.prototype.get=function(e){if(h(e)&&(e={id:e}),h(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?y(t.overlays,M({type:e.type})):t.overlays.slice():[]}return e.type?y(this._overlays,M({type:e.type})):e.id?this._overlays[e.id]:null},Lo.prototype.add=function(e,t,n){if(p(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 r=this._ids.next();return n=L({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Lo.prototype.remove=function(e){var t=this.get(e)||[];c(t)||(t=[t]);var n=this;v(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(we(e.html),we(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}}))},Lo.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Lo.prototype.show=function(){zo(this._overlayRoot)},Lo.prototype.hide=function(){zo(this._overlayRoot,!1)},Lo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ee(this._overlayRoot)},Lo.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=vt(t);r=o.x,i=o.y}$o(n,r,i),X(e.html,"data-container-id",t.id)},Lo.prototype._updateOverlay=function(e){var t,n,r=e.position,i=e.htmlContainer,o=e.element,s=r.left,a=r.top;void 0!==r.right&&(t=o.waypoints?vt(o).width:o.width,s=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?vt(o).height:o.height,a=-1*r.bottom+n);$o(i,s||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Lo.prototype._createOverlayContainer=function(e){var t=ge('<div class="djs-overlays" />');Y(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Lo.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Bo(this._overlayRoot,n)},Lo.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Lo.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),h(o)&&(o=ge(o)),n=this._getOverlayContainer(i),Y(t=ge('<div class="djs-overlay" data-overlay-id="'+r+'">'),{position:"absolute"}),t.appendChild(o),e.type&&K(t).add("djs-overlay-"+e.type),zo(t,this._canvas.findRoot(i)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Lo.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,l=!0;(r!==this._canvas.getRootElement()||n&&(a(i)&&i>t.scale||a(o)&&o<t.scale))&&(l=!1),zo(s,l),this._updateOverlayScale(e,t)},Lo.prototype._updateOverlayScale=function(e,t){var n,r,i,o=e.scale,s=e.htmlContainer,l="";!0!==o&&(!1===o?(n=1,r=1):(n=o.min,r=o.max),a(n)&&t.scale<n&&(i=(1/t.scale||1)*n),a(r)&&t.scale>r&&(i=(1/t.scale||1)*r)),a(i)&&(l="scale("+i+","+i+")"),Bo(s,l)},Lo.prototype._updateOverlaysVisibilty=function(e){var t=this;v(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Lo.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;v(t.get({element:n}),(function(e){t.remove(e.id)}));var r=t._getOverlayContainer(n);if(r){we(r.html);var i=t._overlayContainers.indexOf(r);-1!==i&&t._overlayContainers.splice(i,1)}})),e.on("element.changed",500,(function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&(v(r.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(r))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&K(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 qo={__init__:["overlays"],overlays:["type",Lo]};function Fo(e,t,n,r){e.on("element.changed",(function(r){var i=r.element;(i.parent||i===t.getRootElement())&&(r.gfx=n.getGraphics(i)),r.gfx&&e.fire(bt(i)+".changed",r)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),r.updateContainments(n)})),e.on("shape.changed",(function(e){r.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){r.update("connection",e.element,e.gfx)}))}Fo.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Vo={__init__:["changeSupport"],changeSupport:["type",Fo]};function Ho(e){this._eventBus=e}function Uo(e){return function(t,n,r,i,o){(d(t)||u(t))&&(o=i,i=r,r=n,n=t,t=null),this.on(t,e,n,r,i,o)}}function Wo(e,t){t.invoke(Ho,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)}))}Ho.$inject=["eventBus"],Ho.prototype.on=function(e,t,n,r,i,o){if((d(t)||u(t))&&(o=i,i=r,r=n,n=t,t=null),d(n)&&(o=i,i=r,r=n,n=1e3),p(i)&&(o=i,i=!1),!d(r))throw new Error("handlerFn must be a function");c(e)||(e=[e]);var s=this._eventBus;v(e,(function(e){var a=["commandStack",e,t].filter((function(e){return e})).join(".");s.on(a,n,i?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(r,o):r,o)}))},Ho.prototype.canExecute=Uo("canExecute"),Ho.prototype.preExecute=Uo("preExecute"),Ho.prototype.preExecuted=Uo("preExecuted"),Ho.prototype.execute=Uo("execute"),Ho.prototype.executed=Uo("executed"),Ho.prototype.postExecute=Uo("postExecute"),Ho.prototype.postExecuted=Uo("postExecuted"),Ho.prototype.revert=Uo("revert"),Ho.prototype.reverted=Uo("reverted"),e(Wo,Ho),Wo.$inject=["canvas","injector"];var Go={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Wo]};function Qo(e){return CSS.escape(e)}var Yo={"&":"&","<":"<",">":">",'"':""","'":"'"};function Xo(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return Yo[e]}))}var Zo="_plane";function Ko(e){return function(e){return e.replace(new RegExp(Zo+"$"),"")}(e.id)}function Jo(e){var t=e.id;return Ei(e,"bpmn:SubProcess")?ns(t):t}function es(e){return ns(e)}function ts(e){return Ei(Pi(e),"bpmndi:BPMNPlane")}function ns(e){return e+Zo}function rs(e,t,n){var r=ge('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=K(i);i.appendChild(r);var s=[];function a(e){e&&(s=function(e){for(var t=Oi(e),n=[],r=t;r;r=r.$parent)(Ei(r,"bpmn:SubProcess")||Ei(r,"bpmn:Process"))&&n.push(r);return n.reverse()}(e));var i=s.flatMap((function(e){var r=n.findRoot(Jo(e))||n.findRoot(e.id);if(!r&&Ei(e,"bpmn:Process")){var i=t.find((function(t){var n=Oi(t);return n&&n.get("processRef")===e}));r=i&&n.findRoot(i.id)}if(!r)return[];var o=Xo(e.name||e.id),s=ge('<li><span class="bjs-crumb"><a title="'+o+'">'+o+"</a></span></li>");return s.addEventListener("click",(function(){n.setRootElement(r)})),s}));r.innerHTML="";var a=i.length>1;o.toggle("bjs-breadcrumbs-shown",a),i.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=Oi(e.element);m(s,(function(e){return e===t}))&&a()})),e.on("root.set",(function(e){a(e.element)}))}function is(e,t){var n=null,r=new os;e.on("root.set",(function(e){var i=e.element,o=t.viewbox(),s=r.get(i);if(r.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=i,Ei(i,"bpmn:SubProcess")||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(){r.clear(),n=null}))}function os(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][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)}}rs.$inject=["eventBus","elementRegistry","canvas"],is.$inject=["eventBus","canvas"];var ss=180,as=160;function ls(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 cs(e){return Ei(e,"bpmndi:BPMNDiagram")?e:cs(e.$parent)}ls.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)})),e.diagrams.filter((e=>e.plane)).flatMap((e=>t._createNewDiagrams(e.plane))).forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},ls.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach((function(t){var i=t.bpmnElement;if(i){var o=i.$parent;Ei(i,"bpmn:SubProcess")&&!t.isExpanded&&n.push(i),function(e,t){var n=e.$parent;if(!Ei(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(ki(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(i,e)&&r.push({diElement:t,parent:o})}}));var i=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,i.push(n)}})),r.forEach((function(e){for(var r=e.diElement,i=e.parent;i&&-1===n.indexOf(i);)i=i.$parent;if(i){var o=t._processToDiagramMap[i.id];t._moveToDiPlane(r,o.plane)}})),i},ls.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=yn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),vn(t)}(e),r=n.x-ss,i=n.y-as;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-r,e.y=e.y-i})):e.bounds&&(e.bounds.x=e.bounds.x-r,e.bounds.y=e.bounds.y-i)}))},ls.prototype._moveToDiPlane=function(e,t){var n=cs(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},ls.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},ls.$inject=["eventBus","moddle"];var ps=250;function us(e,t,n,r,i){Ho.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",ps,(function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",ps,(function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],ps,(function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;o._canDrillDown(r)&&o._addOverlay(r),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],ps,(function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;o._canDrillDown(r)&&o._addOverlay(r),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return o._canDrillDown(e)})).map((function(e){o._addOverlay(e)}))}))}e(us,Ho),us.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},us.prototype._canDrillDown=function(e){var t=this._canvas;return Ei(e,"bpmn:SubProcess")&&t.findRoot(Jo(e))},us.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Oi(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;K(r.html).toggle("bjs-drilldown-empty",!i)}},us.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=Oi(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=ge('<button type="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>'),o=r.get("name")||r.get("id"),s=this._translate("Open {element}",{element:o});i.setAttribute("title",s),i.addEventListener("click",(function(){t.setRootElement(t.findRoot(Jo(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},us.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},us.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var ds={__depends__:[qo,Vo,Go],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",rs],drilldownCentering:["type",is],drilldownOverlayBehavior:["type",us],subprocessCompatibility:["type",ls]};function hs(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function fs(e){return e.originalEvent||e.srcEvent}function ms(e){hs(e),hs(fs(e))}function gs(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 ys(){return/mac/i.test(navigator.platform)}function vs(e,t){return(fs(e)||e).button===t}function bs(e){return vs(e,0)}function ws(e){var t=fs(e)||e;return!!bs(e)&&(ys()?t.metaKey:t.ctrlKey)}function xs(e){var t=fs(e)||e;return bs(e)&&t.shiftKey}function _s(e){return!0}function Es(e){return bs(e)||function(e){return vs(e,1)}(e)}function ks(e,t,n){var r=this;function i(n,r,i){var o,s;(function(e,t){var n=l[e]||bs;return!n(t)})(n,r)||(i?s=t.getGraphics(i):(o=r.delegateTarget||r.target)&&(s=o,i=t.get(s)),s&&i&&!1===e.fire(n,{element:i,gfx:s,originalEvent:r})&&(r.stopPropagation(),r.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":_s,"element.mousedown":Es,"element.mouseup":Es,"element.click":Es,"element.dblclick":Es};var c="svg, .djs-element";function p(e,t,n,r){var s=o[n]=function(e){i(n,e)};r&&(l[n]=r),s.$delegate=de.bind(e,c,t,s)}function u(e,t,n){var r=s(n);r&&de.unbind(e,t,r.$delegate)}e.on("canvas.destroy",(function(e){!function(e){v(a,(function(t,n){u(e,n,t)}))}(e.svg)})),e.on("canvas.init",(function(e){!function(e){v(a,(function(t,n){p(e,n,t)}))}(e.svg)})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:r})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:r})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;r.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;r.updateDefaultHit(t,n)}));var d=m("djs-hit djs-hit-stroke"),h=m("djs-hit djs-hit-click-stroke"),f={all:m("djs-hit djs-hit-all"),"click-stroke":h,stroke:d,"no-move":m("djs-hit djs-hit-no-move")};function m(e,t){return t=L({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 Oe(e,n),e}function y(e,t){xe(e,t)}this.removeHits=function(e){v(be(".djs-hit",e),Ue)},this.createDefaultHit=function(e,t){var n,r=e.waypoints,i=e.isFrame;return r?this.createWaypointsHit(t,r):(n=i?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=ut(t);return g(n,"stroke"),y(e,n),n},this.createBoxHit=function(e,t,n){n=L({x:0,y:0},n);var r=Ne("rect");return g(r,t),Oe(r,n),y(e,r),r},this.updateDefaultHit=function(e,t){var n=ve(".djs-hit",t);if(n)return e.waypoints?dt(n,e.waypoints):Oe(n,{width:e.width,height:e.height}),n},this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=a[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=s,this.registerEvent=p,this.unregisterEvent=u}ks.$inject=["eventBus","elementRegistry","styles"];var Os={__init__:["interactionEvents"],interactionEvents:["type",ks]};function Ps(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)}))}Ps.$inject=["eventBus","canvas"],Ps.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},Ps.prototype.get=function(){return this._selectedElements},Ps.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Ps.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();c(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter((function(e){var t=i.findRoot(e);return o===t})),t?v(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Ss="hover",Cs="selected";function Ts(e,t){function n(t,n){e.addMarker(t,n)}function r(t,n){e.removeMarker(t,n)}this._canvas=e,t.on("element.hover",(function(e){n(e.element,Ss)})),t.on("element.out",(function(e){r(e.element,Ss)})),t.on("selection.changed",(function(e){var t=e.oldSelection,i=e.newSelection;v(t,(function(e){-1===i.indexOf(e)&&function(e){r(e,Cs)}(e)})),v(i,(function(e){-1===t.indexOf(e)&&function(e){n(e,Cs)}(e)}))}))}function Ms(e,t,n,r){e.on("create.end",500,(function(e){var n=e.context,r=n.canExecute,i=n.elements,o=(n.hints||{}).autoSelect;if(r){if(!1===o)return;c(o)?t.select(o):t.select(i.filter(As))}})),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||[],i=r.get(e.context.shape.id);m(n,(function(e){return i.id===e.id}))||t.select(i)})),e.on("element.click",(function(e){if(bs(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,s=xs(e);if(i&&o)return s?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,s)}}))}function As(e){return!e.hidden}Ts.$inject=["canvas","eventBus"],Ms.$inject=["eventBus","selection","canvas","elementRegistry"];var Ds={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Os],selection:["type",Ps],selectionVisuals:["type",Ts],selectionBehavior:["type",Ms]};function Rs(e){$i.call(this,e)}e(Rs,$i),Rs.prototype._modules=[No,ds,qo,Ds,To],Rs.prototype._moddleExtensions={};var Ns=["c","C"],js=["v","V"],Is=["y","Y"],Ls=["z","Z"];function $s(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function zs(e,t){return-1!==(e=c(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Bs(e){return e.shiftKey}function qs(e){return $s(e)&&!Bs(e)&&zs(Ls,e)}function Fs(e){return $s(e)&&(zs(Is,e)||zs(Ls,e)&&Bs(e))}var Vs="keyboard.keydown",Hs="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Us(e,t){var n=this;this._config=e=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()})),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Hs));var r=e&&!1!==e.bind;t.on("canvas.init",(function(e){n._target=e.svg,r&&n.bind(),n._fire("init")}))}Us.$inject=["config.keyboard","eventBus"],Us.prototype._keydownHandler=function(e){this._keyHandler(e,Vs)},Us.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Us.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Vs,n)&&e.preventDefault()}},Us.prototype._isEventIgnored=function(e){return!1},Us.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Hs)),this.unbind(),e=this._node=this._target,ce.bind(e,"keydown",this._keydownHandler),ce.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Us.prototype.getBinding=function(){return this._node},Us.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ce.unbind(e,"keydown",this._keydownHandler),ce.unbind(e,"keyup",this._keyupHandler)),this._node=null},Us.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Us.prototype.addListener=function(e,t,n){d(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Vs,e,t)},Us.prototype.removeListener=function(e,t){this._eventBus.off(t||Vs,e)},Us.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Us.prototype.isCmd=$s,Us.prototype.isShift=Bs,Us.prototype.isKey=zs;var Ws=500;function Gs(e,t){var n=this;e.on("editorActions.init",Ws,(function(e){var r=e.editorActions;n.registerBindings(t,r)}))}Gs.$inject=["eventBus","keyboard"],Gs.prototype.registerBindings=function(e,t){function n(n,r){t.isRegistered(n)&&e.addListener(r)}n("undo",(function(e){if(qs(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(Fs(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return $s(e)&&zs(Ns,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return $s(e)&&zs(js,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(zs(["+","Add","="],n)&&$s(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(zs(["-","Subtract"],n)&&$s(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(zs("0",n)&&$s(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(zs(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Qs={__init__:["keyboard","keyboardBindings"],keyboard:["type",Us],keyboardBindings:["type",Gs]},Ys={moveSpeed:50,moveSpeedAccelerated:200};function Xs(e,t,n){var r=this;this._config=L({},Ys,e||{}),t.addListener((function(e){var n=e.keyEvent,i=r._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,s=t.isShift(n)?i.moveSpeedAccelerated:i.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 r.moveCanvas({speed:s,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,r=0,i=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=i;break;case"up":r=i;break;case"right":t=-i;break;case"down":r=-i}n.scroll({dx:t,dy:r})}}Xs.$inject=["config.keyboardMove","keyboard","canvas"];var Zs={__depends__:[Qs],__init__:["keyboardMove"],keyboardMove:["type",Xs]},Ks=/^djs-cursor-.*$/;function Js(e){var t=K(document.body);t.removeMatching(Ks),e&&t.add("djs-cursor-"+e)}function ea(){Js(null)}var ta=5e3;function na(e,t){function n(){return!1}return t=t||"element.click",e.once(t,ta,n),function(){e.off(t,n)}}function ra(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ia(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oa(e,t){var n;function r(e){return s(e.originalEvent)}function i(r){var i,o=n.start,s=n.button,a=gs(r),l=ia(a,o);(!n.dragging&&(i=l,Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))>15)&&(n.dragging=!0,0===s&&na(e),Js("grab")),n.dragging)&&(l=ia(a,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=a);r.preventDefault()}function o(e){ce.unbind(document,"mousemove",i),ce.unbind(document,"mouseup",o),n=null,ea()}function s(e){if(!te(e.target,".djs-draggable")){var t=e.button;if(!(t>=2||e.ctrlKey||e.shiftKey||e.altKey))return n={button:t,start:gs(e)},ce.bind(document,"mousemove",i),ce.bind(document,"mouseup",o),!0}}e.on("canvas.focus.changed",(function(t){t.focused?e.on("element.mousedown",500,r):e.off("element.mousedown",r)})),this.isActive=function(){return!!n}}oa.$inject=["eventBus","canvas"];var sa={__init__:["moveCanvas"],moveCanvas:["type",oa]};function aa(e){return Math.log(e)/Math.log(10)}function la(e,t){var n=aa(e.min),r=aa(e.max);return(Math.abs(n)+Math.abs(r))/t}var ca=Math.sign||function(e){return e>=0?1:-1},pa={min:.2,max:4};function ua(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=I(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var r=this;t.on("canvas.focus.changed",(function(t){r._init(t.focused&&!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=la(pa,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},ua.prototype._handleWheel=function(e){if(this._canvas.isFocused()){var t=this._container;e.preventDefault();var n,r=e.ctrlKey||ys()&&e.metaKey,i=e.shiftKey,o=-1*this._scale;if(o*=r?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,r){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))*ca(e.deltaY)*o,this.zoom(n,a)}else n=i?{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=la(pa,10);this._zoom(e,t,n)},ua.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=aa(r.zoom()),s=Math.round(o/n)*n;s+=n*i;var a=Math.pow(10,s);r.zoom(function(e,t){return Math.max(e.min,Math.min(e.max,t))}(pa,a),t)},ua.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,r=this._enabled;return void 0===e&&(e=!r),r!==e&&ce[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},ua.prototype._init=function(e){this.toggle(e)};var da={__init__:["zoomScroll"],zoomScroll:["type",ua]};function ha(e){Rs.call(this,e)}function fa(e){return e&&e[e.length-1]}function ma(e){return e.y}function ga(e){return e.x}e(ha,Rs),ha.prototype._navigationModules=[Zs,sa,da],ha.prototype._modules=[].concat(Rs.prototype._modules,ha.prototype._navigationModules);var ya={left:ga,center:ga,right:function(e){return e.x+e.width},top:ma,middle:ma,bottom:function(e){return e.y+e.height}};function va(e,t){this._modeling=e,this._rules=t}va.$inject=["modeling","rules"],va.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},va.prototype._isType=function(e,t){return-1!==t.indexOf(e)},va.prototype._alignmentPosition=function(e,t){var n,r,i,o=this._getOrientationDetails(e),s=o.axis,a=o.dimension,l={},c={},p=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))i=fa(t),l[e]=i[s]+i[a];else if(this._isType(e,["center","middle"])){if(v(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=T(c,(function(e){return e.elements.length>1&&(p=!0),e.elements.length})),p)return l[e]=fa(n).center,l;r=t[0],i=fa(t=T(t,(function(e){return e[s]+e[a]}))),l[e]=function(e,t){return Math.round((e[s]+t[s]+t[a])/2)}(r,i)}return l},va.prototype.trigger=function(e,t){var n,r=this._modeling,i=y(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(c(n=this._rules.allowed("elements.align",{elements:i}))&&(i=n),!(i.length<2)&&n){var o=T(i,ya[t]),s=this._alignmentPosition(t,o);r.alignElements(o,s)}};var ba={__init__:["alignElements"],alignElements:["type",va]};const wa=new jo;function xa(e){this._scheduled={},e.on("diagram.destroy",(()=>{Object.keys(this._scheduled).forEach((e=>{this.cancel(e)}))}))}xa.$inject=["eventBus"],xa.prototype.schedule=function(e,t=wa.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},xa.prototype._schedule=function(e,t){const n=function(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}(),r=setTimeout((()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(e){n.reject(e)}}catch(e){console.error("Scheduler#_schedule execution failed",e)}}));return{executionId:r,promise:n.promise}},xa.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},xa.prototype._cancel=function(e){clearTimeout(e.executionId)};var _a={scheduler:["type",xa]},Ea=".entry";function ka(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}ka.$inject=["canvas","elementRegistry","eventBus","scheduler"],ka.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,r=n.length?1===n.length?n[0]:n:null;r?e.open(r,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,r=e._current;if(r){var i=r.target,o=c(i)?i:[i];if(o.filter((function(e){return n.includes(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",(function(){e._updatePosition()})),this._eventBus.on("element.marker.update",(function(t){if(e.isOpen()){var n=t.element,r=e._current;(c(r.target)?r.target:[r.target]).includes(n)&&e._updateVisibility()}})),this._container=this._createContainer()},ka.prototype._createContainer=function(){var e=ge('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},ka.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},ka.prototype.getEntries=function(e){var t=this._getProviders(),n=c(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return v(t,(function(t){if(d(t[n])){var i=t[n](e);d(i)?r=i(r):v(i,(function(e,t){r[t]=e}))}})),r},ka.prototype.trigger=function(e,t,n){var r,i,o=this,s=t.delegateTarget||t.target;return s?(r=X(s,"data-action"),i=t.originalEvent||t,"mouseover"!==e?"mouseout"===e?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(r,e,i,n):void(this._timeout=setTimeout((function(){o._mouseout=o.triggerEntry(r,"hover",i,n)}),300))):t.preventDefault()},ka.prototype.triggerEntry=function(e,t,n,r){if(this.isShown()){var i=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(d(s)){if("click"===t)return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}},ka.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},ka.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ka.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),r=this._createHtml(e);v(n,(function(e,n){var i,o=e.group||"default",s=ge(e.html||'<div class="entry" draggable="true"></div>');X(s,"data-action",n),(i=ve("[data-group="+Qo(o)+"]",r))||(X(i=ge('<div class="group"></div>'),"data-group",o),r.appendChild(i)),i.appendChild(s),e.className&&function(e,t){var n=K(e);t=c(t)?t:t.split(/\s+/g),t.forEach((function(e){n.add(e)}))}(s,e.className),e.title&&X(s,"title",e.title),e.imageUrl&&(X(t=ge("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",s.appendChild(t))})),K(r).add("open"),this._current={entries:n,html:r,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},ka.prototype._createHtml=function(e){var t=this,n=ge('<div class="djs-context-pad"></div>');return de.bind(n,Ea,"click",(function(e){t.trigger("click",e)})),de.bind(n,Ea,"dragstart",(function(e){t.trigger("dragstart",e)})),de.bind(n,Ea,"mouseover",(function(e){t.trigger("mouseover",e)})),de.bind(n,Ea,"mouseout",(function(e){t.trigger("mouseout",e)})),ce.bind(n,"mousedown",(function(e){e.stopPropagation()})),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},ka.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&&x(e,(function(e){return t.includes(e)}))}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},ka.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ka.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&&x(e,(function(e){return n.includes(e)})):n===e)},ka.prototype.isShown=function(){return this.isOpen()&&K(this._current.html).has("open")},ka.prototype.show=function(){this.isOpen()&&(K(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},ka.prototype.hide=function(){this.isOpen()&&(K(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},ka.prototype._getPosition=function(e){if(!c(e)&&hn(e)){var t=this._canvas.viewbox(),n=(o=e).waypoints[o.waypoints.length-1],r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:r+8*this._canvas.zoom(),top:i}}var o,s=this._canvas.getContainer().getBoundingClientRect(),a=this._getTargetBounds(e);return{left:a.right-s.left+8*this._canvas.zoom(),top:a.top-s.top}},ka.prototype._updatePosition=function(){this._scheduler.schedule((()=>{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")}))}}),"ContextPad#_updatePosition")},ka.prototype._updateVisibility=function(){this._scheduler.schedule((()=>{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()}}),"ContextPad#_updateVisibility")},ka.prototype._getTargetBounds=function(e){var t=this;return(c(e)?e:[e]).map((function(e){return t._canvas.getGraphics(e)})).reduce((function(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 Oa,Pa,Sa,Ca,Ta,Ma,Aa={__depends__:[Os,_a,qo],contextPad:["type",ka]},Da={},Ra=[],Na=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ja(e,t){for(var n in t)e[n]=t[n];return e}function Ia(e){var t=e.parentNode;t&&t.removeChild(e)}function La(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Oa.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 $a(e,s,r,i,null)}function $a(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Sa:i};return null==i&&null!=Pa.vnode&&Pa.vnode(o),o}function za(e){return e.children}function Ba(e,t){this.props=e,this.context=t}function qa(e,t){if(null==t)return e.__?qa(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?qa(e):null}function Fa(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 Fa(e)}}function Va(e){(!e.__d&&(e.__d=!0)&&Ca.push(e)&&!Ha.__r++||Ta!==Pa.debounceRendering)&&((Ta=Pa.debounceRendering)||setTimeout)(Ha)}function Ha(){for(var e;Ha.__r=Ca.length;)e=Ca.sort((function(e,t){return e.__v.__b-t.__v.__b})),Ca=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=ja({},i)).__v=i.__v+1,Ja(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?qa(i):o,i.__h),el(n,i),i.__e!=o&&Fa(i)))}))}function Ua(e,t,n,r,i,o,s,a,l,c){var p,u,d,h,f,m,g,y=r&&r.__k||Ra,v=y.length;for(n.__k=[],p=0;p<t.length;p++)if(null!=(h=n.__k[p]=null==(h=t[p])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?$a(null,h,null,null,h):Array.isArray(h)?$a(za,{children:h},null,null,null):h.__b>0?$a(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(d=y[p])||d&&h.key==d.key&&h.type===d.type)y[p]=void 0;else for(u=0;u<v;u++){if((d=y[u])&&h.key==d.key&&h.type===d.type){y[u]=void 0;break}d=null}Ja(e,h,d=d||Da,i,o,s,a,l,c),f=h.__e,(u=h.ref)&&d.ref!=u&&(g||(g=[]),d.ref&&g.push(d.ref,null,h),g.push(u,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===d.__k?h.__d=l=Wa(h,l,e):l=Qa(e,h,d,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=qa(d))}for(n.__e=m,p=v;p--;)null!=y[p]&&nl(y[p],y[p]);if(g)for(p=0;p<g.length;p++)tl(g[p],g[++p],g[++p])}function Wa(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Wa(r,t,n):Qa(n,r,r,i,r.__e,t));return t}function Ga(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){Ga(e,t)})):t.push(e)),t}function Qa(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function Ya(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Na.test(t)?n:n+"px"}function Xa(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ya(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ya(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?r||e.addEventListener(t,o?Ka:Za,o):e.removeEventListener(t,o?Ka:Za,o);else if("dangerouslySetInnerHTML"!==t){if(i)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 Za(e){this.l[e.type+!1](Pa.event?Pa.event(e):e)}function Ka(e){this.l[e.type+!0](Pa.event?Pa.event(e):e)}function Ja(e,t,n,r,i,o,s,a,l){var c,p,u,d,h,f,m,g,y,v,b,w,x,_,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=Pa.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,y=(c=k.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(p=t.__c=n.__c).__=p.__E:("prototype"in k&&k.prototype.render?t.__c=p=new k(g,v):(t.__c=p=new Ba(g,v),p.constructor=k,p.render=rl),y&&y.sub(p),p.props=g,p.state||(p.state={}),p.context=v,p.__n=r,u=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=k.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=ja({},p.__s)),ja(p.__s,k.getDerivedStateFromProps(g,p.__s))),d=p.props,h=p.state,u)null==k.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,v),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,v)||t.__v===n.__v){for(p.props=g,p.state=p.__s,t.__v!==n.__v&&(p.__d=!1),p.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<p._sb.length;b++)p.__h.push(p._sb[b]);p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,v),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(d,h,f)}))}if(p.context=v,p.props=g,p.__v=t,p.__P=e,w=Pa.__r,x=0,"prototype"in k&&k.prototype.render){for(p.state=p.__s,p.__d=!1,w&&w(t),c=p.render(p.props,p.state,p.context),_=0;_<p._sb.length;_++)p.__h.push(p._sb[_]);p._sb=[]}else do{p.__d=!1,w&&w(t),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++x<25);p.state=p.__s,null!=p.getChildContext&&(r=ja(ja({},r),p.getChildContext())),u||null==p.getSnapshotBeforeUpdate||(f=p.getSnapshotBeforeUpdate(d,h)),E=null!=c&&c.type===za&&null==c.key?c.props.children:c,Ua(e,Array.isArray(E)?E:[E],t,n,r,i,o,s,a,l),p.base=t.__e,t.__h=null,p.__h.length&&s.push(p),m&&(p.__E=p.__=null),p.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a){var l,c,p,u=n.props,d=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(d);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,d.is&&d),o=null,a=!1}if(null===h)u===d||a&&e.data===d||(e.data=d);else{if(o=o&&Oa.call(e.childNodes),c=(u=n.props||Da).dangerouslySetInnerHTML,p=d.dangerouslySetInnerHTML,!a){if(null!=o)for(u={},f=0;f<e.attributes.length;f++)u[e.attributes[f].name]=e.attributes[f].value;(p||c)&&(p&&(c&&p.__html==c.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Xa(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Xa(e,o,t[o],n[o],r)}(e,d,u,i,a),p)t.__k=[];else if(f=t.props.children,Ua(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&qa(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&Ia(o[f]);a||("value"in d&&void 0!==(f=d.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==u.value)&&Xa(e,"value",f,u.value,!1),"checked"in d&&void 0!==(f=d.checked)&&f!==e.checked&&Xa(e,"checked",f,u.checked,!1))}return e}(n.__e,t,n,r,i,o,s,l);(c=Pa.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),Pa.__e(e,t,n)}}function el(e,t){Pa.__c&&Pa.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Pa.__e(e,t.__v)}}))}function tl(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Pa.__e(e,n)}}function nl(e,t,n){var r,i;if(Pa.unmount&&Pa.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||tl(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Pa.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&nl(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Ia(e.__e),e.__=e.__e=e.__d=void 0}function rl(e,t,n){return this.constructor(e,n)}function il(e,t,n){var r,i,o;Pa.__&&Pa.__(e,t),i=(r="function"==typeof n)?null:t.__k,o=[],Ja(t,e=(!r&&n||t).__k=La(za,null,[e]),i||Da,Da,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Oa.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),el(o,e)}function ol(e,t){var n={__c:t="__cC"+Ma++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(Va)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}Oa=Ra.slice,Pa={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Sa=0,Ba.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ja({},this.state),"function"==typeof e&&(e=e(ja({},n),this.props)),e&&ja(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Va(this))},Ba.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Va(this))},Ba.prototype.render=za,Ca=[],Ha.__r=0,Ma=0;var sl=function(e,t,n,r){var i;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?r[0]=a:4===s?r[1]=Object.assign(r[1]||{},a):5===s?(r[1]=r[1]||{})[t[++o]]=a:6===s?r[1][t[++o]]+=a+"":s?(i=e.apply(a,sl(e,a,n,["",null])),r.push(i),a[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):r.push(a)}return r},al=new Map;var ll,cl,pl,ul,dl=function(e){var t=al.get(this);return t||(t=new Map,al.set(this,t)),(t=sl(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i="",o="",s=[0],a=function(e){1===r&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(0,e,i):3===r&&(e||i)?(s.push(3,e,i),r=2):2===r&&"..."===i&&e?s.push(4,e,0):2===r&&i&&!e?s.push(5,0,!0,i):r>=5&&((i||!e&&5===r)&&(s.push(r,0,i,n),r=6),e&&(s.push(r,e,0,n),r=6)),i=""},l=0;l<e.length;l++){l&&(1===r&&a(),a(l));for(var c=0;c<e[l].length;c++)t=e[l][c],1===r?"<"===t?(a(),s=[s],r=3):i+=t:4===r?"--"===i&&">"===t?(r=1,i=""):i=t+i[0]:o?t===o?o="":i+=t:'"'===t||"'"===t?o=t:">"===t?(a(),r=1):r&&("="===t?(r=5,n=i,i=""):"/"===t&&(r<5||">"===e[l][c+1])?(a(),3===r&&(s=s[0]),r=s,(s=s[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),r=2):i+=t),3===r&&"!--"===i&&(r=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}.bind(La),hl=0,fl=[],ml=[],gl=Pa.__b,yl=Pa.__r,vl=Pa.diffed,bl=Pa.__c,wl=Pa.unmount;function xl(e,t){Pa.__h&&Pa.__h(cl,e,hl||t),hl=0;var n=cl.__H||(cl.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:ml}),n.__[e]}function _l(e){return hl=1,function(e,t,n){var r=xl(ll++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):jl(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=cl,!cl.u)){cl.u=!0;var i=cl.shouldComponentUpdate;cl.shouldComponentUpdate=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.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&&r.__c.props===e)&&(!i||i.call(this,e,t,n))}}return r.__N||r.__}(jl,e)}function El(e,t){var n=xl(ll++,3);!Pa.__s&&Nl(n.__H,t)&&(n.__=e,n.i=t,cl.__H.__h.push(n))}function kl(e,t){var n=xl(ll++,4);!Pa.__s&&Nl(n.__H,t)&&(n.__=e,n.i=t,cl.__h.push(n))}function Ol(e){return hl=5,Pl((function(){return{current:e}}),[])}function Pl(e,t){var n=xl(ll++,7);return Nl(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Sl(e,t){return hl=8,Pl((function(){return e}),t)}function Cl(e){var t=cl.context[e.__c],n=xl(ll++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(cl)),t.props.value):e.__}function Tl(){for(var e;e=fl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dl),e.__H.__h.forEach(Rl),e.__H.__h=[]}catch(t){e.__H.__h=[],Pa.__e(t,e.__v)}}Pa.__b=function(e){cl=null,gl&&gl(e)},Pa.__r=function(e){yl&&yl(e),ll=0;var t=(cl=e.__c).__H;t&&(pl===cl?(t.__h=[],cl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ml,e.__N=e.i=void 0}))):(t.__h.forEach(Dl),t.__h.forEach(Rl),t.__h=[])),pl=cl},Pa.diffed=function(e){vl&&vl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==fl.push(t)&&ul===Pa.requestAnimationFrame||((ul=Pa.requestAnimationFrame)||Al)(Tl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ml&&(e.__=e.__V),e.i=void 0,e.__V=ml}))),pl=cl=null},Pa.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Dl),e.__h=e.__h.filter((function(e){return!e.__||Rl(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Pa.__e(n,e.__v)}})),bl&&bl(e,t)},Pa.unmount=function(e){wl&&wl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Dl(e)}catch(e){t=e}})),n.__H=void 0,t&&Pa.__e(t,n.__v))};var Ml="function"==typeof requestAnimationFrame;function Al(e){var t,n=function(){clearTimeout(r),Ml&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ml&&(t=requestAnimationFrame(n))}function Dl(e){var t=cl,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),cl=t}function Rl(e){var t=cl;e.__c=e.__(),cl=t}function Nl(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function jl(e,t){return"function"==typeof t?t(e):t}function Il(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Il(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ll(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Il(e))&&(r&&(r+=" "),r+=t);return r}function $l(e){const{headerEntries:t,onSelect:n,selectedEntry:r,setSelectedEntry:i,title:o}=e,s=Pl((()=>function(e){return e.reduce(((e,t)=>{const n=t.group||"default",r=e.find((e=>e.id===n));return r?r.entries.push(t):e.push({id:n,entries:[t]}),e}),[])}(t)),[t]);return dl`
|
|
2
2
|
<div class="djs-popup-header">
|
|
3
3
|
<h3 class="djs-popup-title" title=${o}>${o}</h3>
|
|
4
4
|
${s.map((e=>dl`
|