var Da=Object.defineProperty,Oa=Object.defineProperties;var Na=Object.getOwnPropertyDescriptors;var Mr=Object.getOwnPropertySymbols;var Ba=Object.prototype.hasOwnProperty,La=Object.prototype.propertyIsEnumerable;var kr=(e,t,n)=>t in e?Da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t)=>{for(var n in t||(t={}))Ba.call(t,n)&&kr(e,n,t[n]);if(Mr)for(var n of Mr(t))La.call(t,n)&&kr(e,n,t[n]);return e},xe=(e,t)=>Oa(e,Na(t));var Mt=(e,t,n)=>new Promise((r,i)=>{var a=c=>{try{l(n.next(c))}catch(p){i(p)}},o=c=>{try{l(n.throw(c))}catch(p){i(p)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,o);l((n=n.apply(e,t)).next())});function Xe(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function nf(e){return Array.prototype.concat.apply([],e)}const Zt=Object.prototype.toString,Ia=Object.prototype.hasOwnProperty;function Gt(e){return e===void 0}function Ot(e){return e!==void 0}function Fa(e){return e==null}function Me(e){return Zt.call(e)==="[object Array]"}function Ke(e){return Zt.call(e)==="[object Object]"}function Pe(e){return Zt.call(e)==="[object Number]"}function Qe(e){const t=Zt.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Ge(e){return Zt.call(e)==="[object String]"}function $a(e){if(!Me(e))throw new Error("must supply array")}function St(e,t){return Ia.call(e,t)}function $e(e,t){const n=Dn(t);let r;return B(e,function(i,a){if(n(i,a))return r=i,!1}),r}function ja(e,t){const n=Dn(t);let r=Me(e)?-1:void 0;return B(e,function(i,a){if(n(i,a))return r=a,!1}),r}function _t(e,t){const n=Dn(t);let r=[];return B(e,function(i,a){n(i,a)&&r.push(i)}),r}function B(e,t){let n,r;if(Gt(e))return;const i=Me(e)?Ua:Ha;for(let a in e)if(St(e,a)&&(n=e[a],r=t(n,i(a)),r===!1))return n}function rf(e,t){if(Gt(e))return[];$a(e);const n=Dn(t);return e.filter(function(r,i){return!n(r,i)})}function Nt(e,t,n){return B(e,function(r,i){n=t(n,r,i)}),n}function rr(e,t){return!!Nt(e,function(n,r,i){return n&&t(r,i)},!0)}function ir(e,t){return!!$e(e,t)}function kn(e,t){let n=[];return B(e,function(r,i){n.push(t(r,i))}),n}function Va(e){return e&&Object.keys(e)||[]}function af(e){return Va(e).length}function of(e){return kn(e,t=>t)}function mi(e,t,n={}){return t=ar(t),B(e,function(r){let i=t(r)||"_",a=n[i];a||(a=n[i]=[]),a.push(r)}),n}function Wa(e,...t){e=ar(e);let n={};return B(t,i=>mi(i,e,n)),kn(n,function(i,a){return i[0]})}const sf=Wa;function za(e,t){t=ar(t);let n=[];return B(e,function(r,i){let a=t(r,i),o={d:a,v:r};for(var l=0;lr.v)}function Dr(e){return function(t){return rr(e,function(n,r){return t[r]===n})}}function ar(e){return Qe(e)?e:t=>t[e]}function Dn(e){return Qe(e)?e:t=>t===e}function Ha(e){return e}function Ua(e){return Number(e)}function Ya(e,t){let n,r,i,a;function o(y){let T=Date.now(),g=y?0:a+t-T;if(g>0)return l(g);e.apply(i,r),c()}function l(y){n=setTimeout(o,y)}function c(){n&&clearTimeout(n),n=a=r=i=void 0}function p(){n&&o(!0),c()}function d(...y){a=Date.now(),r=y,i=this,n||l(t)}return d.flush=p,d.cancel=c,d}function et(e,t){return e.bind(t)}function V(e,...t){return Object.assign(e,...t)}function Ka(e,t,n){let r=e;return B(t,function(i,a){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let o=t[a+1],l=r[i];Ot(o)&&Fa(l)&&(l=r[i]=isNaN(+o)?{}:[]),Gt(o)?Gt(n)?delete r[i]:r[i]=n:r=l}),e}function Ga(e,t){let n={},r=Object(e);return B(t,function(i){i in r&&(n[i]=e[i])}),n}function qa(e,t){let n={},r=Object(e);return B(r,function(i,a){t.indexOf(a)===-1&&(n[a]=i)}),n}var Xa=1e3;function nt(e,t){var n=this;t=t||Xa,e.on(["render.shape","render.connection"],t,function(r,i){var a=r.type,o=i.element,l=i.gfx,c=i.attrs;if(n.canRender(o))return a==="render.shape"?n.drawShape(l,o,c):n.drawConnection(l,o,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}nt.prototype.canRender=function(e){};nt.prototype.drawShape=function(e,t){};nt.prototype.drawConnection=function(e,t){};nt.prototype.getShapePath=function(e){};nt.prototype.getConnectionPath=function(e){};function $(e,t){var n=ue(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function xn(e,t){return ir(t,function(n){return $(e,n)})}function ue(e){return e&&e.businessObject||e}function ft(e){return e&&e.di}function xt(e,t){return $(e,"bpmn:CallActivity")?!1:$(e,"bpmn:SubProcess")?(t=t||ft(e),t&&$(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):$(e,"bpmn:Participant")?!!ue(e).processRef:!0}function Or(e){if(!(!$(e,"bpmn:Participant")&&!$(e,"bpmn:Lane"))){var t=ft(e).isHorizontal;return t===void 0?!0:t}}function uf(e){return e&&ue(e).isInterrupting!==!1}function Za(e){return e&&!!ue(e).triggeredByEvent}function or(e,t){var n=ue(e).eventDefinitions;return ir(n,function(r){return $(r,t)})}function lf(e){return or(e,"bpmn:ErrorEventDefinition")}function cf(e){return or(e,"bpmn:EscalationEventDefinition")}function ff(e){return or(e,"bpmn:CompensateEventDefinition")}function Qa(e){return Ke(e)&&St(e,"waypoints")}function sr(e){return Ke(e)&&St(e,"labelTarget")}var _n={width:90,height:20},Nr=15;function Ja(e){return $(e,"bpmn:Event")||$(e,"bpmn:Gateway")||$(e,"bpmn:DataStoreReference")||$(e,"bpmn:DataObjectReference")||$(e,"bpmn:DataInput")||$(e,"bpmn:DataOutput")||$(e,"bpmn:SequenceFlow")||$(e,"bpmn:MessageFlow")||$(e,"bpmn:Group")}function pf(e){return sr(e.label)}function eo(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=to(e),a=Math.atan((r.y-n.y)/(r.x-n.x)),o=i.x,l=i.y;return Math.abs(a)"+e+"",t=!0);var n=po(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function po(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function te(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=fo(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(ur.svg,e),t&&Q(n,t),n}var Vn=null;function Ei(){return Vn===null&&(Vn=te("svg")),Vn}function Lr(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function ho(e,t,n,r,i,a){var o=Ei().createSVGMatrix();switch(arguments.length){case 0:return o;case 1:return Lr(o,e);case 6:return Lr(o,{a:e,b:t,c:n,d:r,e:i,f:a})}}function Ut(e){return Ei().createSVGTransform()}var Ir=/([&<>]{1})/g,mo=/([\n\r"]{1})/g,yo={"&":"&","<":"<",">":">",'"':"'"};function Wn(e,t){function n(r,i){return yo[i]||i}return e.replace(t,n)}function wi(e,t){var n,r,i,a,o;switch(e.nodeType){case 3:t.push(Wn(e.textContent,Ir));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n"),o=e.childNodes,n=0,r=o.length;n")}else t.push("/>");break;case 8:t.push("");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function go(e){for(var t=e.firstChild,n=[];t;)wi(t,n),t=t.nextSibling;return n.join("")}function Fr(e,t){return go(e)}function Qt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function vo(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Eo(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(vo(e,r))}function qt(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),Eo(n,t)),n.consolidate()}function At(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function wo(e){return["M",e.x,e.y]}function zn(e){return["L",e.x,e.y]}function xo(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function _o(e,t){const n=e.length,r=[wo(e[0])];for(let i=1;i
a',Ai=!un.getElementsByTagName("link").length,un=void 0);var he={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:Ai?[1,"X
","
"]:[0,"",""]};he.td=he.th=[3,"","
"];he.option=he.optgroup=[1,'"];he.thead=he.tbody=he.colgroup=he.caption=he.tfoot=[1,"","
"];he.polyline=he.ellipse=he.polygon=he.circle=he.text=he.line=he.path=he.rect=he.g=[1,'',""];function Uo(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if(r=="body"){var c=t.createElement("html");return c.innerHTML=e,c.removeChild(c.lastChild)}var i=Object.prototype.hasOwnProperty.call(he,r)?he[r]:he._default,a=i[0],o=i[1],l=i[2],c=t.createElement("div");for(c.innerHTML=o+e+l;a--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var p=t.createDocumentFragment();c.firstChild;)p.appendChild(c.removeChild(c.firstChild));return p}var qe=Ho;function mf(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function We(e,t){return t=t||document,t.querySelector(e)}function Yo(e,t){return t=t||document,t.querySelectorAll(e)}function Rn(e){e.parentNode&&e.parentNode.removeChild(e)}function Hn(e,t,n,r,i){var a=Ut();a.setTranslate(t,n);var o=Ut();o.setRotate(r||0,0,0);var l=Ut();l.setScale(1,1),qt(e,[a,o,l])}function Ri(e,t,n){var r=Ut();r.setTranslate(t,n),qt(e,r)}function Ko(e,t){var n=Ut();n.setRotate(t,0,0),qt(e,n)}function Go(e,t){return t={exports:{}},e(t,t.exports),t.exports}var qo=Go(function(e){var t=e.exports=function(n,r){if(r||(r=16),n===void 0&&(n=128),n<=0)return"0";for(var i=Math.log(Math.pow(2,n))/Math.log(r),a=2;i===1/0;a*=2)i=Math.log(Math.pow(2,n/a))/Math.log(r)*a;for(var o=i-Math.floor(i),l="",a=0;a=Math.pow(2,n)?t(n,r):l};t.rack=function(n,r,i){var a=function(l){var c=0;do{if(c++>10)if(i)n+=i;else throw new Error("too many ID collisions, use more bits");var p=t(n,r)}while(Object.hasOwnProperty.call(o,p));return o[p]=l,p},o=a.hats={};return a.get=function(l){return a.hats[l]},a.set=function(l,c){return a.hats[l]=c,a},a.bits=n||128,a.base=r||16,a}});function tt(e){if(!(this instanceof tt))return new tt(e);e=e||[128,36,1],this._seed=e.length?qo.rack(e[0],e[1],e[2]):e}tt.prototype.next=function(e){return this._seed(e||!0)};tt.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};tt.prototype.claim=function(e,t){this._seed.set(e,t||!0)};tt.prototype.assigned=function(e){return this._seed.get(e)||!1};tt.prototype.unclaim=function(e){delete this._seed.hats[e]};tt.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var Xo=new tt,Zo=10,ln=3,Qo=1.5,mn=10,kt=.95,Jo=1,es=.25;function Rt(e,t,n,r,i,a,o){nt.call(this,t,o);var l=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,p=e&&e.defaultLabelColor,d=Xo.next(),y={};function T(f){return n.computeStyle(f,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Gn,strokeWidth:2,fill:"white"})}function g(f){return n.computeStyle(f,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Gn,strokeWidth:2})}function w(f,s){var{ref:u={x:0,y:0},scale:h=1,element:m}=s,_=te("marker",{id:f,viewBox:"0 0 20 20",refX:u.x,refY:u.y,markerWidth:20*h,markerHeight:20*h,orient:"auto"});fe(_,m);var z=We("defs",i._svg);z||(z=te("defs"),fe(i._svg,z)),fe(z,_),y[f]=_}function M(f){return f.replace(/[^0-9a-zA-Z]+/g,"_")}function L(f,s,u){var h=f+"-"+M(s)+"-"+M(u)+"-"+d;return y[h]||W(h,f,s,u),"url(#"+h+")"}function W(f,s,u,h){if(s==="sequenceflow-end"){var m=te("path",ae({d:"M 1 5 L 11 10 L 1 15 Z"},T({fill:h,stroke:h,strokeWidth:1})));w(f,{element:m,ref:{x:11,y:10},scale:.5})}if(s==="messageflow-start"){var _=te("circle",ae({cx:6,cy:6,r:3.5},T({fill:u,stroke:h,strokeWidth:1,strokeDasharray:[1e4,1]})));w(f,{element:_,ref:{x:6,y:6}})}if(s==="messageflow-end"){var z=te("path",ae({d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"},T({fill:u,stroke:h,strokeWidth:1,strokeDasharray:[1e4,1]})));w(f,{element:z,ref:{x:8.5,y:5}})}if(s==="association-start"){var Z=te("path",ae({d:"M 11 5 L 1 10 L 11 15"},g({fill:"none",stroke:h,strokeWidth:1.5,strokeDasharray:[1e4,1]})));w(f,{element:Z,ref:{x:1,y:10},scale:.5})}if(s==="association-end"){var X=te("path",ae({d:"M 1 5 L 11 10 L 1 15"},g({fill:"none",stroke:h,strokeWidth:1.5,strokeDasharray:[1e4,1]})));w(f,{element:X,ref:{x:11,y:10},scale:.5})}if(s==="conditional-flow-marker"){var J=te("path",ae({d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"},T({fill:u,stroke:h})));w(f,{element:J,ref:{x:-1,y:10},scale:.5})}if(s==="conditional-default-flow-marker"){var de=te("path",ae({d:"M 6 4 L 10 16"},T({stroke:h})));w(f,{element:de,ref:{x:0,y:10},scale:.5})}}function F(f,s,u,h,m={}){Ke(h)&&(m=h,h=0),h=h||0,m=T(m);var _=s/2,z=u/2,Z=te("circle",ae({cx:_,cy:z,r:Math.round((s+u)/4-h)},m));return fe(f,Z),Z}function b(f,s,u,h,m,_){Ke(m)&&(_=m,m=0),m=m||0,_=T(_);var z=te("rect",ae({x:m,y:m,width:s-m*2,height:u-m*2,rx:h,ry:h},_));return fe(f,z),z}function E(f,s,u,h){var m=s/2,_=u/2,z=[{x:m,y:0},{x:s,y:_},{x:m,y:u},{x:0,y:_}],Z=z.map(function(J){return J.x+","+J.y}).join(" ");h=T(h);var X=te("polygon",xe(ae({},h),{points:Z}));return fe(f,X),X}function x(f,s,u,h){u=g(u);var m=lr(s,u,h);return fe(f,m),m}function R(f,s,u){return x(f,s,u,5)}function S(f,s,u){u=g(u);var h=te("path",xe(ae({},u),{d:s}));return fe(f,h),h}function v(f,s,u,h){return S(s,u,V({"data-marker":f},h))}function k(f){return ge[f]}function P(f){return function(s,u,h){return k(f)(s,u,h)}}var O={"bpmn:MessageEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:s.width,containerHeight:s.height,position:{mx:.235,my:.315}}),_=h?D(s,c,u.stroke):K(s,l,u.fill),z=h?K(s,l,u.fill):D(s,c,u.stroke),Z=S(f,m,{fill:_,stroke:z,strokeWidth:1});return Z},"bpmn:TimerEventDefinition":function(f,s,u={}){var h=F(f,s.width,s.height,.2*s.height,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:2}),m=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:s.width,containerHeight:s.height,position:{mx:.5,my:.5}});S(f,m,{stroke:D(s,c,u.stroke),strokeWidth:2});for(var _=0;_<12;_++){var z=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:s.width,containerHeight:s.height,position:{mx:.5,my:.5}}),Z=s.width/2,X=s.height/2;S(f,z,{strokeWidth:1,stroke:D(s,c,u.stroke),transform:"rotate("+_*30+","+X+","+Z+")"})}return h},"bpmn:EscalationEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.5,my:.2}}),_=h?D(s,c,u.stroke):K(s,l,u.fill);return S(f,m,{fill:_,stroke:D(s,c,u.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(f,s,u={}){var h=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.5,my:.222}});return S(f,h,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.57,my:.263}}),_=h?D(s,c,u.stroke):K(s,l,u.fill);return S(f,m,{fill:_,stroke:D(s,c,u.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:s.width,containerHeight:s.height,position:{mx:.2,my:.722}}),_=h?D(s,c,u.stroke):K(s,l,u.fill);return S(f,m,{fill:_,stroke:D(s,c,u.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.638,my:-.055}}),_=h?D(s,c,u.stroke):"none",z=S(f,m,{fill:_,stroke:D(s,c,u.stroke),strokeWidth:1});return Ko(z,45),z},"bpmn:CompensateEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.22,my:.5}}),_=h?D(s,c,u.stroke):K(s,l,u.fill);return S(f,m,{fill:_,stroke:D(s,c,u.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:s.width,containerHeight:s.height,position:{mx:.5,my:.2}}),_=h?D(s,c,u.stroke):K(s,l,u.fill);return S(f,m,{strokeWidth:1,fill:_,stroke:D(s,c,u.stroke)})},"bpmn:MultipleEventDefinition":function(f,s,u={},h){var m=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:s.width,containerHeight:s.height,position:{mx:.222,my:.36}}),_=h?D(s,c,u.stroke):K(s,l,u.fill);return S(f,m,{fill:_,strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(f,s,u={}){var h=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:s.width,containerHeight:s.height,position:{mx:.458,my:.194}});return S(f,h,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(f,s,u={}){var h=F(f,s.width,s.height,8,{fill:D(s,c,u.stroke),stroke:D(s,c,u.stroke),strokeWidth:4});return h}};function N(f,s,u={}){var h=ue(f),m=So(h);return h.get("eventDefinitions")&&h.get("eventDefinitions").length>1?h.get("parallelMultiple")?O["bpmn:ParallelMultipleEventDefinition"](s,f,u,m):O["bpmn:MultipleEventDefinition"](s,f,u,m):ze(h,"bpmn:MessageEventDefinition")?O["bpmn:MessageEventDefinition"](s,f,u,m):ze(h,"bpmn:TimerEventDefinition")?O["bpmn:TimerEventDefinition"](s,f,u,m):ze(h,"bpmn:ConditionalEventDefinition")?O["bpmn:ConditionalEventDefinition"](s,f,u,m):ze(h,"bpmn:SignalEventDefinition")?O["bpmn:SignalEventDefinition"](s,f,u,m):ze(h,"bpmn:EscalationEventDefinition")?O["bpmn:EscalationEventDefinition"](s,f,u,m):ze(h,"bpmn:LinkEventDefinition")?O["bpmn:LinkEventDefinition"](s,f,u,m):ze(h,"bpmn:ErrorEventDefinition")?O["bpmn:ErrorEventDefinition"](s,f,u,m):ze(h,"bpmn:CancelEventDefinition")?O["bpmn:CancelEventDefinition"](s,f,u,m):ze(h,"bpmn:CompensateEventDefinition")?O["bpmn:CompensateEventDefinition"](s,f,u,m):ze(h,"bpmn:TerminateEventDefinition")?O["bpmn:TerminateEventDefinition"](s,f,u,m):null}var j={ParticipantMultiplicityMarker:function(f,s,u={}){var h=Fe(s,u),m=Ce(s,u),_=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:h,containerHeight:m,position:{mx:(h/2-6)/h,my:(m-15)/m}});v("participant-multiplicity",f,_,{strokeWidth:2,fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)})},SubProcessMarker:function(f,s,u={}){var h=b(f,14,14,0,{strokeWidth:1,fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)});Ri(h,s.width/2-7.5,s.height-20);var m=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:s.width,containerHeight:s.height,position:{mx:(s.width/2-7.5)/s.width,my:(s.height-20)/s.height}});v("sub-process",f,m,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)})},ParallelMarker:function(f,s,u){var h=Fe(s,u),m=Ce(s,u),_=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:h,containerHeight:m,position:{mx:(h/2+u.parallel)/h,my:(m-20)/m}});v("parallel",f,_,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)})},SequentialMarker:function(f,s,u){var h=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:(s.width/2+u.seq)/s.width,my:(s.height-19)/s.height}});v("sequential",f,h,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)})},CompensationMarker:function(f,s,u){var h=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:(s.width/2+u.compensation)/s.width,my:(s.height-13)/s.height}});v("compensation",f,h,{strokeWidth:1,fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)})},LoopMarker:function(f,s,u){var h=Fe(s,u),m=Ce(s,u),_=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:h,containerHeight:m,position:{mx:(h/2+u.loop)/h,my:(m-7)/m}});v("loop",f,_,{strokeWidth:1.5,fill:"none",stroke:D(s,c,u.stroke),strokeMiterlimit:.5})},AdhocMarker:function(f,s,u){var h=Fe(s,u),m=Ce(s,u),_=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:h,containerHeight:m,position:{mx:(h/2+u.adhoc)/h,my:(m-15)/m}});v("adhoc",f,_,{strokeWidth:1,fill:D(s,c,u.stroke),stroke:D(s,c,u.stroke)})}};function Y(f,s,u,h){j[f](s,u,h)}function Ae(f,s,u,h={}){h={fill:h.fill,stroke:h.stroke,width:Fe(s,h),height:Ce(s,h)};var m=ue(s),_=u&&u.includes("SubProcessMarker");_?h=xe(ae({},h),{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}):h=xe(ae({},h),{seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10}),B(u,function(X){Y(X,f,s,h)}),m.get("isForCompensation")&&Y("CompensationMarker",f,s,h),$(m,"bpmn:AdHocSubProcess")&&Y("AdhocMarker",f,s,h);var z=m.get("loopCharacteristics"),Z=z&&z.get("isSequential");z&&(Z===void 0&&Y("LoopMarker",f,s,h),Z===!1&&Y("ParallelMarker",f,s,h),Z===!0&&Y("SequentialMarker",f,s,h))}function ne(f,s,u={}){u=V({size:{width:100}},u);var h=a.createText(s||"",u);return Oe(h).add("djs-label"),fe(f,h),h}function G(f,s,u,h={}){var m=ue(s),_=zt({x:s.x,y:s.y,width:s.width,height:s.height},h);return ne(f,m.name,{align:u,box:_,padding:7,style:{fill:Wt(s,p,c,h.stroke)}})}function Ie(f,s,u={}){var h={width:90,height:30,x:s.width/2+s.x,y:s.height/2+s.y};return ne(f,bn(s),{box:h,fitBox:!0,style:V({},a.getExternalStyle(),{fill:Wt(s,p,c,u.stroke)})})}function De(f,s,u,h={}){var m=Or(u),_=ne(f,s,{box:{height:30,width:m?Ce(u,h):Fe(u,h)},align:"center-middle",style:{fill:Wt(u,p,c,h.stroke)}});if(m){var z=-1*Ce(u,h);Hn(_,0,-z,270)}}function le(f,s,u={}){var{width:h,height:m}=zt(s,u);return b(f,h,m,mn,xe(ae({},u),{fill:K(s,l,u.fill),fillOpacity:kt,stroke:D(s,c,u.stroke)}))}function ve(f,s,u={}){var h=ue(s),m=K(s,l,u.fill),_=D(s,c,u.stroke);return(h.get("associationDirection")==="One"||h.get("associationDirection")==="Both")&&(u.markerEnd=L("association-end",m,_)),h.get("associationDirection")==="Both"&&(u.markerStart=L("association-start",m,_)),u=q(u,["markerStart","markerEnd"]),R(f,s.waypoints,xe(ae({},u),{stroke:_,strokeDasharray:"0, 5"}))}function A(f,s,u={}){var h=K(s,l,u.fill),m=D(s,c,u.stroke),_=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.474,my:.296}}),z=S(f,_,{fill:h,fillOpacity:kt,stroke:m}),Z=ue(s);if(Ao(Z)){var X=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:.33,my:(s.height-18)/s.height}});S(f,X,{strokeWidth:2,fill:h,stroke:m})}return z}function C(f,s,u={}){return F(f,s.width,s.height,xe(ae({fillOpacity:kt},u),{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)}))}function I(f,s,u={}){return E(f,s.width,s.height,{fill:K(s,l,u.fill),fillOpacity:kt,stroke:D(s,c,u.stroke)})}function re(f,s,u={}){var h=b(f,Fe(s,u),Ce(s,u),0,{fill:K(s,l,u.fill),fillOpacity:u.fillOpacity||kt,stroke:D(s,c,u.stroke),strokeWidth:1.5}),m=ue(s);if($(m,"bpmn:Lane")){var _=m.get("name");De(f,_,s,u)}return h}function ye(f,s,u={}){var h=le(f,s,u);Za(s)&&Q(h,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var m=xt(s);return G(f,s,m?"center-top":"center-middle",u),m?Ae(f,s,void 0,u):Ae(f,s,["SubProcessMarker"],u),h}function oe(f,s,u={}){var h=le(f,s,u);return G(f,s,"center-middle",u),Ae(f,s,void 0,u),h}var ge=this.handlers={"bpmn:AdHocSubProcess":function(f,s,u={}){return xt(s)?u=q(u,["fill","stroke","width","height"]):u=q(u,["fill","stroke"]),ye(f,s,u)},"bpmn:Association":function(f,s,u={}){return u=q(u,["fill","stroke"]),ve(f,s,u)},"bpmn:BoundaryEvent":function(f,s,u={}){var{renderIcon:h=!0}=u;u=q(u,["fill","stroke"]);var m=ue(s),_=m.get("cancelActivity");u={strokeWidth:1.5,fill:K(s,l,u.fill),fillOpacity:Jo,stroke:D(s,c,u.stroke)},_||(u.strokeDasharray="6");var z=C(f,s,u);return F(f,s.width,s.height,ln,xe(ae({},u),{fill:"none"})),h&&N(s,f,u),z},"bpmn:BusinessRuleTask":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=oe(f,s,u),m=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),_=S(f,m);Q(_,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1});var z=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),Z=S(f,z);return Q(Z,{fill:D(s,c,u.stroke),stroke:D(s,c,u.stroke),strokeWidth:1}),h},"bpmn:CallActivity":function(f,s,u={}){return u=q(u,["fill","stroke"]),ye(f,s,ae({strokeWidth:5},u))},"bpmn:ComplexGateway":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=I(f,s,u),m=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:s.width,containerHeight:s.height,position:{mx:.46,my:.26}});return S(f,m,{fill:D(s,c,u.stroke),stroke:D(s,c,u.stroke),strokeWidth:1}),h},"bpmn:DataInput":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=r.getRawPath("DATA_ARROW"),m=A(f,s,u);return S(f,h,{fill:"none",stroke:D(s,c,u.stroke),strokeWidth:1}),m},"bpmn:DataInputAssociation":function(f,s,u={}){return u=q(u,["fill","stroke"]),ve(f,s,xe(ae({},u),{markerEnd:L("association-end",K(s,l,u.fill),D(s,c,u.stroke))}))},"bpmn:DataObject":function(f,s,u={}){return u=q(u,["fill","stroke"]),A(f,s,u)},"bpmn:DataObjectReference":P("bpmn:DataObject"),"bpmn:DataOutput":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=r.getRawPath("DATA_ARROW"),m=A(f,s,u);return S(f,h,{strokeWidth:1,fill:K(s,l,u.fill),stroke:D(s,c,u.stroke)}),m},"bpmn:DataOutputAssociation":function(f,s,u={}){return u=q(u,["fill","stroke"]),ve(f,s,xe(ae({},u),{markerEnd:L("association-end",K(s,l,u.fill),D(s,c,u.stroke))}))},"bpmn:DataStoreReference":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:s.width,containerHeight:s.height,position:{mx:0,my:.133}});return S(f,h,{fill:K(s,l,u.fill),fillOpacity:kt,stroke:D(s,c,u.stroke),strokeWidth:2})},"bpmn:EndEvent":function(f,s,u={}){var{renderIcon:h=!0}=u;u=q(u,["fill","stroke"]);var m=C(f,s,xe(ae({},u),{strokeWidth:4}));return h&&N(s,f,u),m},"bpmn:EventBasedGateway":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=ue(s),m=I(f,s,u);F(f,s.width,s.height,s.height*.2,{fill:K(s,"none",u.fill),stroke:D(s,c,u.stroke),strokeWidth:1});var _=h.get("eventGatewayType"),z=!!h.get("instantiate");function Z(){var J=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:s.width,containerHeight:s.height,position:{mx:.36,my:.44}});S(f,J,{fill:"none",stroke:D(s,c,u.stroke),strokeWidth:2})}if(_==="Parallel"){var X=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:s.width,containerHeight:s.height,position:{mx:.474,my:.296}});S(f,X,{fill:"none",stroke:D(s,c,u.stroke),strokeWidth:1})}else _==="Exclusive"&&(z||F(f,s.width,s.height,s.height*.26,{fill:"none",stroke:D(s,c,u.stroke),strokeWidth:1}),Z());return m},"bpmn:ExclusiveGateway":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=I(f,s,u),m=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:s.width,containerHeight:s.height,position:{mx:.32,my:.3}}),_=ft(s);return _.get("isMarkerVisible")&&S(f,m,{fill:D(s,c,u.stroke),stroke:D(s,c,u.stroke),strokeWidth:1}),h},"bpmn:Gateway":function(f,s,u={}){return u=q(u,["fill","stroke"]),I(f,s,u)},"bpmn:Group":function(f,s,u={}){return u=q(u,["fill","stroke","width","height"]),b(f,s.width,s.height,mn,{stroke:D(s,c,u.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Fe(s,u),height:Ce(s,u)})},"bpmn:InclusiveGateway":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=I(f,s,u);return F(f,s.width,s.height,s.height*.24,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:2.5}),h},"bpmn:IntermediateEvent":function(f,s,u={}){var{renderIcon:h=!0}=u;u=q(u,["fill","stroke"]);var m=C(f,s,xe(ae({},u),{strokeWidth:1.5}));return F(f,s.width,s.height,ln,{fill:"none",stroke:D(s,c,u.stroke),strokeWidth:1.5}),h&&N(s,f,u),m},"bpmn:IntermediateCatchEvent":P("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":P("bpmn:IntermediateEvent"),"bpmn:Lane":function(f,s,u={}){return u=q(u,["fill","stroke","width","height"]),re(f,s,xe(ae({},u),{fillOpacity:es}))},"bpmn:ManualTask":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=oe(f,s,u),m=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return S(f,m,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:.5}),h},"bpmn:MessageFlow":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=ue(s),m=ft(s),_=K(s,l,u.fill),z=D(s,c,u.stroke),Z=R(f,s.waypoints,{markerEnd:L("messageflow-end",_,z),markerStart:L("messageflow-start",_,z),stroke:z,strokeDasharray:"10, 11",strokeWidth:1.5});if(h.get("messageRef")){var X=Z.getPointAtLength(Z.getTotalLength()/2),J=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:X.x,y:X.y}}),de={strokeWidth:1};m.get("messageVisibleKind")==="initiating"?(de.fill=_,de.stroke=z):(de.fill=z,de.stroke=_);var ee=S(f,J,de),at=h.get("messageRef"),on=at.get("name"),Re=ne(f,on,{align:"center-top",fitBox:!0,style:{fill:z}}),H=ee.getBBox(),ie=Re.getBBox(),Ma=X.x-ie.width/2,ka=X.y+H.height/2+Zo;Hn(Re,Ma,ka,0)}return Z},"bpmn:ParallelGateway":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=I(f,s,u),m=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:s.width,containerHeight:s.height,position:{mx:.46,my:.2}});return S(f,m,{fill:D(s,c,u.stroke),stroke:D(s,c,u.stroke),strokeWidth:1}),h},"bpmn:Participant":function(f,s,u={}){u=q(u,["fill","stroke","width","height"]);var h=re(f,s,u),m=xt(s),_=Or(s),z=ue(s),Z=z.get("name");if(m){var X=_?[{x:30,y:0},{x:30,y:Ce(s,u)}]:[{x:0,y:30},{x:Fe(s,u),y:30}];x(f,X,{stroke:D(s,c,u.stroke),strokeWidth:Qo}),De(f,Z,s,u)}else{var J=zt(s,u);_||(J.height=Fe(s,u),J.width=Ce(s,u));var de=ne(f,Z,{box:J,align:"center-middle",style:{fill:Wt(s,p,c,u.stroke)}});if(!_){var ee=-1*Ce(s,u);Hn(de,0,-ee,270)}}return z.get("participantMultiplicity")&&Y("ParticipantMultiplicityMarker",f,s,u),h},"bpmn:ReceiveTask":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=ue(s),m=oe(f,s,u),_;return h.get("instantiate")?(F(f,28,28,20*.22,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1}),_=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):_=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),S(f,_,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1}),m},"bpmn:ScriptTask":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=oe(f,s,u),m=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return S(f,m,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1}),h},"bpmn:SendTask":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=oe(f,s,u),m=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return S(f,m,{fill:D(s,c,u.stroke),stroke:K(s,l,u.fill),strokeWidth:1}),h},"bpmn:SequenceFlow":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=K(s,l,u.fill),m=D(s,c,u.stroke),_=R(f,s.waypoints,{markerEnd:L("sequenceflow-end",h,m),stroke:m}),z=ue(s),{source:Z}=s;if(Z){var X=ue(Z);z.get("conditionExpression")&&$(X,"bpmn:Activity")&&Q(_,{markerStart:L("conditional-flow-marker",h,m)}),X.get("default")&&($(X,"bpmn:Gateway")||$(X,"bpmn:Activity"))&&X.get("default")===z&&Q(_,{markerStart:L("conditional-default-flow-marker",h,m)})}return _},"bpmn:ServiceTask":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=oe(f,s,u);F(f,10,10,{fill:K(s,l,u.fill),stroke:"none",transform:"translate(6, 6)"});var m=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});S(f,m,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1}),F(f,10,10,{fill:K(s,l,u.fill),stroke:"none",transform:"translate(11, 10)"});var _=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return S(f,_,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:1}),h},"bpmn:StartEvent":function(f,s,u={}){var{renderIcon:h=!0}=u;u=q(u,["fill","stroke"]);var m=ue(s);m.get("isInterrupting")||(u=xe(ae({},u),{strokeDasharray:"6"}));var _=C(f,s,u);return h&&N(s,f,u),_},"bpmn:SubProcess":function(f,s,u={}){return xt(s)?u=q(u,["fill","stroke","width","height"]):u=q(u,["fill","stroke"]),ye(f,s,u)},"bpmn:Task":function(f,s,u={}){return u=q(u,["fill","stroke"]),oe(f,s,u)},"bpmn:TextAnnotation":function(f,s,u={}){u=q(u,["fill","stroke","width","height"]);var{width:h,height:m}=zt(s,u),_=b(f,h,m,0,0,{fill:"none",stroke:"none"}),z=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:h,containerHeight:m,position:{mx:0,my:0}});S(f,z,{stroke:D(s,c,u.stroke)});var Z=ue(s),X=Z.get("text")||"";return ne(f,X,{align:"left-top",box:zt(s,u),padding:7,style:{fill:Wt(s,p,c,u.stroke)}}),_},"bpmn:Transaction":function(f,s,u={}){xt(s)?u=q(u,["fill","stroke","width","height"]):u=q(u,["fill","stroke"]);var h=ye(f,s,ae({strokeWidth:1.5},u)),m=n.style(["no-fill","no-events"],{stroke:D(s,c,u.stroke),strokeWidth:1.5}),_=xt(s);return _||(u={}),b(f,Fe(s,u),Ce(s,u),mn-ln,ln,m),h},"bpmn:UserTask":function(f,s,u={}){u=q(u,["fill","stroke"]);var h=oe(f,s,u),m=15,_=12,z=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:m,y:_}});S(f,z,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:.5});var Z=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:m,y:_}});S(f,Z,{fill:K(s,l,u.fill),stroke:D(s,c,u.stroke),strokeWidth:.5});var X=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:m,y:_}});return S(f,X,{fill:D(s,c,u.stroke),stroke:D(s,c,u.stroke),strokeWidth:.5}),h},label:function(f,s,u={}){return Ie(f,s,u)}};this._drawPath=S,this._renderer=k}Xe(Rt,nt);Rt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];Rt.prototype.canRender=function(e){return $(e,"bpmn:BaseElement")};Rt.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Rt.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Rt.prototype.getShapePath=function(e){return $(e,"bpmn:Event")?Ro(e):$(e,"bpmn:Activity")?Co(e,mn):$(e,"bpmn:Gateway")?Po(e):To(e)};function q(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}var ts=0,ns={width:150,height:50};function rs(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function is(e){return Ke(e)?V({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function as(e,t){t.textContent=e;var n;try{var r,i=e==="";return t.textContent=i?"dummy":e,n=t.getBBox(),r={width:n.width+n.x*2,height:n.height},i&&(r.width=0),r}catch(a){return{width:0,height:0}}}function os(e,t,n){for(var r=e.shift(),i=r,a;;){if(a=as(i,n),a.width=i?a.width:0,i===" "||i===""||a.width1)for(;r=n.shift();)if(r.length+aF?b.width:F},0),M=a.top;i.vertical==="middle"&&(M+=(n.height-g)/2),M-=(l||p[0].height)/4;var L=te("text");Q(L,r),B(p,function(F){var b;switch(M+=l||F.height,i.horizontal){case"left":b=a.left;break;case"right":b=(o?w:d)-a.right-F.width;break;default:b=Math.max(((o?w:d)-F.width)/2+a.left,0)}var E=te("tspan");Q(E,{x:b,y:M}),E.textContent=F.text,fe(L,E)}),Qt(y);var W={width:w,height:g};return{dimensions:W,element:L}};function fs(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var ps=12,hs=1.2,ds=30;function Ci(e){var t=V({fontFamily:"Arial, sans-serif",fontSize:ps,fontWeight:"normal",lineHeight:hs},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=V({},t,{fontSize:n},e&&e.externalStyle||{}),i=new On({style:t});this.getExternalLabelBounds=function(a,o){var l=i.getDimensions(o,{box:{width:90,height:30},style:r});return{x:Math.round(a.x+a.width/2-l.width/2),y:Math.round(a.y),width:Math.ceil(l.width),height:Math.ceil(l.height)}},this.getTextAnnotationBounds=function(a,o){var l=i.getDimensions(o,{box:a,style:t,align:"left-top",padding:5});return{x:a.x,y:a.y,width:a.width,height:Math.max(ds,Math.round(l.height))}},this.createText=function(a,o){return i.createText(a,o||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Ci.$inject=["config.textRenderer"];function ms(){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(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,a;n.abspos?(i=n.abspos.x,a=n.abspos.y):(i=n.containerWidth*n.position.mx,a=n.containerHeight*n.position.my);var o={};if(n.position){for(var l=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,p=0;pt.x-n&&e.y>t.y-n&&e.x=1e3&&delete i[a.shift()],a.push(r),i[r]=e(...arguments),i[r])}return t}function Ms(e){if(!e)return null;var t=Bt(e);if(t.arr)return Yt(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=[];return Cn(e)&&Cn(e[0])&&(r=Yt(e)),r.length||String(e).replace(Rs,function(i,a,o){var l=[],c=a.toLowerCase();for(o.replace(Cs,function(p,d){d&&l.push(+d)}),c=="m"&&l.length>2&&(r.push([a,...l.splice(0,2)]),c="l",a=a=="m"?"l":"L");l.length>=n[c]&&(r.push([a,...l.splice(0,n[c])]),!!n[c]););}),r.toString=Bt.toString,t.arr=Yt(r),r}function Bt(e){var t=Bt.ps=Bt.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)hr(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function Zn(e,t,n,r){return arguments.length===1&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function Ti(){return this.join(",").replace(As,"$1")}function Pn(e){var t=Yt(e);return t.toString=Ti,t}function zr(e,t,n,r,i,a,o,l,c){var p=1-c,d=Wr(p,3),y=Wr(p,2),T=c*c,g=T*c,w=d*e+y*3*c*n+p*3*c*c*i+g*o,M=d*t+y*3*c*r+p*3*c*c*a+g*l;return{x:Tn(w),y:Tn(M)}}function Hr(e){var t=Ls(...e);return Zn(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function st(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function ks(e,t){return e=Zn(e),t=Zn(t),st(t,e.x,e.y)||st(t,e.x2,e.y)||st(t,e.x,e.y2)||st(t,e.x2,e.y2)||st(e,t.x,t.y)||st(e,t.x2,t.y)||st(e,t.x,t.y2)||st(e,t.x2,t.y2)||(e.xt.x||t.xe.x)&&(e.yt.y||t.ye.y)}function Ur(e,t,n,r,i){var a=-3*t+9*n-9*r+3*i,o=e*a+6*t-12*n+6*r;return e*o-3*t+3*n}function Yr(e,t,n,r,i,a,o,l,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var p=c/2,d=12,y=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],T=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],g=0,w=0;wUe(i,o)||Ue(t,r)Ue(a,l))){var c=(e*r-t*n)*(i-o)-(e-n)*(i*l-a*o),p=(e*r-t*n)*(a-l)-(t-r)*(i*l-a*o),d=(e-n)*(a-l)-(t-r)*(i-o);if(d){var y=Tn(c/d),T=Tn(p/d),g=+y.toFixed(2),w=+T.toFixed(2);if(!(g<+He(e,n).toFixed(2)||g>+Ue(e,n).toFixed(2)||g<+He(i,o).toFixed(2)||g>+Ue(i,o).toFixed(2)||w<+He(t,r).toFixed(2)||w>+Ue(t,r).toFixed(2)||w<+He(a,l).toFixed(2)||w>+Ue(a,l).toFixed(2)))return{x:y,y:T}}}}function Tn(e){return Math.round(e*1e11)/1e11}function Os(e,t,n){var r=Hr(e),i=Hr(t);if(!ks(r,i))return n?0:[];for(var a=Yr(...e),o=Yr(...t),l=Kr(e)?1:~~(a/5)||1,c=Kr(t)?1:~~(o/5)||1,p=[],d=[],y={},T=n?0:[],g=0;g=0&&v<=1&&k>=0&&k<=1&&(n?T++:T.push({x:R.x,y:R.y,t1:v,t2:k}))}}return T}function Ns(e,t,n){e=qr(e),t=qr(t);for(var r,i,a,o,l,c,p,d,y,T,g=n?0:[],w=0,M=e.length;w1&&(W=ce.sqrt(W),n=W*n,r=W*r);var F=n*n,b=r*r,E=(a==o?-1:1)*ce.sqrt(ct((F*b-F*L*L-b*M*M)/(F*L*L+b*M*M))),x=E*n*L/r+(e+l)/2,R=E*-r*M/n+(t+c)/2,S=ce.asin(((t-R)/r).toFixed(9)),v=ce.asin(((c-R)/r).toFixed(9));S=ev&&(S=S-ot*2),!o&&v>S&&(v=v-ot*2)}var k=v-S;if(ct(k)>d){var P=v,O=l,N=c;v=S+d*(o&&v>S?1:-1),l=x+n*ce.cos(v),c=R+r*ce.sin(v),T=Mi(l,c,n,r,i,0,o,O,N,[v,P,x,R])}k=v-S;var j=ce.cos(S),Y=ce.sin(S),Ae=ce.cos(v),ne=ce.sin(v),G=ce.tan(k/4),Ie=4/3*n*G,De=4/3*r*G,le=[e,t],ve=[e+Ie*Y,t-De*j],A=[l+Ie*ne,c-De*Ae],C=[l,c];if(ve[0]=2*le[0]-ve[0],ve[1]=2*le[1]-ve[1],p)return[ve,A,C].concat(T);T=[ve,A,C].concat(T).join().split(",");for(var I=[],re=0,ye=T.length;re7){g[w].shift();for(var M=g[w];M.length;)o[w]="A",g.splice(w++,0,["C",...M.splice(0,6)]);g.splice(w,1),d=n.length}},o=[],l="",c="",p=0,d=n.length;p=i.right,l=r.top-n.y>=i.bottom,c=r.right+n.x<=i.left,p=a?"top":l?"bottom":null,d=c?"left":o?"right":null;return d&&p?p+"-"+d:d||p||"intersect"}function xf(e,t,n){var r=js(e,t);return r.length===1||r.length===2&&pr(r[0],r[1])<1?yn(r[0]):r.length>1?(r=za(r,function(i){var a=Math.floor(i.t2*100)||1;return a=100-a,a=(a<10?"0":"")+a,i.segment2+"#"+a}),yn(r[n?0:r.length-1])):null}function js(e,t){return Ns(e,t)}function _f(e){e=e.slice();for(var t=0,n,r,i;e[t];)n=e[t],r=e[t-1],i=e[t+1],pr(n,i)===0||_s(r,i,n)?e.splice(t,1):t++;return e}function Vs(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function be(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function gn(e,t,n){return V({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Ws(e,t,n){var r=e.waypoint;return!r||r.length<2?[Qn(t),Qn(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function ki(e,t,n){return new Error(`element ${be(t)} referenced by ${be(e)}#${n} not yet drawn`)}function rt(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}rt.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];rt.prototype.add=function(e,t,n){var r,i,a;if($(t,"bpmndi:BPMNPlane")){var o=$(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(gn(e,t,o)),this._canvas.addRootElement(r)}else if($(t,"bpmndi:BPMNShape")){var l=!xt(e,t),c=Hs(e);i=n&&(n.hidden||n.collapsed);var p=t.bounds;r=this._elementFactory.createShape(gn(e,t,{collapsed:l,hidden:i,x:Math.round(p.x),y:Math.round(p.y),width:Math.round(p.width),height:Math.round(p.height),isFrame:c})),$(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),$(e,"bpmn:Lane")&&(a=0),$(e,"bpmn:DataStoreReference")&&(zs(n,Qn(p))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,a)}else if($(t,"bpmndi:BPMNEdge")){var d=this._getSource(e),y=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(gn(e,t,{hidden:i,source:d,target:y,waypoints:Ws(t,d,y)})),$(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,a)}else throw new Error(`unknown di ${be(t)} for element ${be(e)}`);return Ja(e)&&bn(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r};rt.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${be(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw ki(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};rt.prototype.addLabel=function(e,t,n){var r,i,a;return r=ro(t,n),i=bn(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),a=this._elementFactory.createLabel(gn(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!bn(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(a,n.parent)};rt.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(r=r&&r[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(r=e.$parent),n=r&&this._getElement(r),n)return n;throw r?ki(e,r,t+"Ref"):new Error(`${be(e)}#${t} Ref not specified`)};rt.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};rt.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};rt.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function zs(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function Hs(e){return $(e,"bpmn:Group")}const Us={__depends__:[Pi],bpmnImporter:["type",rt]},Ys={__depends__:[ws,Us]};function bf(e){return _t(e,function(t){return!$e(e,function(n){return n!==t&&Di(t,n)})})}function Di(e,t){if(t){if(e===t)return t;if(e.parent)return Di(e.parent,t)}}function Xr(e,t,n){var r=!n||e.indexOf(t)===-1;return r&&e.push(t),r}function dr(e,t,n){n=n||0,Me(e)||(e=[e]),B(e,function(r,i){var a=t(r,i,n);Me(a)&&a.length&&dr(a,t,n+1)})}function Ks(e,t,n){var r=[],i=[];return dr(e,function(a,o,l){Xr(r,a,t);var c=a.children;if(c&&Xr(i,c,t))return c}),r}function Sf(e,t){return Ks(e,!t)}function Af(e,t,n){Gt(t)&&(t=!0),Ke(t)&&(n=t,t=!0),n=n||{};var r=Ht(n.allShapes),i=Ht(n.allConnections),a=Ht(n.enclosedElements),o=Ht(n.enclosedConnections),l=Ht(n.topLevel,t&&mi(e,function(d){return d.id}));function c(d){l[d.source.id]&&l[d.target.id]&&(l[d.id]=[d]),r[d.source.id]&&r[d.target.id]&&(o[d.id]=a[d.id]=d),i[d.id]=d}function p(d){if(a[d.id]=d,d.waypoints)o[d.id]=i[d.id]=d;else return r[d.id]=d,B(d.incoming,c),B(d.outgoing,c),d.children}return dr(e,p),{allShapes:r,allConnections:i,topLevel:l,enclosedConnections:o,enclosedElements:a}}function dt(e,t){t=!!t,Me(e)||(e=[e]);var n,r,i,a;return B(e,function(o){var l=o;o.waypoints&&!t&&(l=dt(o.waypoints,!0));var c=l.x,p=l.y,d=l.height||0,y=l.width||0;(ci||i===void 0)&&(i=c+y),(p+d>a||a===void 0)&&(a=p+d)}),{x:n,y:r,height:a-r,width:i-n}}function Rf(e,t){var n={};return B(e,function(r){var i=r;i.waypoints&&(i=dt(i)),!Pe(t.y)&&i.x>t.x&&(n[r.id]=r),!Pe(t.x)&&i.y>t.y&&(n[r.id]=r),i.x>t.x&&i.y>t.y&&(Pe(t.width)&&Pe(t.height)&&i.width+i.x');Te(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};me.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Ii(this._overlayRoot,n)};me.prototype._getOverlayContainer=function(e,t){var n=$e(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};me.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,a;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),Ge(r)&&(r=qe(r)),a=this._getOverlayContainer(n),i=qe('
'),Te(i,{position:"absolute"}),i.appendChild(r),e.type&&Jt(i).add("djs-overlay-"+e.type);var o=this._canvas.findRoot(n),l=this._canvas.getRootElement();Nn(i,o===l),e.htmlContainer=i,a.overlays.push(e),a.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};me.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,a=n&&n.maxZoom,o=e.htmlContainer,l=this._canvas.getRootElement(),c=!0;(r!==l||n&&(Ot(i)&&i>t.scale||Ot(a)&&ai&&(o=(1/t.scale||1)*i)),Ot(o)&&(l="scale("+o+","+o+")"),Ii(a,l)};me.prototype._updateOverlaysVisibilty=function(e){var t=this;B(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};me.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,a=t.get({element:i});B(a,function(c){t.remove(c.id)});var o=t._getOverlayContainer(i);if(o){Rn(o.html);var l=t._overlayContainers.indexOf(o);l!==-1&&t._overlayContainers.splice(l,1)}}),e.on("element.changed",qs,function(r){var i=r.element,a=t._getOverlayContainer(i,!0);a&&(B(a.overlays,function(o){t._updateOverlay(o)}),t._updateOverlayContainer(a))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Jt(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function Xs(e){var t=qe('
');return Te(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Li(e,t,n){Te(e,{left:t+"px",top:n+"px"})}function Nn(e,t){e.style.display=t===!1?"none":""}function Ii(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const Fi={__init__:["overlays"],overlays:["type",me]};function $i(e,t,n,r){e.on("element.changed",function(i){var a=i.element;(a.parent||a===t.getRootElement())&&(i.gfx=n.getGraphics(a)),i.gfx&&e.fire(Oi(a)+".changed",i)}),e.on("elements.changed",function(i){var a=i.elements;a.forEach(function(o){e.fire("element.changed",{element:o})}),r.updateContainments(a)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}$i.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const Zs={__init__:["changeSupport"],changeSupport:["type",$i]};var Qs=1e3;function Se(e){this._eventBus=e}Se.$inject=["eventBus"];function Js(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}Se.prototype.on=function(e,t,n,r,i,a){if((Qe(t)||Pe(t))&&(a=i,i=r,r=n,n=t,t=null),Qe(n)&&(a=i,i=r,r=n,n=Qs),Ke(i)&&(a=i,i=!1),!Qe(r))throw new Error("handlerFn must be a function");Me(e)||(e=[e]);var o=this._eventBus;B(e,function(l){var c=["commandStack",l,t].filter(function(p){return p}).join(".");o.on(c,n,i?Js(r,a):r,a)})};Se.prototype.canExecute=it("canExecute");Se.prototype.preExecute=it("preExecute");Se.prototype.preExecuted=it("preExecuted");Se.prototype.execute=it("execute");Se.prototype.executed=it("executed");Se.prototype.postExecute=it("postExecute");Se.prototype.postExecuted=it("postExecuted");Se.prototype.revert=it("revert");Se.prototype.reverted=it("reverted");function it(e){return function(n,r,i,a,o){(Qe(n)||Pe(n))&&(o=a,a=i,i=r,r=n,n=null),this.on(n,e,r,i,a,o)}}function mr(e,t){t.invoke(Se,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}Xe(mr,Se);mr.$inject=["canvas","injector"];const eu={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",mr]};function Cf(e){return CSS.escape(e)}var tu={"&":"&","<":"<",">":">",'"':""","'":"'"};function nu(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return tu[t]})}var ji="_plane";function Pf(e){var t=e.id;return ru(t)}function yr(e){var t=e.id;return $(e,"bpmn:SubProcess")?Vi(t):t}function Tf(e){return Vi(e)}function Mf(e){var t=ft(e);return $(t,"bpmndi:BPMNPlane")}function Vi(e){return e+ji}function ru(e){return e.replace(new RegExp(ji+"$"),"")}var iu="bjs-breadcrumbs-shown";function Wi(e,t,n){var r=qe('
    '),i=n.getContainer(),a=Jt(i);i.appendChild(r);var o=[];e.on("element.changed",function(c){var p=c.element,d=ue(p),y=$e(o,function(T){return T===d});y&&l()});function l(c){c&&(o=au(c));var p=o.map(function(y){var T=nu(y.name||y.id),g=qe('
  • '+T+"
  • "),w=n.findRoot(yr(y))||n.findRoot(y.id);if(!w&&$(y,"bpmn:Process")){var M=t.find(function(L){var W=ue(L);return W&&W.get("processRef")&&W.get("processRef")===y});w=n.findRoot(M.id)}return g.addEventListener("click",function(){n.setRootElement(w)}),g});r.innerHTML="";var d=p.length>1;a.toggle(iu,d),p.forEach(function(y){r.appendChild(y)})}e.on("root.set",function(c){l(c.element)})}Wi.$inject=["eventBus","elementRegistry","canvas"];function au(e){for(var t=ue(e),n=[],r=t;r;r=r.$parent)($(r,"bpmn:SubProcess")||$(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function zi(e,t){var n=null,r=new ou;e.on("root.set",function(i){var a=i.element,o=t.viewbox(),l=r.get(a);if(r.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=a,!($(a,"bpmn:Collaboration")&&!l)){l=l||{x:0,y:0,zoom:1};var c=(o.x-l.x)*o.scale,p=(o.y-l.y)*o.scale;(c!==0||p!==0)&&t.scroll({dx:c,dy:p}),l.zoom!==o.scale&&t.zoom(l.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}zi.$inject=["eventBus","canvas"];function ou(){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}t!==-1&&this._entries.splice(t,1)}}var Zr={x:180,y:160};function Ct(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}Ct.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=[];e.diagrams.forEach(function(r){var i=t._createNewDiagrams(r.plane);Array.prototype.push.apply(n,i)}),n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}};Ct.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(a){var o=a.bpmnElement;if(o){var l=o.$parent;$(o,"bpmn:SubProcess")&&!a.isExpanded&&n.push(o),uu(o,e)&&r.push({diElement:a,parent:l})}});var i=[];return n.forEach(function(a){if(!t._processToDiagramMap[a.id]){var o=t._createDiagram(a);t._processToDiagramMap[a.id]=o,i.push(o)}}),r.forEach(function(a){for(var o=a.diElement,l=a.parent;l&&n.indexOf(l)===-1;)l=l.$parent;if(l){var c=t._processToDiagramMap[l.id];t._moveToDiPlane(o,c.plane)}}),i};Ct.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=su(e),r={x:n.x-Zr.x,y:n.y-Zr.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(a){a.x=a.x-r.x,a.y=a.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})};Ct.prototype._moveToDiPlane=function(e,t){var n=Hi(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};Ct.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};Ct.$inject=["eventBus","moddle"];function Hi(e){return $(e,"bpmndi:BPMNDiagram")?e:Hi(e.$parent)}function su(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=Xt(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),Is(t)}function uu(e,t){var n=e.$parent;return!(!$(n,"bpmn:SubProcess")||n===t.bpmnElement||xn(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var fn=250,lu='',cu="bjs-drilldown-empty";function yt(e,t,n,r){Se.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r;var i=this;this.executed("shape.toggleCollapse",fn,function(a){var o=a.shape;i._canDrillDown(o)?i._addOverlay(o):i._removeOverlay(o)},!0),this.reverted("shape.toggleCollapse",fn,function(a){var o=a.shape;i._canDrillDown(o)?i._addOverlay(o):i._removeOverlay(o)},!0),this.executed(["shape.create","shape.move","shape.delete"],fn,function(a){var o=a.oldParent,l=a.newParent||a.parent,c=a.shape;i._canDrillDown(c)&&i._addOverlay(c),i._updateDrilldownOverlay(o),i._updateDrilldownOverlay(l),i._updateDrilldownOverlay(c)},!0),this.reverted(["shape.create","shape.move","shape.delete"],fn,function(a){var o=a.oldParent,l=a.newParent||a.parent,c=a.shape;i._canDrillDown(c)&&i._addOverlay(c),i._updateDrilldownOverlay(o),i._updateDrilldownOverlay(l),i._updateDrilldownOverlay(c)},!0),t.on("import.render.complete",function(){n.filter(function(a){return i._canDrillDown(a)}).map(function(a){i._addOverlay(a)})})}Xe(yt,Se);yt.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};yt.prototype._canDrillDown=function(e){var t=this._canvas;return $(e,"bpmn:SubProcess")&&t.findRoot(yr(e))};yt.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=ue(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Jt(r.html).toggle(cu,!i)}};yt.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=n.get({element:e,type:"drilldown"});r.length&&this._removeOverlay(e);var i=qe('");i.addEventListener("click",function(){t.setRootElement(t.findRoot(yr(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)};yt.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};yt.$inject=["canvas","eventBus","elementRegistry","overlays"];const fu={__depends__:[Fi,Zs,eu],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Wi],drilldownCentering:["type",zi],drilldownOverlayBehavior:["type",yt],subprocessCompatibility:["type",Ct]};var pu=500,hu=1e3;function Pt(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(a){var o=te("rect");return Q(o,V({x:0,y:0,rx:4,width:100,height:100},n)),o}e.on(["shape.added","shape.changed"],pu,function(a){var o=a.element,l=a.gfx,c=We(".djs-outline",l);c||(c=r.getOutline(o)||i(),fe(l,c)),r.updateShapeOutline(c,o)}),e.on(["connection.added","connection.changed"],function(a){var o=a.element,l=a.gfx,c=We(".djs-outline",l);c||(c=i(),fe(l,c)),r.updateConnectionOutline(c,o)})}Pt.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&B(r,function(i){n=n||i.updateOutline(t,e)}),n||Q(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};Pt.prototype.updateConnectionOutline=function(e,t){var n=dt(t);Q(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};Pt.prototype.registerProvider=function(e,t){t||(t=e,e=hu),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};Pt.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};Pt.prototype.getOutline=function(e){var t,n=this._getProviders();return B(n,function(r){Qe(r.getOutline)&&(t=t||r.getOutline(e))}),t};Pt.$inject=["eventBus","styles","elementRegistry"];const Ui={__init__:["outline"],outline:["type",Pt]},du="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",mu="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",yu={width:36,height:50},gu={width:50,height:50};function Qr(e,t,n){return te("path",ae({d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`},n))}const ut=5;function Bn(e,t){this._styles=t,e.registerProvider(this)}Bn.$inject=["outline","styles"];Bn.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!sr(e))return $(e,"bpmn:Gateway")?(n=te("rect"),V(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),Q(n,V({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):xn(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group"])?(n=te("rect"),Q(n,V({x:-ut,y:-ut,rx:14,width:e.width+ut*2,height:e.height+ut*2},t))):$(e,"bpmn:EndEvent")?(n=te("circle"),Q(n,V({cx:e.width/2,cy:e.height/2,r:e.width/2+ut+1},t))):$(e,"bpmn:Event")?(n=te("circle"),Q(n,V({cx:e.width/2,cy:e.height/2,r:e.width/2+ut},t))):$(e,"bpmn:DataObjectReference")&&Jr(e,"bpmn:DataObjectReference")?n=Qr(du,{x:-6,y:-6},t):$(e,"bpmn:DataStoreReference")&&Jr(e,"bpmn:DataStoreReference")&&(n=Qr(mu,{x:-6,y:-6},t)),n};Bn.prototype.updateOutline=function(e,t){if(!sr(e))return xn(e,["bpmn:SubProcess","bpmn:Group"])?(Q(t,{width:e.width+ut*2,height:e.height+ut*2}),!0):!!xn(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function Jr(e,t){var n;return t==="bpmn:DataObjectReference"?n=yu:t==="bpmn:DataStoreReference"&&(n=gu),e.width===n.width&&e.height===n.height}const vu={__depends__:[Ui],__init__:["outlineProvider"],outlineProvider:["type",Bn]};function ei(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Ln(e){return e.originalEvent||e.srcEvent}function kf(e){ei(e),ei(Ln(e))}function ti(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Yi(){return/mac/i.test(navigator.platform)}function Ki(e,t){return(Ln(e)||e).button===t}function en(e){return Ki(e,0)}function Eu(e){return Ki(e,1)}function Df(e){var t=Ln(e)||e;return en(e)?Yi()?t.metaKey:t.ctrlKey:!1}function wu(e){var t=Ln(e)||e;return en(e)&&t.shiftKey}function xu(e){return!0}function pn(e){return en(e)||Eu(e)}var ni=500;function Gi(e,t,n){var r=this;function i(v,k,P){if(!l(v,k)){var O,N,j;P?N=t.getGraphics(P):(O=k.delegateTarget||k.target,O&&(N=O,P=t.get(N))),!(!N||!P)&&(j=e.fire(v,{element:P,gfx:N,originalEvent:k}),j===!1&&(k.stopPropagation(),k.preventDefault()))}}var a={};function o(v){return a[v]}function l(v,k){var P=p[v]||en;return!P(k)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},p={"element.contextmenu":xu,"element.mousedown":pn,"element.mouseup":pn,"element.click":pn,"element.dblclick":pn};function d(v,k,P){var O=c[v];if(!O)throw new Error("unmapped DOM event name <"+v+">");return i(O,k,P)}var y="svg, .djs-element";function T(v,k,P,O){var N=a[P]=function(j){i(P,j)};O&&(p[P]=O),N.$delegate=Xn.bind(v,y,k,N)}function g(v,k,P){var O=o(P);O&&Xn.unbind(v,k,O.$delegate)}function w(v){B(c,function(k,P){T(v,P,k)})}function M(v){B(c,function(k,P){g(v,P,k)})}e.on("canvas.destroy",function(v){M(v.svg)}),e.on("canvas.init",function(v){w(v.svg)}),e.on(["shape.added","connection.added"],function(v){var k=v.element,P=v.gfx;e.fire("interactionEvents.createHit",{element:k,gfx:P})}),e.on(["shape.changed","connection.changed"],ni,function(v){var k=v.element,P=v.gfx;e.fire("interactionEvents.updateHit",{element:k,gfx:P})}),e.on("interactionEvents.createHit",ni,function(v){var k=v.element,P=v.gfx;r.createDefaultHit(k,P)}),e.on("interactionEvents.updateHit",function(v){var k=v.element,P=v.gfx;r.updateDefaultHit(k,P)});var L=x("djs-hit djs-hit-stroke"),W=x("djs-hit djs-hit-click-stroke"),F=x("djs-hit djs-hit-all"),b=x("djs-hit djs-hit-no-move"),E={all:F,"click-stroke":W,stroke:L,"no-move":b};function x(v,k){return k=V({stroke:"white",strokeWidth:15},k||{}),n.cls(v,["no-fill","no-border"],k)}function R(v,k){var P=E[k];if(!P)throw new Error("invalid hit type <"+k+">");return Q(v,P),v}function S(v,k){fe(v,k)}this.removeHits=function(v){var k=Yo(".djs-hit",v);B(k,Qt)},this.createDefaultHit=function(v,k){var P=v.waypoints,O=v.isFrame,N;return P?this.createWaypointsHit(k,P):(N=O?"stroke":"all",this.createBoxHit(k,N,{width:v.width,height:v.height}))},this.createWaypointsHit=function(v,k){var P=lr(k);return R(P,"stroke"),S(v,P),P},this.createBoxHit=function(v,k,P){P=V({x:0,y:0},P);var O=te("rect");return R(O,k),Q(O,P),S(v,O),O},this.updateDefaultHit=function(v,k){var P=We(".djs-hit",k);if(P)return v.waypoints?xi(P,v.waypoints):Q(P,{width:v.width,height:v.height}),P},this.fire=i,this.triggerMouseEvent=d,this.mouseHandler=o,this.registerEvent=T,this.unregisterEvent=g}Gi.$inject=["eventBus","elementRegistry","styles"];const _u={__init__:["interactionEvents"],interactionEvents:["type",Gi]};function Ft(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}Ft.$inject=["eventBus","canvas"];Ft.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}};Ft.prototype.get=function(){return this._selectedElements};Ft.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Ft.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();Me(e)||(e=e?[e]:[]);var i=this._canvas,a=i.getRootElement();e=e.filter(function(o){var l=i.findRoot(o);return a===l}),t?B(e,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var ri="hover",ii="selected",hn=6;function gr(e,t,n){this._canvas=e;var r=this;this._multiSelectionBox=null;function i(o,l){e.addMarker(o,l)}function a(o,l){e.removeMarker(o,l)}t.on("element.hover",function(o){i(o.element,ri)}),t.on("element.out",function(o){a(o.element,ri)}),t.on("selection.changed",function(o){function l(y){a(y,ii)}function c(y){i(y,ii)}var p=o.oldSelection,d=o.newSelection;B(p,function(y){d.indexOf(y)===-1&&l(y)}),B(d,function(y){p.indexOf(y)===-1&&c(y)}),r._updateSelectionOutline(d)}),t.on("element.changed",function(o){n.isSelected(o.element)&&r._updateSelectionOutline(n.get())})}gr.$inject=["canvas","eventBus","selection"];gr.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");co(t);var n=e.length>1,r=this._canvas.getContainer();if(Oe(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=bu(dt(e)),a=te("rect");Q(a,V({rx:3},i)),Oe(a).add("djs-selection-outline"),fe(t,a)}};function bu(e){return{x:e.x-hn,y:e.y-hn,width:e.width+hn*2,height:e.height+hn*2}}function qi(e,t,n,r){e.on("create.end",500,function(i){var a=i.context,o=a.canExecute,l=a.elements,c=a.hints||{},p=c.autoSelect;if(o){if(p===!1)return;Me(p)?t.select(p):t.select(l.filter(Su))}}),e.on("connect.end",500,function(i){var a=i.context,o=a.connection;o&&t.select(o)}),e.on("shape.move.end",500,function(i){var a=i.previousSelection||[],o=r.get(i.context.shape.id),l=$e(a,function(c){return o.id===c.id});l||t.select(o)}),e.on("element.click",function(i){if(en(i)){var a=i.element;a===n.getRootElement()&&(a=null);var o=t.isSelected(a),l=t.get().length>1,c=wu(i);if(o&&l)return c?t.deselect(a):t.select(a);o?t.deselect(a):t.select(a,c)}})}qi.$inject=["eventBus","selection","canvas","elementRegistry"];function Su(e){return!e.hidden}const Au={__init__:["selectionVisuals","selectionBehavior"],__depends__:[_u,Ui],selection:["type",Ft],selectionVisuals:["type",gr],selectionBehavior:["type",qi]},Ru=/^class[ {]/;function Cu(e){return Ru.test(e.toString())}function vr(e){return Array.isArray(e)}function Un(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function vn(...e){e.length===1&&vr(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const Pu=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Tu=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Mu=/\/\*([^*]*)\*\//m;function ku(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(Cu(e)?Pu:Tu);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(r=>{const i=r.match(Mu);return(i&&i[1]||r).trim()})||[]}function Xi(e,t){const n=t||{get:function(b,E){if(r.push(b),E===!1)return null;throw l(`No provider for "${b}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),a=this._instances=Object.create(null),o=a.injector=this,l=function(b){const E=r.join(" -> ");return r.length=0,new Error(E?`${b} (Resolving: ${E})`:b)};function c(b,E){if(!i[b]&&b.includes(".")){const x=b.split(".");let R=c(x.shift());for(;x.length;)R=R[x.shift()];return R}if(Un(a,b))return a[b];if(Un(i,b)){if(r.indexOf(b)!==-1)throw r.push(b),l("Cannot resolve circular dependency!");return r.push(b),a[b]=i[b][0](i[b][1]),r.pop(),a[b]}return n.get(b,E)}function p(b,E){if(typeof E=="undefined"&&(E={}),typeof b!="function")if(vr(b))b=vn(b.slice());else throw l(`Cannot invoke "${b}". Expected a function!`);const R=(b.$inject||ku(b)).map(S=>Un(E,S)?E[S]:c(S));return{fn:b,dependencies:R}}function d(b){const{fn:E,dependencies:x}=p(b),R=Function.prototype.bind.call(E,null,...x);return new R}function y(b,E,x){const{fn:R,dependencies:S}=p(b,x);return R.apply(E,S)}function T(b){return vn(E=>b.get(E))}function g(b,E){if(E&&E.length){const x=Object.create(null),R=Object.create(null),S=[],v=[],k=[];let P,O,N,j;for(let Y in i)P=i[Y],E.indexOf(Y)!==-1&&(P[2]==="private"?(O=S.indexOf(P[3]),O===-1?(N=P[3].createChild([],E),j=T(N),S.push(P[3]),v.push(N),k.push(j),x[Y]=[j,Y,"private",N]):x[Y]=[k[O],Y,"private",v[O]]):x[Y]=[P[2],P[1]],R[Y]=!0),(P[2]==="factory"||P[2]==="type")&&P[1].$scope&&E.forEach(Ae=>{P[1].$scope.indexOf(Ae)!==-1&&(x[Y]=[P[2],P[1]],R[Ae]=!0)});E.forEach(Y=>{if(!R[Y])throw new Error('No provider for "'+Y+'". Cannot use provider from the parent!')}),b.unshift(x)}return new Xi(b,o)}const w={factory:y,type:d,value:function(b){return b}};function M(b,E){const x=b.__init__||[];return function(){x.forEach(R=>{typeof R=="string"?E.get(R):E.invoke(R)})}}function L(b){const E=b.__exports__;if(E){const x=b.__modules__,R=Object.keys(b).reduce((O,N)=>(N!=="__exports__"&&N!=="__modules__"&&N!=="__init__"&&N!=="__depends__"&&(O[N]=b[N]),O),Object.create(null)),S=(x||[]).concat(R),v=g(S),k=vn(function(O){return v.get(O)});E.forEach(function(O){i[O]=[k,O,"private",v]});const P=(b.__init__||[]).slice();return P.unshift(function(){v.init()}),b=Object.assign({},b,{__init__:P}),M(b,v)}return Object.keys(b).forEach(function(x){if(x==="__init__"||x==="__depends__")return;const R=b[x];if(R[2]==="private"){i[x]=R;return}const S=R[0],v=R[1];i[x]=[w[S],Du(S,v),S]}),M(b,o)}function W(b,E){return b.indexOf(E)!==-1||(b=(E.__depends__||[]).reduce(W,b),b.indexOf(E)!==-1)?b:b.concat(E)}function F(b){const E=b.reduce(W,[]).map(L);let x=!1;return function(){x||(x=!0,E.forEach(R=>R()))}}this.get=c,this.invoke=y,this.instantiate=d,this.createChild=g,this.init=F(e)}function Du(e,t){return e!=="value"&&vr(t)&&(t=vn(t.slice())),t}var Ou=1;function gt(e,t){nt.call(this,e,Ou),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})}Xe(gt,nt);gt.prototype.canRender=function(){return!0};gt.prototype.drawShape=function(t,n,r){var i=te("rect");return Q(i,{x:0,y:0,width:n.width||0,height:n.height||0}),Ni(n)?Q(i,V({},this.FRAME_STYLE,r||{})):Q(i,V({},this.SHAPE_STYLE,r||{})),fe(t,i),i};gt.prototype.drawConnection=function(t,n,r){var i=lr(n.waypoints,V({},this.CONNECTION_STYLE,r||{}));return fe(t,i),i};gt.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,a=t.height,o=[["M",n,r],["l",i,0],["l",0,a],["l",-i,0],["z"]];return At(o)};gt.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,a=[];for(r=0;i=n[r];r++)i=i.original||i,a.push([r===0?"M":"L",i.x,i.y]);return At(a)};gt.$inject=["eventBus","styles"];function Nu(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var a=this.style(r,i);return V(a,{class:n})},this.style=function(n,r){!Me(n)&&!r&&(r=n,n=[]);var i=Nt(n,function(a,o){return V(a,e[o]||{})},{});return r?V(i,r):i},this.computeStyle=function(n,r,i){return Me(r)||(i=r,r=[]),t.style(r||[],V({},i,n||{}))}}const Bu={__init__:["defaultRenderer"],defaultRenderer:["type",gt],styles:["type",Nu]};function Lu(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Iu(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Of(e,t){return!e||!t?-1:e.indexOf(t)}function En(e,t){return Math.round(e*t)/t}function ai(e){return Pe(e)?e+"px":e}function Fu(e){for(;e.parent;)e=e.parent;return e}function $u(e){e=V({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Te(n,{position:"relative",overflow:"hidden",width:ai(e.width),height:ai(e.height)}),t.appendChild(n),n}function Zi(e,t,n){const r=te("g");Oe(r).add(t);const i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}const ju="base",Qi=0,Vu=1,Wu={shape:["x","y","width","height"],connection:["waypoints"]};function U(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}U.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];U.prototype._init=function(e){const t=this._eventBus,n=this._container=$u(e),r=this._svg=te("svg");Q(r,{width:"100%",height:"100%"}),fe(n,r);const i=this._viewport=Zi(r,"viewport");e.deferUpdate&&(this._viewboxChanged=Ya(et(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};U.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};U.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const n=Oi(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};U.prototype.getDefaultLayer=function(){return this.getLayer(ju,Qi)};U.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)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};U.prototype._getChildIndex=function(e){return Nt(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};U.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=Vu);const n=this._getChildIndex(t);return{group:Zi(this._viewport,"layer-"+e,n),index:t,visible:!0}};U.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 a=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[a]||null),t.visible=!0,r};U.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&&(Qt(n),t.visible=!1),n};U.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Qt(t.group))};U.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};U.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(Fu(e))||{}).rootElement:void 0};U.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};U.prototype._findPlaneForRoot=function(e){return $e(this._planes,function(t){return t.rootElement===e})};U.prototype.getContainer=function(){return this._container};U.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),r=this._elementRegistry._elements[e.id],r&&(B([r.gfx,r.secondaryGfx],function(i){i&&(n?Oe(i).add(t):Oe(i).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};U.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};U.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};U.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));const n=this.getGraphics(e);return Oe(n).has(t)};U.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};U.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};U.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,Qi);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};U.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};U.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};U.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)};U.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})};U.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})};U.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=Wu[e];if(!rr(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};U.prototype._setParent=function(e,t,n){Iu(t.children,e,n),e.parent=t};U.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();const i=this._eventBus,a=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);const o=a.create(e,t,r);return this._elementRegistry.add(t,o),a.update(e,t,o),i.fire(e+".added",{element:t,gfx:o}),t};U.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};U.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};U.prototype._removeElement=function(e,t){const n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Lu(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};U.prototype.removeShape=function(e){return this._removeElement(e,"shape")};U.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};U.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};U.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};U.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};U.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let r,i,a,o,l,c,p;if(e)this._changeViewbox(function(){l=Math.min(n.width/e.width,n.height/e.height);const d=this._svg.createSVGMatrix().scale(l).translate(-e.x,-e.y);qt(t,d)});else return a=this._rootElement?this.getActiveLayer():null,r=a&&a.getBBox()||{},o=qt(t),i=o?o.matrix:ho(),l=En(i.a,1e3),c=En(-i.e||0,1e3),p=En(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/l:0,y:p?p/l:0,width:n.width/l,height:n.height/l,scale:l,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};U.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=V({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ji(t,n)}),{x:n.e,y:n.f}};U.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const i=dt(e),a=Xt(i),o=this.viewbox(),l=this.zoom();let c,p;o.y+=t.top/l,o.x+=t.left/l,o.width-=(t.right+t.left)/l,o.height-=(t.bottom+t.top)/l;const d=Xt(o);if(!(i.width=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?a={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),a={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(a),this.viewbox(!1).scale};U.prototype._setZoom=function(e,t){const n=this._svg,r=this._viewport,i=n.createSVGMatrix(),a=n.createSVGPoint();let o,l,c,p,d;c=r.getCTM();const y=c.a;return t?(o=V(a,t),l=o.matrixTransform(c.inverse()),p=i.translate(l.x,l.y).scale(1/y*e).translate(-l.x,-l.y),d=c.multiply(p)):d=i.scale(e),Ji(this._viewport,d),d};U.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};U.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,a=n.width*t.scale,o=n.height*t.scale;return{x:r,y:i,width:a,height:o}};U.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Lt="data-element-id";function Ne(e){this._elements={},this._eventBus=e}Ne.$inject=["eventBus"];Ne.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),Q(t,Lt,r),n&&Q(n,Lt,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Ne.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(Q(r.gfx,Lt,""),r.secondaryGfx&&Q(r.secondaryGfx,Lt,""),delete t[n])};Ne.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(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)};Ne.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&Q(t,Lt,r),t};Ne.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&Q(e,Lt);var n=this._elements[t];return n&&n.element};Ne.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Ne.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r in ref");t=this.props[t]}t.collection?ea(this,t,e):Yu(this,t,e)};je.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Hu(n)||ea(this,t,e),n};je.prototype.ensureBound=function(e,t){Uu(e,t)||this.bind(e,t)};je.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};je.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Er=new je({name:"children",enumerable:!0,collection:!0},{name:"parent"}),ta=new je({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),oi=new je({name:"attachers",collection:!0},{name:"host"}),na=new je({name:"outgoing",collection:!0},{name:"source"}),ra=new je({name:"incoming",collection:!0},{name:"target"});function $t(){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)}}),Er.bind(this,"parent"),ta.bind(this,"labels"),na.bind(this,"outgoing"),ra.bind(this,"incoming")}function tn(){$t.call(this),Er.bind(this,"children"),oi.bind(this,"host"),oi.bind(this,"attachers")}Xe(tn,$t);function ia(){$t.call(this),Er.bind(this,"children")}Xe(ia,tn);function aa(){tn.call(this),ta.bind(this,"labelTarget")}Xe(aa,tn);function oa(){$t.call(this),na.bind(this,"source"),ra.bind(this,"target")}Xe(oa,$t);var Ku={connection:oa,shape:tn,label:aa,root:ia};function Gu(e,t){var n=Ku[e];if(!n)throw new Error("unknown type: <"+e+">");return V(new n,t)}function Nf(e){return e instanceof $t}function jt(){this._uid=12}jt.prototype.createRoot=function(e){return this.create("root",e)};jt.prototype.createLabel=function(e){return this.create("label",e)};jt.prototype.createShape=function(e){return this.create("shape",e)};jt.prototype.createConnection=function(e){return this.create("connection",e)};jt.prototype.create=function(e,t){return t=V({},t||{}),t.id||(t.id=e+"_"+this._uid++),Gu(e,t)};var Mn="__fn",sa=1e3,qu=Array.prototype.slice;function ke(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ke.prototype.on=function(e,t,n,r){if(e=Me(e)?e:[e],Qe(t)&&(r=n,n=t,t=sa),!Pe(t))throw new Error("priority must be a number");var i=n;r&&(i=et(n,r),i[Mn]=n[Mn]||n);var a=this;e.forEach(function(o){a._addListener(o,{priority:t,callback:i,next:null})})};ke.prototype.once=function(e,t,n,r){var i=this;if(Qe(t)&&(r=n,n=t,t=sa),!Pe(t))throw new Error("priority must be a number");function a(){a.__isTomb=!0;var o=n.apply(r,arguments);return i.off(e,a),o}a[Mn]=n,this.on(e,t,a)};ke.prototype.off=function(e,t){e=Me(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};ke.prototype.createEvent=function(e){var t=new nn;return t.init(e),t};ke.prototype.fire=function(e,t){var n,r,i,a;if(a=qu.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof nn?n=t:n=this.createEvent(t),a[0]=n;var o=n.type;e!==o&&(n.type=e);try{i=this._invokeListeners(n,a,r)}finally{e!==o&&(n.type=o)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};ke.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};ke.prototype._destroy=function(){this._listeners={}};ke.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};ke.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=Xu(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw i}return r};ke.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority or , got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function Le(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Le.prototype.build=function(){return Ga(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};Le.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};Le.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,a=this.propertiesByName,o=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 l=i.indexOf(e);if(l===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(l,1),this.addProperty(t,n?void 0:l,o),a[r.name]=a[r.localName]=t};Le.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),a=Ee(i[0],r),o=Ee(i[1],a.prefix).name,l=this.propertiesByName[o];if(l)this.replaceProperty(l,e,n);else throw new Error("refined property <"+o+"> not found");delete e.redefines};Le.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};Le.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};Le.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};Le.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};Le.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};Le.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")};Le.prototype.hasProperty=function(e){return this.propertiesByName[e]};Le.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(B(e.properties,et(function(a){a=V({},a,{name:a.ns.localName,inherited:t}),Object.defineProperty(a,"definedBy",{value:e});var o=a.replaces,l=a.redefines;o||l?this.redefineProperty(a,o||l,o):(a.isBody&&this.setBodyProperty(a),a.isId&&this.setIdProperty(a),this.addProperty(a))},this)),r.push(e),n[i]=e)};function Et(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,B(e,et(this.registerPackage,this))}Et.prototype.getPackage=function(e){return this.packageMap[e]};Et.prototype.getPackages=function(){return this.packages};Et.prototype.registerPackage=function(e){e=V({},e);var t=this.packageMap;si(t,e,"prefix"),si(t,e,"uri"),B(e.types,et(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Et.prototype.registerType=function(e,t){e=V({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:V(e.meta||{})});var n=Ee(e.name,t.prefix),r=n.name,i={};B(e.properties,et(function(a){var o=Ee(a.name,n.prefix),l=o.name;Jn(a.type)||(a.type=Ee(a.type,o.prefix).name),V(a,{ns:o,name:l}),i[l]=a},this)),V(e,{ns:n,name:r,propertiesByName:i}),B(e.extends,et(function(a){var o=Ee(a,n.prefix),l=this.typeMap[o.name];l.traits=l.traits||[],l.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Et.prototype.mapTypes=function(e,t,n){var r=Jn(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function a(c,p){var d=Ee(c,Jn(c)?"":e.prefix);i.mapTypes(d,t,p)}function o(c){return a(c,!0)}function l(c){return a(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");B(r.superClass,n?o:l),t(r,!n),B(r.traits,o)};Et.prototype.getEffectiveDescriptor=function(e){var t=Ee(e),n=new Le(t);this.mapTypes(t,function(i,a){n.addTrait(i,a)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Et.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function si(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Tt(e){this.model=e}Tt.prototype.set=function(e,t,n){if(!Ge(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;rl(n)?r?delete e[i]:delete e.$attrs[er(t)]:r?i in e?e[i]=n:pa(e,r,n):e.$attrs[er(t)]=n};Tt.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[er(t)];var r=n.name;return!e[r]&&n.isMany&&pa(e,n,[]),e[r]};Tt.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=V({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Tt.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Tt.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Tt.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(typeof i!="undefined"){const a=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw a}return null};function rl(e){return typeof e=="undefined"}function pa(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function er(e){return e.replace(/^:/,"")}function Ve(e,t={}){this.properties=new Tt(this),this.factory=new la(this,this.properties),this.registry=new Et(e,this.properties),this.typeCache={},this.config=t}Ve.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};Ve.prototype.getType=function(e){var t=this.typeCache,n=Ge(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};Ve.prototype.createAny=function(e,t,n){var r=Ee(e),i={$type:e,$instanceOf:function(o){return o===this.$type},get:function(o){return this[o]},set:function(o,l){Ka(this,[o],l)}},a={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,a),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),B(n,function(o,l){Ke(o)&&o.value!==void 0?i[o.name]=o.value:i[l]=o}),i};Ve.prototype.getPackage=function(e){return this.registry.getPackage(e)};Ve.prototype.getPackages=function(){return this.registry.getPackages()};Ve.prototype.getElementDescriptor=function(e){return e.$descriptor};Ve.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};Ve.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};Ve.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ui=String.fromCharCode,il=Object.prototype.hasOwnProperty,al=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Kt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Kt).forEach(function(e){Kt[e.toUpperCase()]=Kt[e]});function ol(e,t,n,r){return r?il.call(Kt,r)?Kt[r]:"&"+r+";":ui(t||parseInt(n,16))}function wt(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(al,ol):e}var sl="http://www.w3.org/2001/XMLSchema-instance",ul="xsi",li="xsi:type",ci="non-whitespace outside of root node";function Dt(e){return new Error(e)}function fi(e){return"missing namespace for prefix <"+e+">"}function dn(e){return{get:e,enumerable:!0}}function ll(e){var t={},n;for(n in e)t[n]=e[n];return t}function tr(e){return e+"$uri"}function cl(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[tr(r)]=n;return t}function pi(){return{line:0,column:0}}function fl(e){throw e}function ha(e){if(!this)return new ha(e);var t=e&&e.proxy,n,r,i,a,o=fl,l,c,p,d,y=pi,T=!1,g=!1,w=null,M=!1,L;function W(E){E instanceof Error||(E=Dt(E)),w=E,o(E,y)}function F(E){l&&(E instanceof Error||(E=Dt(E)),l(E,y))}this.on=function(E,x){if(typeof x!="function")throw Dt("required args ");switch(E){case"openTag":r=x;break;case"text":n=x;break;case"closeTag":i=x;break;case"error":o=x;break;case"warn":l=x;break;case"cdata":a=x;break;case"attention":d=x;break;case"question":p=x;break;case"comment":c=x;break;default:throw Dt("unsupported event: "+E)}return this},this.ns=function(E){if(typeof E=="undefined"&&(E={}),typeof E!="object")throw Dt("required args ");var x={},R;for(R in E)x[R]=E[R];return x[sl]=ul,g=!0,L=x,this},this.parse=function(E){if(typeof E!="string")throw Dt("required args ");return w=null,b(E),y=pi,M=!1,w},this.stop=function(){M=!0};function b(E){var x=g?[]:null,R=g?cl(L):null,S,v=[],k=0,P=!1,O=!1,N=0,j=0,Y,Ae,ne,G,Ie,De,le,ve,A,C="",I=0,re;function ye(){if(re!==null)return re;var ge,f,s,u=g&&R.xmlns,h=g&&T?[]:null,m=I,_=C,z=_.length,Z,X,J,de,ee,at={},on={},Re,H,ie;e:for(;m8)){for((H<65||H>122||H>90&&H<97)&&H!==95&&H!==58&&(F("illegal first char attribute name"),Re=!0),ie=m+1;ie96&&H<123||H>64&&H<91||H>47&&H<59||H===46||H===45||H===95)){if(H===32||H<14&&H>8){F("missing attribute value"),m=ie;continue e}if(H===61)break;F("illegal attribute name char"),Re=!0}if(ee=_.substring(m,ie),ee==="xmlns:xmlns"&&(F("illegal declaration of xmlns"),Re=!0),H=_.charCodeAt(ie+1),H===34)ie=_.indexOf('"',m=ie+2),ie===-1&&(ie=_.indexOf("'",m),ie!==-1&&(F("attribute value quote missmatch"),Re=!0));else if(H===39)ie=_.indexOf("'",m=ie+2),ie===-1&&(ie=_.indexOf('"',m),ie!==-1&&(F("attribute value quote missmatch"),Re=!0));else for(F("missing attribute value quotes"),Re=!0,ie=ie+1;ie8));ie++);for(ie===-1&&(F("missing closing quotes"),ie=z,Re=!0),Re||(J=_.substring(m,ie)),m=ie;ie+18));ie++)m===ie&&(F("illegal character after attribute end"),Re=!0);if(m=ie+1,Re)continue e;if(ee in on){F("attribute <"+ee+"> already defined");continue}if(on[ee]=!0,!g){at[ee]=J;continue}if(T){if(X=ee==="xmlns"?"xmlns":ee.charCodeAt(0)===120&&ee.substr(0,6)==="xmlns:"?ee.substr(6):null,X!==null){if(ge=wt(J),f=tr(X),de=L[ge],!de){if(X==="xmlns"||f in R&&R[f]!==ge)do de="ns"+k++;while(typeof R[de]!="undefined");else de=X;L[ge]=de}R[X]!==de&&(Z||(R=ll(R),Z=!0),R[X]=de,X==="xmlns"&&(R[tr(de)]=ge,u=de),R[f]=ge),at[ee]=J;continue}h.push(ee,J);continue}if(H=ee.indexOf(":"),H===-1){at[ee]=J;continue}if(!(s=R[ee.substring(0,H)])){F(fi(ee.substring(0,H)));continue}ee=u===s?ee.substr(H+1):s+ee.substr(H),ee===li&&(H=J.indexOf(":"),H!==-1?(s=J.substring(0,H),s=R[s]||s,J=s+J.substring(H)):J=u+":"+J),at[ee]=J}if(T)for(m=0,z=h.length;m=u&&(m=ge.exec(E),!(!m||(h=m[0].length+m.index,h>N)));)f+=1,u=h;return N==-1?(s=h,_=E.substring(j)):j===0?_=E.substring(j,N):(s=N-u,_=j==-1?E.substring(N):E.substring(N,j+1)),{data:_,line:f,column:s}}for(y=oe,t&&(A=Object.create({},{name:dn(function(){return le}),originalName:dn(function(){return ve}),attrs:dn(ye),ns:dn(function(){return R})}));j!==-1;){if(E.charCodeAt(j)===60?N=j:N=E.indexOf("<",j),N===-1){if(v.length)return W("unexpected end of file");if(j===0)return W("missing start tag");j",N),j===-1)return W("unclosed cdata");if(a&&(a(E.substring(N+9,j),y),M))return;j+=3;continue}if(ne===45&&E.charCodeAt(N+3)===45){if(j=E.indexOf("-->",N),j===-1)return W("unclosed comment");if(c&&(c(E.substring(N+4,j),wt,y),M))return;j+=3;continue}}if(G===63){if(j=E.indexOf("?>",N),j===-1)return W("unclosed question");if(p&&(p(E.substring(N,j+2),y),M))return;j+=2;continue}for(Y=N+1;;Y++){if(Ie=E.charCodeAt(Y),isNaN(Ie))return j=-1,W("unclosed tag");if(Ie===34)ne=E.indexOf('"',Y+1),Y=ne!==-1?ne:Y;else if(Ie===39)ne=E.indexOf("'",Y+1),Y=ne!==-1?ne:Y;else if(Ie===62){j=Y;break}}if(G===33){if(d&&(d(E.substring(N,j+1),wt,y),M))return;j+=1;continue}if(re={},G===47){if(P=!1,O=!0,!v.length)return W("missing open tag");if(Y=le=v.pop(),ne=N+2+Y.length,E.substring(N+2,ne)!==Y)return W("closing tag mismatch");for(;ne8&&G<14))return W("close tag")}else{if(E.charCodeAt(j-1)===47?(Y=le=E.substring(N+1,j-1),P=!0,O=!0):(Y=le=E.substring(N+1,j),P=!0,O=!1),!(G>96&&G<123||G>64&&G<91||G===95||G===58))return W("illegal first char nodeName");for(ne=1,Ae=Y.length;ne96&&G<123||G>64&&G<91||G>47&&G<59||G===45||G===95||G==46)){if(G===32||G<14&&G>8){le=Y.substring(0,ne),re=null;break}return W("invalid nodeName")}O||v.push(le)}if(g){if(S=R,P&&(O||x.push(S),re===null&&(T=Y.indexOf("xmlns",ne)!==-1)&&(I=ne,C=Y,ye(),T=!1)),ve=le,G=le.indexOf(":"),G!==-1){if(De=R[le.substring(0,G)],!De)return W("missing namespace on <"+ve+">");le=le.substr(G+1)}else De=R.xmlns;De&&(le=De+":"+le)}if(P&&(I=ne,C=Y,r&&(t?r(A,wt,O,y):r(le,ye,wt,O,y),M)))return;if(O){if(i&&(i(t?A:le,wt,P,y),M))return;g&&(P?R=S:R=x.pop())}j+=1}}}function da(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var pl={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},In="xsi:type";function ma(e){return e.xml&&e.xml.serialize}function ya(e){return ma(e)===In}function hl(e){return ma(e)==="property"}function dl(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ga(e,t){return da(t)?e.prefix+":"+dl(e.localName):e.name}function ml(e,t){var n=e.name,r=e.localName,i=t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function yl(e,t){var n=Ee(e),r=t.getPackage(n.prefix);return ml(n,r)}function mt(e){return new Error(e)}function Je(e){return e.$descriptor}function gl(e){V(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw mt("expected element");var n=this.elementsById,r=Je(t),i=r.idProperty,a;if(i&&(a=t.get(i.name),a)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(a))throw new Error("illegal ID <"+a+">");if(n[a])throw mt("duplicate ID <"+a+">");n[a]=t}},this.addWarning=function(t){this.warnings.push(t)}}function rn(){}rn.prototype.handleEnd=function(){};rn.prototype.handleText=function(){};rn.prototype.handleNode=function(){};function _r(){}_r.prototype=Object.create(rn.prototype);_r.prototype.handleNode=function(){return this};function Vt(){}Vt.prototype=Object.create(rn.prototype);Vt.prototype.handleText=function(e){this.body=(this.body||"")+e};function an(e,t){this.property=e,this.context=t}an.prototype=Object.create(Vt.prototype);an.prototype.handleNode=function(e){if(this.element)throw mt("expected no sub nodes");return this.element=this.createReference(e),this};an.prototype.handleEnd=function(){this.element.id=this.body};an.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function br(e,t){this.element=t,this.propertyDesc=e}br.prototype=Object.create(Vt.prototype);br.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=xr(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function Fn(){}Fn.prototype=Object.create(Vt.prototype);Fn.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};function we(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}we.prototype=Object.create(Fn.prototype);we.prototype.addReference=function(e){this.context.addReference(e)};we.prototype.handleText=function(e){var t=this.element,n=Je(t),r=n.bodyProperty;if(!r)throw mt("unexpected body text <"+e+">");Vt.prototype.handleText.call(this,e)};we.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Je(t),r=n.bodyProperty;r&&e!==void 0&&(e=xr(r.type,e),t.set(r.name,e))};we.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=Je(n),i=this.context,a=new n({}),o=this.model,l;return B(t,function(c,p){var d=r.propertiesByName[p],y;d&&d.isReference?d.isMany?(y=c.split(" "),B(y,function(T){i.addReference({element:a,property:d.ns.name,id:T})})):i.addReference({element:a,property:d.ns.name,id:c}):(d?c=xr(d.type,c):p!=="xmlns"&&(l=Ee(p,r.ns.prefix),o.getPackage(l.prefix)&&i.addWarning({message:"unknown attribute <"+p+">",element:a,property:p,value:c})),a.set(p,c))}),a};we.prototype.getPropertyForNode=function(e){var t=e.name,n=Ee(t),r=this.type,i=this.model,a=Je(r),o=n.name,l=a.propertiesByName[o],c,p;if(l&&!l.isAttr)return ya(l)&&(c=e.attributes[In],c)?(c=yl(c,i),p=i.getType(c),V({},l,{effectiveType:Je(p).name})):l;var d=i.getPackage(n.prefix);if(d){if(c=ga(n,d),p=i.getType(c),l=$e(a.properties,function(y){return!y.isVirtual&&!y.isReference&&!y.isAttribute&&p.hasType(y.type)}),l)return V({},l,{effectiveType:Je(p).name})}else if(l=$e(a.properties,function(y){return!y.isReference&&!y.isAttribute&&y.type==="Element"}),l)return l;throw mt("unrecognized element <"+n.name+">")};we.prototype.toString=function(){return"ElementDescriptor["+Je(this.type).name+"]"};we.prototype.valueHandler=function(e,t){return new br(e,t)};we.prototype.referenceHandler=function(e){return new an(e,this.context)};we.prototype.handler=function(e){return e==="Element"?new It(this.model,e,this.context):new we(this.model,e,this.context)};we.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,fa(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var a=i.element;return a!==void 0&&(t.isMany?r.get(t.name).push(a):r.set(t.name,a),t.isReference?(V(a,{element:r}),this.context.addReference(a)):a.$parent=r),i};function Sr(e,t,n){we.call(this,e,t,n)}Sr.prototype=Object.create(we.prototype);Sr.prototype.createElement=function(e){var t=e.name,n=Ee(t),r=this.model,i=this.type,a=r.getPackage(n.prefix),o=a&&ga(n,a)||t;if(!i.hasType(o))throw mt("unexpected element <"+e.originalName+">");return we.prototype.createElement.call(this,e)};function It(e,t,n){this.model=e,this.context=n}It.prototype=Object.create(Fn.prototype);It.prototype.createElement=function(e){var t=e.name,n=Ee(t),r=n.prefix,i=e.ns[r+"$uri"],a=e.attributes;return this.model.createAny(t,i,a)};It.prototype.handleChild=function(e){var t=new It(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};It.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Ar(e){e instanceof Ve&&(e={model:e}),V(this,{lax:!1},e)}Ar.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof we?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,a=this.lax,o=new gl(V({},t,{rootHandler:r})),l=new ha({proxy:!0}),c=vl();r.context=o,c.push(r);function p(x,R,S){var v=R(),k=v.line,P=v.column,O=v.data;O.charAt(0)==="<"&&O.indexOf(" ")!==-1&&(O=O.slice(0,O.indexOf(" "))+">");var N="unparsable content "+(O?O+" ":"")+`detected line: `+k+` column: `+P+` nested error: `+x.message;if(S)return o.addWarning({message:N,error:x}),!0;throw mt(N)}function d(x,R){return p(x,R,!0)}function y(){var x=o.elementsById,R=o.references,S,v;for(S=0;v=R[S];S++){var k=v.element,P=x[v.id],O=Je(k).propertiesByName[v.property];if(P||o.addWarning({message:"unresolved reference <"+v.id+">",element:v.element,property:v.property,value:v.id}),O.isMany){var N=k.get(O.name),j=N.indexOf(v);j===-1&&(j=N.length),P?N[j]=P:N.splice(j,1)}else k.set(O.name,P)}}function T(){c.pop().handleEnd()}var g=/^<\?xml /i,w=/ encoding="([^"]+)"/i,M=/^utf-8$/i;function L(x){if(g.test(x)){var R=w.exec(x),S=R&&R[1];!S||M.test(S)||o.addWarning({message:"unsupported document encoding <"+S+">, falling back to UTF-8"})}}function W(x,R){var S=c.peek();try{c.push(S.handleNode(x))}catch(v){p(v,R,a)&&c.push(new _r)}}function F(x,R){try{c.peek().handleText(x)}catch(S){d(S,R)}}function b(x,R){x.trim()&&F(x,R)}var E=i.getPackages().reduce(function(x,R){return x[R.uri]=R.prefix,x},{"http://www.w3.org/XML/1998/namespace":"xml"});return l.ns(E).on("openTag",function(x,R,S,v){var k=x.attrs||{},P=Object.keys(k).reduce(function(N,j){var Y=R(k[j]);return N[j]=Y,N},{}),O={name:x.name,originalName:x.originalName,attributes:P,ns:x.ns};W(O,v)}).on("question",L).on("closeTag",T).on("cdata",F).on("text",function(x,R,S){b(R(x),S)}).on("error",p).on("warn",d),new Promise(function(x,R){var S;try{l.parse(e),y()}catch(N){S=N}var v=r.element;!S&&!v&&(S=mt("failed to parse document as <"+r.type.$descriptor.name+">"));var k=o.warnings,P=o.references,O=o.elementsById;return S?(S.warnings=k,R(S)):x({rootElement:v,elementsById:O,references:P,warnings:k})})};Ar.prototype.handler=function(e){return new Sr(this.model,e)};function vl(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var El=` `,wl=/<|>|'|"|&|\n\r|\n/g,va=/<|>|&/g;function xl(e){var t={},n={},r={},i=[],a=[];this.byUri=function(o){return n[o]||e&&e.byUri(o)},this.add=function(o,l){n[o.uri]=o,l?i.push(o):a.push(o),this.mapPrefix(o.prefix,o.uri)},this.uriByPrefix=function(o){return t[o||"xmlns"]},this.mapPrefix=function(o,l){t[o||"xmlns"]=l},this.getNSKey=function(o){return o.prefix!==void 0?o.uri+"|"+o.prefix:o.uri},this.logUsed=function(o){var l=o.uri,c=this.getNSKey(o);r[c]=this.byUri(l),e&&e.logUsed(o)},this.getUsed=function(o){function l(d){var y=c.getNSKey(d);return r[y]}var c=this,p=[].concat(i,a);return p.filter(l)}}function _l(e){return e.charAt(0).toLowerCase()+e.slice(1)}function bl(e,t){return da(t)?_l(e):e}function Ea(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function wa(e){return Ge(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Sl(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function Al(e,t){return t.isGeneric?V({localName:t.ns.localName},e):V({localName:bl(t.ns.localName,t.$pkg)},e)}function Rl(e,t){return V({localName:t.ns.localName},e)}function Cl(e){var t=e.$descriptor;return _t(t.properties,function(n){var r=n.name;if(n.isVirtual||!St(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var Pl={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Tl={"<":"lt",">":"gt","&":"amp"};function xa(e,t,n){return e=Ge(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function Ml(e){return xa(e,wl,Pl)}function kl(e){return xa(e,va,Tl)}function Dl(e){return _t(e,function(t){return t.isAttr})}function Ol(e){return _t(e,function(t){return!t.isAttr})}function Rr(e){this.tagName=e}Rr.prototype.build=function(e){return this.element=e,this};Rr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function bt(){}bt.prototype.serializeValue=bt.prototype.serializeTo=function(e){e.append(this.escape?kl(this.value):this.value)};bt.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(va)!==-1&&(this.escape=!0),this};function Cr(e){this.tagName=e}Ea(Cr,bt);Cr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function se(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}se.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r,i,a=t.isGeneric;return a?r=this.parseGeneric(e):r=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),a||(i=Cl(e),this.parseAttributes(Dl(i)),this.parseContainments(Ol(i))),this.parseGenericAttributes(e,r),this};se.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Al(t,e)};se.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Rl(t,e)};se.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};se.prototype.nsAttributeName=function(e){var t;if(Ge(e)?t=Ee(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:V({localName:t.localName},n)};se.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return B(e,function(i,a){var o;a==="$body"?n.push(new bt().build({type:"String"},i)):a==="$children"?B(i,function(l){n.push(new se(t).build(l))}):a.indexOf("$")!==0&&(o=t.parseNsAttribute(e,a,i),o&&r.push({name:a,value:i}))}),r};se.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Ee(t),a;if(i.prefix==="xmlns"&&(a={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(a={uri:n}),!a)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(a,!0,!0);else{var o=this.logNamespaceUsed(a,!0);this.getNamespaces().logUsed(o)}};se.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,i=[];return B(r,function(a,o){var l=n.parseNsAttribute(e,o,a);l&&i.push(l)}),i};se.prototype.parseGenericAttributes=function(e,t){var n=this;B(t,function(r){if(r.name!==In)try{n.addAttribute(n.nsAttributeName(r.name),r.value)}catch(i){}})};se.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;B(e,function(i){var a=r.get(i.name),o=i.isReference,l=i.isMany;if(l||(a=[a]),i.isBody)n.push(new bt().build(i,a[0]));else if(fa(i.type))B(a,function(d){n.push(new Cr(t.addTagName(t.nsPropertyTagName(i))).build(i,d))});else if(o)B(a,function(d){n.push(new Rr(t.addTagName(t.nsPropertyTagName(i))).build(d))});else{var c=ya(i),p=hl(i);B(a,function(d){var y;c?y=new $n(t,i):p?y=new se(t,i):y=new se(t),n.push(y.build(d))})}})};se.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new xl(r):t=r),t};se.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,a=e.prefix,o=r.byUri(i);return(!o||n)&&r.add(e,t),r.mapPrefix(a,i),e};se.prototype.logNamespaceUsed=function(e,t){var n=this.element,r=n.$model,i=this.getNamespaces(t),a=e.prefix,o=e.uri,l,c,p;if(!a&&!o)return{localName:e.localName};if(p=pl[a]||r&&(r.getPackage(a)||{}).uri,o=o||p||i.uriByPrefix(a),!o)throw new Error("no namespace uri given for prefix <"+a+">");if(e=i.byUri(o),!e){for(l=a,c=1;i.uriByPrefix(l);)l=a+"_"+c++;e=this.logNamespace({prefix:l,uri:o},p===o)}return a&&i.mapPrefix(a,o),e};se.prototype.parseAttributes=function(e){var t=this,n=this.element;B(e,function(r){var i=n.get(r.name);if(r.isReference)if(!r.isMany)i=i.id;else{var a=[];B(i,function(o){a.push(o.id)}),i=a.join(" ")}t.addAttribute(t.nsAttributeName(r),i)})};se.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),wa(e)};se.prototype.addAttribute=function(e,t){var n=this.attrs;Ge(t)&&(t=Ml(t));var r=ja(n,function(a){return a.name.localName===e.localName&&a.name.uri===e.uri&&a.name.prefix===e.prefix}),i={name:e,value:t};r!==-1?n.splice(r,1,i):n.push(i)};se.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=Sl(n).concat(t)),B(t,function(r){e.append(" ").append(wa(r.name)).append('="').append(r.value).append('"')})};se.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==bt;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),B(this.body,function(r){r.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()};function $n(e,t){se.call(this,e,t)}Ea($n,se);$n.prototype.parseNsAttributes=function(e){var t=se.prototype.parseNsAttributes.call(this,e),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),a=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(In),(r.prefix?r.prefix+":":"")+a+n.ns.localName),t};$n.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function Nl(){this.value="",this.write=function(e){this.value+=e}}function Bl(e,t){var n=[""];this.append=function(r){return e.write(r),this},this.appendNewLine=function(){return t&&e.write(` `),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 Ll(e){e=V({format:!1,preamble:!0},e||{});function t(n,r){var i=r||new Nl,a=new Bl(i,e.format);if(e.preamble&&a.append(El),new se().build(n).serializeTo(a),!r)return i.value}return{toXML:t}}function jn(e,t){Ve.call(this,e,t)}jn.prototype=Object.create(Ve.prototype);jn.prototype.fromXML=function(e,t,n){Ge(t)||(n=t,t="bpmn:Definitions");var r=new Ar(V({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)};jn.prototype.toXML=function(e,t){var n=new Ll(t);return new Promise(function(r,i){try{var a=n.toXML(e);return r({xml:a})}catch(o){return i(o)}})};var Il="BPMN20",Fl="http://www.omg.org/spec/BPMN/20100524/MODEL",$l="bpmn",jl=[],Vl=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],Wl=[{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"}]}],zl={tagAlias:"lowerCase",typePrefix:"t"},Hl={name:Il,uri:Fl,prefix:$l,associations:jl,types:Vl,enumerations:Wl,xml:zl},Ul="BPMNDI",Yl="http://www.omg.org/spec/BPMN/20100524/DI",Kl="bpmndi",Gl=[{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"]}],ql=[{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"}]}],Xl=[],Zl={name:Ul,uri:Yl,prefix:Kl,types:Gl,enumerations:ql,associations:Xl},Ql="DC",Jl="http://www.omg.org/spec/DD/20100524/DC",ec="dc",tc=[{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}]}],nc=[],rc={name:Ql,uri:Jl,prefix:ec,types:tc,associations:nc},ic="DI",ac="http://www.omg.org/spec/DD/20100524/DI",oc="di",sc=[{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"}]}],uc=[],lc={tagAlias:"lowerCase"},cc={name:ic,uri:ac,prefix:oc,types:sc,associations:uc,xml:lc},fc="bpmn.io colors for BPMN",pc="http://bpmn.io/schema/bpmn/biocolor/1.0",hc="bioc",dc=[{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"}]}],mc=[],yc=[],gc={name:fc,uri:pc,prefix:hc,types:dc,enumerations:mc,associations:yc},vc="BPMN in Color",Ec="http://www.omg.org/spec/BPMN/non-normative/color/1.0",wc="color",xc=[{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"}]}],_c=[],bc=[],Sc={name:vc,uri:Ec,prefix:wc,types:xc,enumerations:_c,associations:bc},Ac={bpmn:Hl,bpmndi:Zl,dc:rc,di:cc,bioc:gc,color:Sc};function Rc(e,t){var n=V({},Ac,e);return new jn(n,t)}var Cc="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function Pc(e){St(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(Cc)}})}function _e(e,t){return e.$instanceOf(t)}function Tc(e){return $e(e.rootElements,function(t){return _e(t,"bpmn:Process")||_e(t,"bpmn:Collaboration")})}function Mc(e){var t={},n=[],r={};function i(A,C){return function(I){A(I,C)}}function a(A){t[A.id]=A}function o(A){return t[A.id]}function l(A,C){var I=A.gfx;if(I)throw new Error("already rendered ${ elementToString(element) }");return e.element(A,r[A.id],C)}function c(A,C){return e.root(A,r[A.id],C)}function p(A,C){try{var I=r[A.id]&&l(A,C);return a(A),I}catch(re){d(re.message,{element:A,error:re})}}function d(A,C){e.error(A,C)}var y=this.registerDi=function(C){var I=C.bpmnElement;I?r[I.id]?d(`multiple DI elements defined for ${be(I)}`,{element:I}):(r[I.id]=C,Pc(I)):d(`no bpmnElement referenced in ${be(C)}`,{element:C})};function T(A){g(A.plane)}function g(A){y(A),B(A.planeElement,w)}function w(A){y(A)}this.handleDefinitions=function(C,I){var re=C.diagrams;if(I&&re.indexOf(I)===-1)throw new Error("diagram not part of ");if(!I&&re&&re.length&&(I=re[0]),!I)throw new Error("no diagram to display");r={},T(I);var ye=I.plane;if(!ye)throw new Error(`no plane for ${be(I)}`);var oe=ye.bpmnElement;if(!oe)if(oe=Tc(C),oe)d(`correcting missing bpmnElement on ${be(ye)} to ${be(oe)}`),ye.bpmnElement=oe,y(ye);else throw new Error("no process or collaboration to display");var ge=c(oe,ye);if(_e(oe,"bpmn:Process")||_e(oe,"bpmn:SubProcess"))L(oe,ge);else if(_e(oe,"bpmn:Collaboration"))le(oe,ge),W(C.rootElements,ge);else throw new Error(`unsupported bpmnElement for ${be(ye)}: ${be(oe)}`);M(n)};var M=this.handleDeferred=function(){for(var C;n.length;)C=n.shift(),C()};function L(A,C){G(A,C),k(A.ioSpecification,C),v(A.artifacts,C),a(A)}function W(A,C){var I=_t(A,function(re){return!o(re)&&_e(re,"bpmn:Process")&&re.laneSets});I.forEach(i(L,C))}function F(A,C){p(A,C)}function b(A,C){B(A,i(F,C))}function E(A,C){p(A,C)}function x(A,C){p(A,C)}function R(A,C){p(A,C)}function S(A,C){p(A,C)}function v(A,C){B(A,function(I){_e(I,"bpmn:Association")?n.push(function(){S(I,C)}):S(I,C)})}function k(A,C){A&&(B(A.dataInputs,i(x,C)),B(A.dataOutputs,i(R,C)))}var P=this.handleSubProcess=function(C,I){G(C,I),v(C.artifacts,I)};function O(A,C){var I=p(A,C);_e(A,"bpmn:SubProcess")&&P(A,I||C),_e(A,"bpmn:Activity")&&k(A.ioSpecification,C),n.push(function(){B(A.dataInputAssociations,i(E,C)),B(A.dataOutputAssociations,i(E,C))})}function N(A,C){p(A,C)}function j(A,C){p(A,C)}function Y(A,C){n.push(function(){var I=p(A,C);A.childLaneSet&&Ae(A.childLaneSet,I||C),ve(A)})}function Ae(A,C){B(A.lanes,i(Y,C))}function ne(A,C){B(A,i(Ae,C))}function G(A,C){Ie(A.flowElements,C),A.laneSets&&ne(A.laneSets,C)}function Ie(A,C){B(A,function(I){_e(I,"bpmn:SequenceFlow")?n.push(function(){N(I,C)}):_e(I,"bpmn:BoundaryEvent")?n.unshift(function(){O(I,C)}):_e(I,"bpmn:FlowNode")?O(I,C):_e(I,"bpmn:DataObject")||(_e(I,"bpmn:DataStoreReference")||_e(I,"bpmn:DataObjectReference")?j(I,C):d(`unrecognized flowElement ${be(I)} in context ${be(C&&C.businessObject)}`,{element:I,context:C}))})}function De(A,C){var I=p(A,C),re=A.processRef;re&&L(re,I||C)}function le(A,C){B(A.participants,i(De,C)),v(A.artifacts,C),n.push(function(){b(A.messageFlows,C)})}function ve(A){B(A.flowNodeRef,function(C){var I=C.get("lanes");I&&I.push(A)})}}function kc(e,t,n){var r,i,a,o,l=[];function c(p,d){var y={root:function(M,L){return r.add(M,L)},element:function(M,L,W){return r.add(M,L,W)},error:function(M,L){l.push({message:M,context:L})}},T=new Mc(y);d=d||p.diagrams&&p.diagrams[0];var g=Dc(p,d);if(!g)throw new Error("no diagram to display");B(g,function(M){T.handleDefinitions(p,M)});var w=d.plane.bpmnElement.id;a.setRootElement(a.findRoot(w+"_plane")||a.findRoot(w))}return new Promise(function(p,d){try{return r=e.get("bpmnImporter"),i=e.get("eventBus"),a=e.get("canvas"),i.fire("import.render.start",{definitions:t}),c(t,n),i.fire("import.render.complete",{error:o,warnings:l}),p({warnings:l})}catch(y){return y.warnings=l,d(y)}})}function Dc(e,t){if(t){var n=t.plane.bpmnElement,r=n;!$(n,"bpmn:Process")&&!$(n,"bpmn:Collaboration")&&(r=Oc(n));var i;$(r,"bpmn:Collaboration")?i=r:i=$e(e.rootElements,function(p){if($(p,"bpmn:Collaboration"))return $e(p.participants,function(d){return d.processRef===r})});var a=[r];i&&(a=kn(i.participants,function(p){return p.processRef}),a.push(i));var o=_a(a),l=[t],c=[n];return B(e.diagrams,function(p){var d=p.plane.bpmnElement;o.indexOf(d)!==-1&&c.indexOf(d)===-1&&(l.push(p),c.push(d))}),l}}function _a(e){var t=[];return B(e,function(n){n&&(t.push(n),t=t.concat(_a(n.flowElements)))}),t}function Oc(e){for(var t=e;t;){if($(t,"bpmn:Process"))return t;t=t.$parent}}var Nc='',ba=Nc,Sa={verticalAlign:"middle"},Aa={color:"#404040"},Bc={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Lc={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Ic={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"},Fc='
    '+ba+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
    ',Ye;function $c(){Ye=qe(Fc),Te(Ye,Bc),Te(We("svg",Ye),Sa),Te(We(".backdrop",Ye),Lc),Te(We(".notice",Ye),Ic),Te(We(".link",Ye),Aa,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function jc(){Ye||($c(),Xn.bind(Ye,".backdrop","click",function(e){document.body.removeChild(Ye)})),document.body.appendChild(Ye)}function pe(e){e=V({},Wc,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),Hc(this._container),this._init(this._container,this._moddle,e)}Xe(pe,vt);pe.prototype.importXML=function(t,n){return Mt(this,null,function*(){const r=this;function i(o){return r.get("eventBus").createEvent(o)}let a=[];try{t=this._emit("import.parse.start",{xml:t})||t;let o;try{o=yield this._moddle.fromXML(t,"bpmn:Definitions")}catch(T){throw this._emit("import.parse.complete",{error:T}),T}let l=o.rootElement;const c=o.references,p=o.warnings,d=o.elementsById;a=a.concat(p),l=this._emit("import.parse.complete",i({error:null,definitions:l,elementsById:d,references:c,warnings:a}))||l;const y=yield this.importDefinitions(l,n);return a=a.concat(y.warnings),this._emit("import.done",{error:null,warnings:a}),{warnings:a}}catch(o){let l=o;throw a=a.concat(l.warnings||[]),wn(l,a),l=Vc(l),this._emit("import.done",{error:l,warnings:l.warnings}),l}})};pe.prototype.importDefinitions=function(t,n){return Mt(this,null,function*(){return this._setDefinitions(t),{warnings:(yield this.open(n)).warnings}})};pe.prototype.open=function(t){return Mt(this,null,function*(){const n=this._definitions;let r=t;if(!n){const a=new Error("no XML imported");throw wn(a,[]),a}if(typeof t=="string"&&(r=zc(n,t),!r)){const a=new Error("BPMNDiagram <"+t+"> not found");throw wn(a,[]),a}try{this.clear()}catch(a){throw wn(a,[]),a}const{warnings:i}=yield kc(this,n,r);return{warnings:i}})};pe.prototype.saveXML=function(t){return Mt(this,null,function*(){t=t||{};let n=this._definitions,r,i;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,i=(yield this._moddle.toXML(n,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(o){r=o}const a=r?{error:r}:{xml:i};if(this._emit("saveXML.done",a),r)throw r;return a})};pe.prototype.saveSVG=function(){return Mt(this,null,function*(){this._emit("saveSVG.start");let t,n;try{const r=this.get("canvas"),i=r.getActiveLayer(),a=We("defs",r._svg),o=Fr(i),l=a?""+Fr(a)+"":"",c=i.getBBox();t=` '+l+o+""}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}})};pe.prototype._setDefinitions=function(e){this._definitions=e};pe.prototype.getModules=function(){return this._modules};pe.prototype.clear=function(){this.getDefinitions()&&vt.prototype.clear.call(this)};pe.prototype.destroy=function(){vt.prototype.destroy.call(this),Rn(this._container)};pe.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};pe.prototype.off=function(e,t){this.get("eventBus").off(e,t)};pe.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=We(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};pe.prototype.getDefinitions=function(){return this._definitions};pe.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};pe.prototype._init=function(e,t,n){const r=n.modules||this.getModules(n),i=n.additionalModules||[],a=[{bpmnjs:["value",this],moddle:["value",t]}],o=[].concat(a,r,i),l=V(qa(n,["additionalModules"]),{canvas:V({},n.canvas,{container:e}),modules:o});vt.call(this,l),n&&n.container&&this.attachTo(n.container)};pe.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};pe.prototype._createContainer=function(e){const t=qe('
    ');return Te(t,{width:hi(e.width),height:hi(e.height),position:e.position}),t};pe.prototype._createModdle=function(e){const t=V({},this._moddleExtensions,e.moddleExtensions);return new Rc(t)};pe.prototype._modules=[];function wn(e,t){return e.warnings=t,e}function Vc(e){const n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}const Wc={width:"100%",height:"100%",position:"relative"};function hi(e){return e+(Pe(e)?"px":"")}function zc(e,t){return t&&$e(e.diagrams,function(n){return n.id===t})||null}function Hc(e){const n=''+ba+"",r=qe(n);Te(We("svg",r),Sa),Te(r,Aa,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),lt.bind(r,"click",function(i){jc(),i.preventDefault()})}function Pr(e){pe.call(this,e)}Xe(Pr,pe);Pr.prototype._modules=[Ys,fu,vu,Fi,Au,Pi];Pr.prototype._moddleExtensions={};var Uc=/^djs-cursor-.*$/;function Ra(e){var t=Jt(document.body);t.removeMatching(Uc),e&&t.add("djs-cursor-"+e)}function Yc(){Ra(null)}var Kc=5e3;function Gc(e,t){t=t||"element.click";function n(){return!1}return e.once(t,Kc,n),function(){e.off(t,n)}}function Bf(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function di(e,t){return{x:e.x-t.x,y:e.y-t.y}}var qc=15;function Ca(e,t){var n;e.on("element.mousedown",500,function(o){return a(o.originalEvent)});function r(o){var l=n.start,c=n.button,p=ti(o),d=di(p,l);if(!n.dragging&&Xc(d)>qc&&(n.dragging=!0,c===0&&Gc(e),Ra("grab")),n.dragging){var y=n.last||n.start;d=di(p,y),t.scroll({dx:d.x,dy:d.y}),n.last=p}o.preventDefault()}function i(o){lt.unbind(document,"mousemove",r),lt.unbind(document,"mouseup",i),n=null,Yc()}function a(o){if(!cr(o.target,".djs-draggable")){var l=o.button;if(!(l>=2||o.ctrlKey||o.shiftKey||o.altKey))return n={button:l,start:ti(o)},lt.bind(document,"mousemove",r),lt.bind(document,"mouseup",i),!0}}this.isActive=function(){return!!n}}Ca.$inject=["eventBus","canvas"];function Xc(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const Lf={__init__:["moveCanvas"],moveCanvas:["type",Ca]};function nr(e){return Math.log(e)/Math.log(10)}function Pa(e,t){var n=nr(e.min),r=nr(e.max),i=Math.abs(n)+Math.abs(r);return i/t}function Zc(e,t){return Math.max(e.min,Math.min(e.max,t))}var Qc=Math.sign||function(e){return e>=0?1:-1},Tr={min:.2,max:4},Ta=10,Jc=.1,ef=.75;function Ze(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=et(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||ef;var r=this;t.on("canvas.init",function(i){r._init(e.enabled!==!1)})}Ze.$inject=["config.zoomScroll","eventBus","canvas"];Ze.prototype.scroll=function(t){this._canvas.scroll(t)};Ze.prototype.reset=function(){this._canvas.zoom("fit-viewport")};Ze.prototype.zoom=function(t,n){var r=Pa(Tr,Ta*2);this._totalDelta+=t,Math.abs(this._totalDelta)>Jc&&(this._zoom(t,n,r),this._totalDelta=0)};Ze.prototype._handleWheel=function(t){if(!cr(t.target,".djs-scrollable",!0)){var n=this._container;t.preventDefault();var r=t.ctrlKey||Yi()&&t.metaKey,i=t.shiftKey,a=-1*this._scale,o;if(r?a*=t.deltaMode===0?.02:.32:a*=t.deltaMode===0?1:16,r){var l=n.getBoundingClientRect(),c={x:t.clientX-l.left,y:t.clientY-l.top};o=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*Qc(t.deltaY)*a,this.zoom(o,c)}else i?o={dx:a*t.deltaY,dy:0}:o={dx:a*t.deltaX,dy:a*t.deltaY},this.scroll(o)}};Ze.prototype.stepZoom=function(t,n){var r=Pa(Tr,Ta);this._zoom(t,n,r)};Ze.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,a=nr(r.zoom()),o=Math.round(a/n)*n;o+=n*i;var l=Math.pow(10,o);r.zoom(Zc(Tr,l),t)};Ze.prototype.toggle=function(t){var n=this._container,r=this._handleWheel,i=this._enabled;return typeof t=="undefined"&&(t=!i),i!==t&<[t?"bind":"unbind"](n,"wheel",r,!1),this._enabled=t,t};Ze.prototype._init=function(e){this.toggle(e)};const If={__init__:["zoomScroll"],zoomScroll:["type",Ze]};export{Gc as $,Xt as A,pe as B,Se as C,Qn as D,Ge as E,xn as F,Or as G,$ as H,tt as I,nf as J,of as K,mi as L,Lf as M,Dr as N,Fi as O,dt as P,Is as Q,Ga as R,sr as S,ti as T,di as U,Pr as V,kf as W,Yc as X,Ln as Y,If as Z,Ra as _,lt as a,Va as a$,Au as a0,pr as a1,Ns as a2,te as a3,Oe as a4,fe as a5,Q as a6,vf as a7,yf as a8,Ri as a9,bn as aA,kn as aB,xt as aC,Sf as aD,Df as aE,Ef as aF,ir as aG,yr as aH,Mf as aI,Tf as aJ,Pf as aK,uf as aL,lf as aM,cf as aN,ff as aO,ja as aP,Gt as aQ,St as aR,wu as aS,Wa as aT,Of as aU,sf as aV,jt as aW,_n as aX,Pc as aY,Af as aZ,Nf as a_,Ko as aa,Qt as ab,en as ac,Yo as ad,_f as ae,_s as af,Fa as ag,Ke as ah,co as ai,xf as aj,lr as ak,df as al,Zu as am,Bi as an,pf as ao,ue as ap,or as aq,Za as ar,Iu as as,Lu as at,ft as au,Pe as av,dr as aw,yn as ax,Bf as ay,Ja as az,Qe as b,no as b0,hf as b1,rf as b2,gf as b3,Zs as b4,et as b5,Hn as b6,Te as b7,af as b8,Ui as b9,_i as ba,Rf as bb,Pi as bc,Ya as bd,nu as be,nt as bf,cr as c,V as d,Xe as e,B as f,_t as g,qe as h,Me as i,Fo as j,Cf as k,Jt as l,mf as m,Xn as n,rr as o,Qa as p,We as q,_u as r,za as s,Ot as t,Rn as u,qa as v,bf as w,$e as x,wf as y,Nt as z};