bpmn-js 18.28.0 → 18.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- /*! bpmn-js - bpmn-modeler v18.28.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
1
+ /*! bpmn-js - bpmn-modeler v18.29.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2
2
  !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).BpmnJS=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}}))}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,i={exports:{}};var r=function(){if(n)return i.exports;n=1;var e=i.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var c=parseInt(a,n);return c!==1/0&&c>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");t+=i}var s=e(t,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=t||128,r.base=n||16,r},i.exports}(),o=t(r);function a(e){if(!(this instanceof a))return new a(e);e=e||[128,36,1],this._seed=e.length?o.rack(e[0],e[1],e[2]):e}function s(e){return Array.prototype.concat.apply([],e)}a.prototype.next=function(e){return this._seed(e||!0)},a.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},a.prototype.claim=function(e,t){this._seed.set(e,t||!0)},a.prototype.assigned=function(e){return this._seed.get(e)||!1},a.prototype.unclaim=function(e){delete this._seed.hats[e]},a.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const c=Object.prototype.toString,l=Object.prototype.hasOwnProperty;function p(e){return void 0===e}function u(e){return void 0!==e}function h(e){return null==e}function d(e){return"[object Array]"===c.call(e)}function f(e){return"[object Object]"===c.call(e)}function m(e){return"[object Number]"===c.call(e)}function g(e){const t=c.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function y(e){return"[object String]"===c.call(e)}function v(e,t){return!h(e)&&l.call(e,t)}function b(e,t){const n=N(t);let i;return w(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function _(e,t){const n=N(t);let i=d(e)?-1:void 0;return w(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function x(e,t){const n=N(t);let i=[];return w(e,(function(e,t){n(e,t)&&i.push(e)})),i}function w(e,t){let n,i;if(p(e))return;const r=d(e)?$:L;for(let o in e)if(v(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function E(e,t){if(p(e))return[];!function(e){if(!d(e))throw new Error("must supply array")}(e);const n=N(t);return e.filter((function(e,t){return!n(e,t)}))}function S(e,t,n){return w(e,(function(e,i){n=t(n,e,i)})),n}function k(e,t){return!!S(e,(function(e,n,i){return e&&t(n,i)}),!0)}function C(e,t){return!!b(e,t)}function R(e,t){let n=[];return w(e,(function(e,i){n.push(t(e,i))})),n}function P(e){return e&&Object.keys(e)||[]}function A(e){return R(e,(e=>e))}function M(e,t,n={}){return t=O(t),w(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function T(e,...t){e=O(e);let n={};return w(t,(t=>M(t,e,n))),R(n,(function(e,t){return e[0]}))}const B=T;function D(e,t){t=O(t);let n=[];return w(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var a=0;a<n.length;a++){let{d:e}=n[a];if(r<e)return void n.splice(a,0,o)}n.push(o)})),R(n,(e=>e.v))}function j(e){return function(t){return k(e,(function(e,n){return t[n]===e}))}}function O(e){return g(e)?e:t=>t[e]}function N(e){return g(e)?e:t=>t===e}function L(e){return e}function $(e){return Number(e)}function I(e,t){let n,i,r,o;function a(n){let a=Date.now(),l=n?0:o+t-a;if(l>0)return s(l);e.apply(r,i),c()}function s(e){n=setTimeout(a,e)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function l(...e){o=Date.now(),i=e,r=this,n||s(t)}return l.flush=function(){n&&a(!0),c()},l.cancel=c,l}function F(e,t){return e.bind(t)}function z(e,...t){return Object.assign(e,...t)}function H(e,t){let n={},i=Object(e);return w(t,(function(t){t in i&&(n[t]=e[t])})),n}function V(e,t){let n={};return w(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}const G={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};function W(e,t=globalThis.document){if("string"!=typeof e)throw new TypeError("String expected");const n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);const i=/<([\w:]+)/.exec(e)?.[1];if(!i)return t.createTextNode(e);if(e=e.trim(),"body"===i){const n=t.createElement("html");n.innerHTML=e;const{lastChild:i}=n;return i.remove(),i}let[r,o,a]=Object.hasOwn(G,i)?G[i]:G._default,s=t.createElement("div");for(s.innerHTML=o+e+a;r--;)s=s.lastChild;if(s.firstChild===s.lastChild){const{firstChild:e}=s;return e.remove(),e}const c=t.createDocumentFragment();return c.append(...s.childNodes),c}function U(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function q(e,...t){const n=e.style;return w(t,(function(e){e&&w(e,(function(e,t){n[t]=e}))})),e}function K(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}G.td=G.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],G.option=G.optgroup=[1,'<select multiple="multiple">',"</select>"],G.thead=G.tbody=G.colgroup=G.caption=G.tfoot=[1,"<table>","</table>"],G.polyline=G.ellipse=G.polygon=G.circle=G.text=G.line=G.path=G.rect=G.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];const Y=Object.prototype.toString;function X(e){return new Z(e)}function Z(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Q(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function J(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Z.prototype.add=function(e){return this.list.add(e),this},Z.prototype.remove=function(e){return"[object RegExp]"==Y.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Z.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},Z.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Z.prototype.array=function(){return Array.from(this.list)},Z.prototype.has=Z.prototype.contains=function(e){return this.list.contains(e)};var te,ne={};var ie=function(){if(te)return ne;var e,t,n;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n="addEventListener"!==e?"on":""}return te=1,ne.bind=function(t,r,o,a){return e||i(),t[e](n+r,o,a||!1),o},ne.unbind=function(e,r,o,a){return t||i(),e[t](n+r,o,a||!1),o},ne}(),re=U({__proto__:null,default:ee(ie)},[ie]),oe=["focus","blur"];var ae={bind:function(e,t,n,i,r){return-1!==oe.indexOf(n)&&(r=!0),re.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=J(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==oe.indexOf(t)&&(i=!0),re.unbind(e,t,n,i)}};function se(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function ce(e,t){return(t=t||document).querySelector(e)}function le(e,t){return(t=t||document).querySelectorAll(e)}function pe(e){e.parentNode&&e.parentNode.removeChild(e)}function ue(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 he={"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":2,"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":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function de(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=he[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function fe(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return he[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);de(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)de(e,i,t[i])}(e,t);return e}const me=Object.prototype.toString;function ge(e){return new ye(e)}function ye(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ve(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function be(e){return e.cloneNode(!0)}ye.prototype.add=function(e){return this.list.add(e),this},ye.prototype.remove=function(e){return"[object RegExp]"==me.call(e)?this.removeMatching(e):(this.list.remove(e),this)},ye.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},ye.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},ye.prototype.array=function(){return Array.from(this.list)},ye.prototype.has=ye.prototype.contains=function(e){return this.list.contains(e)};var _e="http://www.w3.org/2000/svg",xe='<svg xmlns="'+_e+'"';function we(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(_e)&&(e=xe+e.substring(4)):(e=xe+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Ee(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=we(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(_e,e),t&&fe(n,t),n}var Se=null;function ke(){return null===Se&&(Se=Ee("svg")),Se}function Ce(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Re(e){return ke().createSVGTransform()}var Pe=/([&<>]{1})/g,Ae=/([&<>\n\r"]{1})/g,Me={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Te(e,t){return e.replace(t,(function(e,t){return Me[t]||t}))}function Be(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Te(e.textContent,Pe));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Te(o.value,Ae),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)Be(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Te(e.nodeValue,Pe),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function De(e,t){return function(e){for(var t=e.firstChild,n=[];t;)Be(t,n),t=t.nextSibling;return n.join("")}(e)}function je(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Oe(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ne(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(Oe(e,i))}(n,t)),n.consolidate()}const Le=/^class[ {]/;function $e(e){return Array.isArray(e)}function Ie(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Fe(...e){1===e.length&&$e(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const ze=/constructor\s*[^(]*\(\s*([^)]*)\)/m,He=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Ve=/\/\*([^*]*)\*\//m;function Ge(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return Le.test(e.toString())}(e)?ze:He);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(Ve);return(t&&t[1]||e).trim()}))||[]}function We(e,t){const n=t||{get:function(e,t){if(i.push(e),!1===t)return null;throw s(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function c(e,t){if(!r[e]&&e.includes(".")){const t=e.split(".");let n=c(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Ie(o,e))return o[e];if(Ie(r,e)){if(-1!==i.indexOf(e))throw i.push(e),s("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!$e(e))throw s(`Cannot invoke "${e}". Expected a function!`);e=Fe(e.slice())}return{fn:e,dependencies:(e.$inject||Ge(e)).map((e=>Ie(t,e)?t[e]:c(e)))}}function p(e){const{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:i,dependencies:r}=l(e,n);return i.apply(t,r)}function h(e){return Fe((t=>e.get(t)))}function d(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],a=[],s=[];let c,l,p,u;for(let e in r)c=r[e],-1!==t.indexOf(e)&&("private"===c[2]?(l=o.indexOf(c[3]),-1===l?(p=c[3].createChild([],t),u=h(p),o.push(c[3]),a.push(p),s.push(u),n[e]=[u,e,"private",p]):n[e]=[s[l],e,"private",a[l]]):n[e]=[c[2],c[1]],i[e]=!0),"factory"!==c[2]&&"type"!==c[2]||!c[1].$scope||t.forEach((t=>{-1!==c[1].$scope.indexOf(t)&&(n[e]=[c[2],c[1]],i[t]=!0)}));t.forEach((e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new We(e,a)}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__,i=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=d((n||[]).concat(i)),a=Fe((function(e){return o.get(e)}));t.forEach((function(e){r[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),m(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],Ue(i,o),i]})),m(e,a)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=c,this.invoke=u,this.instantiate=p,this.createChild=d,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 Ue(e,t){return"value"!==e&&$e(t)&&(t=Fe(t.slice())),t}function qe(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function Ke(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function Ye(e){return["L",e.x,e.y]}function Xe(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let r=1;r<n;r++){const n=e[r-1],c=e[r],l=e[r+1];if(!l||!t){i.push(Ye(c));continue}const p=Math.min(t,Qe(c.x-n.x,c.y-n.y),Qe(l.x-c.x,l.y-c.y));if(!p){i.push(Ye(c));continue}const u=Ze(c,n,p),h=Ze(c,n,.5*p),d=Ze(c,l,p),f=Ze(c,l,.5*p);i.push(Ye(u)),i.push((a=f,s=d,["C",(o=h).x,o.y,a.x,a.y,s.x,s.y]))}return i}function Ze(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/Qe(i,r);return{x:e.x+i*o,y:e.y+r*o}}function Qe(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function Je(e,t,n){m(t)&&(n=t,t=null),t||(t={});const i=Ee("path",t);return m(n)&&(i.dataset.cornerRadius=String(n)),et(i,e)}function et(e,t){return fe(e,{d:Ke(Xe(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function tt(e){var t=new Set(e);return x(e,(function(e){for(var n=e.parent;n;){if(t.has(n))return!1;n=n.parent}return!0}))}function nt(e,t,n){n=n||0,d(e)||(e=[e]),w(e,(function(e,i){var r=t(e,i,n);d(r)&&r.length&&nt(r,t,n+1)}))}function it(e,t,n){var i=new Set,r=new Set;return nt(e,(function(e,t,n){i.add(e);var o=e.children;if(o&&!r.has(o))return r.add(o),o})),Array.from(i)}function rt(e,t){return it(e)}function ot(e,t){var n,i,r,o;return t=!!t,d(e)||(e=[e]),w(e,(function(e){var a=e;e.waypoints&&!t&&(a=ot(e.waypoints,!0));var s=a.x,c=a.y,l=a.height||0,p=a.width||0;(s<n||void 0===n)&&(n=s),(c<i||void 0===i)&&(i=c),(s+p>r||void 0===r)&&(r=s+p),(c+l>o||void 0===o)&&(o=c+l)})),{x:n,y:i,height:o-i,width:r-n}}function at(e,t){var n={};return w(e,(function(e){var i=e;i.waypoints&&(i=ot(i)),!m(t.y)&&i.x>t.x&&(n[e.id]=e),!m(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(m(t.width)&&m(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:m(t.width)&&m(t.height)||(n[e.id]=e))})),n}function st(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function ct(e){return!(!e||!e.isFrame)}function lt(e,t){return z({},e||{},t||{})}qe.prototype.canRender=function(e){},qe.prototype.drawShape=function(e,t){},qe.prototype.drawConnection=function(e,t){},qe.prototype.getShapePath=function(e){},qe.prototype.getConnectionPath=function(e){};function pt(e,t){qe.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(pt,qe),pt.prototype.canRender=function(){return!0},pt.prototype.drawShape=function(e,t,n){var i=Ee("rect");return fe(i,{x:0,y:0,width:t.width||0,height:t.height||0}),ct(t)?fe(i,z({},this.FRAME_STYLE,n||{})):fe(i,z({},this.SHAPE_STYLE,n||{})),ue(e,i),i},pt.prototype.drawConnection=function(e,t,n){var i=Je(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return ue(e,i),i},pt.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Ke([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},pt.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return Ke(r)},pt.$inject=["eventBus","styles"];var ut={__init__:["defaultRenderer"],defaultRenderer:["type",pt],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return z(this.style(t,n),{class:e})},this.style=function(t,n){d(t)||n||(n=t,t=[]);var i=S(t,(function(t,n){return z(t,e[n]||{})}),{});return n?z(i,n):i},this.computeStyle=function(e,n,i){return d(n)||(i=n,n=[]),t.style(n||[],z({},i,e||{}))}}]};function ht(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function dt(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function ft(e,t){return e&&t?e.indexOf(t):-1}function mt(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function gt(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=mt(e,t);return Math.abs(r/o)<=i}function yt(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(vt(e,n))return t;return!1}function vt(e,t){const n=t[0];return k(t,(function(t){return Math.abs(n[e]-t[e])<=2}))}function bt(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 _t(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}
3
3
  /**
4
4
  * This file contains source code adapted from Snap.svg (licensed Apache-2.0).
5
5
  *
6
6
  * @see https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js
7
- */var xt=/,?([a-z]),?/gi,wt=parseFloat,Et=Math,St=Et.PI,kt=Et.min,Ct=Et.max,Rt=Et.pow,Pt=Et.abs,At=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Mt=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Tt=Array.isArray||function(e){return e instanceof Array};function Bt(e){return function t(){var n,i,r=Array.prototype.slice.call(arguments,0).join("␀"),o=t.cache=t.cache||{},a=t.count=t.count||[];return n=o,i=r,Object.prototype.hasOwnProperty.call(n,i)?(function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(a,r),o[r]):(a.length>=1e3&&delete o[a.shift()],a.push(r),o[r]=e(...arguments),o[r])}}function Dt(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace(At,(function(e,i,r){var o=[],a=i.toLowerCase();for(r.replace(Mt,(function(e,t){t&&o.push(+t)})),"m"==a&&o.length>2&&(n.push([i,...o.splice(0,2)]),a="l",i="m"==i?"l":"L");o.length>=t[a]&&(n.push([i,...o.splice(0,t[a])]),t[a]););})),n.toString=Ot,n}function jt(e,t,n,i){return 1===arguments.length&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function Ot(){return this.join(",").replace(xt,"$1")}function Nt(e,t,n,i,r,o,a,s,c){var l=1-c,p=Rt(l,3),u=Rt(l,2),h=c*c*c,d=p*t+3*u*c*i+3*l*c*c*o+h*s;return{x:Ht(p*e+3*u*c*n+3*l*c*c*r+h*a),y:Ht(d)}}function Lt(e){var t=function(e,t,n,i,r,o,a,s){for(var c,l,p,u,h,d,f,m,g=[],y=[[],[]],v=0;v<2;++v)if(0==v?(l=6*e-12*n+6*r,c=-3*e+9*n-9*r+3*a,p=3*n-3*e):(l=6*t-12*i+6*o,c=-3*t+9*i-9*o+3*s,p=3*i-3*t),Pt(c)<1e-12){if(Pt(l)<1e-12)continue;0<(u=-p/l)&&u<1&&g.push(u)}else f=l*l-4*p*c,m=Et.sqrt(f),f<0||(0<(h=(-l+m)/(2*c))&&h<1&&g.push(h),0<(d=(-l-m)/(2*c))&&d<1&&g.push(d));var b,_=g.length,x=_;for(;_--;)b=1-(u=g[_]),y[0][_]=b*b*b*e+3*b*b*u*n+3*b*u*u*r+u*u*u*a,y[1][_]=b*b*b*t+3*b*b*u*i+3*b*u*u*o+u*u*u*s;return y[0][x]=e,y[1][x]=t,y[0][x+1]=a,y[1][x+1]=s,y[0].length=y[1].length=x+2,{x0:kt(...y[0]),y0:kt(...y[1]),x1:Ct(...y[0]),y1:Ct(...y[1])}}(...e);return jt(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function $t(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function It(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Ft(e,t,n,i,r,o,a,s,c){null==c&&(c=1);for(var l=(c=c>1?1:c<0?0:c)/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],h=0,d=0;d<12;d++){var f=l*p[d]+l,m=It(f,e,n,r,a),g=It(f,t,i,o,s),y=m*m+g*g;h+=u[d]*Et.sqrt(y)}return l*h}function zt(e,t,n,i,r,o,a,s){if(!(Ct(e,n)<kt(r,a)||kt(e,n)>Ct(r,a)||Ct(t,i)<kt(o,s)||kt(t,i)>Ct(o,s))){var c=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),l=(e-n)*(o-s)-(t-i)*(r-a);if(l){var p=Ht(((e*i-t*n)*(r-a)-(e-n)*(r*s-o*a))/l),u=Ht(c/l),h=+p.toFixed(2),d=+u.toFixed(2);if(!(h<+kt(e,n).toFixed(2)||h>+Ct(e,n).toFixed(2)||h<+kt(r,a).toFixed(2)||h>+Ct(r,a).toFixed(2)||d<+kt(t,i).toFixed(2)||d>+Ct(t,i).toFixed(2)||d<+kt(o,s).toFixed(2)||d>+Ct(o,s).toFixed(2)))return{x:p,y:u}}}}function Ht(e){return Math.round(1e11*e)/1e11}function Vt(e,t,n){if(!function(e,t){return e=jt(e),$t(t=jt(t),e.x,e.y)||$t(t,e.x2,e.y)||$t(t,e.x,e.y2)||$t(t,e.x2,e.y2)||$t(e,t.x,t.y)||$t(e,t.x2,t.y)||$t(e,t.x,t.y2)||$t(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)}(Lt(e),Lt(t)))return[];var i,r,o=Ft(...e),a=Ft(...t),s=Wt(e)?1:~~(o/5)||1,c=Wt(t)?1:~~(a/5)||1,l=new Array(s+1),p=new Array(c+1),u={},h=[];for(i=0;i<s+1;i++){var d=Nt(...e,i/s);l[i]={x:d.x,y:d.y,t:i/s}}for(i=0;i<c+1;i++)d=Nt(...t,i/c),p[i]={x:d.x,y:d.y,t:i/c};for(i=0;i<s;i++)for(r=0;r<c;r++){var f,m=l[i],g=l[i+1],y=p[r],v=p[r+1],b=Pt(g.x-m.x)<.01?"y":"x",_=Pt(v.x-y.x)<.01?"y":"x",x=zt(m.x,m.y,g.x,g.y,y.x,y.y,v.x,v.y);if(x){if(u[f=x.x.toFixed(9)+"#"+x.y.toFixed(9)])continue;u[f]=!0;var w=m.t+Pt((x[b]-m[b])/(g[b]-m[b]))*(g.t-m.t),E=y.t+Pt((x[_]-y[_])/(v[_]-y[_]))*(v.t-y.t);w>=0&&w<=1&&E>=0&&E<=1&&h.push({x:x.x,y:x.y,t1:w,t2:E})}}return h}function Gt(e,t,n){e=Yt(e),t=Yt(t);for(var i,r,o,a,s,c,l,p,u,h,d=n?0:[],f=0,m=e.length;f<m;f++){var g=e[f];if("M"==g[0])i=s=g[1],r=c=g[2];else{"C"==g[0]?(i=(u=[i,r,...g.slice(1)])[6],r=u[7]):(u=[i,r,i,r,s,c,s,c],i=s,r=c);for(var y=0,v=t.length;y<v;y++){var b=t[y];if("M"==b[0])o=l=b[1],a=p=b[2];else{"C"==b[0]?(o=(h=[o,a,...b.slice(1)])[6],a=h[7]):(h=[o,a,o,a,l,p,l,p],o=l,a=p);for(var _=Vt(u,h),x=0,w=_.length;x<w;x++)_[x].segment1=f,_[x].segment2=y,_[x].bez1=u,_[x].bez2=h;d=d.concat(_)}}}}return d}function Wt(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function Ut(e,t,n,i){return[e,t,n,i,n,i]}function qt(e,t,n,i,r,o){var a=1/3,s=2/3;return[a*e+s*n,a*t+s*i,a*r+s*n,a*o+s*i,r,o]}function Kt(e,t,n,i,r,o,a,s,c,l){var p,u=120*St/180,h=St/180*(+r||0),d=[],f=Bt((function(e,t,n){return{x:e*Et.cos(n)-t*Et.sin(n),y:e*Et.sin(n)+t*Et.cos(n)}}));if(l)E=l[0],S=l[1],x=l[2],w=l[3];else{e=(p=f(e,t,-h)).x,t=p.y;var m=(e-(s=(p=f(s,c,-h)).x))/2,g=(t-(c=p.y))/2,y=m*m/(n*n)+g*g/(i*i);y>1&&(n*=y=Et.sqrt(y),i*=y);var v=n*n,b=i*i,_=(o==a?-1:1)*Et.sqrt(Pt((v*b-v*g*g-b*m*m)/(v*g*g+b*m*m))),x=_*n*g/i+(e+s)/2,w=_*-i*m/n+(t+c)/2,E=Et.asin(((t-w)/i).toFixed(9)),S=Et.asin(((c-w)/i).toFixed(9));(E=e<x?St-E:E)<0&&(E=2*St+E),(S=s<x?St-S:S)<0&&(S=2*St+S),a&&E>S&&(E-=2*St),!a&&S>E&&(S-=2*St)}var k=S-E;if(Pt(k)>u){var C=S,R=s,P=c;S=E+u*(a&&S>E?1:-1),d=Kt(s=x+n*Et.cos(S),c=w+i*Et.sin(S),n,i,r,0,a,R,P,[S,C,x,w])}k=S-E;var A=Et.cos(E),M=Et.sin(E),T=Et.cos(S),B=Et.sin(S),D=Et.tan(k/4),j=4/3*n*D,O=4/3*i*D,N=[e,t],L=[e+j*M,t-O*A],$=[s+j*B,c-O*T],I=[s,c];if(L[0]=2*N[0]-L[0],L[1]=2*N[1]-L[1],l)return[L,$,I].concat(d);for(var F=[],z=0,H=(d=[L,$,I].concat(d).join().split(",")).length;z<H;z++)F[z]=z%2?f(d[z-1],d[z],h).y:f(d[z],d[z+1],h).x;return F}function Yt(e){if(function(e){return Tt(e)&&Tt(e[0])}(e)||(e=Dt(e)),function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("M"!==i&&"C"!==i)return!1}return!0}(e))return e;for(var t=function(e){for(var t=new Array(e.length),n=0,i=e.length;n<i;n++)for(var r=e[n],o=t[n]=new Array(r.length),a=0,s=r.length;a<s;a++)o[a]=r[a];return t.toString=Ot,t}(function(e){if(function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("string"==typeof i&&i!==i.toUpperCase())return!1}return!0}(e))return e;var t,n=new Array(e.length),i=0,r=0,o=0,a=0,s=0;"M"==e[0][0]&&(o=i=+e[0][1],a=r=+e[0][2],s++,n[0]=["M",i,r]);for(var c,l,p=s,u=e.length;p<u;p++){if(t=(l=e[p])[0],n[p]=c=new Array(l.length),t!=t.toUpperCase())switch(c[0]=t.toUpperCase(),c[0]){case"A":c[1]=l[1],c[2]=l[2],c[3]=l[3],c[4]=l[4],c[5]=l[5],c[6]=+l[6]+i,c[7]=+l[7]+r;break;case"V":c[1]=+l[1]+r;break;case"H":c[1]=+l[1]+i;break;case"M":o=+l[1]+i,a=+l[2]+r;default:for(var h=1,d=l.length;h<d;h++)c[h]=+l[h]+(h%2?i:r)}else for(var f=0,m=l.length;f<m;f++)c[f]=l[f];switch(t=t.toUpperCase(),c[0]){case"Z":i=+o,r=+a;break;case"H":i=c[1];break;case"V":r=c[1];break;case"M":o=c[c.length-2],a=c[c.length-1];default:i=c[c.length-2],r=c[c.length-1]}}return n.toString=Ot,n}(e)),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(e,t,n){var i,r;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C",...Kt(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(i=2*t.x-t.bx,r=2*t.y-t.by):(i=t.x,r=t.y),e=["C",i,r,...e.slice(1)];break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C",...qt(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",...qt(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...Ut(t.x,t.y,e[1],e[2])];break;case"H":e=["C",...Ut(t.x,t.y,e[1],t.y)];break;case"V":e=["C",...Ut(t.x,t.y,t.x,e[1])];break;case"Z":e=["C",...Ut(t.x,t.y,t.X,t.Y)]}return e},r=function(e,n){if(e[n].length>7){e[n].shift();for(var i=e[n];i.length;)o[n]="A",e.splice(n++,0,["C",...i.splice(0,6)]);e.splice(n,1),l=t.length}},o=[],a="",s="",c=0,l=t.length;c<l;c++){t[c]&&(a=t[c][0]),"C"!=a&&(o[c]=a,c&&(s=o[c-1])),t[c]=i(t[c],n,s),"A"!=o[c]&&"C"==a&&(o[c]="C"),r(t,c);var p=t[c],u=p.length;n.x=p[u-2],n.y=p[u-1],n.bx=wt(p[u-4])||n.x,n.by=wt(p[u-3])||n.y}return t}function Xt(e){return f(e)&&v(e,"waypoints")}function Zt(e){return f(e)&&v(e,"labelTarget")}function Qt(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Jt(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function en(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function tn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function nn(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r=t[i-1];if(r){var o=e[e.length-1],a=o&&o.endLength||0,s=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}(r,n);e.push({start:r,end:n,startLength:a,endLength:a+s,length:s})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length;return{x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s}}function rn(e){return Xt(e)?nn(e):Jt({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function on(e,t,n){f(n=n||0)||(n={x:n,y:n});var i=en(e),r=en(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=o?"top":s?"bottom":null,l=i.right+n.x<=r.left?"left":a?"right":null;return l&&c?c+"-"+l:l||c||"intersect"}function an(e,t,n){var i=function(e,t){return Gt(e,t)}(e,t);return 1===i.length||2===i.length&&mt(i[0],i[1])<1?Jt(i[0]):i.length>1?(i=D(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),Jt(i[n?0:i.length-1])):null}function sn(e,t){return Math.round(e*t)/t}function cn(e){return m(e)?e+"px":e}function ln(e){for(;e.parent;)e=e.parent;return e}function pn(e,t,n){const i=Ee("g");ge(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const un={shape:["x","y","width","height"],connection:["waypoints"]};function hn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}function dn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}hn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],hn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=z({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),q(n,{position:"relative",overflow:"hidden",width:cn(e.width),height:cn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Ee("svg");fe(i,{width:"100%",height:"100%"}),K(i,"tabindex",0),e.autoFocus&&t.on("element.hover",(()=>{this.restoreFocus()})),t.on("element.mousedown",500,(e=>{this.focus()})),i.addEventListener("focusin",(()=>{this._setFocused(!0)})),i.addEventListener("focusout",(()=>{this._setFocused(!1)})),i.addEventListener("mouseover",(()=>{this._eventBus.fire("canvas.mouseover")})),i.addEventListener("mouseout",(()=>{this._eventBus.fire("canvas.mouseout")})),ue(n,i);const r=this._viewport=pn(i,"viewport");e.deferUpdate&&(this._viewboxChanged=I(this._viewboxChanged,300)),this._restoreFocus=I(this._restoreFocus,0),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(()=>{delete this._cachedViewbox})),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},hn.prototype._destroy=function(){this._restoreFocus.cancel(),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},hn.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},hn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=st(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},hn.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},hn.prototype.restoreFocus=function(){this._restoreFocus()},hn.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},hn.prototype.isFocused=function(){return this._focused},hn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},hn.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},hn.prototype._getChildIndex=function(e){return S(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},hn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:pn(this._viewport,"layer-"+e,n),index:t,visible:!0}},hn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},hn.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?(je(n),t.visible=!1,n):n},hn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],je(t.group))},hn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},hn.prototype.findRoot=function(e){const t=this._resolveElements(e);let n;for(const e of t){const t=this._findPlaneForRoot(ln(e));if(!t)return;if(n&&t.rootElement!==n)return;n=t.rootElement}return n},hn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},hn.prototype._findPlaneForRoot=function(e){return b(this._planes,(function(t){return t.rootElement===e}))},hn.prototype._resolveElement=function(e){return"string"==typeof e?this._elementRegistry.get(e):e},hn.prototype._resolveElements=function(e){return d(e)||(e=[e]),e.map((e=>this._resolveElement(e))).filter(Boolean)},hn.prototype.getContainer=function(){return this._container},hn.prototype._updateMarker=function(e,t,n){let i;(e=this._resolveElement(e)).markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(w([i.gfx,i.secondaryGfx],(function(i){i&&(n?(e.markers.add(t),ge(i).add(t)):(e.markers.delete(t),ge(i).remove(t)))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},hn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},hn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},hn.prototype.hasMarker=function(e,t){return!!(e=this._resolveElement(e)).markers&&e.markers.has(t)},hn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},hn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},hn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},hn.prototype.removeRootElement=function(e){e=this._resolveElement(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},hn.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},hn.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)},hn.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},hn.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})},hn.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=un[e],i=k(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},hn.prototype._setParent=function(e,t,n){dt(t.children,e,n),e.parent=t},hn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},hn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},hn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},hn.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),ht(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},hn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},hn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},hn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},hn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},hn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},hn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let i,r,o,a,s,c,l;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Ne(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Ne(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=ke().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Ce(a,e);case 6:return Ce(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=sn(r.a,1e3),c=sn(-r.e||0,1e3),l=sn(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:l?l/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},hn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),dn(t,n)})),{x:n.e,y:n.f}},hn.prototype.scrollToElement=function(e,t){let n=100;const i=this._resolveElements(e);if(!i.length)return;const r=this.findRoot(i);if(!r)return;r!==this.getRootElement()&&this.setRootElement(r);const o=i.filter((e=>e!=r));if(!o.length)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 a=ot(o),s=en(a),c=this.viewbox(),l=this.zoom();let p,u;c.y+=t.top/l,c.x+=t.left/l,c.width-=(t.right+t.left)/l,c.height-=(t.bottom+t.top)/l;const h=en(c);if(a.width<c.width&&a.height<c.height){const e=Math.max(0,s.right-h.right),t=Math.min(0,s.left-h.left),n=Math.max(0,s.bottom-h.bottom),i=Math.min(0,s.top-h.top);p=e||t,u=n||i}else p=a.x-c.x,u=a.y-c.y;this.scroll({dx:-p*l,dy:-u*l})},hn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),sn(i.a,1e3)},hn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},hn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,l,p;c=i.getCTM();const u=c.a;return t?(a=z(o,t),s=a.matrixTransform(c.inverse()),l=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),p=c.multiply(l)):p=r.scale(e),dn(this._viewport,p),p},hn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},hn.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}},hn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var fn="data-element-id";function mn(e){this._elements={},this._eventBus=e}function gn(e,t,n){var i=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function yn(e,t){if(!(this instanceof yn))return new yn(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 i=e.id;this._validateId(i),fe(t,fn,i),n&&fe(n,fn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},mn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(fe(i.gfx,fn,""),i.secondaryGfx&&fe(i.secondaryGfx,fn,""),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),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},mn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&fe(t,fn,i),t},mn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&fe(e,fn);var n=this._elements[t];return n&&n.element},mn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},mn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},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 i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},mn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.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")},yn.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?gn(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},yn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||gn(this,t,e),n},yn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},yn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},yn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var vn=new yn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),bn=new yn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),_n=new yn({name:"attachers",collection:!0},{name:"host"}),xn=new yn({name:"outgoing",collection:!0},{name:"source"}),wn=new yn({name:"incoming",collection:!0},{name:"target"});function En(){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)}}),vn.bind(this,"parent"),bn.bind(this,"labels"),xn.bind(this,"outgoing"),wn.bind(this,"incoming")}function Sn(){En.call(this),vn.bind(this,"children"),_n.bind(this,"host"),_n.bind(this,"attachers")}function kn(){En.call(this),vn.bind(this,"children")}function Cn(){Sn.call(this),bn.bind(this,"labelTarget")}function Rn(){En.call(this),xn.bind(this,"source"),wn.bind(this,"target")}e(Sn,En),e(kn,Sn),e(Cn,Sn),e(Rn,En);var Pn={connection:Rn,shape:Sn,label:Cn,root:kn};function An(){this._uid=12}An.prototype.createRoot=function(e){return this.create("root",e)},An.prototype.createLabel=function(e){return this.create("label",e)},An.prototype.createShape=function(e){return this.create("shape",e)},An.prototype.createConnection=function(e){return this.create("connection",e)},An.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Pn[e];if(!n)throw new Error("unknown type: <"+e+">");return z(new n,t)}(e,t)};var Mn="__fn",Tn=Array.prototype.slice;function Bn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Dn(){}function jn(e){return e.childNodes[0]}function On(e,t,n,i,r){var o=Re();o.setTranslate(t,n);var a=Re();a.setRotate(i||0,0,0);var s=Re();s.setScale(1,1),Ne(e,[o,a,s])}function Nn(e,t,n){var i=Re();i.setTranslate(t,n),Ne(e,i)}function Ln(e,t){var n=Re();n.setRotate(t,0,0),Ne(e,n)}function $n(e,t){this._eventBus=e,this._elementRegistry=t}Bn.prototype.on=function(e,t,n,i){if(e=d(e)?e:[e],g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");var r=n;i&&((r=F(n,i))[Mn]=n[Mn]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},Bn.prototype.once=function(e,t,n,i){var r=this;if(g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[Mn]=n,this.on(e,t,o)},Bn.prototype.off=function(e,t){e=d(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Bn.prototype.createEvent=function(e){var t=new Dn;return t.init(e),t},Bn.prototype.fire=function(e,t){var n,i,r,o;if(o=Tn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Dn?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Bn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Bn.prototype._destroy=function(){this._listeners={}},Bn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Bn.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},Bn.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},Bn.prototype._getListeners=function(e){return this._listeners[e]},Bn.prototype._setListeners=function(e,t){this._listeners[e]=t},Bn.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[Mn]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Dn.prototype.stopPropagation=function(){this.cancelBubble=!0},Dn.prototype.preventDefault=function(){this.defaultPrevented=!0},Dn.prototype.init=function(e){z(this,e||{})},$n.$inject=["eventBus","elementRegistry"],$n.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(ge(t=Ee("g")).add("djs-children"),ue(n.parentNode,t))):t=n,t},$n.prototype._clear=function(e){var t=jn(e);return Q(t),t},$n.prototype._createContainer=function(e,t,n,i){var r=Ee("g");ge(r).add("djs-group"),void 0!==n?function(e,t,n){var i=n||t.firstChild;if(e===i)return;t.insertBefore(e,i)}(r,t,t.childNodes[n]):ue(t,r);var o=Ee("g");ge(o).add("djs-element"),ge(o).add("djs-"+e),i&&ge(o).add("djs-frame"),ue(r,o);var a=Ee("g");return ge(a).add("djs-visual"),ue(o,a),o},$n.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,ct(t))},$n.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=S(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),w(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e),o=r.firstChild;w(t,(function(e){var t=i.getGraphics(e).parentNode;t===o?o=o.nextSibling:r.insertBefore(t,o)}))}}))},$n.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},$n.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},$n.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},$n.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},$n.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),Nn(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?fe(n,"display","none"):fe(n,"display","block")}},$n.prototype.remove=function(e){je(this._elementRegistry.getGraphics(e).parentNode)};var In={__depends__:[ut],__init__:["canvas"],canvas:["type",hn],elementRegistry:["type",mn],elementFactory:["type",An],eventBus:["type",Bn],graphicsFactory:["type",$n]};function Fn(e){return function(e){var t=new We(e);return t.init(),t}([{config:["value",e=e||{}]},In].concat(e.modules||[]))}function zn(e,t){this._injector=t||Fn(e),this.get("eventBus").fire("diagram.init")}function Hn(){}function Vn(e,t){this.model=e,this.properties=t}zn.prototype.get=function(e,t){return this._injector.get(e,t)},zn.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},zn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},zn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Hn.prototype.get=function(e){return this.$model.properties.get(this,e)},Hn.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Vn.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Hn.prototype);w(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),w(e,F((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Gn=z(Object.create(null),{String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0}),Wn=z(Object.create(null),{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 Un(e,t){var n=Wn[e];return n?n(t):t}function qn(e){return!!Gn[e]}function Kn(e){return!!Wn[e]}function Yn(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Xn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName=Object.create(null),this.properties=[],this.propertiesByName=Object.create(null)}function Zn(e,t){this.packageMap=Object.create(null),this.typeMap=Object.create(null),this.packages=[],this.properties=t,w(e,F(this.registerPackage,this))}function Qn(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Jn(e){this.model=e}function ei(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function ti(e){return e.replace(/^:/,"")}function ni(e,t={}){this.properties=new Jn(this),this.factory=new Vn(this,this.properties),this.registry=new Zn(e,this.properties),this.typeCache=Object.create(null),this.config=t}Xn.prototype.build=function(){return H(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Xn.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Xn.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=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 s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Xn.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Yn(r[0],i),a=Yn(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Xn.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Xn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Xn.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},Xn.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},Xn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Xn.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Xn.prototype.hasProperty=function(e){return this.propertiesByName[e]},Xn.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(w(e.properties,F((function(n){n=z({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Zn.prototype.getPackage=function(e){return this.packageMap[e]},Zn.prototype.getPackages=function(){return this.packages},Zn.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Qn(t,e,"prefix"),Qn(t,e,"uri"),w(e.types,F((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Zn.prototype.registerType=function(e,t){var n=Yn((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z({},e.meta||{})})).name,t.prefix),i=n.name,r=Object.create(null);w(e.properties,F((function(e){var t=Yn(e.name,n.prefix),i=t.name;qn(e.type)||(e.type=Yn(e.type,t.prefix).name),z(e,{ns:t,name:i}),r[i]=e}),this)),z(e,{ns:n,name:i,propertiesByName:r}),w(e.extends,F((function(e){var t=Yn(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Zn.prototype.mapTypes=function(e,t,n){var i=qn(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=Yn(n,qn(n)?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");w(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),w(i.traits,a)},Zn.prototype.getEffectiveDescriptor=function(e){var t=Yn(e),n=new Xn(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Zn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Jn.prototype.set=function(e,t,n){if(!y(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[ti(t)]:i?r in e?e[r]=n:ei(e,i,n):e.$attrs[ti(t)]=n},Jn.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[ti(t)];var i=n.name;return!e[i]&&n.isMany&&ei(e,n,[]),e[i]},Jn.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Jn.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Jn.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Jn.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},ni.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ni.prototype.getType=function(e){var t=this.typeCache,n=y(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},ni.prototype.createAny=function(e,t,n){var i=Yn(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let i=e;w(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],a=i[e];u(o)&&h(a)&&(a=i[e]=isNaN(+o)?{}:[]),p(o)?p(n)?delete i[e]:i[e]=n:i=a}))}(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),w(n,(function(e,t){f(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},ni.prototype.getPackage=function(e){return this.registry.getPackage(e)},ni.prototype.getPackages=function(){return this.registry.getPackages()},ni.prototype.getElementDescriptor=function(e){return e.$descriptor},ni.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},ni.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ni.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ii=String.fromCharCode,ri=Object.prototype.hasOwnProperty,oi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ai={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function si(e,t,n,i){return i?ri.call(ai,i)?ai[i]:"&"+i+";":ii(t||parseInt(n,16))}function ci(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(oi,si):e}Object.keys(ai).forEach((function(e){ai[e.toUpperCase()]=ai[e]}));var li="non-whitespace outside of root node";function pi(e){return new Error(e)}function ui(e){return{get:e,enumerable:!0}}function hi(e){var t,n=Object.create(null);for(t in e)n[t]=e[t];return n}var di=Symbol("nameCache");function fi(e){return e+"$uri"}function mi(){return{line:0,column:0}}function gi(e){throw e}function yi(e){if(!this)return new yi(e);var t,n,i,r,o,a,s,c,l,p,u,h,d=e&&e.proxy,f=gi,m=mi,g=!1,y=!1,v="",b=!1,_=!1,x=null,w=!1;function E(e){e instanceof Error||(e=pi(e)),x=e,f(e,m)}function S(e){o&&(e instanceof Error||(e=pi(e)),o(e,m))}function k(){l=_?[]:null,p=_?function(e){var t,n,i=Object.create(null);for(t in e)i[n=e[t]]=n,i[fi(n)]=t;return i}(h):null,u=[],m=mi,w=!1,x=null,y=!1,v=""}function C(e,o=!1){var f,g,v,x,k,C,R,P,A,M,T,B=null,D=null,j=0,O=!1,N=!1,L=0,$=0,I="",F=0;function z(e,t){var n=e.indexOf(":");if(-1===n)return e;var i=p[e.substring(0,n)];return i?t===i?e.substr(n+1):i+e.substr(n):(S(function(e){return"missing namespace for prefix <"+e+">"}(e.substring(0,n))),null)}function H(){if(null!==T)return T;var e,t,n,i,r,o,a,s,c,l,u=_&&p.xmlns,d=_&&b?[]:null,f=F,m=I,g=m.length,y={},v=new Set;e:for(;f<g;f++)if(s=!1,!(32===(c=m.charCodeAt(f))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(S("illegal first char attribute name"),s=!0),l=f+1;l<g;l++)if(!((c=m.charCodeAt(l))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){S("missing attribute value"),f=l;continue e}if(61===c)break;S("illegal attribute name char"),s=!0}if("xmlns:xmlns"===(a=m.substring(f,l))&&(S("illegal declaration of xmlns"),s=!0),34===(c=m.charCodeAt(l+1)))-1===(l=m.indexOf('"',f=l+2))&&-1!==(l=m.indexOf("'",f))&&(S("attribute value quote missmatch"),s=!0);else if(39===c)-1===(l=m.indexOf("'",f=l+2))&&-1!==(l=m.indexOf('"',f))&&(S("attribute value quote missmatch"),s=!0);else for(S("missing attribute value quotes"),s=!0,l+=1;l<g&&!(32===(c=m.charCodeAt(l+1))||c<14&&c>8);l++);for(-1===l&&(S("missing closing quotes"),l=g,s=!0),s||(r=m.substring(f,l)),f=l;l+1<g&&!(32===(c=m.charCodeAt(l+1))||c<14&&c>8);l++)f===l&&(S("illegal character after attribute end"),s=!0);if(f=l+1,!s)if(v.has(a))S("attribute <"+a+"> already defined");else if(v.add(a),_)if(b){if(null!==(i="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=ci(r),t=fi(i),!(o=h[e])){if("xmlns"===i||t in p&&p[t]!==e)do{o="ns"+j++}while(void 0!==p[o]);else o=i;h[e]=o}p[i]!==o&&(n||(p=hi(p),n=!0),p[i]=o,"xmlns"===i&&(p[fi(o)]=e,u=o),p[t]=e),y[a]=r;continue}d.push(a,r)}else null!==(a=z(a,u))&&(y[a]=r);else y[a]=r}if(b)for(f=0,g=d.length;f<g;f++)a=z(d[f++],u),r=d[f],null!==a&&(y[a]=r);return T=y}for(m=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=$;L>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>L);)r+=1,a=s;return-1==L?(o=s,n=e.substring($)):0===$?n=e.substring($,L):(o=L-a,n=-1==$?e.substring(L):e.substring(L,$+1)),{data:n,line:r,column:o}},d&&(M=Object.create({},{name:ui((function(){return P})),originalName:ui((function(){return A})),attrs:ui(H),ns:ui((function(){return p}))}));-1!==$;){if(-1===(L=60===e.charCodeAt($)?$:e.indexOf("<",$)))return o?e.substring($):u.length?E("unexpected end of file"):y?void($<e.length&&e.substring($).trim()&&S(li)):E("missing start tag");if(y||(y=!0),$!==L)if(u.length){if(t&&(t(e.substring($,L),ci,m),w))return}else if(e.substring($,L).trim()&&(S(li),w))return;if(33===(k=e.charCodeAt(L+1))){if(91===(x=e.charCodeAt(L+2))&&"CDATA["===e.substr(L+3,6)){if(-1===($=e.indexOf("]]>",L)))return o?e.substring(L):E("unclosed cdata");if(r&&(r(e.substring(L+9,$),m),w))return;$+=3;continue}if(45===x&&45===e.charCodeAt(L+3)){if(-1===($=e.indexOf("--\x3e",L)))return o?e.substring(L):E("unclosed comment");if(a&&(a(e.substring(L+4,$),ci,m),w))return;$+=3;continue}}if(63!==k){for(g=L+1;;g++){if(C=e.charCodeAt(g),isNaN(C))return o?e.substring(L):($=-1,E("unclosed tag"));if(34===C)g=-1!==(x=e.indexOf('"',g+1))?x:g;else if(39===C)g=-1!==(x=e.indexOf("'",g+1))?x:g;else if(62===C){$=g;break}}if(33!==k){if(T={},47===k){if(O=!1,N=!0,!u.length)return E("missing open tag");if(g=P=u.pop(),x=L+2+g.length,e.substring(L+2,x)!==g)return E("closing tag mismatch");for(;x<$;x++)if(!(32===(k=e.charCodeAt(x))||k>8&&k<14))return E("close tag")}else{if(47===e.charCodeAt($-1)?(g=P=e.substring(L+1,$-1),O=!0,N=!0):(g=P=e.substring(L+1,$),O=!0,N=!1),!(k>96&&k<123||k>64&&k<91||95===k||58===k))return E("illegal first char nodeName");for(x=1,v=g.length;x<v;x++)if(!((k=g.charCodeAt(x))>96&&k<123||k>64&&k<91||k>47&&k<59||45===k||95===k||46==k)){if(32===k||k<14&&k>8){P=g.substring(0,x),T=null;break}return E("invalid nodeName")}N||u.push(P)}if(_){f=p,O&&(N||l.push(f),null===T&&(b=-1!==g.indexOf("xmlns",x))&&(F=x,I=g,H(),b=!1)),A=P,D!==p&&(void 0===(B=p[di])&&(B=p[di]=Object.create(null)),D=p);var V=B[P];if(void 0!==V)P=V;else{if(-1!==(k=P.indexOf(":"))){if(!(R=p[P.substring(0,k)]))return E("missing namespace on <"+A+">");P=P.substr(k+1)}else R=p.xmlns;R&&(P=R+":"+P),B[A]=P}}if(O&&(F=x,I=g,n&&(d?n(M,ci,N,m):n(P,H,ci,N,m),w)))return;if(N){if(i&&(i(d?M:P,ci,O,m),w))return;_&&(p=O?f:l.pop())}$+=1}else{if(c&&(c(e.substring(L,$+1),ci,m),w))return;$+=1}}else{if(-1===($=e.indexOf("?>",L)))return o?e.substring(L):E("unclosed question");if(s&&(s(e.substring(L,$+2),m),w))return;$+=2}}}this.on=function(e,l){if("function"!=typeof l)throw pi("required args <name, cb>");switch(e){case"openTag":n=l;break;case"text":t=l;break;case"closeTag":i=l;break;case"error":f=l;break;case"warn":o=l;break;case"cdata":r=l;break;case"attention":c=l;break;case"question":s=l;break;case"comment":a=l;break;default:throw pi("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw pi("required args <nsMap={}>");var t,n=Object.create(null);for(t in e)n[t]=e[t];return _=!0,h=n,this},this.parse=function(e){if("string"!=typeof e)throw pi("required args <xml=string>");if(g)throw pi("parse during stream; call end() first");return k(),C(e),m=mi,w=!1,x},this.write=function(e){if("string"!=typeof e)throw pi("required args <xml=string>");return g||(k(),g=!0),x||(v=C(v+e,!0)||""),this},this.end=function(){return g||k(),g=!1,x||C(v),v="",m=mi,w=!1,x},this.stop=function(){w=!0}}function vi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var bi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},_i="property";function xi(e){return e.xml&&e.xml.serialize}function wi(e,t){return vi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ei(e){return new Error(e)}function Si(e){return e.$descriptor}function ki(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Ei("expected element");var t,n=this.elementsById,i=Si(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Ei("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Ci(){}function Ri(){}function Pi(){}function Ai(e,t){this.property=e,this.context=t}function Mi(e,t){this.element=t,this.propertyDesc=e}function Ti(){}function Bi(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Di(e,t,n){Bi.call(this,e,t,n)}function ji(e,t,n){this.model=e,this.context=n}function Oi(e){e instanceof ni&&(e={model:e}),z(this,{lax:!1},e)}Ci.prototype.handleEnd=function(){},Ci.prototype.handleText=function(){},Ci.prototype.handleNode=function(){},Ri.prototype=Object.create(Ci.prototype),Ri.prototype.handleNode=function(){return this},Pi.prototype=Object.create(Ci.prototype),Pi.prototype.handleText=function(e){this.body=(this.body||"")+e},Ai.prototype=Object.create(Pi.prototype),Ai.prototype.handleNode=function(e){if(this.element)throw Ei("expected no sub nodes");return this.element=this.createReference(e),this},Ai.prototype.handleEnd=function(){this.element.id=this.body},Ai.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Mi.prototype=Object.create(Pi.prototype),Mi.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Un(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Ti.prototype=Object.create(Pi.prototype),Ti.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},Bi.prototype=Object.create(Ti.prototype),Bi.prototype.addReference=function(e){this.context.addReference(e)},Bi.prototype.handleText=function(e){if(!Si(this.element).bodyProperty)throw Ei("unexpected body text <"+e+">");Pi.prototype.handleText.call(this,e)},Bi.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Si(t).bodyProperty;n&&void 0!==e&&(e=Un(n.type,e),t.set(n.name,e))},Bi.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Si(i),o=this.context,a=new i({}),s=this.model;return w(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?w(e.split(" "),(function(e){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=Un(i.type,e):"xmlns"===n?n=":"+n:(t=Yn(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},Bi.prototype.getPropertyForNode=function(e){var t=Yn(e.name),n=this.type,i=this.model,r=Si(n),o=t.name,a=r.propertiesByName[o];if(a&&!a.isAttr){const t=function(e){const t=xi(e);return t!==_i&&(t||null)}(a);if(t){const n=e.attributes[t];if(n){const t=function(e,t,n){const i=Yn(e,t.xmlns),r=Yn(`${t[i.prefix]||i.prefix}:${i.localName}`);return function(e,t){var n=e.name,i=e.localName,r=t&&t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(r,n.getPackage(r.prefix))}(n,e.ns,i);return z({},a,{effectiveType:Si(i.getType(t)).name})}}return a}var s=i.getPackage(t.prefix);if(s){const e=wi(t,s),n=i.getType(e);if(a=b(r.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),a)return z({},a,{effectiveType:Si(n).name})}else if(a=b(r.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),a)return a;throw Ei("unrecognized element <"+t.name+">")},Bi.prototype.toString=function(){return"ElementDescriptor["+Si(this.type).name+"]"},Bi.prototype.valueHandler=function(e,t){return new Mi(e,t)},Bi.prototype.referenceHandler=function(e){return new Ai(e,this.context)},Bi.prototype.handler=function(e){return"Element"===e?new ji(this.model,e,this.context):new Bi(this.model,e,this.context)},Bi.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Kn(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Di.prototype=Object.create(Bi.prototype),Di.prototype.createElement=function(e){var t=e.name,n=Yn(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&wi(n,o)||t;if(!r.hasType(a))throw Ei("unexpected element <"+e.originalName+">");return Bi.prototype.createElement.call(this,e)},ji.prototype=Object.create(Ti.prototype),ji.prototype.createElement=function(e){var t=e.name,n=Yn(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},ji.prototype.handleChild=function(e){var t=new ji(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},ji.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Oi.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Bi?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new ki(z({},t,{rootHandler:i})),s=new yi({proxy:!0}),c=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function l(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var c="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:c,error:e}),!0;throw Ei(c)}function p(e,t){return l(e,t,!0)}i.context=a,c.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function f(e,t){try{c.peek().handleText(e)}catch(e){p(e,t)}}var m=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),Object.entries(bi).reduce((function(e,[t,n]){return e[n]=t,e}),r.config&&r.config.nsMap||{}));return s.ns(m).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=c.peek();try{c.push(n.handleNode(e))}catch(e){l(e,t,o)&&c.push(new Ri)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!d.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){c.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",l).on("warn",p),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=Si(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var c=r.get(s.name),l=c.indexOf(t);-1===l&&(l=c.length),o?c[l]=o:c.splice(l,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=Ei("failed to parse document as <"+i.type.$descriptor.name+">"));var c=a.warnings,l=a.references,p=a.elementsById;return r?(r.warnings=c,n(r)):t({rootElement:o,elementsById:p,references:l,warnings:c})}))},Oi.prototype.handler=function(e){return new Di(this.model,e)};var Ni=/<|>|'|"|&|\n\r|\n/g,Li=/<|>|&/g;function $i(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function Ii(e,t){return vi(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Fi(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function zi(e){return y(e)?e:(e.prefix?e.prefix+":":"")+e.localName}$i.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},$i.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},$i.prototype.resolve=function(e){for(var t=this;t;){var n=e(t);if(n)return n;t=t.parent}},$i.prototype.eachScope=function(e){for(var t=this;t;)e(t),t=t.parent},$i.prototype.byUri=function(e){return this.resolve((function(t){return t.uriMap[e]}))},$i.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)},$i.prototype.uriByPrefix=function(e){var t=e||"xmlns";return this.resolve((function(e){return e.prefixMap[t]}))},$i.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},$i.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},$i.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.eachScope((function(e){e.used[n]=e.byUri(t)}))},$i.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter((e=>{var t=this.getNSKey(e);return this.used[t]}))};var Hi={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Vi={"<":"lt",">":"gt","&":"amp"};function Gi(e,t,n){return(e=y(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Wi(e){this.tagName=e}function Ui(){}function qi(e){this.tagName=e}function Ki(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Yi(e,t,n){Ki.call(this,e,t),this.serialization=n}function Xi(){this.value="",this.write=function(e){this.value+=e}}function Zi(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 Qi(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Xi,r=new Zi(i,e.format);e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n');var o=new Ki,a=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){const t=e.config&&e.config.nsMap||{},n={};for(const e in bi)n[e]=bi[e];for(const e in t){n[t[e]]=e}for(const t of e.getPackages())n[t.prefix]=t.uri;return n}(a)),o.build(t).serializeTo(r),!n)return i.value}}}function Ji(e,t){ni.call(this,e,t)}Wi.prototype.build=function(e){return this.element=e,this},Wi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Ui.prototype.serializeValue=Ui.prototype.serializeTo=function(e){e.append(this.escape?Gi(this.value,Li,Vi):this.value)},Ui.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Li)&&(this.escape=!0),this},Fi(qi,Ui),qi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Ki.prototype.build=function(e){return function(e,t){var n=[{serializer:e,children:e.enter(t),index:0}];for(;n.length;){var i=n[n.length-1];if(i.index>=i.children.length)i.serializer.exit(),n.pop();else{var r=i.children[i.index++],o=r.create();i.serializer.body.push(o),r.element&&n.push({serializer:o,children:o.enter(r.element),index:0})}}}(this,e),this},Ki.prototype.enter=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,i=t.isGeneric;if(this.otherAttrs=i?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=n?this.nsPropertyTagName(n):this.nsTagName(t),this.tagName=this.addTagName(this.ns),i)return this.collectGenericContainments(e);var r=function(e){return x(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!v(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e);return this.parseAttributes(x(r,(function(e){return e.isAttr}))),this.collectContainments(function(e){return x(e,(function(e){return!e.isAttr}))}(r))},Ki.prototype.exit=function(){this.parseGenericAttributes(this.element,this.otherAttrs)},Ki.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?z({localName:t.ns.localName},e):z({localName:Ii(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Ki.prototype.nsPropertyTagName=function(e){return function(e,t){return z({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Ki.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ki.prototype.nsAttributeName=function(e){var t;if(t=y(e)?Yn(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},Ki.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})))},Ki.prototype.collectGenericContainments=function(e){var t=this,n=[],i=e.$body;i&&n.push({create:function(){return(new Ui).build({type:"String"},i)}});var r=e.$children;return r&&w(r,(function(e){n.push({create:function(){return new Ki(t)},element:e})})),n},Ki.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Yn(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Ki.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=[];return w(n,(function(n,r){var o=t.parseNsAttribute(e,r,n);o&&i.push(o)})),i},Ki.prototype.parseGenericAttributes=function(e,t){var n=this;w(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)}}))},Ki.prototype.collectContainments=function(e){var t=this,n=this.element,i=[];return w(e,(function(e){var r=n.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)i.push({create:function(){return(new Ui).build(e,r[0])}});else if(Kn(e.type))w(r,(function(n){i.push({create:function(){return new qi(t.addTagName(t.nsPropertyTagName(e))).build(e,n)}})}));else if(o)w(r,(function(n){i.push({create:function(){return new Wi(t.addTagName(t.nsPropertyTagName(e))).build(n)}})}));else{var a=xi(e);w(r,(function(n){i.push({create:function(){return a?a===_i?new Ki(t,e):new Yi(t,e,a):new Ki(t)},element:n})}))}})),i},Ki.prototype.getNamespaces=function(e){var t=this.namespaces;if(!t){var n=this.getParentNamespaces();e||!n?this.namespaces=t=new $i(n):t=n}return t},Ki.prototype.getParentNamespaces=function(){if(void 0!==this.parentNamespaces)return this.parentNamespaces;for(var e=null,t=this.parent;t;){if(t.namespaces){e=t.namespaces;break}if(void 0!==t.parentNamespaces){e=t.parentNamespaces;break}t=t.parent}return this.parentNamespaces=e},Ki.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Ki.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.getNamespaces(t),a=e.prefix,s=e.uri;if(!a&&!s)return{localName:e.localName};if(r=o.defaultUriByPrefix(a),!(s=s||r||o.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if((e=o.byUri(s))||a||(e=this.logNamespace({uri:s},r===s,!0)),!e){for(n=a,i=1;o.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:s},r===s)}return a&&o.mapPrefix(a,s),e},Ki.prototype.parseAttributes=function(e){var t=this,n=this.element;w(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];w(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Ki.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),zi(e)},Ki.prototype.addAttribute=function(e,t){var n=this.attrs;y(t)&&(t=Gi(t,Ni,Hi));var i=_(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Ki.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)),w(t,(function(t){e.append(" ").append(zi(t.name)).append('="').append(t.value).append('"')}))},Ki.prototype.serializeTo=function(e){!function(e,t){var n=[{serializer:e,index:0,opened:!1,indent:!1}];for(;n.length;){var i=n[n.length-1],r=i.serializer;if(!i.opened){var o=r.body[0];if(i.indent=o&&o.constructor!==Ui,t.appendIndent().append("<"+r.tagName),r.serializeAttributes(t),t.append(o?">":" />"),i.opened=!0,!o){t.appendNewLine(),n.pop();continue}i.indent&&t.appendNewLine().indent()}if(i.index<r.body.length){var a=r.body[i.index++];a instanceof Ki?n.push({serializer:a,index:0,opened:!1,indent:!1}):a.serializeTo(t)}else i.indent&&t.unindent().appendIndent(),t.append("</"+r.tagName+">").appendNewLine(),n.pop()}}(this,e)},Fi(Yi,Ki),Yi.prototype.parseNsAttributes=function(e){var t=Ki.prototype.parseNsAttributes.call(this,e).filter((e=>e.name!==this.serialization)),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Yi.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Ji.prototype=Object.create(ni.prototype),Ji.prototype.fromXML=function(e,t,n){y(t)||(n=t,t="bpmn:Definitions");var i=new Oi(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Ji.prototype.toXML=function(e,t){var n=new Qi(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};const er={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",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 tr(e,t){return new Ji(z({},er,e),t)}function nr(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function ir(e,t){return e.$instanceOf(t)}function rr(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function a(t,n){try{var r=i[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${nr(t)}`);return e.element(t,i[t.id],n)}(t,n);return o(t),r}catch(e){s(e.message,{element:t,error:e}),console.error(`failed to import ${nr(t)}`,e)}}function s(t,n){e.error(t,n)}var c=this.registerDi=function(e){var t=e.bpmnElement;t?i[t.id]?s(`multiple DI elements defined for ${nr(t)}`,{element:t}):i[t.id]=e:s(`no bpmnElement referenced in ${nr(e)}`,{element:e})};function l(e){var t;t=e.plane,c(t),w(t.planeElement,p)}function p(e){c(e)}this.handleDefinitions=function(o,a){var p=o.diagrams;if(a&&-1===p.indexOf(a))throw new Error("diagram not part of <bpmn:Definitions />");if(!a&&p&&p.length&&(a=p[0]),!a)throw new Error("no diagram to display");i={},l(a);var f=a.plane;if(!f)throw new Error(`no plane for ${nr(a)}`);var m=f.bpmnElement;if(!m){if(m=function(e){return b(e.rootElements,(function(e){return ir(e,"bpmn:Process")||ir(e,"bpmn:Collaboration")}))}(o),!m)throw new Error("no process or collaboration to display");s(`correcting missing bpmnElement on ${nr(f)} to ${nr(m)}`),f.bpmnElement=m,c(f)}var g,y,_=function(t,n){return e.root(t,i[t.id],n)}(m,f);if(ir(m,"bpmn:Process")||ir(m,"bpmn:SubProcess"))h(m,_);else{if(!ir(m,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${nr(f)}: ${nr(m)}`);y=_,w((g=m).participants,r(A,y)),n.push((function(){!function(e,t){w(e,r(d,t))}(g.messageFlows,y)})),v(g.artifacts,y),function(e,n){var i=x(e,(function(e){return!t[e.id]&&ir(e,"bpmn:Process")&&e.laneSets}));i.forEach(r(h,n))}(o.rootElements,_)}u(n)};var u=this.handleDeferred=function(){for(;n.length;)n.shift()()};function h(e,t){P(e,t),_(e.ioSpecification,t),v(e.artifacts,t),o(e)}function d(e,t){a(e,t)}function f(e,t){a(e,t)}function m(e,t){a(e,t)}function g(e,t){a(e,t)}function y(e,t){a(e,t)}function v(e,t){w(e,(function(e){ir(e,"bpmn:Association")?n.push((function(){y(e,t)})):y(e,t)}))}function _(e,t){e&&(w(e.dataInputs,r(m,t)),w(e.dataOutputs,r(g,t)))}var E=this.handleSubProcess=function(e,t){P(e,t),v(e.artifacts,t)};function S(e,t){var i=a(e,t);ir(e,"bpmn:SubProcess")&&E(e,i||t),ir(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){w(e.dataInputAssociations,r(f,t)),w(e.dataOutputAssociations,r(f,t))}))}function k(e,t){a(e,t)}function C(e,t){n.push((function(){var n=a(e,t);e.childLaneSet&&R(e.childLaneSet,n||t),function(e){w(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function R(e,t){w(e.lanes,r(C,t))}function P(e,t){!function(e,t){w(e,(function(e){ir(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){a(e,t)}(e,t)})):ir(e,"bpmn:BoundaryEvent")?n.unshift((function(){S(e,t)})):ir(e,"bpmn:FlowNode")?S(e,t):ir(e,"bpmn:DataObject")||(ir(e,"bpmn:DataStoreReference")||ir(e,"bpmn:DataObjectReference")?k(e,t):s(`unrecognized flowElement ${nr(e)} in context ${nr(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){w(e,r(R,t))}(e.laneSets,t)}function A(e,t){var n=a(e,t),i=e.processRef;i&&h(i,n||t)}}function or(e,t){var n=sr(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function ar(e,t){return C(t,(function(t){return or(e,t)}))}function sr(e){return e&&e.businessObject||e}function cr(e){return e&&e.di}function lr(e,t,n){var i,r,o,a=[];function s(e,t){var n=new rr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){a.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t||!t.plane)return;var n,i=t.plane.bpmnElement,r=i;or(i,"bpmn:Process")||or(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(or(t,"bpmn:Process"))return t;t=t.$parent}}
7
+ */var xt=/,?([a-z]),?/gi,wt=parseFloat,Et=Math,St=Et.PI,kt=Et.min,Ct=Et.max,Rt=Et.pow,Pt=Et.abs,At=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Mt=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Tt=Array.isArray||function(e){return e instanceof Array};function Bt(e){return function t(){var n,i,r=Array.prototype.slice.call(arguments,0).join("␀"),o=t.cache=t.cache||{},a=t.count=t.count||[];return n=o,i=r,Object.prototype.hasOwnProperty.call(n,i)?(function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(a,r),o[r]):(a.length>=1e3&&delete o[a.shift()],a.push(r),o[r]=e(...arguments),o[r])}}function Dt(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace(At,(function(e,i,r){var o=[],a=i.toLowerCase();for(r.replace(Mt,(function(e,t){t&&o.push(+t)})),"m"==a&&o.length>2&&(n.push([i,...o.splice(0,2)]),a="l",i="m"==i?"l":"L");o.length>=t[a]&&(n.push([i,...o.splice(0,t[a])]),t[a]););})),n.toString=Ot,n}function jt(e,t,n,i){return 1===arguments.length&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function Ot(){return this.join(",").replace(xt,"$1")}function Nt(e,t,n,i,r,o,a,s,c){var l=1-c,p=Rt(l,3),u=Rt(l,2),h=c*c*c,d=p*t+3*u*c*i+3*l*c*c*o+h*s;return{x:Ht(p*e+3*u*c*n+3*l*c*c*r+h*a),y:Ht(d)}}function Lt(e){var t=function(e,t,n,i,r,o,a,s){for(var c,l,p,u,h,d,f,m,g=[],y=[[],[]],v=0;v<2;++v)if(0==v?(l=6*e-12*n+6*r,c=-3*e+9*n-9*r+3*a,p=3*n-3*e):(l=6*t-12*i+6*o,c=-3*t+9*i-9*o+3*s,p=3*i-3*t),Pt(c)<1e-12){if(Pt(l)<1e-12)continue;0<(u=-p/l)&&u<1&&g.push(u)}else f=l*l-4*p*c,m=Et.sqrt(f),f<0||(0<(h=(-l+m)/(2*c))&&h<1&&g.push(h),0<(d=(-l-m)/(2*c))&&d<1&&g.push(d));var b,_=g.length,x=_;for(;_--;)b=1-(u=g[_]),y[0][_]=b*b*b*e+3*b*b*u*n+3*b*u*u*r+u*u*u*a,y[1][_]=b*b*b*t+3*b*b*u*i+3*b*u*u*o+u*u*u*s;return y[0][x]=e,y[1][x]=t,y[0][x+1]=a,y[1][x+1]=s,y[0].length=y[1].length=x+2,{x0:kt(...y[0]),y0:kt(...y[1]),x1:Ct(...y[0]),y1:Ct(...y[1])}}(...e);return jt(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function $t(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function It(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Ft(e,t,n,i,r,o,a,s,c){null==c&&(c=1);for(var l=(c=c>1?1:c<0?0:c)/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],h=0,d=0;d<12;d++){var f=l*p[d]+l,m=It(f,e,n,r,a),g=It(f,t,i,o,s),y=m*m+g*g;h+=u[d]*Et.sqrt(y)}return l*h}function zt(e,t,n,i,r,o,a,s){if(!(Ct(e,n)<kt(r,a)||kt(e,n)>Ct(r,a)||Ct(t,i)<kt(o,s)||kt(t,i)>Ct(o,s))){var c=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),l=(e-n)*(o-s)-(t-i)*(r-a);if(l){var p=Ht(((e*i-t*n)*(r-a)-(e-n)*(r*s-o*a))/l),u=Ht(c/l),h=+p.toFixed(2),d=+u.toFixed(2);if(!(h<+kt(e,n).toFixed(2)||h>+Ct(e,n).toFixed(2)||h<+kt(r,a).toFixed(2)||h>+Ct(r,a).toFixed(2)||d<+kt(t,i).toFixed(2)||d>+Ct(t,i).toFixed(2)||d<+kt(o,s).toFixed(2)||d>+Ct(o,s).toFixed(2)))return{x:p,y:u}}}}function Ht(e){return Math.round(1e11*e)/1e11}function Vt(e,t,n){if(!function(e,t){return e=jt(e),$t(t=jt(t),e.x,e.y)||$t(t,e.x2,e.y)||$t(t,e.x,e.y2)||$t(t,e.x2,e.y2)||$t(e,t.x,t.y)||$t(e,t.x2,t.y)||$t(e,t.x,t.y2)||$t(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)}(Lt(e),Lt(t)))return[];var i,r,o=Ft(...e),a=Ft(...t),s=Wt(e)?1:~~(o/5)||1,c=Wt(t)?1:~~(a/5)||1,l=new Array(s+1),p=new Array(c+1),u={},h=[];for(i=0;i<s+1;i++){var d=Nt(...e,i/s);l[i]={x:d.x,y:d.y,t:i/s}}for(i=0;i<c+1;i++)d=Nt(...t,i/c),p[i]={x:d.x,y:d.y,t:i/c};for(i=0;i<s;i++)for(r=0;r<c;r++){var f,m=l[i],g=l[i+1],y=p[r],v=p[r+1],b=Pt(g.x-m.x)<.01?"y":"x",_=Pt(v.x-y.x)<.01?"y":"x",x=zt(m.x,m.y,g.x,g.y,y.x,y.y,v.x,v.y);if(x){if(u[f=x.x.toFixed(9)+"#"+x.y.toFixed(9)])continue;u[f]=!0;var w=m.t+Pt((x[b]-m[b])/(g[b]-m[b]))*(g.t-m.t),E=y.t+Pt((x[_]-y[_])/(v[_]-y[_]))*(v.t-y.t);w>=0&&w<=1&&E>=0&&E<=1&&h.push({x:x.x,y:x.y,t1:w,t2:E})}}return h}function Gt(e,t,n){e=Yt(e),t=Yt(t);for(var i,r,o,a,s,c,l,p,u,h,d=n?0:[],f=0,m=e.length;f<m;f++){var g=e[f];if("M"==g[0])i=s=g[1],r=c=g[2];else{"C"==g[0]?(i=(u=[i,r,...g.slice(1)])[6],r=u[7]):(u=[i,r,i,r,s,c,s,c],i=s,r=c);for(var y=0,v=t.length;y<v;y++){var b=t[y];if("M"==b[0])o=l=b[1],a=p=b[2];else{"C"==b[0]?(o=(h=[o,a,...b.slice(1)])[6],a=h[7]):(h=[o,a,o,a,l,p,l,p],o=l,a=p);for(var _=Vt(u,h),x=0,w=_.length;x<w;x++)_[x].segment1=f,_[x].segment2=y,_[x].bez1=u,_[x].bez2=h;d=d.concat(_)}}}}return d}function Wt(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function Ut(e,t,n,i){return[e,t,n,i,n,i]}function qt(e,t,n,i,r,o){var a=1/3,s=2/3;return[a*e+s*n,a*t+s*i,a*r+s*n,a*o+s*i,r,o]}function Kt(e,t,n,i,r,o,a,s,c,l){var p,u=120*St/180,h=St/180*(+r||0),d=[],f=Bt((function(e,t,n){return{x:e*Et.cos(n)-t*Et.sin(n),y:e*Et.sin(n)+t*Et.cos(n)}}));if(l)E=l[0],S=l[1],x=l[2],w=l[3];else{e=(p=f(e,t,-h)).x,t=p.y;var m=(e-(s=(p=f(s,c,-h)).x))/2,g=(t-(c=p.y))/2,y=m*m/(n*n)+g*g/(i*i);y>1&&(n*=y=Et.sqrt(y),i*=y);var v=n*n,b=i*i,_=(o==a?-1:1)*Et.sqrt(Pt((v*b-v*g*g-b*m*m)/(v*g*g+b*m*m))),x=_*n*g/i+(e+s)/2,w=_*-i*m/n+(t+c)/2,E=Et.asin(((t-w)/i).toFixed(9)),S=Et.asin(((c-w)/i).toFixed(9));(E=e<x?St-E:E)<0&&(E=2*St+E),(S=s<x?St-S:S)<0&&(S=2*St+S),a&&E>S&&(E-=2*St),!a&&S>E&&(S-=2*St)}var k=S-E;if(Pt(k)>u){var C=S,R=s,P=c;S=E+u*(a&&S>E?1:-1),d=Kt(s=x+n*Et.cos(S),c=w+i*Et.sin(S),n,i,r,0,a,R,P,[S,C,x,w])}k=S-E;var A=Et.cos(E),M=Et.sin(E),T=Et.cos(S),B=Et.sin(S),D=Et.tan(k/4),j=4/3*n*D,O=4/3*i*D,N=[e,t],L=[e+j*M,t-O*A],$=[s+j*B,c-O*T],I=[s,c];if(L[0]=2*N[0]-L[0],L[1]=2*N[1]-L[1],l)return[L,$,I].concat(d);for(var F=[],z=0,H=(d=[L,$,I].concat(d).join().split(",")).length;z<H;z++)F[z]=z%2?f(d[z-1],d[z],h).y:f(d[z],d[z+1],h).x;return F}function Yt(e){if(function(e){return Tt(e)&&Tt(e[0])}(e)||(e=Dt(e)),function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("M"!==i&&"C"!==i)return!1}return!0}(e))return e;for(var t=function(e){for(var t=new Array(e.length),n=0,i=e.length;n<i;n++)for(var r=e[n],o=t[n]=new Array(r.length),a=0,s=r.length;a<s;a++)o[a]=r[a];return t.toString=Ot,t}(function(e){if(function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("string"==typeof i&&i!==i.toUpperCase())return!1}return!0}(e))return e;var t,n=new Array(e.length),i=0,r=0,o=0,a=0,s=0;"M"==e[0][0]&&(o=i=+e[0][1],a=r=+e[0][2],s++,n[0]=["M",i,r]);for(var c,l,p=s,u=e.length;p<u;p++){if(t=(l=e[p])[0],n[p]=c=new Array(l.length),t!=t.toUpperCase())switch(c[0]=t.toUpperCase(),c[0]){case"A":c[1]=l[1],c[2]=l[2],c[3]=l[3],c[4]=l[4],c[5]=l[5],c[6]=+l[6]+i,c[7]=+l[7]+r;break;case"V":c[1]=+l[1]+r;break;case"H":c[1]=+l[1]+i;break;case"M":o=+l[1]+i,a=+l[2]+r;default:for(var h=1,d=l.length;h<d;h++)c[h]=+l[h]+(h%2?i:r)}else for(var f=0,m=l.length;f<m;f++)c[f]=l[f];switch(t=t.toUpperCase(),c[0]){case"Z":i=+o,r=+a;break;case"H":i=c[1];break;case"V":r=c[1];break;case"M":o=c[c.length-2],a=c[c.length-1];default:i=c[c.length-2],r=c[c.length-1]}}return n.toString=Ot,n}(e)),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(e,t,n){var i,r;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C",...Kt(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(i=2*t.x-t.bx,r=2*t.y-t.by):(i=t.x,r=t.y),e=["C",i,r,...e.slice(1)];break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C",...qt(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",...qt(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...Ut(t.x,t.y,e[1],e[2])];break;case"H":e=["C",...Ut(t.x,t.y,e[1],t.y)];break;case"V":e=["C",...Ut(t.x,t.y,t.x,e[1])];break;case"Z":e=["C",...Ut(t.x,t.y,t.X,t.Y)]}return e},r=function(e,n){if(e[n].length>7){e[n].shift();for(var i=e[n];i.length;)o[n]="A",e.splice(n++,0,["C",...i.splice(0,6)]);e.splice(n,1),l=t.length}},o=[],a="",s="",c=0,l=t.length;c<l;c++){t[c]&&(a=t[c][0]),"C"!=a&&(o[c]=a,c&&(s=o[c-1])),t[c]=i(t[c],n,s),"A"!=o[c]&&"C"==a&&(o[c]="C"),r(t,c);var p=t[c],u=p.length;n.x=p[u-2],n.y=p[u-1],n.bx=wt(p[u-4])||n.x,n.by=wt(p[u-3])||n.y}return t}function Xt(e){return f(e)&&v(e,"waypoints")}function Zt(e){return f(e)&&v(e,"labelTarget")}function Qt(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Jt(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function en(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function tn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function nn(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r=t[i-1];if(r){var o=e[e.length-1],a=o&&o.endLength||0,s=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}(r,n);e.push({start:r,end:n,startLength:a,endLength:a+s,length:s})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length;return{x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s}}function rn(e){return Xt(e)?nn(e):Jt({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function on(e,t,n){f(n=n||0)||(n={x:n,y:n});var i=en(e),r=en(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=o?"top":s?"bottom":null,l=i.right+n.x<=r.left?"left":a?"right":null;return l&&c?c+"-"+l:l||c||"intersect"}function an(e,t,n){var i=function(e,t){return Gt(e,t)}(e,t);return 1===i.length||2===i.length&&mt(i[0],i[1])<1?Jt(i[0]):i.length>1?(i=D(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),Jt(i[n?0:i.length-1])):null}function sn(e,t){return Math.round(e*t)/t}function cn(e){return m(e)?e+"px":e}function ln(e){for(;e.parent;)e=e.parent;return e}function pn(e,t,n){const i=Ee("g");ge(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const un={shape:["x","y","width","height"],connection:["waypoints"]};function hn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}function dn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}hn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],hn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=z({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),q(n,{position:"relative",overflow:"hidden",width:cn(e.width),height:cn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Ee("svg");fe(i,{width:"100%",height:"100%"}),K(i,"tabindex",0),e.autoFocus&&t.on("element.hover",(()=>{this.restoreFocus()})),t.on("element.mousedown",500,(e=>{this.focus()})),i.addEventListener("focusin",(()=>{this._setFocused(!0)})),i.addEventListener("focusout",(()=>{this._setFocused(!1)})),i.addEventListener("mouseover",(()=>{this._eventBus.fire("canvas.mouseover")})),i.addEventListener("mouseout",(()=>{this._eventBus.fire("canvas.mouseout")})),ue(n,i);const r=this._viewport=pn(i,"viewport");e.deferUpdate&&(this._viewboxChanged=I(this._viewboxChanged,300)),this._restoreFocus=I(this._restoreFocus,0),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(()=>{delete this._cachedViewbox})),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},hn.prototype._destroy=function(){this._restoreFocus.cancel(),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},hn.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},hn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=st(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},hn.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},hn.prototype.restoreFocus=function(){this._restoreFocus()},hn.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},hn.prototype.isFocused=function(){return this._focused},hn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},hn.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},hn.prototype._getChildIndex=function(e){return S(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},hn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:pn(this._viewport,"layer-"+e,n),index:t,visible:!0}},hn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},hn.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?(je(n),t.visible=!1,n):n},hn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],je(t.group))},hn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},hn.prototype.findRoot=function(e){const t=this._resolveElements(e);let n;for(const e of t){const t=this._findPlaneForRoot(ln(e));if(!t)return;if(n&&t.rootElement!==n)return;n=t.rootElement}return n},hn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},hn.prototype._findPlaneForRoot=function(e){return b(this._planes,(function(t){return t.rootElement===e}))},hn.prototype._resolveElement=function(e){return"string"==typeof e?this._elementRegistry.get(e):e},hn.prototype._resolveElements=function(e){return d(e)||(e=[e]),e.map((e=>this._resolveElement(e))).filter(Boolean)},hn.prototype.getContainer=function(){return this._container},hn.prototype._updateMarker=function(e,t,n){let i;(e=this._resolveElement(e)).markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(w([i.gfx,i.secondaryGfx],(function(i){i&&(n?(e.markers.add(t),ge(i).add(t)):(e.markers.delete(t),ge(i).remove(t)))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},hn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},hn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},hn.prototype.hasMarker=function(e,t){return!!(e=this._resolveElement(e)).markers&&e.markers.has(t)},hn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},hn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},hn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},hn.prototype.removeRootElement=function(e){e=this._resolveElement(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},hn.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},hn.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)},hn.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},hn.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})},hn.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=un[e],i=k(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},hn.prototype._setParent=function(e,t,n){dt(t.children,e,n),e.parent=t},hn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},hn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},hn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},hn.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),ht(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},hn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},hn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},hn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},hn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},hn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},hn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let i,r,o,a,s,c,l;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Ne(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Ne(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=ke().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Ce(a,e);case 6:return Ce(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=sn(r.a,1e3),c=sn(-r.e||0,1e3),l=sn(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:l?l/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},hn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),dn(t,n)})),{x:n.e,y:n.f}},hn.prototype.scrollToElement=function(e,t){let n=100;const i=this._resolveElements(e);if(!i.length)return;const r=this.findRoot(i);if(!r)return;r!==this.getRootElement()&&this.setRootElement(r);const o=i.filter((e=>e!=r));if(!o.length)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 a=ot(o),s=en(a),c=this.viewbox(),l=this.zoom();let p,u;c.y+=t.top/l,c.x+=t.left/l,c.width-=(t.right+t.left)/l,c.height-=(t.bottom+t.top)/l;const h=en(c);if(a.width<c.width&&a.height<c.height){const e=Math.max(0,s.right-h.right),t=Math.min(0,s.left-h.left),n=Math.max(0,s.bottom-h.bottom),i=Math.min(0,s.top-h.top);p=e||t,u=n||i}else p=a.x-c.x,u=a.y-c.y;this.scroll({dx:-p*l,dy:-u*l})},hn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),sn(i.a,1e3)},hn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},hn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,l,p;c=i.getCTM();const u=c.a;return t?(a=z(o,t),s=a.matrixTransform(c.inverse()),l=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),p=c.multiply(l)):p=r.scale(e),dn(this._viewport,p),p},hn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},hn.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}},hn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var fn="data-element-id";function mn(e){this._elements={},this._eventBus=e}function gn(e,t,n){var i=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function yn(e,t){if(!(this instanceof yn))return new yn(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 i=e.id;this._validateId(i),fe(t,fn,i),n&&fe(n,fn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},mn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(fe(i.gfx,fn,""),i.secondaryGfx&&fe(i.secondaryGfx,fn,""),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),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},mn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&fe(t,fn,i),t},mn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&fe(e,fn);var n=this._elements[t];return n&&n.element},mn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},mn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},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 i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},mn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.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")},yn.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?gn(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},yn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||gn(this,t,e),n},yn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},yn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},yn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var vn=new yn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),bn=new yn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),_n=new yn({name:"attachers",collection:!0},{name:"host"}),xn=new yn({name:"outgoing",collection:!0},{name:"source"}),wn=new yn({name:"incoming",collection:!0},{name:"target"});function En(){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)}}),vn.bind(this,"parent"),bn.bind(this,"labels"),xn.bind(this,"outgoing"),wn.bind(this,"incoming")}function Sn(){En.call(this),vn.bind(this,"children"),_n.bind(this,"host"),_n.bind(this,"attachers")}function kn(){En.call(this),vn.bind(this,"children")}function Cn(){Sn.call(this),bn.bind(this,"labelTarget")}function Rn(){En.call(this),xn.bind(this,"source"),wn.bind(this,"target")}e(Sn,En),e(kn,Sn),e(Cn,Sn),e(Rn,En);var Pn={connection:Rn,shape:Sn,label:Cn,root:kn};function An(){this._uid=12}An.prototype.createRoot=function(e){return this.create("root",e)},An.prototype.createLabel=function(e){return this.create("label",e)},An.prototype.createShape=function(e){return this.create("shape",e)},An.prototype.createConnection=function(e){return this.create("connection",e)},An.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Pn[e];if(!n)throw new Error("unknown type: <"+e+">");return z(new n,t)}(e,t)};var Mn="__fn",Tn=Array.prototype.slice;function Bn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Dn(){}function jn(e){return e.childNodes[0]}function On(e,t,n,i,r){var o=Re();o.setTranslate(t,n);var a=Re();a.setRotate(i||0,0,0);var s=Re();s.setScale(1,1),Ne(e,[o,a,s])}function Nn(e,t,n){var i=Re();i.setTranslate(t,n),Ne(e,i)}function Ln(e,t){var n=Re();n.setRotate(t,0,0),Ne(e,n)}function $n(e,t){this._eventBus=e,this._elementRegistry=t}Bn.prototype.on=function(e,t,n,i){if(e=d(e)?e:[e],g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");var r=n;i&&((r=F(n,i))[Mn]=n[Mn]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},Bn.prototype.once=function(e,t,n,i){var r=this;if(g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[Mn]=n,this.on(e,t,o)},Bn.prototype.off=function(e,t){e=d(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Bn.prototype.createEvent=function(e){var t=new Dn;return t.init(e),t},Bn.prototype.fire=function(e,t){var n,i,r,o;if(o=Tn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Dn?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Bn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Bn.prototype._destroy=function(){this._listeners={}},Bn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Bn.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},Bn.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},Bn.prototype._getListeners=function(e){return this._listeners[e]},Bn.prototype._setListeners=function(e,t){this._listeners[e]=t},Bn.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[Mn]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Dn.prototype.stopPropagation=function(){this.cancelBubble=!0},Dn.prototype.preventDefault=function(){this.defaultPrevented=!0},Dn.prototype.init=function(e){z(this,e||{})},$n.$inject=["eventBus","elementRegistry"],$n.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(ge(t=Ee("g")).add("djs-children"),ue(n.parentNode,t))):t=n,t},$n.prototype._clear=function(e){var t=jn(e);return Q(t),t},$n.prototype._createContainer=function(e,t,n,i){var r=Ee("g");ge(r).add("djs-group"),void 0!==n?function(e,t,n){var i=n||t.firstChild;if(e===i)return;t.insertBefore(e,i)}(r,t,t.childNodes[n]):ue(t,r);var o=Ee("g");ge(o).add("djs-element"),ge(o).add("djs-"+e),i&&ge(o).add("djs-frame"),ue(r,o);var a=Ee("g");return ge(a).add("djs-visual"),ue(o,a),o},$n.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,ct(t))},$n.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=S(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),w(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e),o=r.firstChild;w(t,(function(e){var t=i.getGraphics(e).parentNode;t===o?o=o.nextSibling:r.insertBefore(t,o)}))}}))},$n.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},$n.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},$n.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},$n.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},$n.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),Nn(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?fe(n,"display","none"):fe(n,"display","block")}},$n.prototype.remove=function(e){je(this._elementRegistry.getGraphics(e).parentNode)};var In={__depends__:[ut],__init__:["canvas"],canvas:["type",hn],elementRegistry:["type",mn],elementFactory:["type",An],eventBus:["type",Bn],graphicsFactory:["type",$n]};function Fn(e){return function(e){var t=new We(e);return t.init(),t}([{config:["value",e=e||{}]},In].concat(e.modules||[]))}function zn(e,t){this._injector=t||Fn(e),this.get("eventBus").fire("diagram.init")}function Hn(){}function Vn(e,t){this.model=e,this.properties=t}zn.prototype.get=function(e,t){return this._injector.get(e,t)},zn.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},zn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},zn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Hn.prototype.get=function(e){return this.$model.properties.get(this,e)},Hn.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Vn.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Hn.prototype);w(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),w(e,F((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Gn=z(Object.create(null),{String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0}),Wn=z(Object.create(null),{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 Un(e,t){var n=Wn[e];return n?n(t):t}function qn(e){return!!Gn[e]}function Kn(e){return!!Wn[e]}function Yn(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Xn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName=Object.create(null),this.properties=[],this.propertiesByName=Object.create(null)}function Zn(e,t){this.packageMap=Object.create(null),this.typeMap=Object.create(null),this.packages=[],this.properties=t,w(e,F(this.registerPackage,this))}function Qn(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Jn(e){this.model=e}function ei(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function ti(e){return e.replace(/^:/,"")}function ni(e,t={}){this.properties=new Jn(this),this.factory=new Vn(this,this.properties),this.registry=new Zn(e,this.properties),this.typeCache=Object.create(null),this.config=t}Xn.prototype.build=function(){return H(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Xn.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Xn.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=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 s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Xn.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Yn(r[0],i),a=Yn(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Xn.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Xn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Xn.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},Xn.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},Xn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Xn.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Xn.prototype.hasProperty=function(e){return this.propertiesByName[e]},Xn.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(w(e.properties,F((function(n){n=z({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Zn.prototype.getPackage=function(e){return this.packageMap[e]},Zn.prototype.getPackages=function(){return this.packages},Zn.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Qn(t,e,"prefix"),Qn(t,e,"uri"),w(e.types,F((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Zn.prototype.registerType=function(e,t){var n=Yn((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z({},e.meta||{})})).name,t.prefix),i=n.name,r=Object.create(null);w(e.properties,F((function(e){var t=Yn(e.name,n.prefix),i=t.name;qn(e.type)||(e.type=Yn(e.type,t.prefix).name),z(e,{ns:t,name:i}),r[i]=e}),this)),z(e,{ns:n,name:i,propertiesByName:r}),w(e.extends,F((function(e){var t=Yn(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Zn.prototype.mapTypes=function(e,t,n){var i=qn(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=Yn(n,qn(n)?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");w(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),w(i.traits,a)},Zn.prototype.getEffectiveDescriptor=function(e){var t=Yn(e),n=new Xn(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Zn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Jn.prototype.set=function(e,t,n){if(!y(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[ti(t)]:i?r in e?e[r]=n:ei(e,i,n):e.$attrs[ti(t)]=n},Jn.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[ti(t)];var i=n.name;return!e[i]&&n.isMany&&ei(e,n,[]),e[i]},Jn.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Jn.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Jn.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Jn.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},ni.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ni.prototype.getType=function(e){var t=this.typeCache,n=y(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},ni.prototype.createAny=function(e,t,n){var i=Yn(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let i=e;w(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],a=i[e];u(o)&&h(a)&&(a=i[e]=isNaN(+o)?{}:[]),p(o)?p(n)?delete i[e]:i[e]=n:i=a}))}(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),w(n,(function(e,t){f(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},ni.prototype.getPackage=function(e){return this.registry.getPackage(e)},ni.prototype.getPackages=function(){return this.registry.getPackages()},ni.prototype.getElementDescriptor=function(e){return e.$descriptor},ni.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},ni.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ni.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ii=String.fromCharCode,ri=Object.prototype.hasOwnProperty,oi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ai={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function si(e,t,n,i){return i?ri.call(ai,i)?ai[i]:"&"+i+";":ii(t||parseInt(n,16))}function ci(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(oi,si):e}Object.keys(ai).forEach((function(e){ai[e.toUpperCase()]=ai[e]}));var li="non-whitespace outside of root node";function pi(e){return new Error(e)}function ui(e){return{get:e,enumerable:!0}}function hi(e,t,n,i){n in t||(t[n]=n in e?e[n]:null),e[n]=i}function di(e,t){var n,i;for(n in t)null===(i=t[n])?delete e[n]:e[n]=i}function fi(e){return e+"$uri"}function mi(){return{line:0,column:0}}function gi(e){throw e}function yi(e){if(!this)return new yi(e);var t,n,i,r,o,a,s,c,l,p,u,h,d=e&&e.proxy,f=gi,m=mi,g=!1,y=!1,v="",b=!1,_=!1,x=null,w=!1;function E(e){e instanceof Error||(e=pi(e)),x=e,f(e,m)}function S(e){o&&(e instanceof Error||(e=pi(e)),o(e,m))}function k(){l=_?[]:null,p=_?function(e){var t,n,i=Object.create(null);for(t in e)i[n=e[t]]=n,i[fi(n)]=t;return i}(h):null,u=[],m=mi,w=!1,x=null,y=!1,v=""}function C(e,o=!1){var f,g,v,x,k,C,R,P,A,M,T,B,D=null,j=0,O=!1,N=!1,L=0,$=0,I="",F=0;function z(e,t){var n=e.indexOf(":");if(-1===n)return e;var i=p[e.substring(0,n)];return i?t===i?e.substr(n+1):i+e.substr(n):(S(function(e){return"missing namespace for prefix <"+e+">"}(e.substring(0,n))),null)}function H(){if(null!==B)return B;var e,t,n,i,r,o,a,s,c,l=_&&p.xmlns,u=_&&b?[]:null,d=F,m=I,y=m.length,v={},x=new Set;e:for(;d<y;d++)if(a=!1,!(32===(s=m.charCodeAt(d))||s<14&&s>8)){for((s<65||s>122||s>90&&s<97)&&95!==s&&58!==s&&(S("illegal first char attribute name"),a=!0),c=d+1;c<y;c++)if(!((s=m.charCodeAt(c))>96&&s<123||s>64&&s<91||s>47&&s<59||46===s||45===s||95===s)){if(32===s||s<14&&s>8){S("missing attribute value"),d=c;continue e}if(61===s)break;S("illegal attribute name char"),a=!0}if("xmlns:xmlns"===(o=m.substring(d,c))&&(S("illegal declaration of xmlns"),a=!0),34===(s=m.charCodeAt(c+1)))-1===(c=m.indexOf('"',d=c+2))&&-1!==(c=m.indexOf("'",d))&&(S("attribute value quote missmatch"),a=!0);else if(39===s)-1===(c=m.indexOf("'",d=c+2))&&-1!==(c=m.indexOf('"',d))&&(S("attribute value quote missmatch"),a=!0);else for(S("missing attribute value quotes"),a=!0,c+=1;c<y&&!(32===(s=m.charCodeAt(c+1))||s<14&&s>8);c++);for(-1===c&&(S("missing closing quotes"),c=y,a=!0),a||(i=m.substring(d,c)),"xmlns:xml"===o&&"http://www.w3.org/XML/1998/namespace"!==i&&E("illegal value of xmlns:xml"),d=c;c+1<y&&!(32===(s=m.charCodeAt(c+1))||s<14&&s>8);c++)d===c&&(S("illegal character after attribute end"),a=!0);if(d=c+1,!a)if(x.has(o))S("attribute <"+o+"> already defined");else if(x.add(o),_)if(b){if(null!==(n="xmlns"===o?"xmlns":120===o.charCodeAt(0)&&"xmlns:"===o.substr(0,6)?o.substr(6):null)){if(e=ci(i),t=fi(n),!(r=h[e])){if("xmlns"===n||t in p&&p[t]!==e)do{r="ns"+j++}while(void 0!==p[r]);else r=n;h[e]=r}p[n]!==r&&(f||(f=Object.create(null)),D=null,g=null,hi(p,f,n,r),"xmlns"===n&&(hi(p,f,fi(r),e),l=r),hi(p,f,t,e)),v[o]=i;continue}u.push(o,i)}else null!==(o=z(o,l))&&(v[o]=i);else v[o]=i}if(b)for(d=0,y=u.length;d<y;d++)o=z(u[d++],l),i=u[d],null!==o&&(v[o]=i);return B=v}for(m=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=$;L>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>L);)r+=1,a=s;return-1==L?(o=s,n=e.substring($)):0===$?n=e.substring($,L):(o=L-a,n=-1==$?e.substring(L):e.substring(L,$+1)),{data:n,line:r,column:o}},d&&(T=Object.create({},{name:ui((function(){return A})),originalName:ui((function(){return M})),attrs:ui(H),ns:ui((function(){return g||(g=Object.assign(Object.create(null),p)),g}))}));-1!==$;){if(-1===(L=60===e.charCodeAt($)?$:e.indexOf("<",$)))return o?e.substring($):u.length?E("unexpected end of file"):y?void($<e.length&&e.substring($).trim()&&S(li)):E("missing start tag");if(y||(y=!0),$!==L)if(u.length){if(t&&(t(e.substring($,L),ci,m),w))return}else if(e.substring($,L).trim()&&(S(li),w))return;if(33===(C=e.charCodeAt(L+1))){if(91===(k=e.charCodeAt(L+2))&&"CDATA["===e.substr(L+3,6)){if(-1===($=e.indexOf("]]>",L)))return o?e.substring(L):E("unclosed cdata");if(r&&(r(e.substring(L+9,$),m),w))return;$+=3;continue}if(45===k&&45===e.charCodeAt(L+3)){if(-1===($=e.indexOf("--\x3e",L)))return o?e.substring(L):E("unclosed comment");if(a&&(a(e.substring(L+4,$),ci,m),w))return;$+=3;continue}}if(63!==C){for(v=L+1;;v++){if(R=e.charCodeAt(v),isNaN(R))return o?e.substring(L):($=-1,E("unclosed tag"));if(34===R)v=-1!==(k=e.indexOf('"',v+1))?k:v;else if(39===R)v=-1!==(k=e.indexOf("'",v+1))?k:v;else if(62===R){$=v;break}}if(33!==C){if(B={},47===C){if(O=!1,N=!0,!u.length)return E("missing open tag");if(v=A=u.pop(),k=L+2+v.length,e.substring(L+2,k)!==v)return E("closing tag mismatch");for(;k<$;k++)if(!(32===(C=e.charCodeAt(k))||C>8&&C<14))return E("close tag")}else{if(47===e.charCodeAt($-1)?(v=A=e.substring(L+1,$-1),O=!0,N=!0):(v=A=e.substring(L+1,$),O=!0,N=!1),!(C>96&&C<123||C>64&&C<91||95===C||58===C))return E("illegal first char nodeName");for(k=1,x=v.length;k<x;k++)if(!((C=v.charCodeAt(k))>96&&C<123||C>64&&C<91||C>47&&C<59||45===C||95===C||46==C)){if(32===C||C<14&&C>8){A=v.substring(0,k),B=null;break}return E("invalid nodeName")}N||u.push(A)}if(_){O&&(f=null,null===B&&(b=-1!==v.indexOf("xmlns",k))&&(F=k,I=v,H(),b=!1),N||l.push(f)),M=A,null===D&&(D=Object.create(null));var V=D[A];if(void 0!==V)A=V;else{if(-1!==(C=A.indexOf(":"))){if(!(P=p[A.substring(0,C)]))return E("missing namespace on <"+M+">");A=A.substr(C+1)}else P=p.xmlns;P&&(A=P+":"+A),D[M]=A}}if(O&&(F=k,I=v,n&&(d?n(T,ci,N,m):n(A,H,ci,N,m),w)))return;if(N){if(i&&(i(d?T:A,ci,O,m),w))return;_&&(O||(f=l.pop()),f&&(di(p,f),f=null,D=null,g=null))}$+=1}else{if(c&&(c(e.substring(L,$+1),ci,m),w))return;$+=1}}else{if(-1===($=e.indexOf("?>",L)))return o?e.substring(L):E("unclosed question");if(s&&(s(e.substring(L,$+2),m),w))return;$+=2}}}this.on=function(e,l){if("function"!=typeof l)throw pi("required args <name, cb>");switch(e){case"openTag":n=l;break;case"text":t=l;break;case"closeTag":i=l;break;case"error":f=l;break;case"warn":o=l;break;case"cdata":r=l;break;case"attention":c=l;break;case"question":s=l;break;case"comment":a=l;break;default:throw pi("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw pi("required args <nsMap={}>");var t,n=Object.create(null);for(t in e)n[t]=e[t];return _=!0,h=n,this},this.parse=function(e){if("string"!=typeof e)throw pi("required args <xml=string>");if(g)throw pi("parse during stream; call end() first");return k(),C(e),m=mi,w=!1,x},this.write=function(e){if("string"!=typeof e)throw pi("required args <xml=string>");return g||(k(),g=!0),x||(v=C(v+e,!0)||""),this},this.end=function(){return g||k(),g=!1,x||C(v),v="",m=mi,w=!1,x},this.stop=function(){w=!0}}function vi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var bi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},_i="property";function xi(e){return e.xml&&e.xml.serialize}function wi(e,t){return vi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ei(e){return new Error(e)}function Si(e){return e.$descriptor}function ki(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Ei("expected element");var t,n=this.elementsById,i=Si(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Ei("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Ci(){}function Ri(){}function Pi(){}function Ai(e,t){this.property=e,this.context=t}function Mi(e,t){this.element=t,this.propertyDesc=e}function Ti(){}function Bi(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Di(e,t,n){Bi.call(this,e,t,n)}function ji(e,t,n){this.model=e,this.context=n}function Oi(e){e instanceof ni&&(e={model:e}),z(this,{lax:!1},e)}Ci.prototype.handleEnd=function(){},Ci.prototype.handleText=function(){},Ci.prototype.handleNode=function(){},Ri.prototype=Object.create(Ci.prototype),Ri.prototype.handleNode=function(){return this},Pi.prototype=Object.create(Ci.prototype),Pi.prototype.handleText=function(e){this.body=(this.body||"")+e},Ai.prototype=Object.create(Pi.prototype),Ai.prototype.handleNode=function(e){if(this.element)throw Ei("expected no sub nodes");return this.element=this.createReference(e),this},Ai.prototype.handleEnd=function(){this.element.id=this.body},Ai.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Mi.prototype=Object.create(Pi.prototype),Mi.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Un(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Ti.prototype=Object.create(Pi.prototype),Ti.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},Bi.prototype=Object.create(Ti.prototype),Bi.prototype.addReference=function(e){this.context.addReference(e)},Bi.prototype.handleText=function(e){if(!Si(this.element).bodyProperty)throw Ei("unexpected body text <"+e+">");Pi.prototype.handleText.call(this,e)},Bi.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Si(t).bodyProperty;n&&void 0!==e&&(e=Un(n.type,e),t.set(n.name,e))},Bi.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Si(i),o=this.context,a=new i({}),s=this.model;return w(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?w(e.split(" "),(function(e){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=Un(i.type,e):"xmlns"===n?n=":"+n:(t=Yn(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},Bi.prototype.getPropertyForNode=function(e){var t=Yn(e.name),n=this.type,i=this.model,r=Si(n),o=t.name,a=r.propertiesByName[o];if(a&&!a.isAttr){const t=function(e){const t=xi(e);return t!==_i&&(t||null)}(a);if(t){const n=e.attributes[t];if(n){const t=function(e,t,n){const i=Yn(e,t.xmlns),r=Yn(`${t[i.prefix]||i.prefix}:${i.localName}`);return function(e,t){var n=e.name,i=e.localName,r=t&&t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(r,n.getPackage(r.prefix))}(n,e.ns,i);return z({},a,{effectiveType:Si(i.getType(t)).name})}}return a}var s=i.getPackage(t.prefix);if(s){const e=wi(t,s),n=i.getType(e);if(a=b(r.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),a)return z({},a,{effectiveType:Si(n).name})}else if(a=b(r.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),a)return a;throw Ei("unrecognized element <"+t.name+">")},Bi.prototype.toString=function(){return"ElementDescriptor["+Si(this.type).name+"]"},Bi.prototype.valueHandler=function(e,t){return new Mi(e,t)},Bi.prototype.referenceHandler=function(e){return new Ai(e,this.context)},Bi.prototype.handler=function(e){return"Element"===e?new ji(this.model,e,this.context):new Bi(this.model,e,this.context)},Bi.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Kn(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Di.prototype=Object.create(Bi.prototype),Di.prototype.createElement=function(e){var t=e.name,n=Yn(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&wi(n,o)||t;if(!r.hasType(a))throw Ei("unexpected element <"+e.originalName+">");return Bi.prototype.createElement.call(this,e)},ji.prototype=Object.create(Ti.prototype),ji.prototype.createElement=function(e){var t=e.name,n=Yn(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},ji.prototype.handleChild=function(e){var t=new ji(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},ji.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Oi.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Bi?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new ki(z({},t,{rootHandler:i})),s=new yi({proxy:!0}),c=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function l(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var c="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:c,error:e}),!0;throw Ei(c)}function p(e,t){return l(e,t,!0)}i.context=a,c.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function f(e,t){try{c.peek().handleText(e)}catch(e){p(e,t)}}var m=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),Object.entries(bi).reduce((function(e,[t,n]){return e[n]=t,e}),r.config&&r.config.nsMap||{}));return s.ns(m).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=c.peek();try{c.push(n.handleNode(e))}catch(e){l(e,t,o)&&c.push(new Ri)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!d.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){c.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",l).on("warn",p),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=Si(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var c=r.get(s.name),l=c.indexOf(t);-1===l&&(l=c.length),o?c[l]=o:c.splice(l,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=Ei("failed to parse document as <"+i.type.$descriptor.name+">"));var c=a.warnings,l=a.references,p=a.elementsById;return r?(r.warnings=c,n(r)):t({rootElement:o,elementsById:p,references:l,warnings:c})}))},Oi.prototype.handler=function(e){return new Di(this.model,e)};var Ni=/<|>|'|"|&|\n\r|\n/g,Li=/<|>|&/g;function $i(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function Ii(e,t){return vi(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Fi(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function zi(e){return y(e)?e:(e.prefix?e.prefix+":":"")+e.localName}$i.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},$i.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},$i.prototype.resolve=function(e){for(var t=this;t;){var n=e(t);if(n)return n;t=t.parent}},$i.prototype.eachScope=function(e){for(var t=this;t;)e(t),t=t.parent},$i.prototype.byUri=function(e){return this.resolve((function(t){return t.uriMap[e]}))},$i.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)},$i.prototype.uriByPrefix=function(e){var t=e||"xmlns";return this.resolve((function(e){return e.prefixMap[t]}))},$i.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},$i.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},$i.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.eachScope((function(e){e.used[n]=e.byUri(t)}))},$i.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter((e=>{var t=this.getNSKey(e);return this.used[t]}))};var Hi={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Vi={"<":"lt",">":"gt","&":"amp"};function Gi(e,t,n){return(e=y(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Wi(e){this.tagName=e}function Ui(){}function qi(e){this.tagName=e}function Ki(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Yi(e,t,n){Ki.call(this,e,t),this.serialization=n}function Xi(){this.value="",this.write=function(e){this.value+=e}}function Zi(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 Qi(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Xi,r=new Zi(i,e.format);e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n');var o=new Ki,a=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){const t=e.config&&e.config.nsMap||{},n={};for(const e in bi)n[e]=bi[e];for(const e in t){n[t[e]]=e}for(const t of e.getPackages())n[t.prefix]=t.uri;return n}(a)),o.build(t).serializeTo(r),!n)return i.value}}}function Ji(e,t){ni.call(this,e,t)}Wi.prototype.build=function(e){return this.element=e,this},Wi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Ui.prototype.serializeValue=Ui.prototype.serializeTo=function(e){e.append(this.escape?Gi(this.value,Li,Vi):this.value)},Ui.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Li)&&(this.escape=!0),this},Fi(qi,Ui),qi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Ki.prototype.build=function(e){return function(e,t){var n=[{serializer:e,children:e.enter(t),index:0}];for(;n.length;){var i=n[n.length-1];if(i.index>=i.children.length)i.serializer.exit(),n.pop();else{var r=i.children[i.index++],o=r.create();i.serializer.body.push(o),r.element&&n.push({serializer:o,children:o.enter(r.element),index:0})}}}(this,e),this},Ki.prototype.enter=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,i=t.isGeneric;if(this.otherAttrs=i?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=n?this.nsPropertyTagName(n):this.nsTagName(t),this.tagName=this.addTagName(this.ns),i)return this.collectGenericContainments(e);var r=function(e){return x(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!v(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e);return this.parseAttributes(x(r,(function(e){return e.isAttr}))),this.collectContainments(function(e){return x(e,(function(e){return!e.isAttr}))}(r))},Ki.prototype.exit=function(){this.parseGenericAttributes(this.element,this.otherAttrs)},Ki.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?z({localName:t.ns.localName},e):z({localName:Ii(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Ki.prototype.nsPropertyTagName=function(e){return function(e,t){return z({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Ki.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ki.prototype.nsAttributeName=function(e){var t;if(t=y(e)?Yn(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},Ki.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})))},Ki.prototype.collectGenericContainments=function(e){var t=this,n=[],i=e.$body;i&&n.push({create:function(){return(new Ui).build({type:"String"},i)}});var r=e.$children;return r&&w(r,(function(e){n.push({create:function(){return new Ki(t)},element:e})})),n},Ki.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Yn(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Ki.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=[];return w(n,(function(n,r){var o=t.parseNsAttribute(e,r,n);o&&i.push(o)})),i},Ki.prototype.parseGenericAttributes=function(e,t){var n=this;w(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)}}))},Ki.prototype.collectContainments=function(e){var t=this,n=this.element,i=[];return w(e,(function(e){var r=n.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)i.push({create:function(){return(new Ui).build(e,r[0])}});else if(Kn(e.type))w(r,(function(n){i.push({create:function(){return new qi(t.addTagName(t.nsPropertyTagName(e))).build(e,n)}})}));else if(o)w(r,(function(n){i.push({create:function(){return new Wi(t.addTagName(t.nsPropertyTagName(e))).build(n)}})}));else{var a=xi(e);w(r,(function(n){i.push({create:function(){return a?a===_i?new Ki(t,e):new Yi(t,e,a):new Ki(t)},element:n})}))}})),i},Ki.prototype.getNamespaces=function(e){var t=this.namespaces;if(!t){var n=this.getParentNamespaces();e||!n?this.namespaces=t=new $i(n):t=n}return t},Ki.prototype.getParentNamespaces=function(){if(void 0!==this.parentNamespaces)return this.parentNamespaces;for(var e=null,t=this.parent;t;){if(t.namespaces){e=t.namespaces;break}if(void 0!==t.parentNamespaces){e=t.parentNamespaces;break}t=t.parent}return this.parentNamespaces=e},Ki.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Ki.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.getNamespaces(t),a=e.prefix,s=e.uri;if(!a&&!s)return{localName:e.localName};if(r=o.defaultUriByPrefix(a),!(s=s||r||o.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if((e=o.byUri(s))||a||(e=this.logNamespace({uri:s},r===s,!0)),!e){for(n=a,i=1;o.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:s},r===s)}return a&&o.mapPrefix(a,s),e},Ki.prototype.parseAttributes=function(e){var t=this,n=this.element;w(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];w(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Ki.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),zi(e)},Ki.prototype.addAttribute=function(e,t){var n=this.attrs;y(t)&&(t=Gi(t,Ni,Hi));var i=_(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Ki.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)),w(t,(function(t){e.append(" ").append(zi(t.name)).append('="').append(t.value).append('"')}))},Ki.prototype.serializeTo=function(e){!function(e,t){var n=[{serializer:e,index:0,opened:!1,indent:!1}];for(;n.length;){var i=n[n.length-1],r=i.serializer;if(!i.opened){var o=r.body[0];if(i.indent=o&&o.constructor!==Ui,t.appendIndent().append("<"+r.tagName),r.serializeAttributes(t),t.append(o?">":" />"),i.opened=!0,!o){t.appendNewLine(),n.pop();continue}i.indent&&t.appendNewLine().indent()}if(i.index<r.body.length){var a=r.body[i.index++];a instanceof Ki?n.push({serializer:a,index:0,opened:!1,indent:!1}):a.serializeTo(t)}else i.indent&&t.unindent().appendIndent(),t.append("</"+r.tagName+">").appendNewLine(),n.pop()}}(this,e)},Fi(Yi,Ki),Yi.prototype.parseNsAttributes=function(e){var t=Ki.prototype.parseNsAttributes.call(this,e).filter((e=>e.name!==this.serialization)),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Yi.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Ji.prototype=Object.create(ni.prototype),Ji.prototype.fromXML=function(e,t,n){y(t)||(n=t,t="bpmn:Definitions");var i=new Oi(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Ji.prototype.toXML=function(e,t){var n=new Qi(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};const er={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",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 tr(e,t){return new Ji(z({},er,e),t)}function nr(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function ir(e,t){return e.$instanceOf(t)}function rr(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function a(t,n){try{var r=i[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${nr(t)}`);return e.element(t,i[t.id],n)}(t,n);return o(t),r}catch(e){s(e.message,{element:t,error:e}),console.error(`failed to import ${nr(t)}`,e)}}function s(t,n){e.error(t,n)}var c=this.registerDi=function(e){var t=e.bpmnElement;t?i[t.id]?s(`multiple DI elements defined for ${nr(t)}`,{element:t}):i[t.id]=e:s(`no bpmnElement referenced in ${nr(e)}`,{element:e})};function l(e){var t;t=e.plane,c(t),w(t.planeElement,p)}function p(e){c(e)}this.handleDefinitions=function(o,a){var p=o.diagrams;if(a&&-1===p.indexOf(a))throw new Error("diagram not part of <bpmn:Definitions />");if(!a&&p&&p.length&&(a=p[0]),!a)throw new Error("no diagram to display");i={},l(a);var f=a.plane;if(!f)throw new Error(`no plane for ${nr(a)}`);var m=f.bpmnElement;if(!m){if(m=function(e){return b(e.rootElements,(function(e){return ir(e,"bpmn:Process")||ir(e,"bpmn:Collaboration")}))}(o),!m)throw new Error("no process or collaboration to display");s(`correcting missing bpmnElement on ${nr(f)} to ${nr(m)}`),f.bpmnElement=m,c(f)}var g,y,_=function(t,n){return e.root(t,i[t.id],n)}(m,f);if(ir(m,"bpmn:Process")||ir(m,"bpmn:SubProcess"))h(m,_);else{if(!ir(m,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${nr(f)}: ${nr(m)}`);y=_,w((g=m).participants,r(A,y)),n.push((function(){!function(e,t){w(e,r(d,t))}(g.messageFlows,y)})),v(g.artifacts,y),function(e,n){var i=x(e,(function(e){return!t[e.id]&&ir(e,"bpmn:Process")&&e.laneSets}));i.forEach(r(h,n))}(o.rootElements,_)}u(n)};var u=this.handleDeferred=function(){for(;n.length;)n.shift()()};function h(e,t){P(e,t),_(e.ioSpecification,t),v(e.artifacts,t),o(e)}function d(e,t){a(e,t)}function f(e,t){a(e,t)}function m(e,t){a(e,t)}function g(e,t){a(e,t)}function y(e,t){a(e,t)}function v(e,t){w(e,(function(e){ir(e,"bpmn:Association")?n.push((function(){y(e,t)})):y(e,t)}))}function _(e,t){e&&(w(e.dataInputs,r(m,t)),w(e.dataOutputs,r(g,t)))}var E=this.handleSubProcess=function(e,t){P(e,t),v(e.artifacts,t)};function S(e,t){var i=a(e,t);ir(e,"bpmn:SubProcess")&&E(e,i||t),ir(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){w(e.dataInputAssociations,r(f,t)),w(e.dataOutputAssociations,r(f,t))}))}function k(e,t){a(e,t)}function C(e,t){n.push((function(){var n=a(e,t);e.childLaneSet&&R(e.childLaneSet,n||t),function(e){w(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function R(e,t){w(e.lanes,r(C,t))}function P(e,t){!function(e,t){w(e,(function(e){ir(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){a(e,t)}(e,t)})):ir(e,"bpmn:BoundaryEvent")?n.unshift((function(){S(e,t)})):ir(e,"bpmn:FlowNode")?S(e,t):ir(e,"bpmn:DataObject")||(ir(e,"bpmn:DataStoreReference")||ir(e,"bpmn:DataObjectReference")?k(e,t):s(`unrecognized flowElement ${nr(e)} in context ${nr(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){w(e,r(R,t))}(e.laneSets,t)}function A(e,t){var n=a(e,t),i=e.processRef;i&&h(i,n||t)}}function or(e,t){var n=sr(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function ar(e,t){return C(t,(function(t){return or(e,t)}))}function sr(e){return e&&e.businessObject||e}function cr(e){return e&&e.di}function lr(e,t,n){var i,r,o,a=[];function s(e,t){var n=new rr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){a.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t||!t.plane)return;var n,i=t.plane.bpmnElement,r=i;or(i,"bpmn:Process")||or(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(or(t,"bpmn:Process"))return t;t=t.$parent}}
8
8
  /**
9
9
  * This file must not be changed or exchanged.
10
10
  *