@jylups/flowable-bpmn-js 0.0.0-stage → 0.1.0-next.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.
- package/LICENSE +21 -0
- package/README.md +286 -2
- package/assets/flowable-bpmn-js-touch.css +76 -0
- package/assets/flowable-bpmn-js.css +70 -0
- package/dist/assets/bpmn-font/css/bpmn-codes.css +110 -0
- package/dist/assets/bpmn-font/css/bpmn-embedded.css +168 -0
- package/dist/assets/bpmn-font/css/bpmn.css +166 -0
- package/dist/assets/bpmn-font/font/bpmn.eot +0 -0
- package/dist/assets/bpmn-font/font/bpmn.svg +228 -0
- package/dist/assets/bpmn-font/font/bpmn.ttf +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff2 +0 -0
- package/dist/assets/bpmn-js-bpmnlint.css +263 -0
- package/dist/assets/bpmn-js.css +151 -0
- package/dist/assets/diagram-js.css +1325 -0
- package/dist/assets/flowable-bpmn-js-touch.css +76 -0
- package/dist/assets/flowable-bpmn-js.css +70 -0
- package/dist/assets/properties-panel.css +1905 -0
- package/dist/flowable-bpmn-modeler.development.js +128087 -0
- package/dist/flowable-bpmn-modeler.development.js.map +1 -0
- package/dist/flowable-bpmn-modeler.production.min.js +348 -0
- package/dist/flowable-bpmn-navigated-viewer.development.js +28092 -0
- package/dist/flowable-bpmn-navigated-viewer.development.js.map +1 -0
- package/dist/flowable-bpmn-navigated-viewer.production.min.js +2 -0
- package/dist/flowable-bpmn-viewer.development.js +26751 -0
- package/dist/flowable-bpmn-viewer.development.js.map +1 -0
- package/dist/flowable-bpmn-viewer.production.min.js +2 -0
- package/index.d.ts +107 -0
- package/index.js +32 -0
- package/lib/Modeler.js +68 -0
- package/lib/NavigatedViewer.js +30 -0
- package/lib/NewDiagram.js +69 -0
- package/lib/Theme.js +32 -0
- package/lib/Viewer.js +32 -0
- package/lib/distro/Modeler.js +5 -0
- package/lib/distro/NavigatedViewer.js +5 -0
- package/lib/distro/Viewer.js +5 -0
- package/lib/draw/TypedTaskRenderer.js +81 -0
- package/lib/draw/index.js +10 -0
- package/lib/features/touch/InputTracker.js +34 -0
- package/lib/features/touch/LICENSE +21 -0
- package/lib/features/touch/TouchContextPad.js +197 -0
- package/lib/features/touch/TouchInteraction.js +1276 -0
- package/lib/features/touch/TouchLabelEditing.js +60 -0
- package/lib/features/touch/index.js +40 -0
- package/lib/features/typed-tasks/ReplaceWithTypedTaskHandler.js +63 -0
- package/lib/features/typed-tasks/TypedTaskPaletteProvider.js +76 -0
- package/lib/features/typed-tasks/TypedTaskReplaceMenuProvider.js +71 -0
- package/lib/features/typed-tasks/TypedTasks.js +127 -0
- package/lib/features/typed-tasks/icons.js +99 -0
- package/lib/features/typed-tasks/index.js +17 -0
- package/lib/lint/FlowableLinting.js +23 -0
- package/lib/lint/index.js +44 -0
- package/lib/lint/module.js +15 -0
- package/lib/lint/rules/called-element.js +19 -0
- package/lib/lint/rules/service-task-implementation.js +81 -0
- package/lib/lint/rules/valid-durations.js +102 -0
- package/lib/lint/values.js +71 -0
- package/lib/xml/FlowableXML.js +50 -0
- package/lib/xml/index.js +6 -0
- package/package.json +80 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @jylups/flowable-bpmn-js 0.1.0-next.0 | MIT | bpmn-js (c) Camunda Services GmbH, bpmn.io license; keep the bpmn.io watermark visible */
|
|
2
|
+
var FlowableBpmnJS=function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}const t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function r(e){return void 0===e}function i(e){return void 0!==e}function o(e){return null==e}function a(e){return"[object Array]"===t.call(e)}function s(e){return"[object Object]"===t.call(e)}function l(e){return"[object Number]"===t.call(e)}function p(e){const n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function c(e){return"[object String]"===t.call(e)}function u(e,t){return!o(e)&&n.call(e,t)}function m(e,t){const n=b(t);let r;return f(e,function(e,t){if(n(e,t))return r=e,!1}),r}function h(e,t){const n=b(t);let r=[];return f(e,function(e,t){n(e,t)&&r.push(e)}),r}function f(e,t){let n,i;if(r(e))return;const o=a(e)?E:x;for(let r in e)if(u(e,r)&&(n=e[r],i=t(n,o(r)),!1===i))return n}function d(e,t,n){return f(e,function(e,r){n=t(n,e,r)}),n}function y(e,t){return!!d(e,function(e,n,r){return e&&t(n,r)},!0)}function g(e,t){return!!m(e,t)}function v(e){return function(t){return y(e,function(e,n){return t[n]===e})}}function b(e){return p(e)?e:t=>t===e}function x(e){return e}function E(e){return Number(e)}function w(e,t){let n,r,i,o;function a(n){let a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(i,r),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=r=i=void 0}function p(...e){o=Date.now(),r=e,i=this,n||s(t)}return p.flush=function(){n&&a(!0),l()},p.cancel=l,p}function _(e,t){return e.bind(t)}function A(e,...t){return Object.assign(e,...t)}function S(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,function(e,t){var r=e.type,i=t.element,o=t.gfx,a=t.attrs;if(n.canRender(i))return"render.shape"===r?n.drawShape(o,i,a):n.drawConnection(o,i,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 k(e,t){var n=C(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function C(e){return e&&e.businessObject||e}function R(e){return e&&e.di}function M(e,t){return!k(e,"bpmn:CallActivity")&&(k(e,"bpmn:SubProcess")?!(!(t=t||R(e))||!k(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!k(e,"bpmn:Participant")||!!C(e).processRef)}function P(e){if(k(e,"bpmn:Participant")||k(e,"bpmn:Lane")){var t=R(e).isHorizontal;return void 0===t||t}}S.prototype.canRender=function(e){},S.prototype.drawShape=function(e,t){},S.prototype.drawConnection=function(e,t){},S.prototype.getShapePath=function(e){},S.prototype.getConnectionPath=function(e){};var T={width:90,height:20};function B(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=function(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}}(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o)<Math.PI/2?s-=15:a+=15,{x:a,y:s}}function N(e,t){var n,r,i,o=e.label;return o&&o.bounds?(r={width:(i=o.bounds).width,height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=function(e){return e.waypoints?B(e.waypoints):k(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+T.height/2}:{x:e.x+e.width/2,y:e.y+e.height+T.height/2}}(t),r=T),A({x:n.x-r.width/2,y:n.y-r.height/2},r)}function D(e){var t=e.businessObject,n=function(e){return k(e,"bpmn:FlowElement")||k(e,"bpmn:Participant")||k(e,"bpmn:Lane")||k(e,"bpmn:SequenceFlow")||k(e,"bpmn:MessageFlow")||k(e,"bpmn:DataInput")||k(e,"bpmn:DataOutput")?"name":k(e,"bpmn:TextAnnotation")?"text":k(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function O(e,t){var n,r,i,o;return t=!!t,a(e)||(e=[e]),f(e,function(e){var a=e;e.waypoints&&!t&&(a=O(e.waypoints,!0));var s=a.x,l=a.y,p=a.height||0,c=a.width||0;(s<n||void 0===n)&&(n=s),(l<r||void 0===r)&&(r=l),(s+c>i||void 0===i)&&(i=s+c),(l+p>o||void 0===o)&&(o=l+p)}),{x:n,y:r,height:o-r,width:i-n}}function I(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function L(e){return!(!e||!e.isFrame)}function F(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 j={"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 V(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=j[r];i?(2===i&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function $(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return j[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);V(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)V(e,r,t[r])}(e,t);return e}const W=Object.prototype.toString;function z(e){return new G(e)}function G(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}G.prototype.add=function(e){return this.list.add(e),this},G.prototype.remove=function(e){return"[object RegExp]"==W.call(e)?this.removeMatching(e):(this.list.remove(e),this)},G.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},G.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},G.prototype.array=function(){return Array.from(this.list)},G.prototype.has=G.prototype.contains=function(e){return this.list.contains(e)};var H="http://www.w3.org/2000/svg",K='<svg xmlns="'+H+'"';function U(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(H)&&(e=K+e.substring(4)):(e=K+">"+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 r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function q(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=U(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(H,e),t&&$(n,t),n}var Y=null;function X(){return null===Y&&(Y=q("svg")),Y}function Z(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function J(e){return X().createSVGTransform()}var Q=/([&<>]{1})/g,ee=/([&<>\n\r"]{1})/g,te={"&":"&","<":"<",">":">",'"':"'"};function ne(e,t){return e.replace(t,function(e,t){return te[t]||t})}function re(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(ne(e.textContent,Q));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',ne(o.value,ee),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(a=e.childNodes).length;n<r;++n)re(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",ne(e.nodeValue,Q),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ie(e,t){return function(e){for(var t=e.firstChild,n=[];t;)re(t,n),t=t.nextSibling;return n.join("")}(e)}function oe(e){var t=e.parentNode;return t&&t.removeChild(e),e}function ae(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function se(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(ae(e,r))}(n,t)),n.consolidate()}function le(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function pe(e){return["L",e.x,e.y]}function ce(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function ue(e,t){const n=e.length,r=[(i=e[0],["M",i.x,i.y])];var i;for(let i=1;i<n;i++){const n=e[i-1],o=e[i],a=e[i+1];if(!a||!t){r.push(pe(o));continue}const s=Math.min(t,he(o.x-n.x,o.y-n.y),he(a.x-o.x,a.y-o.y));if(!s){r.push(pe(o));continue}const l=me(o,n,s),p=me(o,n,.5*s),c=me(o,a,s),u=me(o,a,.5*s);r.push(pe(l)),r.push(ce(p,u,c))}return r}function me(e,t,n){const r=t.x-e.x,i=t.y-e.y,o=n/he(r,i);return{x:e.x+r*o,y:e.y+i*o}}function he(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function fe(e,t,n){l(t)&&(n=t,t=null),t||(t={});const r=q("path",t);return l(n)&&(r.dataset.cornerRadius=String(n)),de(r,e)}function de(e,t){return $(e,{d:le(ue(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}var ye="hsl(225, 10%, 15%)";function ge(e,t){return g(e.eventDefinitions,function(e){return e.$type===t})}function ve(e,t,n){var r=R(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||"white"}function be(e,t,n){var r=R(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||ye}function xe(e,t,n,r){var i=R(e).get("label");return r||i&&i.get("color:color")||t||be(e,n)}function Ee(e,t){var n=e.x,r=e.y,i=e.width,o=e.height;return le([["M",n+t,r],["l",i-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-i,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}function we(e,t={}){return{width:_e(e,t),height:Ae(e,t)}}function _e(e,t={}){return u(t,"width")?t.width:e.width}function Ae(e,t={}){return u(t,"height")?t.height:e.height}const Se={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};function ke(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 r=/<([\w:]+)/.exec(e)?.[1];if(!r)return t.createTextNode(e);if(e=e.trim(),"body"===r){const n=t.createElement("html");n.innerHTML=e;const{lastChild:r}=n;return r.remove(),r}let[i,o,a]=Object.hasOwn(Se,r)?Se[r]:Se._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){const{firstChild:e}=s;return e.remove(),e}const l=t.createDocumentFragment();return l.append(...s.childNodes),l}function Ce(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function Re(e,...t){const n=e.style;return f(t,function(e){e&&f(e,function(e,t){n[t]=e})}),e}function Me(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}Se.td=Se.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Se.option=Se.optgroup=[1,'<select multiple="multiple">',"</select>"],Se.thead=Se.tbody=Se.colgroup=Se.caption=Se.tfoot=[1,"<table>","</table>"],Se.polyline=Se.ellipse=Se.polygon=Se.circle=Se.text=Se.line=Se.path=Se.rect=Se.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];const Pe=Object.prototype.toString;function Te(e){return new Be(e)}function Be(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ne(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function De(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Be.prototype.add=function(e){return this.list.add(e),this},Be.prototype.remove=function(e){return"[object RegExp]"==Pe.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Be.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},Be.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Be.prototype.array=function(){return Array.from(this.list)},Be.prototype.has=Be.prototype.contains=function(e){return this.list.contains(e)};var Oe,Ie={};var Le=function(){if(Oe)return Ie;var e,t,n;function r(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n="addEventListener"!==e?"on":""}return Oe=1,Ie.bind=function(t,i,o,a){return e||r(),t[e](n+i,o,a||!1),o},Ie.unbind=function(e,i,o,a){return t||r(),e[t](n+i,o,a||!1),o},Ie}(),Fe=Ce({__proto__:null,default:De(Le)},[Le]),je=["focus","blur"];var Ve={bind:function(e,t,n,r,i){return-1!==je.indexOf(n)&&(i=!0),Fe.bind(e,n,function(n){var i=n.target||n.srcElement;n.delegateTarget=function(e,t,n){var r=n?e:e.parentNode;return r&&"function"==typeof r.closest&&r.closest(t)||null}(i,t,!0),n.delegateTarget&&r.call(e,n)},i)},unbind:function(e,t,n,r){return-1!==je.indexOf(t)&&(r=!0),Fe.unbind(e,t,n,r)}};function $e(e,t){return(t=t||document).querySelector(e)}function We(e){e.parentNode&&e.parentNode.removeChild(e)}function ze(e,t,n,r,i){var o=J();o.setTranslate(t,n);var a=J();a.setRotate(r||0,0,0);var s=J();s.setScale(1,1),se(e,[o,a,s])}function Ge(e,t,n){var r=J();r.setTranslate(t,n),se(e,r)}function He(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ke,Ue={exports:{}};var qe=function(){if(Ke)return Ue.exports;Ke=1;var e=Ue.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;var o=r-Math.floor(r),a="";for(i=0;i<Math.floor(r);i++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(i){var a=0;do{if(a++>10){if(!r)throw new Error("too many ID collisions, use more bits");t+=r}var s=e(t,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=i,s},o=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=t||128,i.base=n||16,i},Ue.exports}(),Ye=He(qe);function Xe(e){if(!(this instanceof Xe))return new Xe(e);e=e||[128,36,1],this._seed=e.length?Ye.rack(e[0],e[1],e[2]):e}Xe.prototype.next=function(e){return this._seed(e||!0)},Xe.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},Xe.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Xe.prototype.assigned=function(e){return this._seed.get(e)||!1},Xe.prototype.unclaim=function(e){delete this._seed.hats[e]},Xe.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Ze=new Xe,Je=.95;function Qe(e,t,n,r,i,o,a){S.call(this,t,a);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor;function u(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ye,strokeWidth:2,fill:"white"})}function m(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ye,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:r=1,element:o,parentGfx:a=i._svg}=t,s=q("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*r,markerHeight:20*r,orient:"auto"});F(s,o);var l=$e(":scope > defs",a);l||F(a,l=q("defs")),F(l,s)}function d(e,t,n,r){var i=Ze.nextPrefixed("marker-");return function(e,t,n,r,i){if("sequenceflow-end"===n){h(t,{element:q("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){h(t,{element:q("circle",{cx:6,cy:6,r:3.5,...u({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){h(t,{element:q("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){h(t,{element:q("path",{d:"M 11 5 L 1 10 L 11 15",...m({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){h(t,{element:q("path",{d:"M 1 5 L 11 10 L 1 15",...m({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){h(t,{element:q("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:r,stroke:i})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){h(t,{element:q("path",{d:"M 6 4 L 10 16",...u({stroke:i,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,i,t,n,r),"url(#"+i+")"}function y(e,t,n,r,i={}){s(r)&&(i=r,r=0),r=r||0,i=u(i);var o=q("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-r),...i});return F(e,o),o}function g(e,t,n,r,i,o){s(i)&&(o=i,i=0),i=i||0,o=u(o);var a=q("rect",{x:i,y:i,width:t-2*i,height:n-2*i,rx:r,ry:r,...o});return F(e,a),a}function v(e,t,n,r){var i=fe(t,n=m(n),r);return F(e,i),i}function b(e,t,n){return v(e,t,n,5)}function x(e,t,n){n=m(n);var r=q("path",{...n,d:t});return F(e,r),r}function E(e,t,n,r){return x(t,n,A({"data-marker":e},r))}function w(e){return ue[e]}function _(e){return function(t,n,r){return w(e)(t,n,r)}}var T=function(e,t,n={},i){return x(e,r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:i?be(t,p,n.stroke):ve(t,l,n.fill),stroke:i?ve(t,l,n.fill):be(t,p,n.stroke),strokeWidth:1})},B=function(e,t,n={}){var i=n.width||t.width,o=n.height||t.height,a=n.width?1:2,s=y(e,i,o,.2*o,{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:a});x(e,r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:i,containerHeight:o,position:{mx:.5,my:.5}}),{stroke:be(t,p,n.stroke),strokeWidth:a});for(var c=0;c<12;c++){var u=i/2,m=o/2;x(e,r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:i,containerHeight:o,position:{mx:.5,my:.5}}),{strokeWidth:1,stroke:be(t,p,n.stroke),transform:"rotate("+30*c+","+m+","+u+")"})}return s},N=function(e,t,n={},i){return x(e,r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:i?be(t,p,n.stroke):ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1})},O=function(e,t,n={}){return x(e,r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1})},I=function(e,t,n={},i){return x(e,r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:i?be(t,p,n.stroke):ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1})},L=function(e,t,n={},i){return x(e,r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:i?be(t,p,n.stroke):ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1})},j=function(e,t,n={},i){var o=x(e,r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:i?be(t,p,n.stroke):"none",stroke:be(t,p,n.stroke),strokeWidth:1});return function(e,t){var n=J();n.setRotate(t,0,0),se(e,n)}(o,45),o},V=function(e,t,n={},i){return x(e,r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:i?be(t,p,n.stroke):ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1})},W=function(e,t,n={},i){return x(e,r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?be(t,p,n.stroke):ve(t,l,n.fill),stroke:be(t,p,n.stroke)})},G=function(e,t,n={},i){return x(e,r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:i?be(t,p,n.stroke):ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1})},H=function(e,t,n={}){return x(e,r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1})},K=function(e,t,n={}){return y(e,t.width,t.height,8,{fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke),strokeWidth:4})};function U(e,t,n={},r){var i=C(e),o=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(i),a=r||e;return i.get("eventDefinitions")&&i.get("eventDefinitions").length>1?i.get("parallelMultiple")?H(t,a,n):G(t,a,n,o):ge(i,"bpmn:MessageEventDefinition")?T(t,a,n,o):ge(i,"bpmn:TimerEventDefinition")?B(t,a,n):ge(i,"bpmn:ConditionalEventDefinition")?O(t,a,n):ge(i,"bpmn:SignalEventDefinition")?W(t,a,n,o):ge(i,"bpmn:EscalationEventDefinition")?N(t,a,n,o):ge(i,"bpmn:LinkEventDefinition")?I(t,a,n,o):ge(i,"bpmn:ErrorEventDefinition")?L(t,a,n,o):ge(i,"bpmn:CancelEventDefinition")?j(t,a,n,o):ge(i,"bpmn:CompensateEventDefinition")?V(t,a,n,o):ge(i,"bpmn:TerminateEventDefinition")?K(t,a,n):null}var Y={ParticipantMultiplicityMarker:function(e,t,n={}){var i=_e(t,n),o=Ae(t,n);E("participant-multiplicity",e,r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2-6)/i,my:(o-15)/o}}),{strokeWidth:2,fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke)})},SubProcessMarker:function(e,t,n={}){Ge(g(e,14,14,0,{strokeWidth:1,fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke)}),t.width/2-7.5,t.height-20),E("sub-process",e,r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke)})},ParallelMarker:function(e,t,n){var i=_e(t,n),o=Ae(t,n);E("parallel",e,r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.parallel)/i,my:(o-20)/o}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke)})},SequentialMarker:function(e,t,n){E("sequential",e,r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke)})},CompensationMarker:function(e,t,n){E("compensation",e,r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke)})},LoopMarker:function(e,t,n){var i=_e(t,n),o=Ae(t,n);E("loop",e,r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.loop)/i,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:be(t,p,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var i=_e(t,n),o=Ae(t,n);E("adhoc",e,r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:(i/2+n.adhoc)/i,my:(o-15)/o}}),{strokeWidth:1,fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke)})}};function X(e,t,n,r){Y[e](t,n,r)}function Z(e,t,n=[],r={}){r={fill:r.fill,stroke:r.stroke,width:_e(t,r),height:Ae(t,r)};var i=C(t),o=n.includes("SubProcessMarker");r=o?{...r,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...r,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},i.get("isForCompensation")&&n.push("CompensationMarker"),k(i,"bpmn:AdHocSubProcess")&&(n.push("AdhocMarker"),o||A(r,{compensation:r.compensation-18}));var a=i.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(A(r,{compensation:r.compensation-18}),n.includes("AdhocMarker")&&A(r,{seq:-23,loop:-18,parallel:-24}),void 0===s&&n.push("LoopMarker"),!1===s&&n.push("ParallelMarker"),!0===s&&n.push("SequentialMarker")),n.includes("CompensationMarker")&&1===n.length&&A(r,{compensation:-8}),f(n,function(n){X(n,e,t,r)})}function Q(e,t,n={}){n=A({size:{width:100}},n);var r=o.createText(t||"",n);return z(r).add("djs-label"),F(e,r),r}function ee(e,t,n,r={}){var i=C(t),o=we({x:t.x,y:t.y,width:t.width,height:t.height},r);return Q(e,i.name,{align:n,box:o,padding:7,style:{fill:xe(t,c,p,r.stroke)}})}function te(e,t,n,r={}){var i=P(n),o=Q(e,t,{box:{height:30,width:i?Ae(n,r):_e(n,r)},align:"center-middle",style:{fill:xe(n,c,p,r.stroke)}});i&&ze(o,0,-(-1*Ae(n,r)),270)}function ne(e,t,n={}){var{width:r,height:i}=we(t,n);return g(e,r,i,10,{...n,fill:ve(t,l,n.fill),fillOpacity:Je,stroke:be(t,p,n.stroke)})}function re(e,t,n={}){var r=C(t),i=ve(t,l,n.fill),o=be(t,p,n.stroke);return"One"!==r.get("associationDirection")&&"Both"!==r.get("associationDirection")||(n.markerEnd=d(e,"association-end",i,o)),"Both"===r.get("associationDirection")&&(n.markerStart=d(e,"association-start",i,o)),n=et(n,["markerStart","markerEnd"]),b(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function ie(e,t,n={}){var i=ve(t,l,n.fill),o=be(t,p,n.stroke),a=x(e,r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:i,fillOpacity:Je,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(C(t))&&x(e,r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:i,stroke:o});return a}function oe(e,t,n={}){return y(e,t.width,t.height,{fillOpacity:Je,...n,fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke)})}function ae(e,t,n={}){return function(e,t,n,r){var i=t/2,o=n/2,a=[{x:i,y:0},{x:t,y:o},{x:i,y:n},{x:0,y:o}].map(function(e){return e.x+","+e.y}).join(" ");r=u(r);var s=q("polygon",{...r,points:a});return F(e,s),s}(e,t.width,t.height,{fill:ve(t,l,n.fill),fillOpacity:Je,stroke:be(t,p,n.stroke)})}function le(e,t,n={}){var r=g(e,_e(t,n),Ae(t,n),0,{fill:ve(t,l,n.fill),fillOpacity:n.fillOpacity||Je,stroke:be(t,p,n.stroke),strokeWidth:1.5}),i=C(t);k(i,"bpmn:Lane")&&te(e,i.get("name"),t,n);return r}function pe(e,t,n={}){var r=ne(e,t,n),i=M(t);if(function(e){return e&&!!C(e).triggeredByEvent}(t)&&($(r,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!i)){var o=(C(t).flowElements||[]).filter(e=>k(e,"bpmn:StartEvent"));1===o.length&&function(e,t,n,r){var i=22,o={fill:ve(r,l,n.fill),stroke:be(r,p,n.stroke),width:i,height:i},a=C(e).isInterrupting,s=a?0:3,c=a?1:1.2,u=20,m=(i-u)/2,h="translate("+m+","+m+")";y(t,u,u,{fill:o.fill,stroke:o.stroke,strokeWidth:c,strokeDasharray:s,transform:h}),U(e,t,o,r)}(o[0],e,n,t)}return ee(e,t,i?"center-top":"center-middle",n),Z(e,t,i?void 0:["SubProcessMarker"],n),r}function ce(e,t,n={}){var r=ne(e,t,n);return ee(e,t,"center-middle",n),Z(e,t,void 0,n),r}var ue=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return pe(e,t,n=M(t)?et(n,["fill","stroke","width","height"]):et(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return re(e,t,n=et(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=et(n,["fill","stroke"]);var i=C(t).get("cancelActivity");n={strokeWidth:1.5,fill:ve(t,l,n.fill),fillOpacity:1,stroke:be(t,p,n.stroke)},i||(n.strokeDasharray="6");var o=oe(e,t,n);return y(e,t.width,t.height,3,{...n,fill:"none"}),r&&U(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var i=ce(e,t,n=et(n,["fill","stroke"]));return $(x(e,r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1}),$(x(e,r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke),strokeWidth:1}),i},"bpmn:CallActivity":function(e,t,n={}){return n=et(n,["fill","stroke"]),pe(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var i=ae(e,t,n=et(n,["fill","stroke"]));return x(e,r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke),strokeWidth:1}),i},"bpmn:DataInput":function(e,t,n={}){n=et(n,["fill","stroke"]);var i=r.getRawPath("DATA_ARROW"),o=ie(e,t,n);return x(e,i,{fill:"none",stroke:be(t,p,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=et(n,["fill","stroke"]),re(e,t,{...n,markerEnd:d(e,"association-end",ve(t,l,n.fill),be(t,p,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return ie(e,t,n=et(n,["fill","stroke"]))},"bpmn:DataObjectReference":_("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=et(n,["fill","stroke"]);var i=r.getRawPath("DATA_ARROW"),o=ie(e,t,n);return x(e,i,{strokeWidth:1,fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=et(n,["fill","stroke"]),re(e,t,{...n,markerEnd:d(e,"association-end",ve(t,l,n.fill),be(t,p,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=et(n,["fill","stroke"]),x(e,r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:ve(t,l,n.fill),fillOpacity:Je,stroke:be(t,p,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=et(n,["fill","stroke"]);var i=oe(e,t,{...n,strokeWidth:4});return r&&U(t,e,n),i},"bpmn:EventBasedGateway":function(e,t,n={}){n=et(n,["fill","stroke"]);var i=C(t),o=ae(e,t,n);y(e,t.width,t.height,.2*t.height,{fill:ve(t,"none",n.fill),stroke:be(t,p,n.stroke),strokeWidth:1});var a=i.get("eventGatewayType"),s=!!i.get("instantiate");if("Parallel"===a){var l=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});x(e,l,{fill:"none",stroke:be(t,p,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||y(e,t.width,t.height,.26*t.height,{fill:"none",stroke:be(t,p,n.stroke),strokeWidth:1}),function(){var i=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});x(e,i,{fill:"none",stroke:be(t,p,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var i=ae(e,t,n=et(n,["fill","stroke"])),o=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return R(t).get("isMarkerVisible")&&x(e,o,{fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke),strokeWidth:1}),i},"bpmn:Gateway":function(e,t,n={}){return ae(e,t,n=et(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=et(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:be(t,p,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:_e(t,n),height:Ae(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var r=ae(e,t,n=et(n,["fill","stroke"]));return y(e,t.width,t.height,.24*t.height,{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:2.5}),r},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=et(n,["fill","stroke"]);var i=oe(e,t,{...n,strokeWidth:1.5});return y(e,t.width,t.height,3,{fill:"none",stroke:be(t,p,n.stroke),strokeWidth:1.5}),r&&U(t,e,n),i},"bpmn:IntermediateCatchEvent":_("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":_("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=et(n,["fill","stroke","width","height"]),le(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var i=ce(e,t,n=et(n,["fill","stroke"]));return x(e,r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:.5}),i},"bpmn:MessageFlow":function(e,t,n={}){n=et(n,["fill","stroke"]);var i=C(t),a=R(t),s=ve(t,l,n.fill),c=be(t,p,n.stroke),u=b(e,t.waypoints,{markerEnd:d(e,"messageflow-end",s,c),markerStart:d(e,"messageflow-start",s,c),stroke:c,strokeDasharray:"10, 11",strokeWidth:1.5});if(i.get("messageRef")){var m=u.getPointAtLength(u.getTotalLength()/2),h=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:m.x,y:m.y}}),f={strokeWidth:1};"initiating"===a.get("messageVisibleKind")?(f.fill=s,f.stroke=c):(f.fill=c,f.stroke=s),x(e,h,f);var y=i.get("messageRef").get("name")||"",g={align:"center-top",fitBox:!0,style:{fill:c}},v=Q(e,y,g),E=o.getDimensions(y,g).width;ze(v,m.x-E/2,m.y+7+10,0)}return u},"bpmn:ParallelGateway":function(e,t,n={}){var i=ae(e,t,n=et(n,["fill","stroke"]));return x(e,r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke),strokeWidth:1}),i},"bpmn:Participant":function(e,t,n={}){var r=le(e,t,n=et(n,["fill","stroke","width","height"])),i=M(t),o=P(t),a=C(t),s=a.get("name");if(i){v(e,o?[{x:30,y:0},{x:30,y:Ae(t,n)}]:[{x:0,y:30},{x:_e(t,n),y:30}],{stroke:be(t,p,n.stroke),strokeWidth:1.5}),te(e,s,t,n)}else{var l=we(t,n);o||(l.height=_e(t,n),l.width=Ae(t,n));var u=Q(e,s,{box:l,align:"center-middle",style:{fill:xe(t,c,p,n.stroke)}});if(!o)ze(u,0,-(-1*Ae(t,n)),270)}return a.get("participantMultiplicity")&&X("ParticipantMultiplicityMarker",e,t,n),r},"bpmn:ReceiveTask":function(e,t,n={}){n=et(n,["fill","stroke"]);var i,o=C(t),a=ce(e,t,n);return o.get("instantiate")?(y(e,28,28,4.4,{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1}),i=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),x(e,i,{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var i=ce(e,t,n=et(n,["fill","stroke"]));return x(e,r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1}),i},"bpmn:SendTask":function(e,t,n={}){var i=ce(e,t,n=et(n,["fill","stroke"]));return x(e,r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:be(t,p,n.stroke),stroke:ve(t,l,n.fill),strokeWidth:1}),i},"bpmn:SequenceFlow":function(e,t,n={}){n=et(n,["fill","stroke"]);var r=ve(t,l,n.fill),i=be(t,p,n.stroke),o=b(e,t.waypoints,{markerEnd:d(e,"sequenceflow-end",r,i),stroke:i}),a=C(t),{source:s}=t;if(s){var c=C(s);a.get("conditionExpression")&&k(c,"bpmn:Activity")&&$(o,{markerStart:d(e,"conditional-flow-marker",r,i)}),c.get("default")&&(k(c,"bpmn:Gateway")||k(c,"bpmn:Activity"))&&c.get("default")===a&&$(o,{markerStart:d(e,"conditional-default-flow-marker",r,i)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var i=ce(e,t,n=et(n,["fill","stroke"]));return y(e,10,10,{fill:ve(t,l,n.fill),stroke:"none",transform:"translate(6, 6)"}),x(e,r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1}),y(e,10,10,{fill:ve(t,l,n.fill),stroke:"none",transform:"translate(11, 10)"}),x(e,r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:1}),i},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=et(n,["fill","stroke"]),C(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var i=oe(e,t,n);return r&&U(t,e,n),i},"bpmn:SubProcess":function(e,t,n={}){return pe(e,t,n=M(t)?et(n,["fill","stroke","width","height"]):et(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return ce(e,t,n=et(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=et(n,["fill","stroke"]);var{width:i,height:o}=we(t,n),a=g(e,i,o,0,0,{fill:"none",stroke:"none"});return x(e,r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:o,position:{mx:0,my:0}}),{stroke:be(t,p,n.stroke)}),Q(e,C(t).get("text")||"",{align:"left-top",box:we(t,n),padding:7,style:{fill:xe(t,c,p,n.stroke)}}),a},"bpmn:Transaction":function(e,t,r={}){r=M(t)?et(r,["fill","stroke","width","height"]):et(r,["fill","stroke"]);var i=pe(e,t,{strokeWidth:1.5,...r}),o=n.style(["no-fill","no-events"],{stroke:be(t,p,r.stroke),strokeWidth:1.5});return M(t)||(r={}),g(e,_e(t,r),Ae(t,r),7,3,o),i},"bpmn:UserTask":function(e,t,n={}){var i=ce(e,t,n=et(n,["fill","stroke"]));return x(e,r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:.5}),x(e,r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:ve(t,l,n.fill),stroke:be(t,p,n.stroke),strokeWidth:.5}),x(e,r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:be(t,p,n.stroke),stroke:be(t,p,n.stroke),strokeWidth:.5}),i},label:function(e,t,n={}){return function(e,t,n={}){var r={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return Q(e,D(t),{box:r,style:A({},o.getExternalStyle(),{fill:xe(t,c,p,n.stroke)})})}(e,t,n)}};this._drawPath=x,this._renderer=w}function et(e,t=[]){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}e(Qe,S),Qe.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Qe.prototype.canRender=function(e){return k(e,"bpmn:BaseElement")},Qe.prototype.drawShape=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},Qe.prototype.drawConnection=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},Qe.prototype.getShapePath=function(e){return s(t=e)&&u(t,"labelTarget")?Ee(e,4):k(e,"bpmn:Event")?function(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2;return le([["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])}(e):k(e,"bpmn:Activity")?Ee(e,10):k(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return le([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,r=e.width;return le([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])}(e);var t};var tt={width:150,height:50};var nt=null;function rt(e){if(null!=e)return"number"==typeof e||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function it(e,t){var n=(nt||(nt=document.createElement("canvas").getContext("2d")),nt);if(!n)return{width:0,height:0};n.font=function(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(rt(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}(t),"letterSpacing"in n&&(n.letterSpacing=rt(t.letterSpacing)||"0px");var r=""===e,i=r?"dummy":e.trimEnd(),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function ot(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=it(o,n)).width=o?r.width:0," "===o||""===o||r.width<=t||o.length<2)return at(e,o,i,r);o=lt(o,r.width,t)}}function at(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}var st="";function lt(e,t,n){var r=Math.max(e.length*(n/t),1),i=function(e,t){var n,r=e.split(/(\s|-|\u00AD)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"!==n&&n!==st||i.pop();break}i.push(n),o+=n.length}var a=i[i.length-1];return a&&a===st&&(i[i.length-1]="-"),i.join("")}(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function pt(e){this._config=A({},{size:tt,padding:0,style:{},align:"center-top"},e||{})}pt.prototype.createText=function(e,t){return this.layoutText(e,t).element},pt.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},pt.prototype.layoutText=function(e,t){for(var n=A({},this._config.size,t.box),r=A({},this._config.style,t.style),i=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return s(e)?A({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,l=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(r),p=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right;p.length;)c.push(ot(p,u,r));"middle"===i.vertical&&(o.top=o.bottom=0);var m=d(c,function(e,t,n){return e+(l||t.height)},0)+o.top+o.bottom,h=d(c,function(e,t,n){return t.width>e?t.width:e},0),y=o.top;"middle"===i.vertical&&(y+=(n.height-m)/2),y-=(l||c[0].height)/4;var g=q("text");return $(g,r),f(c,function(e){var t;switch(y+=l||e.height,i.horizontal){case"left":t=o.left;break;case"right":t=(a?h:u)-o.right-e.width;break;default:t=Math.max(((a?h:u)-e.width)/2+o.left,0)}var n=q("tspan");$(n,{x:t,y:y}),n.textContent=e.text,F(g,n)}),{dimensions:{width:h,height:m},element:g}};function ct(e){var t=A({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=A({},t,{fontSize:n},e&&e.externalStyle||{}),i=new pt({style:t});function o(e,t,n){return i.getDimensions(e,A({box:t},n))}this.getExternalLabelBounds=function(e,t){var n=o(t,{width:Math.max(e.width,T.width),height:30},{style:r});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var r=o(n,e,{style:t,align:"left-top",padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(40,Math.round(r.height))}},this.getDimensions=function(e,t){return i.getDimensions(e,t||{})},this.createText=function(e,t){return i.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}ct.$inject=["config.textRenderer"];var ut=/\{([^{}]+)\}/g,mt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var ht={__init__:["bpmnRenderer"],bpmnRenderer:["type",Qe],textRenderer:["type",ct],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,i=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/i.height*t.yScaleFactor,s=t.containerWidth/i.width*t.xScaleFactor,l=0;l<i.heightElements.length;l++)o["y"+l]=i.heightElements[l]*a;for(var p=0;p<i.widthElements.length;p++)o["x"+p]=i.widthElements[p]*s}var c,u,m=(c=i.d,u={mx:n,my:r,e:o},String(c).replace(ut,function(e,t){return function(e,t,n){var r=n;return t.replace(mt,function(e,t,n,i,o){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&o&&(r=r()))}),r=(null==r||r==n?e:r)+""}(e,t,u)}));return m}}]};var ft={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]};function dt(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function yt(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function gt(e){for(var t=e.waypoints,n=t.reduce(function(e,n,r){var i,o,a=t[r-1];if(a){var s=e[e.length-1],l=s&&s.endLength||0,p=(i=a,o=n,Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2)));e.push({start:a,end:n,startLength:l,endLength:l+p,length:p})}return e},[]),r=n.reduce(function(e,t){return e+t.length},0)/2,i=0,o=n[i];o.endLength<r;)o=n[++i];var a=(r-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*a,y:o.start.y+(o.end.y-o.start.y)*a}}function vt(e){return s(t=e)&&u(t,"waypoints")?gt(e):yt(e);var t}function bt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function xt(e,t,n){return A({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Et(e,t,n){var r=e.waypoint;return!r||r.length<2?[vt(t),vt(n)]:r.map(function(e){return{x:e.x,y:e.y}})}function wt(e,t,n){return new Error(`element ${bt(t)} referenced by ${bt(e)}#${n} not yet drawn`)}function _t(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}_t.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],_t.prototype.add=function(e,t,n){var r,i,o,a,s,l,p;if(k(t,"bpmndi:BPMNPlane")){var c=k(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(xt(e,t,c)),this._canvas.addRootElement(r)}else if(k(t,"bpmndi:BPMNShape")){var u=!M(e,t),m=function(e){return k(e,"bpmn:Group")}(e);i=n&&(n.hidden||n.collapsed);var h=t.bounds;r=this._elementFactory.createShape(xt(e,t,{collapsed:u,hidden:i,x:Math.round(h.x),y:Math.round(h.y),width:Math.round(h.width),height:Math.round(h.height),isFrame:m})),k(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),k(e,"bpmn:Lane")&&(o=0),k(e,"bpmn:DataStoreReference")&&(a=n,s=vt(h),l=s.x,p=s.y,l>=a.x&&l<=a.x+a.width&&p>=a.y&&p<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else{if(!k(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${bt(t)} for element ${bt(e)}`);var f=this._getSource(e),d=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(xt(e,t,{hidden:i,source:f,target:d,waypoints:Et(t,f,d)})),k(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}return function(e){return k(e,"bpmn:Event")||k(e,"bpmn:Gateway")||k(e,"bpmn:DataStoreReference")||k(e,"bpmn:DataObjectReference")||k(e,"bpmn:DataInput")||k(e,"bpmn:DataOutput")||k(e,"bpmn:SequenceFlow")||k(e,"bpmn:MessageFlow")||k(e,"bpmn:Group")}(e)&&D(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r},_t.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${bt(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw wt(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),-1===i.indexOf(t)&&i.push(t)},_t.prototype.addLabel=function(e,t,n){var r,i,o;if(r=N(t,n),(i=D(n))&&t.label&&t.label.bounds&&r.width>0){var a=this._textRenderer.getDimensions(i,{box:r,style:this._textRenderer.getExternalStyle()});r=A({},r,{height:Math.ceil(a.height)})}else i&&(r=this._textRenderer.getExternalLabelBounds(r,i));return o=this._elementFactory.createLabel(xt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!D(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(o,n.parent)},_t.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===i&&(r=r&&r[0]),("source"===t&&"bpmn:DataOutputAssociation"===i||"target"===t&&"bpmn:DataInputAssociation"===i)&&(r=e.$parent),n=r&&this._getElement(r))return n;throw r?wt(e,r,t+"Ref"):new Error(`${bt(e)}#${t} Ref not specified`)},_t.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},_t.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},_t.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var At={__depends__:[ht,{__depends__:[ft],bpmnImporter:["type",_t]}]};function St(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}St.prototype.next=function(){return this._prefix+ ++this._counter};var kt=new St("ov");function Ct(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=kt,this._overlayDefaults=A({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),Re(o=ke('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),i.insertBefore(o,i.firstChild),o),this._init()}function Rt(e,t,n){Re(e,{left:t+"px",top:n+"px"})}function Mt(e,t){e.style.display=!1===t?"none":""}function Pt(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}Ct.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Ct.prototype.get=function(e){if(c(e)&&(e={id:e}),c(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?h(t.overlays,v({type:e.type})):t.overlays.slice():[]}return e.type?h(this._overlays,v({type:e.type})):e.id?this._overlays[e.id]:null},Ct.prototype.add=function(e,t,n){if(s(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=A({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Ct.prototype.remove=function(e){var t=this.get(e)||[];a(t)||(t=[t]);var n=this;f(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(We(e.html),We(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}})},Ct.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Ct.prototype.show=function(){Mt(this._overlayRoot)},Ct.prototype.hide=function(){Mt(this._overlayRoot,!1)},Ct.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Ne(this._overlayRoot)},Ct.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=O(t);r=o.x,i=o.y}Rt(n,r,i),Me(e.html,"data-container-id",t.id)},Ct.prototype._updateOverlay=function(e){var t,n,r=e.position,i=e.htmlContainer,o=e.element,a=r.left,s=r.top;void 0!==r.right&&(t=o.waypoints?O(o).width:o.width,a=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?O(o).height:o.height,s=-1*r.bottom+n);Rt(i,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Ct.prototype._createOverlayContainer=function(e){var t=ke('<div class="djs-overlays" />');Re(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Ct.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Pt(this._overlayRoot,n)},Ct.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},Ct.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),c(o)&&(o=ke(o)),n=this._getOverlayContainer(i),Re(t=ke('<div class="djs-overlay" data-overlay-id="'+r+'">'),{position:"absolute"}),t.appendChild(o),e.type&&Te(t).add("djs-overlay-"+e.type),Mt(t,this._canvas.findRoot(i)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Ct.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),o=n&&n.minZoom,a=n&&n.maxZoom,s=e.htmlContainer,l=!0;(r!==this._canvas.getRootElement()||n&&(i(o)&&o>t.scale||i(a)&&a<t.scale))&&(l=!1),Mt(s,l),this._updateOverlayScale(e,t)},Ct.prototype._updateOverlayScale=function(e,t){var n,r,o,a=e.scale,s=e.htmlContainer,l="";!0!==a&&(!1===a?(n=1,r=1):(n=a.min,r=a.max),i(n)&&t.scale<n&&(o=(1/t.scale||1)*n),i(r)&&t.scale>r&&(o=(1/t.scale||1)*r)),i(o)&&(l="scale("+o+","+o+")"),Pt(s,l)},Ct.prototype._updateOverlaysVisibilty=function(e){var t=this;f(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},Ct.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element;f(t.get({element:n}),function(e){t.remove(e.id)});var r=t._getOverlayContainer(n);if(r){We(r.html);var i=t._overlayContainers.indexOf(r);-1!==i&&t._overlayContainers.splice(i,1)}}),e.on("element.changed",500,function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&(f(r.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(r))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&Te(n.html)[e.add?"add":"remove"](e.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};var Tt={__init__:["overlays"],overlays:["type",Ct]};function Bt(e,t,n,r){e.on("element.changed",function(r){var i=r.element;(i.parent||i===t.getRootElement())&&(r.gfx=n.getGraphics(i)),r.gfx&&e.fire(I(i)+".changed",r)}),e.on("elements.changed",function(t){var n=t.elements;n.forEach(function(t){e.fire("element.changed",{element:t})}),r.updateContainments(n)}),e.on("shape.changed",function(e){r.update("shape",e.element,e.gfx)}),e.on("connection.changed",function(e){r.update("connection",e.element,e.gfx)})}Bt.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Nt={__init__:["changeSupport"],changeSupport:["type",Bt]};function Dt(e){this._eventBus=e}function Ot(e){return function(t,n,r,i,o){(p(t)||l(t))&&(o=i,i=r,r=n,n=t,t=null),this.on(t,e,n,r,i,o)}}function It(e,t){t.invoke(Dt,this),this.executed(function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()}),this.revert(function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)})}Dt.$inject=["eventBus"],Dt.prototype.on=function(e,t,n,r,i,o){if((p(t)||l(t))&&(o=i,i=r,r=n,n=t,t=null),p(n)&&(o=i,i=r,r=n,n=1e3),s(i)&&(o=i,i=!1),!p(r))throw new Error("handlerFn must be a function");a(e)||(e=[e]);var c=this._eventBus;f(e,function(e){var a=["commandStack",e,t].filter(function(e){return e}).join(".");c.on(a,n,i?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(r,o):r,o)})},Dt.prototype.canExecute=Ot("canExecute"),Dt.prototype.preExecute=Ot("preExecute"),Dt.prototype.preExecuted=Ot("preExecuted"),Dt.prototype.execute=Ot("execute"),Dt.prototype.executed=Ot("executed"),Dt.prototype.postExecute=Ot("postExecute"),Dt.prototype.postExecuted=Ot("postExecuted"),Dt.prototype.revert=Ot("revert"),Dt.prototype.reverted=Ot("reverted"),e(It,Dt),It.$inject=["canvas","injector"];var Lt={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",It]},Ft={"&":"&","<":"<",">":">",'"':""","'":"'"};function jt(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(e){return Ft[e]})}var Vt="_plane";function $t(e){var t=e.id;return k(e,"bpmn:SubProcess")?function(e){return e+Vt}(t):t}function Wt(e,t,n){var r=ke('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=Te(i);i.appendChild(r);var a=[];function s(e){e&&(a=function(e){for(var t=C(e),n=[],r=t;r;r=r.$parent)(k(r,"bpmn:SubProcess")||k(r,"bpmn:Process"))&&n.push(r);return n.reverse()}(e));var i=a.flatMap(function(e){var r=n.findRoot($t(e))||n.findRoot(e.id);if(!r&&k(e,"bpmn:Process")){var i=t.find(function(t){var n=C(t);return n&&n.get("processRef")===e});r=i&&n.findRoot(i.id)}return r?[{parent:e,parentPlane:r}]:[]});r.innerHTML="";var s=i.length>1;o.toggle("bjs-breadcrumbs-shown",s),i.forEach(function(e,t){var o,a=e.parent,s=e.parentPlane,l=jt(a.name||a.id);t===i.length-1?o=ke('<li><span class="bjs-crumb" title="'+l+'">'+l+"</span></li>"):(o=ke('<li><a class="bjs-crumb" href="'+("#"+jt(a.id))+'" title="'+l+'">'+l+"</a></li>")).addEventListener("click",function(e){e.preventDefault(),n.setRootElement(s)});r.appendChild(o)})}e.on("element.changed",function(e){var t=C(e.element);m(a,function(e){return e===t})&&s()}),e.on("root.set",function(e){s(e.element)})}function zt(e,t){var n=null,r=new Gt;e.on("root.set",function(e){var i=e.element,o=t.viewbox(),a=r.get(i);if(r.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=i,k(i,"bpmn:SubProcess")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}function Gt(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}Wt.$inject=["eventBus","elementRegistry","canvas"],zt.$inject=["eventBus","canvas"];var Ht=180,Kt=160;function Ut(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(e,t){n._handleImport(t.definitions)})}function qt(e){return k(e,"bpmndi:BPMNDiagram")?e:qt(e.$parent)}Ut.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}),e.diagrams.filter(e=>e.plane).flatMap(e=>t._createNewDiagrams(e.plane)).forEach(function(e){t._movePlaneElementsToOrigin(e.plane)})}},Ut.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(t){var i=t.bpmnElement;if(i){var o=i.$parent;k(i,"bpmn:SubProcess")&&!t.isExpanded&&n.push(i),function(e,t){var n=e.$parent;if(!k(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(function(e,t){return g(t,function(t){return k(e,t)})}(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(i,e)&&r.push({diElement:t,parent:o})}});var i=[];return n.forEach(function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,i.push(n)}}),r.forEach(function(e){for(var r=e.diElement,i=e.parent;i&&-1===n.indexOf(i);)i=i.$parent;if(i){var o=t._processToDiagramMap[i.id];t._moveToDiPlane(r,o.plane)}}),i},Ut.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(e){if(e.bounds){var n=dt(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),r=n.x-Ht,i=n.y-Kt;t.forEach(function(e){e.waypoint?e.waypoint.forEach(function(e){e.x=e.x-r,e.y=e.y-i}):e.bounds&&(e.bounds.x=e.bounds.x-r,e.bounds.y=e.bounds.y-i)})},Ut.prototype._moveToDiPlane=function(e,t){var n=qt(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Ut.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Ut.$inject=["eventBus","moddle"];var Yt=250;function Xt(e,t,n,r,i){Dt.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Yt,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.reverted("shape.toggleCollapse",Yt,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.executed(["shape.create","shape.move","shape.delete"],Yt,function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;o._canDrillDown(r)&&o._addOverlay(r),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Yt,function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;o._canDrillDown(r)&&o._addOverlay(r),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r)},!0),t.on("import.render.complete",function(){n.filter(function(e){return o._canDrillDown(e)}).map(function(e){o._addOverlay(e)})})}e(Xt,Dt),Xt.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Xt.prototype._canDrillDown=function(e){var t=this._canvas;return k(e,"bpmn:SubProcess")&&t.findRoot($t(e))},Xt.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=C(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Te(r.html).toggle("bjs-drilldown-empty",!i)}},Xt.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=C(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=ke('<button type="button" class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>'),o=r.get("name")||r.get("id"),a=this._translate("Open {element}",{element:o});i.setAttribute("title",a),i.addEventListener("click",function(){t.setRootElement(t.findRoot($t(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Xt.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Xt.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var Zt={__depends__:[Tt,Nt,Lt],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Wt],drilldownCentering:["type",zt],drilldownOverlayBehavior:["type",Xt],subprocessCompatibility:["type",Ut]};function Jt(e){return e.originalEvent||e.srcEvent}function Qt(e,t){return(Jt(e)||e).button===t}function en(e){return Qt(e,0)}function tn(e){return!0}function nn(e){return en(e)||function(e){return Qt(e,1)}(e)}function rn(e,t,n){var r=this;function i(n,r,i){var o,a;(function(e,t){var n=l[e]||en;return!n(t)})(n,r)||(i?a=t.getGraphics(i):(o=r.delegateTarget||r.target)&&(a=o,i=t.get(a)),a&&i&&!1===e.fire(n,{element:i,gfx:a,originalEvent:r})&&(r.stopPropagation(),r.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":tn,"element.mousedown":nn,"element.mouseup":nn,"element.click":nn,"element.dblclick":nn};function p(e,t,n,r){var a=o[n]=function(e){i(n,e)};r&&(l[n]=r),a.$delegate=Ve.bind(e,"svg, .djs-element",t,a)}function c(e,t,n){var r=a(n);r&&Ve.unbind(e,t,r.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,f(s,function(e,n){c(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,f(s,function(e,n){p(t,n,e)})}),e.on(["shape.added","connection.added"],function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:r})}),e.on(["shape.changed","connection.changed"],500,function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:r})}),e.on("interactionEvents.createHit",500,function(e){var t=e.element,n=e.gfx;r.createDefaultHit(t,n)}),e.on("interactionEvents.updateHit",function(e){var t=e.element,n=e.gfx;r.updateDefaultHit(t,n)});var u=d("djs-hit djs-hit-stroke"),m=d("djs-hit djs-hit-click-stroke"),h={all:d("djs-hit djs-hit-all"),"click-stroke":m,stroke:u,"no-move":d("djs-hit djs-hit-no-move")};function d(e,t){return t=A({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function y(e,t){var n=h[t];if(!n)throw new Error("invalid hit type <"+t+">");return $(e,n),e}function g(e,t){F(e,t)}this.removeHits=function(e){var t;f((t=".djs-hit",(e||document).querySelectorAll(t)),oe)},this.createDefaultHit=function(e,t){var n,r=e.waypoints,i=e.isFrame;return r?this.createWaypointsHit(t,r):(n=i?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=fe(t);return y(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=A({x:0,y:0},n);var r=q("rect");return y(r,t),$(r,n),g(e,r),r},this.updateDefaultHit=function(e,t){var n=$e(".djs-hit",t);if(n)return e.waypoints?de(n,e.waypoints):$(n,{width:e.width,height:e.height}),n},this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=s[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=c}rn.$inject=["eventBus","elementRegistry","styles"];var on={__init__:["interactionEvents"],interactionEvents:["type",rn]};function an(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;var n=this;e.on(["shape.remove","connection.remove"],function(e){var t=e.element;n.deselect(t)}),e.on(["diagram.clear","root.set"],function(e){n.select(null)})}an.$inject=["eventBus","canvas"],an.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire("selection.changed",{oldSelection:t,newSelection:this.get()})}},an.prototype.get=function(){return Array.from(this._selectedElements)},an.prototype.isSelected=function(e){return this._selectedElements.has(e)},an.prototype.select=function(e,t){var n=this.get();a(e)||(e=e?[e]:[]);var r=this._canvas,i=r.getRootElement();e=e.filter(function(e){var t=r.findRoot(e);return i===t}),t?f(e,e=>{this._selectedElements.add(e)}):this._selectedElements=new Set(e),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:this.get()})};var sn="hover",ln="selected";function pn(e,t){function n(t,n){e.addMarker(t,n)}function r(t,n){e.removeMarker(t,n)}this._canvas=e,t.on("element.hover",function(e){n(e.element,sn)}),t.on("element.out",function(e){r(e.element,sn)}),t.on("selection.changed",function(e){function t(e){r(e,ln)}function i(e){n(e,ln)}var o=new Set(e.oldSelection),a=new Set(e.newSelection);for(let e of o)a.has(e)||t(e);for(let e of a)o.has(e)||i(e)})}function cn(e,t,n,r){e.on("create.end",500,function(e){var n=e.context,r=n.canExecute,i=n.elements,o=(n.hints||{}).autoSelect;if(r){if(!1===o)return;a(o)?t.select(o):t.select(i.filter(un))}}),e.on("connect.end",500,function(e){var n=e.context.connection;n&&t.select(n)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],i=r.get(e.context.shape.id);m(n,function(e){return i.id===e.id})||t.select(i)}),e.on("element.click",function(e){if(en(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,a=function(e){var t=Jt(e)||e;return en(e)&&t.shiftKey}(e);if(i&&o)return a?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,a)}})}function un(e){return!e.hidden}pn.$inject=["canvas","eventBus"],cn.$inject=["eventBus","selection","canvas","elementRegistry"];var mn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[on],selection:["type",an],selectionVisuals:["type",pn],selectionBehavior:["type",cn]};const hn=/^class[ {]/;function fn(e){return Array.isArray(e)}function dn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function yn(...e){1===e.length&&fn(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const gn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,vn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,bn=/\/\*([^*]*)\*\//m;function xn(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return hn.test(e.toString())}(e)?gn:vn);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(e=>{const t=e.match(bn),[n,r]=e.replace(bn,"").split("="),i=(t&&t[1]||n).trim();return void 0===r||i.endsWith("?")?i:i+"?"})||[]}function En(e,t){const n=t||{get:function(e,t){if(!1!==t)throw r.push(e),s(`No provider for "${e}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(e){const t=r.join(" -> ");return r.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){const a=e.lastIndexOf("?");if(-1!==a){const t=l(e.slice(0,a),!1),n=e.slice(a+2);if(n&&null==t)return;return n?n.split(".").reduce((e,t)=>e[t],t):t}if(!i[e]&&e.includes(".")){const n=e.split(".");let r=l(n.shift(),t);for(;n.length;){const e=n.shift();r=!1===t?r?.[e]:r[e]}return r}if(dn(o,e))return o[e];if(dn(i,e)){if(-1!==r.indexOf(e))throw r.push(e),s("Cannot resolve circular dependency!");return r.push(e),o[e]=i[e][0](i[e][1]),r.pop(),o[e]}return n.get(e,t)}function p(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!fn(e))throw s(`Cannot invoke "${e}". Expected a function!`);e=yn(e.slice())}return{fn:e,dependencies:(e.$inject||xn(e)).map(e=>{const n=e.replace(/\?$/,"");return dn(t,n)?t[n]:l(e)})}}function c(e){const{fn:t,dependencies:n}=p(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:r,dependencies:i}=p(e,n);return r.apply(t,i)}function m(e){return yn(t=>e.get(t))}function h(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],a=[],s=[];let l,p,c,u;for(let e in i)l=i[e],-1!==t.indexOf(e)&&("private"===l[2]?(p=o.indexOf(l[3]),-1===p?(c=l[3].createChild([],t),u=m(c),o.push(l[3]),a.push(c),s.push(u),n[e]=[u,e,"private",c]):n[e]=[s[p],e,"private",a[p]]):n[e]=[l[2],l[1]],r[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach(t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],r[t]=!0)});t.forEach(e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(n)}return new En(e,a)}const f={factory:u,type:c,value:function(e){return e}};function d(e,t){const n=e.__init__||[];return function(){n.forEach(e=>{"string"==typeof e?t.get(e):t.invoke(e)})}}function y(e){const t=e.__exports__;if(t){const n=e.__modules__,r=Object.keys(e).reduce((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t),Object.create(null)),o=h((n||[]).concat(r)),a=yn(function(e){return o.get(e)});t.forEach(function(e){i[e]=[a,e,"private",o]});const s=(e.__init__||[]).slice();return s.unshift(function(){o.init()}),d(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(i[t]=n);const r=n[0],o=n[1];i[t]=[f[r],wn(r,o),r]}),d(e,a)}function g(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(g,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=c,this.createChild=h,this.init=function(e){const t=e.reduce(g,[]).map(y);let n=!1;return function(){n||(n=!0,t.forEach(e=>e()))}}(e)}function wn(e,t){return"value"!==e&&fn(t)&&(t=yn(t.slice())),t}function _n(e,t){S.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(_n,S),_n.prototype.canRender=function(){return!0},_n.prototype.drawShape=function(e,t,n){var r=q("rect");return $(r,{x:0,y:0,width:t.width||0,height:t.height||0}),L(t)?$(r,A({},this.FRAME_STYLE,n||{})):$(r,A({},this.SHAPE_STYLE,n||{})),F(e,r),r},_n.prototype.drawConnection=function(e,t,n){var r=fe(t.waypoints,A({},this.CONNECTION_STYLE,n||{}));return F(e,r),r},_n.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return le([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},_n.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,i=[];for(t=0;n=r[t];t++)n=n.original||n,i.push([0===t?"M":"L",n.x,n.y]);return le(i)},_n.$inject=["eventBus","styles"];var An={__init__:["defaultRenderer"],defaultRenderer:["type",_n],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 A(this.style(t,n),{class:e})},this.style=function(t,n){a(t)||n||(n=t,t=[]);var r=d(t,function(t,n){return A(t,e[n]||{})},{});return n?A(r,n):r},this.computeStyle=function(e,n,r){return a(n)||(r=n,n=[]),t.style(n||[],A({},r,e||{}))}}]};function Sn(e,t){return Math.round(e*t)/t}function kn(e){return l(e)?e+"px":e}function Cn(e){for(;e.parent;)e=e.parent;return e}function Rn(e,t,n){const r=q("g");z(r).add(t);const i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}const Mn={shape:["x","y","width","height"],connection:["waypoints"]};function Pn(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}function Tn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Pn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Pn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=A({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent bio-theme-parent"),Re(n,{position:"relative",overflow:"hidden",width:kn(e.width),height:kn(e.height)}),t.appendChild(n),n}(e),r=this._svg=q("svg");$(r,{width:"100%",height:"100%"}),Me(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,e=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),F(n,r);const i=this._viewport=Rn(r,"viewport");e.deferUpdate&&(this._viewboxChanged=w(this._viewboxChanged,300)),this._restoreFocus=w(this._restoreFocus,0),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Pn.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},Pn.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},Pn.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{const t=I(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Pn.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},Pn.prototype.restoreFocus=function(){this._restoreFocus()},Pn.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},Pn.prototype.isFocused=function(){return this._focused},Pn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Pn.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},Pn.prototype._getChildIndex=function(e){return d(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},Pn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:Rn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Pn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;const o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r},Pn.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?(oe(n),t.visible=!1,n):n},Pn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],oe(t.group))},Pn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Pn.prototype.findRoot=function(e){const t=this._resolveElements(e);let n;for(const e of t){const t=this._findPlaneForRoot(Cn(e));if(!t)return;if(n&&t.rootElement!==n)return;n=t.rootElement}return n},Pn.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},Pn.prototype._findPlaneForRoot=function(e){return m(this._planes,function(t){return t.rootElement===e})},Pn.prototype._resolveElement=function(e){return"string"==typeof e?this._elementRegistry.get(e):e},Pn.prototype._resolveElements=function(e){return a(e)||(e=[e]),e.map(e=>this._resolveElement(e)).filter(Boolean)},Pn.prototype.getContainer=function(){return this._container},Pn.prototype._updateMarker=function(e,t,n){let r;(e=this._resolveElement(e)).markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(f([r.gfx,r.secondaryGfx],function(r){r&&(n?(e.markers.add(t),z(r).add(t)):(e.markers.delete(t),z(r).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},Pn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Pn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Pn.prototype.hasMarker=function(e,t){return!!(e=this._resolveElement(e)).markers&&e.markers.has(t)},Pn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Pn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Pn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const r=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},Pn.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},Pn.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},Pn.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)},Pn.prototype._addRoot=function(e,t){const n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},Pn.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})},Pn.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=Mn[e],r=y(n,function(e){return void 0!==t[e]});if(!r)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Pn.prototype._setParent=function(e,t,n){!function(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}}(t.children,e,n),e.parent=t},Pn.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();const i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);const a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t},Pn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Pn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Pn.prototype._removeElement=function(e,t){const n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e))return i.fire(t+".remove",{element:e}),r.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},Pn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Pn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Pn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Pn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Pn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Pn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let r,i,o,a,s,l,p;return e?(this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);const r=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);se(t,r)}),e):(o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=se(t),i=a?a.matrix:function(e,t,n,r,i,o){var a=X().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Z(a,e);case 6:return Z(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}(),s=Sn(i.a,1e3),l=Sn(-i.e||0,1e3),p=Sn(-i.f||0,1e3),e=this._cachedViewbox={x:l?l/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n})},Pn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=A({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Tn(t,n)}),{x:n.e,y:n.f}},Pn.prototype.scrollToElement=function(e,t){let n=100;const r=this._resolveElements(e);if(!r.length)return;const i=this.findRoot(r);if(!i)return;i!==this.getRootElement()&&this.setRootElement(i);const o=r.filter(e=>e!=i);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=O(o),s=dt(a),l=this.viewbox(),p=this.zoom();let c,u;l.y+=t.top/p,l.x+=t.left/p,l.width-=(t.right+t.left)/p,l.height-=(t.bottom+t.top)/p;const m=dt(l);if(a.width<l.width&&a.height<l.height){const e=Math.max(0,s.right-m.right),t=Math.min(0,s.left-m.left),n=Math.max(0,s.bottom-m.bottom),r=Math.min(0,s.top-m.top);c=e||t,u=n||r}else c=a.x-l.x,u=a.y-l.y;this.scroll({dx:-c*p,dy:-u*p})},Pn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,r;return this._changeViewbox(function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),Sn(r.a,1e3)},Pn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,r=t.inner;let i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale},Pn.prototype._setZoom=function(e,t){const n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,l,p,c;l=r.getCTM();const u=l.a;return t?(a=A(o,t),s=a.matrixTransform(l.inverse()),p=i.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),c=l.multiply(p)):c=i.scale(e),Tn(this._viewport,c),c},Pn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Pn.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}},Pn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Bn="data-element-id";function Nn(e){this._elements={},this._eventBus=e}function Dn(e,t,n){var r=function(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,i,r)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(r){e.set(r,t.inverse,n)})}function On(e,t){if(!(this instanceof On))return new On(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Nn.$inject=["eventBus"],Nn.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),$(t,Bn,r),n&&$(n,Bn,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},Nn.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&($(r.gfx,Bn,""),r.secondaryGfx&&$(r.secondaryGfx,Bn,""),delete t[n])},Nn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},Nn.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&$(t,Bn,r),t},Nn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&$(e,Bn);var n=this._elements[t];return n&&n.element},Nn.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},Nn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=t[n[r]],o=i.element;if(e(o,i.gfx))return o}},Nn.prototype.getAll=function(){return this.filter(function(e){return e})},Nn.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})},Nn.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},Nn.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")},On.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?Dn(this,t,e):function(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}(this,t,e)},On.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||Dn(this,t,e),n},On.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},On.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},On.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var In=new On({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Ln=new On({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Fn=new On({name:"attachers",collection:!0},{name:"host"}),jn=new On({name:"outgoing",collection:!0},{name:"source"}),Vn=new On({name:"incoming",collection:!0},{name:"target"});function $n(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),In.bind(this,"parent"),Ln.bind(this,"labels"),jn.bind(this,"outgoing"),Vn.bind(this,"incoming")}function Wn(){$n.call(this),In.bind(this,"children"),Fn.bind(this,"host"),Fn.bind(this,"attachers")}function zn(){$n.call(this),In.bind(this,"children")}function Gn(){Wn.call(this),Ln.bind(this,"labelTarget")}function Hn(){$n.call(this),jn.bind(this,"source"),Vn.bind(this,"target")}e(Wn,$n),e(zn,Wn),e(Gn,Wn),e(Hn,$n);var Kn={connection:Hn,shape:Wn,label:Gn,root:zn};function Un(){this._uid=12}Un.prototype.createRoot=function(e){return this.create("root",e)},Un.prototype.createLabel=function(e){return this.create("label",e)},Un.prototype.createShape=function(e){return this.create("shape",e)},Un.prototype.createConnection=function(e){return this.create("connection",e)},Un.prototype.create=function(e,t){return(t=A({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Kn[e];if(!n)throw new Error("unknown type: <"+e+">");return A(new n,t)}(e,t)};var qn="__fn",Yn=Array.prototype.slice;function Xn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Zn(){}function Jn(e,t){this._eventBus=e,this._elementRegistry=t}Xn.prototype.on=function(e,t,n,r){if(e=a(e)?e:[e],p(t)&&(r=n,n=t,t=1e3),!l(t))throw new Error("priority must be a number");var i=n;r&&((i=_(n,r))[qn]=n[qn]||n);var o=this;e.forEach(function(e){o._addListener(e,{priority:t,callback:i,next:null})})},Xn.prototype.once=function(e,t,n,r){var i=this;if(p(t)&&(r=n,n=t,t=1e3),!l(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(r,arguments);return i.off(e,o),t}o[qn]=n,this.on(e,t,o)},Xn.prototype.off=function(e,t){e=a(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},Xn.prototype.createEvent=function(e){var t=new Zn;return t.init(e),t},Xn.prototype.fire=function(e,t){var n,r,i,o;if(o=Yn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(r=this._listeners[e]){n=t instanceof Zn?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return void 0===i&&n.defaultPrevented&&(i=!1),i}},Xn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Xn.prototype._destroy=function(){this._listeners={}},Xn.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},Xn.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==r&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return r},Xn.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));n=r,r=r.next}n.next=t}else this._setListeners(e,t)},Xn.prototype._getListeners=function(e){return this._listeners[e]},Xn.prototype._setListeners=function(e,t){this._listeners[e]=t},Xn.prototype._removeListener=function(e,t){var n,r,i,o=this._getListeners(e);if(t)for(;o;)n=o.next,(i=o.callback)!==t&&i[qn]!==t||(r?r.next=n:this._setListeners(e,n)),r=o,o=n;else this._setListeners(e,null)},Zn.prototype.stopPropagation=function(){this.cancelBubble=!0},Zn.prototype.preventDefault=function(){this.defaultPrevented=!0},Zn.prototype.init=function(e){A(this,e||{})},Jn.$inject=["eventBus","elementRegistry"],Jn.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(z(t=q("g")).add("djs-children"),F(n.parentNode,t))):t=n,t},Jn.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return Ne(t),t},Jn.prototype._createContainer=function(e,t,n,r){var i=q("g");z(i).add("djs-group"),void 0!==n?function(e,t,n){var r=n||t.firstChild;if(e===r)return;t.insertBefore(e,r)}(i,t,t.childNodes[n]):F(t,i);var o=q("g");z(o).add("djs-element"),z(o).add("djs-"+e),r&&z(o).add("djs-frame"),F(i,o);var a=q("g");return z(a).add("djs-visual"),F(o,a),o},Jn.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,L(t))},Jn.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=d(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),f(t,function(e){var t=e.children;if(t){var i=n._getChildrenContainer(e),o=i.firstChild;f(t,function(e){var t=r.getGraphics(e).parentNode;t===o?o=o.nextSibling:i.insertBefore(t,o)})}})},Jn.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Jn.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Jn.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Jn.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Jn.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),Ge(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?$(n,"display","none"):$(n,"display","block")}},Jn.prototype.remove=function(e){oe(this._elementRegistry.getGraphics(e).parentNode)};var Qn={__depends__:[An],__init__:["canvas"],canvas:["type",Pn],elementRegistry:["type",Nn],elementFactory:["type",Un],eventBus:["type",Xn],graphicsFactory:["type",Jn]};function er(e){return function(e){var t=new En(e);return t.init(),t}([{config:["value",e=e||{}]},Qn].concat(e.modules||[]))}function tr(e,t){this._injector=t||er(e),this.get("eventBus").fire("diagram.init")}function nr(){}function rr(e,t){this.model=e,this.properties=t}tr.prototype.get=function(e,t){return this._injector.get(e,t)},tr.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},tr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},tr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},nr.prototype.get=function(e){return this.$model.properties.get(this,e)},nr.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},rr.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(nr.prototype);f(e.properties,function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),f(e,_(function(e,t){this.set(t,e)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var ir=A(Object.create(null),{String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0}),or=A(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 ar(e,t){var n=or[e];return n?n(t):t}function sr(e){return!!ir[e]}function lr(e){return!!or[e]}function pr(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function cr(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName=Object.create(null),this.properties=[],this.propertiesByName=Object.create(null)}function ur(e,t){this.packageMap=Object.create(null),this.typeMap=Object.create(null),this.packages=[],this.properties=t,f(e,_(this.registerPackage,this))}function mr(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function hr(e){this.model=e}function fr(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function dr(e){return e.replace(/^:/,"")}function yr(e,t={}){this.properties=new hr(this),this.factory=new rr(this,this.properties),this.registry=new ur(e,this.properties),this.typeCache=Object.create(null),this.config=t}cr.prototype.build=function(){return function(e,t){let n={},r=Object(e);return f(t,function(t){t in r&&(n[t]=e[t])}),n}(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},cr.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var r=this.properties;void 0!==t?r.splice(t,0,e):r.push(e)},cr.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=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=i.indexOf(e);if(-1===s)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t},cr.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=pr(i[0],r),a=pr(i[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},cr.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},cr.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},cr.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},cr.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},cr.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},cr.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},cr.prototype.hasProperty=function(e){return this.propertiesByName[e]},cr.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(f(e.properties,_(function(n){n=A({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this)),r.push(e),n[i]=e)},ur.prototype.getPackage=function(e){return this.packageMap[e]},ur.prototype.getPackages=function(){return this.packages},ur.prototype.registerPackage=function(e){e=A({},e);var t=this.packageMap;mr(t,e,"prefix"),mr(t,e,"uri"),f(e.types,_(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},ur.prototype.registerType=function(e,t){var n=pr((e=A({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:A({},e.meta||{})})).name,t.prefix),r=n.name,i=Object.create(null);f(e.properties,_(function(e){var t=pr(e.name,n.prefix),r=t.name;sr(e.type)||(e.type=pr(e.type,t.prefix).name),A(e,{ns:t,name:r}),i[r]=e},this)),A(e,{ns:n,name:r,propertiesByName:i}),f(e.extends,_(function(e){var t=pr(e,n.prefix),i=this.typeMap[t.name];i.traits=i.traits||[],i.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e},ur.prototype.mapTypes=function(e,t,n){var r=sr(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(n,r){var o=pr(n,sr(n)?"":e.prefix);i.mapTypes(o,t,r)}function a(e){return o(e,!0)}if(!r)throw new Error("unknown type <"+e.name+">");f(r.superClass,n?a:function(e){return o(e,!1)}),t(r,!n),f(r.traits,a)},ur.prototype.getEffectiveDescriptor=function(e){var t=pr(e),n=new cr(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},ur.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},hr.prototype.set=function(e,t,n){if(!c(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;void 0===n?r?delete e[i]:delete e.$attrs[dr(t)]:r?i in e?e[i]=n:fr(e,r,n):e.$attrs[dr(t)]=n},hr.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[dr(t)];var r=n.name;return!e[r]&&n.isMany&&fr(e,n,[]),e[r]},hr.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;delete(n=A({},n,{get:function(){return r}})).value}Object.defineProperty(e,t,n)},hr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},hr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},hr.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;const i=n.config.strict;if(void 0!==i){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw n;"undefined"!=typeof console&&console.warn(n)}return null},yr.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},yr.prototype.getType=function(e){var t=this.typeCache,n=c(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},yr.prototype.createAny=function(e,t,n){var a=pr(e),l={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let a=e;f(t,function(e,s){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 l=t[s+1],p=a[e];i(l)&&o(p)&&(p=a[e]=isNaN(+l)?{}:[]),r(l)?r(n)?delete a[e]:a[e]=n:a=p})}(this,[e],t)}},p={name:e,isGeneric:!0,ns:{prefix:a.prefix,localName:a.localName,uri:t}};return this.properties.defineDescriptor(l,p),this.properties.defineModel(l,this),this.properties.define(l,"get",{enumerable:!1,writable:!0}),this.properties.define(l,"set",{enumerable:!1,writable:!0}),this.properties.define(l,"$parent",{enumerable:!1,writable:!0}),this.properties.define(l,"$instanceOf",{enumerable:!1,writable:!0}),f(n,function(e,t){s(e)&&void 0!==e.value?l[e.name]=e.value:l[t]=e}),l},yr.prototype.getPackage=function(e){return this.registry.getPackage(e)},yr.prototype.getPackages=function(){return this.registry.getPackages()},yr.prototype.getElementDescriptor=function(e){return e.$descriptor},yr.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},yr.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},yr.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var gr=String.fromCharCode,vr=Object.prototype.hasOwnProperty,br=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,xr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Er(e,t,n,r){return r?vr.call(xr,r)?xr[r]:"&"+r+";":gr(t||parseInt(n,16))}function wr(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(br,Er):e}Object.keys(xr).forEach(function(e){xr[e.toUpperCase()]=xr[e]});var _r="non-whitespace outside of root node";function Ar(e){return new Error(e)}function Sr(e){return{get:e,enumerable:!0}}function kr(e,t,n,r){n in t||(t[n]=n in e?e[n]:null),e[n]=r}function Cr(e,t){var n,r;for(n in t)null===(r=t[n])?delete e[n]:e[n]=r}function Rr(e){return e+"$uri"}function Mr(){return{line:0,column:0}}function Pr(e){throw e}function Tr(e){if(!this)return new Tr(e);var t,n,r,i,o,a,s,l,p,c,u,m,h=e&&e.proxy,f=Pr,d=Mr,y=!1,g=!1,v="",b=!1,x=!1,E=null,w=!1;function _(e){e instanceof Error||(e=Ar(e)),E=e,f(e,d)}function A(e){o&&(e instanceof Error||(e=Ar(e)),o(e,d))}function S(){p=x?[]:null,c=x?function(e){var t,n,r=Object.create(null);for(t in e)r[n=e[t]]=n,r[Rr(n)]=t;return r}(m):null,u=[],d=Mr,w=!1,E=null,g=!1,v=""}function k(e,o=!1){var f,y,v,E,S,k,C,R,M,P,T,B,N=null,D=0,O=!1,I=!1,L=0,F=0,j="",V=0;function $(e,t){var n=e.indexOf(":");if(-1===n)return e;var r=c[e.substring(0,n)];return r?t===r?e.substr(n+1):r+e.substr(n):(A(function(e){return"missing namespace for prefix <"+e+">"}(e.substring(0,n))),null)}function W(){if(null!==B)return B;var e,t,n,r,i,o,a,s,l,p=x&&c.xmlns,u=x&&b?[]:null,h=V,d=j,g=d.length,v={},E=new Set;e:for(;h<g;h++)if(a=!1,!(32===(s=d.charCodeAt(h))||s<14&&s>8)){for((s<65||s>122||s>90&&s<97)&&95!==s&&58!==s&&(A("illegal first char attribute name"),a=!0),l=h+1;l<g;l++)if(!((s=d.charCodeAt(l))>96&&s<123||s>64&&s<91||s>47&&s<59||46===s||45===s||95===s)){if(32===s||s<14&&s>8){A("missing attribute value"),h=l;continue e}if(61===s)break;A("illegal attribute name char"),a=!0}if("xmlns:xmlns"===(o=d.substring(h,l))&&(A("illegal declaration of xmlns"),a=!0),34===(s=d.charCodeAt(l+1)))-1===(l=d.indexOf('"',h=l+2))&&-1!==(l=d.indexOf("'",h))&&(A("attribute value quote missmatch"),a=!0);else if(39===s)-1===(l=d.indexOf("'",h=l+2))&&-1!==(l=d.indexOf('"',h))&&(A("attribute value quote missmatch"),a=!0);else for(A("missing attribute value quotes"),a=!0,l+=1;l<g&&!(32===(s=d.charCodeAt(l+1))||s<14&&s>8);l++);for(-1===l&&(A("missing closing quotes"),l=g,a=!0),a||(r=d.substring(h,l)),"xmlns:xml"===o&&"http://www.w3.org/XML/1998/namespace"!==r&&_("illegal value of xmlns:xml"),h=l;l+1<g&&!(32===(s=d.charCodeAt(l+1))||s<14&&s>8);l++)h===l&&(A("illegal character after attribute end"),a=!0);if(h=l+1,!a)if(E.has(o))A("attribute <"+o+"> already defined");else if(E.add(o),x)if(b){if(null!==(n="xmlns"===o?"xmlns":120===o.charCodeAt(0)&&"xmlns:"===o.substr(0,6)?o.substr(6):null)){if(e=wr(r),t=Rr(n),!(i=m[e])){if("xmlns"===n||t in c&&c[t]!==e)do{i="ns"+D++}while(void 0!==c[i]);else i=n;m[e]=i}c[n]!==i&&(f||(f=Object.create(null)),N=null,y=null,kr(c,f,n,i),"xmlns"===n&&(kr(c,f,Rr(i),e),p=i),kr(c,f,t,e)),v[o]=r;continue}u.push(o,r)}else null!==(o=$(o,p))&&(v[o]=r);else v[o]=r}if(b)for(h=0,g=u.length;h<g;h++)o=$(u[h++],p),r=u[h],null!==o&&(v[o]=r);return B=v}for(d=function(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,o=0,a=0,s=F;L>=a&&(t=r.exec(e))&&!((s=t[0].length+t.index)>L);)i+=1,a=s;return-1==L?(o=s,n=e.substring(F)):0===F?n=e.substring(F,L):(o=L-a,n=-1==F?e.substring(L):e.substring(L,F+1)),{data:n,line:i,column:o}},h&&(T=Object.create({},{name:Sr(function(){return M}),originalName:Sr(function(){return P}),attrs:Sr(W),ns:Sr(function(){return y||(y=Object.assign(Object.create(null),c)),y})}));-1!==F;){if(-1===(L=60===e.charCodeAt(F)?F:e.indexOf("<",F)))return o?e.substring(F):u.length?_("unexpected end of file"):g?void(F<e.length&&e.substring(F).trim()&&A(_r)):_("missing start tag");if(g||(g=!0),F!==L)if(u.length){if(t&&(t(e.substring(F,L),wr,d),w))return}else if(e.substring(F,L).trim()&&(A(_r),w))return;if(33===(k=e.charCodeAt(L+1))){if(91===(S=e.charCodeAt(L+2))&&"CDATA["===e.substr(L+3,6)){if(-1===(F=e.indexOf("]]>",L)))return o?e.substring(L):_("unclosed cdata");if(i&&(i(e.substring(L+9,F),d),w))return;F+=3;continue}if(45===S&&45===e.charCodeAt(L+3)){if(-1===(F=e.indexOf("--\x3e",L)))return o?e.substring(L):_("unclosed comment");if(a&&(a(e.substring(L+4,F),wr,d),w))return;F+=3;continue}}if(63!==k){for(v=L+1;;v++){if(C=e.charCodeAt(v),isNaN(C))return o?e.substring(L):(F=-1,_("unclosed tag"));if(34===C)v=-1!==(S=e.indexOf('"',v+1))?S:v;else if(39===C)v=-1!==(S=e.indexOf("'",v+1))?S:v;else if(62===C){F=v;break}}if(33!==k){if(B={},47===k){if(O=!1,I=!0,!u.length)return _("missing open tag");if(v=M=u.pop(),S=L+2+v.length,e.substring(L+2,S)!==v)return _("closing tag mismatch");for(;S<F;S++)if(!(32===(k=e.charCodeAt(S))||k>8&&k<14))return _("close tag")}else{if(47===e.charCodeAt(F-1)?(v=M=e.substring(L+1,F-1),O=!0,I=!0):(v=M=e.substring(L+1,F),O=!0,I=!1),!(k>96&&k<123||k>64&&k<91||95===k||58===k))return _("illegal first char nodeName");for(S=1,E=v.length;S<E;S++)if(!((k=v.charCodeAt(S))>96&&k<123||k>64&&k<91||k>47&&k<59||45===k||95===k||46==k)){if(32===k||k<14&&k>8){M=v.substring(0,S),B=null;break}return _("invalid nodeName")}I||u.push(M)}if(x){O&&(f=null,null===B&&(b=-1!==v.indexOf("xmlns",S))&&(V=S,j=v,W(),b=!1),I||p.push(f)),P=M,null===N&&(N=Object.create(null));var z=N[M];if(void 0!==z)M=z;else{if(-1!==(k=M.indexOf(":"))){if(!(R=c[M.substring(0,k)]))return _("missing namespace on <"+P+">");M=M.substr(k+1)}else R=c.xmlns;R&&(M=R+":"+M),N[P]=M}}if(O&&(V=S,j=v,n&&(h?n(T,wr,I,d):n(M,W,wr,I,d),w)))return;if(I){if(r&&(r(h?T:M,wr,O,d),w))return;x&&(O||(f=p.pop()),f&&(Cr(c,f),f=null,N=null,y=null))}F+=1}else{if(l&&(l(e.substring(L,F+1),wr,d),w))return;F+=1}}else{if(-1===(F=e.indexOf("?>",L)))return o?e.substring(L):_("unclosed question");if(s&&(s(e.substring(L,F+2),d),w))return;F+=2}}}this.on=function(e,p){if("function"!=typeof p)throw Ar("required args <name, cb>");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":r=p;break;case"error":f=p;break;case"warn":o=p;break;case"cdata":i=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw Ar("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Ar("required args <nsMap={}>");var t,n=Object.create(null);for(t in e)n[t]=e[t];return x=!0,m=n,this},this.parse=function(e){if("string"!=typeof e)throw Ar("required args <xml=string>");if(y)throw Ar("parse during stream; call end() first");return S(),k(e),d=Mr,w=!1,E},this.write=function(e){if("string"!=typeof e)throw Ar("required args <xml=string>");return y||(S(),y=!0),E||(v=k(v+e,!0)||""),this},this.end=function(){return y||S(),y=!1,E||k(v),v="",d=Mr,w=!1,E},this.stop=function(){w=!0}}function Br(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Nr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Dr="property";function Or(e){return e.xml&&e.xml.serialize}function Ir(e,t){return Br(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Lr(e){return new Error(e)}function Fr(e){return e.$descriptor}function jr(e){A(this,e),this.elementsById=Object.create(null),this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Lr("expected element");var t,n=this.elementsById,r=Fr(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Lr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Vr(){}function $r(){}function Wr(){}function zr(e,t){this.property=e,this.context=t}function Gr(e,t){this.element=t,this.propertyDesc=e}function Hr(){}function Kr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Ur(e,t,n){Kr.call(this,e,t,n)}function qr(e,t,n){this.model=e,this.context=n}function Yr(e){e instanceof yr&&(e={model:e}),A(this,{lax:!1},e)}Vr.prototype.handleEnd=function(){},Vr.prototype.handleText=function(){},Vr.prototype.handleNode=function(){},$r.prototype=Object.create(Vr.prototype),$r.prototype.handleNode=function(){return this},Wr.prototype=Object.create(Vr.prototype),Wr.prototype.handleText=function(e){this.body=(this.body||"")+e},zr.prototype=Object.create(Wr.prototype),zr.prototype.handleNode=function(e){if(this.element)throw Lr("expected no sub nodes");return this.element=this.createReference(e),this},zr.prototype.handleEnd=function(){this.element.id=this.body},zr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Gr.prototype=Object.create(Wr.prototype),Gr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=ar(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Hr.prototype=Object.create(Wr.prototype),Hr.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},Kr.prototype=Object.create(Hr.prototype),Kr.prototype.addReference=function(e){this.context.addReference(e)},Kr.prototype.handleText=function(e){if(!Fr(this.element).bodyProperty)throw Lr("unexpected body text <"+e+">");Wr.prototype.handleText.call(this,e)},Kr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Fr(t).bodyProperty;n&&void 0!==e&&(e=ar(n.type,e),t.set(n.name,e))},Kr.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=Fr(r),o=this.context,a=new r({}),s=this.model;return f(n,function(e,n){var r=i.propertiesByName[n];r&&r.isReference?r.isMany?f(e.split(" "),function(e){o.addReference({element:a,property:r.ns.name,id:e})}):o.addReference({element:a,property:r.ns.name,id:e}):(r?e=ar(r.type,e):"xmlns"===n?n=":"+n:(t=pr(n,i.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))}),a},Kr.prototype.getPropertyForNode=function(e){var t=pr(e.name),n=this.type,r=this.model,i=Fr(n),o=t.name,a=i.propertiesByName[o];if(a&&!a.isAttr){const t=function(e){const t=Or(e);return t!==Dr&&(t||null)}(a);if(t){const n=e.attributes[t];if(n){const t=function(e,t,n){const r=pr(e,t.xmlns),i=pr(`${t[r.prefix]||r.prefix}:${r.localName}`);return function(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(i,n.getPackage(i.prefix))}(n,e.ns,r);return A({},a,{effectiveType:Fr(r.getType(t)).name})}}return a}var s=r.getPackage(t.prefix);if(s){const e=Ir(t,s),n=r.getType(e);if(a=m(i.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return A({},a,{effectiveType:Fr(n).name})}else if(a=m(i.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return a;throw Lr("unrecognized element <"+t.name+">")},Kr.prototype.toString=function(){return"ElementDescriptor["+Fr(this.type).name+"]"},Kr.prototype.valueHandler=function(e,t){return new Gr(e,t)},Kr.prototype.referenceHandler=function(e){return new zr(e,this.context)},Kr.prototype.handler=function(e){return"Element"===e?new qr(this.model,e,this.context):new Kr(this.model,e,this.context)},Kr.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,lr(n=t.effectiveType||t.type))return this.valueHandler(t,r);var o=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(A(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},Ur.prototype=Object.create(Kr.prototype),Ur.prototype.createElement=function(e){var t=e.name,n=pr(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&Ir(n,o)||t;if(!i.hasType(a))throw Lr("unexpected element <"+e.originalName+">");return Kr.prototype.createElement.call(this,e)},qr.prototype=Object.create(Hr.prototype),qr.prototype.createElement=function(e){var t=e.name,n=pr(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},qr.prototype.handleChild=function(e){var t=new qr(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element;return void 0!==r&&((n.$children=n.$children||[]).push(r),r.$parent=n),t},qr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Yr.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Kr?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,o=this.lax,a=new jr(A({},t,{rootHandler:r})),s=new Tr({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var r=t(),i=r.line,o=r.column,s=r.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw Lr(l)}function c(e,t){return p(e,t,!0)}r.context=a,l.push(r);var u=/^<\?xml /i,m=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=i.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},Object.entries(Nr).reduce(function(e,[t,n]){return e[n]=t,e},i.config&&i.config.nsMap||{}));return s.ns(d).on("openTag",function(e,t,n,r){var i=e.attrs||{},a=Object.keys(i).reduce(function(e,n){var r=t(i[n]);return e[n]=r,e},{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,o)&&l.push(new $r)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},r)}).on("question",function(e){if(u.test(e)){var t=m.exec(e),n=t&&t[1];n&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",f).on("text",function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)}).on("error",p).on("warn",c),new Promise(function(t,n){var i;try{s.parse(e),function(){var e,t,n=a.elementsById,r=a.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],s=Fr(i).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=i.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),o?l[p]=o:l.splice(p,1)}else i.set(s.name,o)}}()}catch(e){i=e}var o=r.element;i||o||(i=Lr("failed to parse document as <"+r.type.$descriptor.name+">"));var l=a.warnings,p=a.references,c=a.elementsById;return i?(i.warnings=l,n(i)):t({rootElement:o,elementsById:c,references:p,warnings:l})})},Yr.prototype.handler=function(e){return new Ur(this.model,e)};var Xr=/<|>|'|"|&|\n\r|\n/g,Zr=/<|>|&/g;function Jr(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function Qr(e,t){return Br(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function ei(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function ti(e){return c(e)?e:(e.prefix?e.prefix+":":"")+e.localName}Jr.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},Jr.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},Jr.prototype.resolve=function(e){for(var t=this;t;){var n=e(t);if(n)return n;t=t.parent}},Jr.prototype.eachScope=function(e){for(var t=this;t;)e(t),t=t.parent},Jr.prototype.byUri=function(e){return this.resolve(function(t){return t.uriMap[e]})},Jr.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)},Jr.prototype.uriByPrefix=function(e){var t=e||"xmlns";return this.resolve(function(e){return e.prefixMap[t]})},Jr.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},Jr.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},Jr.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e),r=this.byUri(t);this.eachScope(function(e){e.used[n]=r})},Jr.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter(e=>{var t=this.getNSKey(e);return this.used[t]})};var ni={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},ri={"<":"lt",">":"gt","&":"amp"};function ii(e,t,n){return(e=c(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function oi(e){return ii(e,Xr,ni)}function ai(e){return ii(e,Zr,ri)}function si(e){this.tagName=e}function li(){}function pi(e){this.tagName=e}function ci(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ui(e,t,n){ci.call(this,e,t),this.serialization=n}function mi(){this.value="",this.write=function(e){this.value+=e}}function hi(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function fi(e){return e=A({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new mi,i=new hi(r,e.format);e.preamble&&i.append('<?xml version="1.0" encoding="UTF-8"?>\n');var o=new ci,a=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){const t=e.config&&e.config.nsMap||{},n={};for(const e in Nr)n[e]=Nr[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(i),!n)return r.value}}}function di(e,t){yr.call(this,e,t)}si.prototype.build=function(e){return this.element=e,this},si.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+ai(this.element.id)+"</"+this.tagName+">").appendNewLine()},li.prototype.serializeValue=li.prototype.serializeTo=function(e){e.append(this.escape?ai(this.value):this.value)},li.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Zr)&&(this.escape=!0),this},ei(pi,li),pi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},ci.prototype.build=function(e){return function(e,t){var n=[{serializer:e,children:e.enter(t),index:0}];for(;n.length;){var r=n[n.length-1];if(r.index>=r.children.length)r.serializer.exit(),n.pop();else{var i=r.children[r.index++],o=i.create();r.serializer.body.push(o),i.element&&n.push({serializer:o,children:o.enter(i.element),index:0})}}}(this,e),this},ci.prototype.enter=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r=t.isGeneric;if(this.otherAttrs=r?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=n?this.nsPropertyTagName(n):this.nsTagName(t),this.tagName=this.addTagName(this.ns),r)return this.collectGenericContainments(e);var i=function(e){return h(e.$descriptor.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!u(e,n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)})}(e);return this.parseAttributes(h(i,function(e){return e.isAttr})),this.collectContainments(function(e){return h(e,function(e){return!e.isAttr})}(i))},ci.prototype.exit=function(){this.parseGenericAttributes(this.element,this.otherAttrs)},ci.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?A({localName:t.ns.localName},e):A({localName:Qr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},ci.prototype.nsPropertyTagName=function(e){return function(e,t){return A({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},ci.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},ci.prototype.nsAttributeName=function(e){var t;if(t=c(e)?pr(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}:A({localName:t.localName},n)},ci.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}))},ci.prototype.collectGenericContainments=function(e){var t=this,n=[],r=e.$body;r&&n.push({create:function(){return(new li).build({type:"String"},r)}});var i=e.$children;return i&&f(i,function(e){n.push({create:function(){return new ci(t)},element:e})}),n},ci.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,o=pr(t);if("xmlns"===o.prefix&&(r={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var a=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(a)}},ci.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return f(n,function(n,i){var o=t.parseNsAttribute(e,i,n);o&&r.push(o)}),r},ci.prototype.parseGenericAttributes=function(e,t){var n=this;f(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)}})},ci.prototype.collectContainments=function(e){var t=this,n=this.element,r=[];return f(e,function(e){var i=n.get(e.name),o=e.isReference;if(e.isMany||(i=[i]),e.isBody)r.push({create:function(){return(new li).build(e,i[0])}});else if(lr(e.type))f(i,function(n){r.push({create:function(){return new pi(t.addTagName(t.nsPropertyTagName(e))).build(e,n)}})});else if(o)f(i,function(n){r.push({create:function(){return new si(t.addTagName(t.nsPropertyTagName(e))).build(n)}})});else{var a=Or(e);f(i,function(n){r.push({create:function(){return a?a===Dr?new ci(t,e):new ui(t,e,a):new ci(t)},element:n})})}}),r},ci.prototype.getNamespaces=function(e){var t=this.namespaces;if(!t){var n=this.getParentNamespaces();e||!n?this.namespaces=t=new Jr(n):t=n}return t},ci.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},ci.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix;return r.byUri(i)&&!n||r.add(e,t),r.mapPrefix(o,i),e},ci.prototype.logNamespaceUsed=function(e,t){var n,r,i,o=this.getNamespaces(t),a=e.prefix,s=e.uri;if(!a&&!s)return{localName:e.localName};if(i=o.defaultUriByPrefix(a),!(s=s||i||o.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if((e=o.byUri(s))||a||(e=this.logNamespace({uri:s},i===s,!0)),!e){for(n=a,r=1;o.uriByPrefix(n);)n=a+"_"+r++;e=this.logNamespace({prefix:n,uri:s},i===s)}return a&&o.mapPrefix(a,s),e},ci.prototype.parseAttributes=function(e){var t=this,n=this.element;f(e,function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];f(r,function(e){i.push(e.id)}),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)})},ci.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),ti(e)},ci.prototype.addAttribute=function(e,t){var n=this.attrs;c(t)&&(t=oi(t));var r=function(e,t){const n=b(t);let r=a(e)?-1:void 0;return f(e,function(e,t){if(n(e,t))return r=t,!1}),r}(n,function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix}),i={name:e,value:t};-1!==r?n.splice(r,1,i):n.push(i)},ci.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:oi(e.uri)}})}(n).concat(t)),f(t,function(t){e.append(" ").append(ti(t.name)).append('="').append(t.value).append('"')})},ci.prototype.serializeTo=function(e){!function(e,t){var n=[{serializer:e,index:0,opened:!1,indent:!1}];for(;n.length;){var r=n[n.length-1],i=r.serializer;if(!r.opened){var o=i.body[0];if(r.indent=o&&o.constructor!==li,t.appendIndent().append("<"+i.tagName),i.serializeAttributes(t),t.append(o?">":" />"),r.opened=!0,!o){t.appendNewLine(),n.pop();continue}r.indent&&t.appendNewLine().indent()}if(r.index<i.body.length){var a=i.body[r.index++];a instanceof ci?n.push({serializer:a,index:0,opened:!1,indent:!1}):a.serializeTo(t)}else r.indent&&t.unindent().appendIndent(),t.append("</"+i.tagName+">").appendNewLine(),n.pop()}}(this,e)},ei(ui,ci),ui.prototype.parseNsAttributes=function(e){var t=ci.prototype.parseNsAttributes.call(this,e).filter(e=>e.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},ui.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},di.prototype=Object.create(yr.prototype),di.prototype.fromXML=function(e,t,n){c(t)||(n=t,t="bpmn:Definitions");var r=new Yr(A({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)},di.prototype.toXML=function(e,t){var n=new fi(t);return new Promise(function(t,r){try{return t({xml:n.toXML(e)})}catch(e){return r(e)}})};const yi={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 gi(e,t){return new di(A({},yi,e),t)}function vi(e,t){return e.$instanceOf(t)}function bi(e){var t={},n=[],r={};function i(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function a(t,n){try{var i=r[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${bt(t)}`);return e.element(t,r[t.id],n)}(t,n);return o(t),i}catch(e){s(e.message,{element:t,error:e}),console.error(`failed to import ${bt(t)}`,e)}}function s(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t=e.bpmnElement;t?r[t.id]?s(`multiple DI elements defined for ${bt(t)}`,{element:t}):r[t.id]=e:s(`no bpmnElement referenced in ${bt(e)}`,{element:e})};function p(e){var t;t=e.plane,l(t),f(t.planeElement,c)}function c(e){l(e)}this.handleDefinitions=function(o,a){var c=o.diagrams;if(a&&-1===c.indexOf(a))throw new Error("diagram not part of <bpmn:Definitions />");if(!a&&c&&c.length&&(a=c[0]),!a)throw new Error("no diagram to display");r={},p(a);var g=a.plane;if(!g)throw new Error(`no plane for ${bt(a)}`);var v=g.bpmnElement;if(!v){if(v=function(e){return m(e.rootElements,function(e){return vi(e,"bpmn:Process")||vi(e,"bpmn:Collaboration")})}(o),!v)throw new Error("no process or collaboration to display");s(`correcting missing bpmnElement on ${bt(g)} to ${bt(v)}`),g.bpmnElement=v,l(g)}var b,x,w=function(t,n){return e.root(t,r[t.id],n)}(v,g);if(vi(v,"bpmn:Process")||vi(v,"bpmn:SubProcess"))d(v,w);else{if(!vi(v,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${bt(g)}: ${bt(v)}`);x=w,f((b=v).participants,i(M,x)),n.push(function(){!function(e,t){f(e,i(y,t))}(b.messageFlows,x)}),E(b.artifacts,x),function(e,n){var r=h(e,function(e){return!t[e.id]&&vi(e,"bpmn:Process")&&e.laneSets});r.forEach(i(d,n))}(o.rootElements,w)}u(n)};var u=this.handleDeferred=function(){for(;n.length;)n.shift()()};function d(e,t){R(e,t),w(e.ioSpecification,t),E(e.artifacts,t),o(e)}function y(e,t){a(e,t)}function g(e,t){a(e,t)}function v(e,t){a(e,t)}function b(e,t){a(e,t)}function x(e,t){a(e,t)}function E(e,t){f(e,function(e){vi(e,"bpmn:Association")?n.push(function(){x(e,t)}):x(e,t)})}function w(e,t){e&&(f(e.dataInputs,i(v,t)),f(e.dataOutputs,i(b,t)))}var _=this.handleSubProcess=function(e,t){R(e,t),E(e.artifacts,t)};function A(e,t){var r=a(e,t);vi(e,"bpmn:SubProcess")&&_(e,r||t),vi(e,"bpmn:Activity")&&w(e.ioSpecification,t),n.push(function(){f(e.dataInputAssociations,i(g,t)),f(e.dataOutputAssociations,i(g,t))})}function S(e,t){a(e,t)}function k(e,t){n.push(function(){var n=a(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){f(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function C(e,t){f(e.lanes,i(k,t))}function R(e,t){!function(e,t){f(e,function(e){vi(e,"bpmn:SequenceFlow")?n.push(function(){!function(e,t){a(e,t)}(e,t)}):vi(e,"bpmn:BoundaryEvent")?n.unshift(function(){A(e,t)}):vi(e,"bpmn:FlowNode")?A(e,t):vi(e,"bpmn:DataObject")||(vi(e,"bpmn:DataStoreReference")||vi(e,"bpmn:DataObjectReference")?S(e,t):s(`unrecognized flowElement ${bt(e)} in context ${bt(t&&t.businessObject)}`,{element:e,context:t}))})}(e.flowElements,t),e.laneSets&&function(e,t){f(e,i(C,t))}(e.laneSets,t)}function M(e,t){var n=a(e,t),r=e.processRef;r&&d(r,n||t)}}function xi(e,t,n){var r,i,o,a=[];function s(e,t){var n=new bi({root:function(e,t){return r.add(e,t)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){a.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var i=function(e,t){if(!t||!t.plane)return;var n,r=t.plane.bpmnElement,i=r;k(r,"bpmn:Process")||k(r,"bpmn:Collaboration")||(i=function(e){var t=e;for(;t;){if(k(t,"bpmn:Process"))return t;t=t.$parent}}(r));n=k(i,"bpmn:Collaboration")?i:m(e.rootElements,function(e){if(k(e,"bpmn:Collaboration"))return m(e.participants,function(e){return e.processRef===i})});var o=[i];n&&(o=function(e,t){let n=[];return f(e,function(e,r){n.push(t(e,r))}),n}(n.participants,function(e){return e.processRef})).push(n);var a=Ei(o),s=[t],l=[r];return f(e.diagrams,function(e){if(e.plane){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))}}),s}(e,t);if(!i)throw new Error("no diagram to display");f(i,function(t){n.handleDefinitions(e,t)});var s=t.plane.bpmnElement.id;o.setRootElement(o.findRoot(s+"_plane")||o.findRoot(s))}return new Promise(function(l,p){try{return r=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),s(t,n),i.fire("import.render.complete",{error:void 0,warnings:a}),l({warnings:a})}catch(e){return e.warnings=a,p(e)}})}function Ei(e){var t=[];return f(e,function(e){e&&(t.push(e),t=t.concat(Ei(e.flowElements)))}),t}var wi,_i='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',Ai={verticalAlign:"middle"},Si={color:"#404040"},ki={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Ci={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Ri={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},Mi='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+_i+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function Pi(){wi||(Re(wi=ke(Mi),ki),Re($e("svg",wi),Ai),Re($e(".backdrop",wi),Ci),Re($e(".notice",wi),Ri),Re($e(".link",wi),Si,{margin:"15px 20px 15px 10px",alignSelf:"center"}),Ve.bind(wi,".backdrop","click",function(e){document.body.removeChild(wi)})),document.body.appendChild(wi)}const Ti="djs-outline-hidden";function Bi(e){e=A({},Di,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),function(e){const t=ke('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+_i+"</a>");Re($e("svg",t),Ai),Re(t,Si,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),Fe.bind(t,"click",function(e){Pi(),e.preventDefault()})}(this._container)}function Ni(e,t){return e.warnings=t,e}e(Bi,tr),Bi.prototype.importXML=async function(e,t){const n=this;let r=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let a=o.rootElement;const s=o.references,l=o.warnings,p=o.elementsById;r=r.concat(l),a=this._emit("import.parse.complete",(i={error:null,definitions:a,elementsById:p,references:s,warnings:r},n.get("eventBus").createEvent(i)))||a;const c=await this.importDefinitions(a,t);return r=r.concat(c.warnings),this._emit("import.done",{error:null,warnings:r}),{warnings:r}}catch(e){let t=e;throw r=r.concat(t.warnings||[]),Ni(t,r),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var i},Bi.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},Bi.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Ni(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return m(e.diagrams,function(e){return e.id===t})||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Ni(t,[]),t}try{this.clear()}catch(e){throw Ni(e,[]),e}const{warnings:r}=await xi(this,t,n);return{warnings:r}},Bi.prototype.saveXML=async function(e){e=e||{};let t,n,r=this._definitions;try{if(!r)throw new Error("no definitions loaded");r=this._emit("saveXML.start",{definitions:r})||r;n=(await this._moddle.toXML(r,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const i=t?{error:t}:{xml:n};if(this._emit("saveXML.done",i),t)throw t;return i},Bi.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),r=$e(":scope > defs",t._svg),i=ie(n),o=r?"<defs>"+ie(r)+"</defs>":"",a=t.getContainer();let s;Te(a).add(Ti);try{s=n.getBBox()}finally{Te(a).remove(Ti)}const l=s.x-5,p=s.y-5,c=s.width+10,u=s.height+10;e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+c+'" height="'+u+'" viewBox="'+l+" "+p+" "+c+" "+u+'" version="1.1">'+o+i+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},Bi.prototype._setDefinitions=function(e){this._definitions=e},Bi.prototype.getModules=function(){return this._modules},Bi.prototype.clear=function(){this.getDefinitions()&&tr.prototype.clear.call(this)},Bi.prototype.destroy=function(){tr.prototype.destroy.call(this),We(this._container)},Bi.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},Bi.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Bi.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=$e(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Bi.prototype.getDefinitions=function(){return this._definitions},Bi.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Bi.prototype._init=function(e,t,n){const r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],r,i),a=A(function(e,t){let n={};return f(Object(e),function(e,r){-1===t.indexOf(r)&&(n[r]=e)}),n}(n,["additionalModules"]),{canvas:A({},n.canvas,{container:e}),modules:o});tr.call(this,a),n&&n.container&&this.attachTo(n.container)},Bi.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Bi.prototype._createContainer=function(e){const t=ke('<div class="bjs-container bio-theme-parent"></div>');return Re(t,{width:Oi(e.width),height:Oi(e.height),position:e.position}),t},Bi.prototype._createModdle=function(e){return new gi(A({},this._moddleExtensions,e.moddleExtensions))},Bi.prototype._modules=[];const Di={width:"100%",height:"100%",position:"relative"};function Oi(e){return e+(l(e)?"px":"")}function Ii(e){Bi.call(this,e)}e(Ii,Bi),Ii.prototype._modules=[At,Zt,Tt,mn,ft],Ii.prototype._moddleExtensions={};var Li={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:FlowNode"],properties:[{name:"async",isAttr:!0,type:"Boolean"},{name:"exclusive",isAttr:!0,type:"Boolean"},{name:"asyncLeave",isAttr:!0,type:"Boolean"},{name:"asyncLeaveExclusive",isAttr:!0,type:"Boolean"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["bpmn:Activity"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Element-name",superClass:["Element"],meta:{allowedIn:["bpmn:FlowElement"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"JobCategory",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","bpmn:TimerEventDefinition"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"IncludeInHistory",superClass:["Element"],meta:{allowedIn:["bpmn:FlowElement"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Localization",superClass:["Element"],meta:{allowedIn:["bpmn:Process","bpmn:FlowElement","bpmn:DataObject"]},properties:[{name:"locale",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"documentation",type:"Documentation"}]},{name:"Documentation",superClass:["Element"],properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Listener",isAbstract:!0,superClass:["Element"],properties:[{name:"event",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"onTransaction",isAttr:!0,type:"String"},{name:"customPropertiesResolverClass",isAttr:!0,type:"String"},{name:"customPropertiesResolverExpression",isAttr:!0,type:"String"},{name:"customPropertiesResolverDelegateExpression",isAttr:!0,type:"String"},{name:"fields",type:"Field",isMany:!0},{name:"script",type:"Script"}]},{name:"ExecutionListener",superClass:["Listener"],meta:{allowedIn:["bpmn:Process","bpmn:FlowNode","bpmn:SequenceFlow"]}},{name:"TaskListener",superClass:["Listener"],meta:{allowedIn:["bpmn:UserTask"]}},{name:"EventListener",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"events",isAttr:!0,type:"String"},{name:"entityType",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"throwEvent",isAttr:!0,type:"String"},{name:"signalName",isAttr:!0,type:"String"},{name:"messageName",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"},{name:"onTransaction",isAttr:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:SendTask","flowable:Listener","flowable:HttpHandler"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"string",type:"String"},{name:"expressionElement",type:"Expression"}]},{name:"Expression",superClass:["Element"],properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Script",superClass:["Element"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"isEagerExecutionFetching",isAttr:!0,type:"Boolean"}]},{name:"PotentialStarter",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"HistoryLevel",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask","bpmn:ServiceTask"],properties:[{name:"formKey",isAttr:!0,type:"String"},{name:"formFieldValidation",isAttr:!0,type:"String"},{name:"sameDeployment",isAttr:!0,type:"Boolean"}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"variable",isAttr:!0,type:"String"},{name:"default",isAttr:!0,type:"String"},{name:"datePattern",isAttr:!0,type:"String"},{name:"lenientDateParsing",isAttr:!0,type:"Boolean"},{name:"readable",isAttr:!0,type:"Boolean"},{name:"writable",isAttr:!0,type:"Boolean"},{name:"required",isAttr:!0,type:"Boolean"},{name:"values",type:"Value",isMany:!0}]},{name:"Value",superClass:["Element"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"ResourceAssignmentExpression",isAbstract:!0,extends:["bpmn:ResourceAssignmentExpression"],properties:[{name:"expression",type:"bpmn:Expression",replaces:"bpmn:ResourceAssignmentExpression#expression"}]},{name:"UserTask",isAbstract:!0,extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"owner",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"businessCalendarName",isAttr:!0,type:"String"},{name:"category",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"extensionId",isAttr:!0,type:"String"},{name:"skipExpression",isAttr:!0,type:"String"},{name:"taskIdVariableName",isAttr:!0,type:"String"},{name:"taskCompleterVariableName",isAttr:!0,type:"String"}]},{name:"CustomResource",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"ServiceTask",isAbstract:!0,extends:["bpmn:ServiceTask"],properties:[{name:"class",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariableName",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"},{name:"useLocalScopeForResultVariable",isAttr:!0,type:"Boolean"},{name:"storeResultVariableAsTransient",isAttr:!0,type:"Boolean"},{name:"skipExpression",isAttr:!0,type:"String"},{name:"extensionId",isAttr:!0,type:"String"},{name:"triggerable",isAttr:!0,type:"Boolean"},{name:"type",isAttr:!0,type:"String"},{name:"parallelInSameTransaction",isAttr:!0,type:"Boolean"},{name:"caseDefinitionKey",isAttr:!0,type:"String"},{name:"caseInstanceName",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"inheritBusinessKey",isAttr:!0,type:"Boolean"},{name:"inheritVariables",isAttr:!0,type:"Boolean"},{name:"fallbackToDefaultTenant",isAttr:!0,type:"Boolean"},{name:"idVariableName",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"},{name:"doNotIncludeVariables",isAttr:!0,type:"Boolean"}]},{name:"MapException",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:CallActivity"]},properties:[{name:"errorCode",isAttr:!0,type:"String"},{name:"includeChildExceptions",isAttr:!0,type:"Boolean"},{name:"rootCause",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"HttpHandler",isAbstract:!0,superClass:["Element"],properties:[{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"fields",type:"Field",isMany:!0},{name:"script",type:"Script"},{name:"extensionElements",type:"bpmn:ExtensionElements"}]},{name:"HttpRequestHandler",superClass:["HttpHandler"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"HttpResponseHandler",superClass:["HttpHandler"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"IOParameter",isAbstract:!0,superClass:["Element"],properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"targetExpression",isAttr:!0,type:"String"},{name:"sourceType",isAttr:!0,type:"String"},{name:"targetType",isAttr:!0,type:"String"},{name:"transient",isAttr:!0,type:"Boolean"}]},{name:"ExternalWorkerInParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"ExternalWorkerOutParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"EventInParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"EventOutParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:Event","bpmn:ReceiveTask"]}},{name:"EventType",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:Event","bpmn:ReceiveTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"TriggerEventType",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"SendSynchronously",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"TriggerEventCorrelationParameter",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"}]},{name:"ChannelKey",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"SystemChannel",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resultVariableName",isAttr:!0,type:"String"},{name:"autoStoreVariables",isAttr:!0,type:"Boolean"},{name:"doNotIncludeVariables",isAttr:!0,type:"Boolean"},{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"BusinessRuleTask",isAbstract:!0,extends:["bpmn:BusinessRuleTask"],properties:[{name:"ruleVariablesInput",isAttr:!0,type:"String"},{name:"rules",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"exclude",isAttr:!0,type:"Boolean"}]},{name:"SendTask",isAbstract:!0,extends:["bpmn:SendTask"],properties:[{name:"type",isAttr:!0,type:"String"}]},{name:"ReceiveTask",isAbstract:!0,extends:["bpmn:ReceiveTask"],properties:[{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"CallActivity",isAbstract:!0,extends:["bpmn:CallActivity"],properties:[{name:"calledElementType",isAttr:!0,type:"String"},{name:"processInstanceName",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"inheritBusinessKey",isAttr:!0,type:"Boolean"},{name:"inheritVariables",isAttr:!0,type:"Boolean"},{name:"sameDeployment",isAttr:!0,type:"Boolean"},{name:"calledElementBinding",isAttr:!0,type:"String"},{name:"useLocalScopeForOutParameters",isAttr:!0,type:"Boolean"},{name:"completeAsync",isAttr:!0,type:"Boolean"},{name:"fallbackToDefaultTenant",isAttr:!0,type:"Boolean"},{name:"idVariableName",isAttr:!0,type:"String"}]},{name:"In",superClass:["IOParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:StartEvent","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"]},properties:[{name:"variables",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean"},{name:"businessKey",isAttr:!0,type:"String"}]},{name:"Out",superClass:["IOParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:ServiceTask","bpmn:EndEvent","bpmn:IntermediateThrowEvent"]},properties:[{name:"variables",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean"}]},{name:"MultiInstanceLoopCharacteristics",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"},{name:"elementIndexVariable",isAttr:!0,type:"String"},{name:"noWaitStatesAsyncLeave",isAttr:!0,type:"Boolean"}]},{name:"Collection",superClass:["Element"],meta:{allowedIn:["bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"string",type:"String"},{name:"expression",type:"String"}]},{name:"VariableAggregation",superClass:["Element"],meta:{allowedIn:["bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"target",isAttr:!0,type:"String"},{name:"targetExpression",isAttr:!0,type:"String"},{name:"storeAsTransientVariable",isAttr:!0,type:"Boolean"},{name:"createOverviewVariable",isAttr:!0,type:"Boolean"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"bpmn:variable",type:"flowable:Variable",isMany:!0,xml:{serialize:"property"}}]},{name:"Variable",superClass:["Element"],properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"targetExpression",isAttr:!0,type:"String"}]},{name:"TimerEventDefinition",isAbstract:!0,extends:["bpmn:TimerEventDefinition"],properties:[{name:"businessCalendarName",isAttr:!0,type:"String"}]},{name:"TimeCycle",isAbstract:!0,extends:["bpmn:Expression"],properties:[{name:"endDate",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"signalExpression",isAttr:!0,type:"String"},{name:"async",isAttr:!0,type:"Boolean"}]},{name:"MessageEventDefinition",isAbstract:!0,extends:["bpmn:MessageEventDefinition"],properties:[{name:"messageExpression",isAttr:!0,type:"String"}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorVariableName",isAttr:!0,type:"String"},{name:"errorVariableTransient",isAttr:!0,type:"Boolean"},{name:"errorVariableLocalScope",isAttr:!0,type:"Boolean"}]},{name:"TerminateEventDefinition",isAbstract:!0,extends:["bpmn:TerminateEventDefinition"],properties:[{name:"terminateAll",isAttr:!0,type:"Boolean"},{name:"terminateMultiInstance",isAttr:!0,type:"Boolean"}]},{name:"VariableListenerEventDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"]},properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableChangeType",isAttr:!0,type:"String"}]},{name:"EventName",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:ReceiveTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"EventCorrelationParameter",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:ReceiveTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"}]},{name:"StartEventCorrelationConfiguration",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Signal",isAbstract:!0,extends:["bpmn:Signal"],properties:[{name:"scope",isAttr:!0,type:"String"}]},{name:"SequenceFlow",isAbstract:!0,extends:["bpmn:SequenceFlow"],properties:[{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"Work-form-field-validation",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Task-candidates-type",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Static-process-key",superClass:["Element"],meta:{allowedIn:["bpmn:CallActivity"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Translation",superClass:["Element"],meta:{allowedIn:["bpmn:BaseElement"]},properties:[{name:"key",isAttr:!0,type:"String"},{name:"locale",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"ItemAwareElement",isAbstract:!0,extends:["bpmn:ItemAwareElement"],properties:[{name:"bpmn:itemSubjectRef",isAttr:!0,type:"String",replaces:"bpmn:ItemAwareElement#itemSubjectRef"}]}],enumerations:[]};const Fi="http://flowable.org/bpmn",ji=/(\sxmlns(?::[A-Za-z_][\w.-]*)?\s*=\s*)(["'])http:\/\/activiti\.org\/bpmn\2/g;function Vi(e,t){const n=e.getPackage("flowable");if(!n)throw new Error("the Flowable descriptor is not registered with this moddle instance");const r=[];for(const i of function(e){const t=new Set,n=/\sxmlns:([A-Za-z_][\w.-]*)\s*=\s*(["'])([^"']*)\2/g;for(const r of e.matchAll(n))r[3]===Fi&&t.add(r[1]);return t}(t)){const o=new RegExp(`<${Wi(i)}:([A-Za-z_][\\w.-]*)`,"g");for(const i of t.matchAll(o)){const t=i[1].charAt(0).toUpperCase()+i[1].slice(1),o=`${n.prefix}:${t}`;r.includes(o)||$i(e,o)||(e.registry.registerType({name:t,superClass:["Element"],meta:{generic:!0},properties:[{name:"body",isBody:!0,type:"String"},{name:"children",type:"Element",isMany:!0}]},n),r.push(o))}}return r}function $i(e,t){try{return!!e.getType(t)}catch{return!1}}function Wi(e){return e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")}const zi={"bpmn:errorRef":{type:"bpmn:Error",attribute:"errorCode",prefix:"Error"},"bpmn:messageRef":{type:"bpmn:Message",attribute:"name",prefix:"Message"},"bpmn:signalRef":{type:"bpmn:Signal",attribute:"name",prefix:"Signal"},"bpmn:escalationRef":{type:"bpmn:Escalation",attribute:"escalationCode",prefix:"Escalation"}},Gi=/^unresolved reference </,Hi=/^[a-z_][\w-.]*$/i;function Ki(e,{warnings:t,elementsById:n={}}){if(!e||!t)return[];const r=e.$model,i=new Map,o=[];t.forEach(t=>{const a=zi[t.property];if(!a||!t.element||"string"!=typeof t.value||!Gi.test(t.message||""))return;const s=`${a.type} ${t.value}`;let l=function(e,t,n,r){const i=/^([A-Za-z_][\w.-]*):([A-Za-z_][\w.-]*)$/.exec(n);if(!i)return null;const[,o,a]=i,s=e.$attrs&&e.$attrs[`xmlns:${o}`],l=r[a];if(!s||s!==e.get("targetNamespace")||!l||!l.$instanceOf(t.type))return null;return l}(e,a,t.value,n)||i.get(s)||function(e,t,n){return(e.get("rootElements")||[]).find(e=>e.$instanceOf(t.type)&&e.get(t.attribute)===n)}(e,a,t.value);l||(l=r.create(a.type,{id:Ui(a,t.value,n),[a.attribute]:t.value}),function(e,t){const n=e.get("rootElements");let r=n.findIndex(e=>!Object.values(zi).some(t=>e.$instanceOf(t.type)));-1===r&&(r=n.length);n.splice(r,0,t),t.$parent=e}(e,l),n[l.get("id")]=l),i.set(s,l),t.element.set(t.property,l),o.push({warning:t,element:t.element,property:t.property,value:t.value,definition:l})});const a=t.filter(e=>!o.some(t=>t.warning===e));return t.splice(0,t.length,...a),o}function Ui(e,t,n){if(Hi.test(t)&&!n[t])return t;const r=`${e.prefix}_${t.replace(/[^\w-.]/g,"_").replace(/^_+|_+$/g,"")||"Ref"}`;let i=r;for(let e=2;n[i];e++)i=`${r}_${e}`;return i}class qi{constructor(e,t){e.on("import.parse.start",({xml:e})=>{const n=function(e){return e.replace(ji,`$1$2${Fi}$2`)}(e);return Vi(t,n),n}),e.on("import.parse.complete",1500,({error:e,definitions:t,warnings:n,elementsById:r})=>{!e&&t&&Ki(t,{warnings:n,elementsById:r})}),e.on("saveXML.start",({definitions:e})=>function(e){const t=e.$attrs||{};for(const e of Object.keys(t))e.startsWith("xmlns:")&&"xmlns:flowable"!==e&&t[e]===Fi&&delete t[e];return t["xmlns:flowable"]&&t["xmlns:flowable"]!==Fi&&delete t["xmlns:flowable"],e}(e))}}qi.$inject=["eventBus","moddle"];var Yi={__init__:["flowableXML"],flowableXML:["type",qi]};const Xi={defaultFillColor:"var(--flowable-shape-fill, white)",defaultStrokeColor:"var(--flowable-shape-stroke, hsl(225, 10%, 15%))",defaultLabelColor:"var(--flowable-label-color, var(--flowable-shape-stroke, hsl(225, 10%, 15%)))"};const Zi={mail:[["rect",{x:3,y:6,width:18,height:12,rx:1.5}],["path",{d:"M3.5 7 L12 13 L20.5 7"}]],http:[["circle",{cx:12,cy:12,r:8.5}],["path",{d:"M3.5 12 H20.5"}],["path",{d:"M12 3.5 C8.4 7 8.4 17 12 20.5 C15.6 17 15.6 7 12 3.5"}]],shell:[["rect",{x:3,y:5,width:18,height:14,rx:2}],["path",{d:"M7 9.5 L10 12 L7 14.5"}],["path",{d:"M12 15 H16.5"}]],camel:[["circle",{cx:6,cy:6.5,r:2.2}],["circle",{cx:18,cy:17.5,r:2.2}],["path",{d:"M8.2 6.5 H13 C16.2 6.5 16.2 12 12 12 C7.8 12 7.8 17.5 11 17.5 H15.8"}]],dmn:[["rect",{x:3.5,y:5,width:17,height:14,rx:1}],["path",{d:"M3.5 9.5 H20.5"}],["path",{d:"M3.5 14.25 H20.5"}],["path",{d:"M9.5 9.5 V19"}]],case:[["rect",{x:3.5,y:8,width:17,height:11,rx:1.5}],["path",{d:"M9 8 V6.2 C9 5.5 9.5 5 10.2 5 H13.8 C14.5 5 15 5.5 15 6.2 V8"}],["path",{d:"M3.5 12.5 H20.5"}]],"send-event":[["circle",{cx:12,cy:12,r:1.8}],["path",{d:"M8.6 8.6 C6.7 10.5 6.7 13.5 8.6 15.4"}],["path",{d:"M15.4 8.6 C17.3 10.5 17.3 13.5 15.4 15.4"}],["path",{d:"M5.6 5.6 C2.1 9.1 2.1 14.9 5.6 18.4"}],["path",{d:"M18.4 5.6 C21.9 9.1 21.9 14.9 18.4 18.4"}]],"external-worker":[["path",{d:"M14 4.5 H19.5 V10"}],["path",{d:"M19.5 4.5 L11 13"}],["path",{d:"M17 13.5 V18.5 C17 19.1 16.6 19.5 16 19.5 H5.5 C4.9 19.5 4.5 19.1 4.5 18.5 V8 C4.5 7.4 4.9 7 5.5 7 H10.5"}]]},Ji={fill:"none","stroke-width":1.5,"stroke-linecap":"round","stroke-linejoin":"round"},Qi=[{type:"mail",label:"Mail task"},{type:"http",label:"HTTP task",fields:{requestMethod:"GET"}},{type:"shell",label:"Shell task"},{type:"camel",label:"Camel task"},{type:"dmn",label:"Decision task"},{type:"case",label:"Case task"},{type:"send-event",label:"Send event task"},{type:"external-worker",label:"External worker task"}];function eo(e){const t=e&&e.businessObject;return k(t,"bpmn:ServiceTask")?(n=t.get("flowable:type"),Qi.find(e=>e.type===n)||null):null;var n}class to extends S{constructor(e,t,n){super(t,1500),this._bpmnRenderer=n,this._defaultStrokeColor=e&&e.defaultStrokeColor}canRender(e){return!e.labelTarget&&!!eo(e)}drawShape(e,t,n){const r=this._bpmnRenderer.handlers["bpmn:Task"](e,t,n);return this._drawIcon(e,t,n),r}getShapePath(e){return this._bpmnRenderer.getShapePath(e)}_drawIcon(e,t,n={}){const{type:r}=eo(t),i=q("g");z(i).add("flowable-task-icon"),$(i,{"data-type":r,transform:"translate(5, 5) scale(0.75)",...Ji,stroke:be(t,this._defaultStrokeColor,n.stroke)}),Zi[r].forEach(([e,t])=>{const n=q(e);$(n,t),F(i,n)}),F(e,i)}}to.$inject=["config.bpmnRenderer","eventBus","bpmnRenderer"];var no={__init__:["typedTaskRenderer"],typedTaskRenderer:["type",to]};class ro extends Ii{constructor(e){super(function(e={}){return{...e,bpmnRenderer:{...Xi,...e.bpmnRenderer}}}(e))}}return ro.prototype._modules=[...Ii.prototype._modules,Yi,no],ro.prototype._moddleExtensions={flowable:Li},ro}();
|