var q2=Object.defineProperty,K2=Object.defineProperties;var Y2=Object.getOwnPropertyDescriptors;var qs=Object.getOwnPropertySymbols;var Yy=Object.prototype.hasOwnProperty,Xy=Object.prototype.propertyIsEnumerable;var nu=(Be,ze,Le)=>ze in Be?q2(Be,ze,{enumerable:!0,configurable:!0,writable:!0,value:Le}):Be[ze]=Le,Ce=(Be,ze)=>{for(var Le in ze||(ze={}))Yy.call(ze,Le)&&nu(Be,Le,ze[Le]);if(qs)for(var Le of qs(ze))Xy.call(ze,Le)&&nu(Be,Le,ze[Le]);return Be},Pn=(Be,ze)=>K2(Be,Y2(ze));var Zy=(Be,ze)=>{var Le={};for(var q in Be)Yy.call(Be,q)&&ze.indexOf(q)<0&&(Le[q]=Be[q]);if(Be!=null&&qs)for(var q of qs(Be))ze.indexOf(q)<0&&Xy.call(Be,q)&&(Le[q]=Be[q]);return Le};var Qy=(Be,ze,Le)=>(nu(Be,typeof ze!="symbol"?ze+"":ze,Le),Le);var Ui=(Be,ze,Le)=>new Promise((q,Lo)=>{var Zs=An=>{try{Er(Le.next(An))}catch(wr){Lo(wr)}},Vt=An=>{try{Er(Le.throw(An))}catch(wr){Lo(wr)}},Er=An=>An.done?q(An.value):Promise.resolve(An.value).then(Zs,Vt);Er((Le=Le.apply(Be,ze)).next())});import{bX as Ks,a4 as Jy,__tla as X2}from"./index-b5895273.js";import{i as ie,a as le,f as k,b as ce,c as ye,d as rt,g as No,e as N,h as Ys,r as Gt,j as Oo,k as pn,s as ln,l as eg,m as Ct,n as pt,o as Mt,p as Z2,q as un,t as tg,u as kn,v as bt,w as Tn,x as hn,y as ot,z as Xs,A as iu,B as ng,C as Q2,D as J2,E as ru,F as ek,G as tk}from"./index.esm-5037906b.js";import{y as nk,l as at,q as ig}from"./preact.module-8c2bd209.js";let jo,ik=Promise.all([(()=>{try{return X2}catch(Be){}})()]).then(()=>Ui(void 0,null,function*(){var Be={exports:{}};typeof Object.create=="function"?Be.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Be.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var ze=Be.exports;const Le=Ks(ze);function q(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Lo(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Zs=Lo(function(e){var t=e.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;for(var a=r-Math.floor(r),s="",o=0;o=Math.pow(2,n)?t(n,i):s};t.rack=function(n,i,r){var o=function(s){var c=0;do{if(c++>10)if(r)n+=r;else throw new Error("too many ID collisions, use more bits");var p=t(n,i)}while(Object.hasOwnProperty.call(a,p));return a[p]=s,p},a=o.hats={};return o.get=function(s){return o.hats[s]},o.set=function(s,c){return o.hats[s]=c,o},o.bits=n||128,o.base=i||16,o}});function Vt(e){if(!(this instanceof Vt))return new Vt(e);e=e||[128,36,1],this._seed=e.length?Zs.rack(e[0],e[1],e[2]):e}Vt.prototype.next=function(e){return this._seed(e||!0)},Vt.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},Vt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Vt.prototype.assigned=function(e){return this._seed.get(e)||!1},Vt.prototype.unclaim=function(e){delete this._seed.hats[e]},Vt.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};function Er(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(i){if(i!=="default"&&!(i in e)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}})}),Object.freeze(e)}const An=Object.prototype.toString,wr=Object.prototype.hasOwnProperty;function rg(e){return e===void 0}function og(e){return An.call(e)==="[object Array]"}function ag(e,t){return wr.call(e,t)}function ou(e,t){let n,i;if(rg(e))return;const r=og(e)?cg:sg;for(let o in e)if(ag(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function sg(e){return e}function cg(e){return Number(e)}function st(e,...t){const n=e.style;return ou(t,function(i){i&&ou(i,function(r,o){n[o]=r})}),e}function ft(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const pg=Object.prototype.toString;function Je(e){return new Yn(e)}function Yn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Yn.prototype.add=function(e){return this.list.add(e),this},Yn.prototype.remove=function(e){return pg.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Yn.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n
a',cu=!Fo.getElementsByTagName("link").length,Fo=void 0);var Xe={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:cu?[1,"X
","
"]:[0,"",""]};Xe.td=Xe.th=[3,"","
"],Xe.option=Xe.optgroup=[1,'"],Xe.thead=Xe.tbody=Xe.colgroup=Xe.caption=Xe.tfoot=[1,"","
"],Xe.polyline=Xe.ellipse=Xe.polygon=Xe.circle=Xe.text=Xe.line=Xe.path=Xe.rect=Xe.g=[1,'',""];function mg(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 i=n[1];if(i=="body"){var c=t.createElement("html");return c.innerHTML=e,c.removeChild(c.lastChild)}var r=Object.prototype.hasOwnProperty.call(Xe,i)?Xe[i]:Xe._default,o=r[0],a=r[1],s=r[2],c=t.createElement("div");for(c.innerHTML=a+e+s;o--;)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 Me=fg;function Ae(e,t){return t=t||document,t.querySelector(e)}function ec(e,t){return t=t||document,t.querySelectorAll(e)}function dn(e){e.parentNode&&e.parentNode.removeChild(e)}function vg(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(n){}return e}function pu(e,t){return t.appendChild(vg(e,t))}function ee(e,t){return pu(t,e),e}var tc=2,lu={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":tc,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":tc,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function yg(e,t){return lu[t]?e.style[t]:e.getAttributeNS(null,t)}function uu(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=lu[i];r?(r===tc&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function gg(e,t){var n=Object.keys(t),i,r;for(i=0,r;r=n[i];i++)uu(e,r,t[r])}function Y(e,t,n){if(typeof t=="string")if(n!==void 0)uu(e,t,n);else return yg(e,t);else gg(e,t);return e}const bg=Object.prototype.toString;function he(e){return new Xn(e)}function Xn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Xn.prototype.add=function(e){return this.list.add(e),this},Xn.prototype.remove=function(e){return bg.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Xn.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n"+e+"",t=!0);var n=xg(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function xg(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function Z(e,t){var n;return e.charAt(0)==="<"?(n=fu(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(nc.svg,e),t&&Y(n,t),n}var ic=null;function rc(){return ic===null&&(ic=Z("svg")),ic}function mu(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function _g(e,t,n,i,r,o){var a=rc().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return mu(a,e);case 6:return mu(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}function Cr(e){return e?rc().createSVGTransformFromMatrix(e):rc().createSVGTransform()}var vu=/([&<>]{1})/g,Eg=/([\n\r"]{1})/g,wg={"&":"&","<":"<",">":">",'"':"'"};function oc(e,t){function n(i,r){return wg[r]||r}return e.replace(t,n)}function yu(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(oc(e.textContent,vu));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(r=e.attributes,n=0,i=r.length;n"),a=e.childNodes,n=0,i=a.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 Sg(e,t){var n=fu(t);if(Ho(e),!!t){Rg(n)||(n=n.documentElement);for(var i=Pg(n.childNodes),r=0;r{const r=i.match(Ng);return(r&&r[1]||i).trim()})||[]}function bu(e,t){t=t||{get:function(E,_){if(n.push(E),_===!1)return null;throw a(`No provider for "${E}"!`)}};const n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(E){const _=n.join(" -> ");return n.length=0,new Error(_?`${E} (Resolving: ${_})`:E)};function s(E,_){if(!i[E]&&E.indexOf(".")!==-1){const x=E.split(".");let S=s(x.shift());for(;x.length;)S=S[x.shift()];return S}if(sc(r,E))return r[E];if(sc(i,E)){if(n.indexOf(E)!==-1)throw n.push(E),a("Cannot resolve circular dependency!");return n.push(E),r[E]=i[E][0](i[E][1]),n.pop(),r[E]}return t.get(E,_)}function c(E,_){if(typeof _>"u"&&(_={}),typeof E!="function")if(ac(E))E=Go(E.slice());else throw a(`Cannot invoke "${E}". Expected a function!`);const x=(E.$inject||Og(E)).map(S=>sc(_,S)?_[S]:s(S));return{fn:E,dependencies:x}}function p(E){const{fn:_,dependencies:x}=c(E),S=Function.prototype.bind.apply(_,[null].concat(x));return new S}function l(E,_,x){const{fn:S,dependencies:M}=c(E,x);return S.apply(_,M)}function u(E){return Go(_=>E.get(_))}function h(E,_){if(_&&_.length){const x=Object.create(null),S=Object.create(null),M=[],j=[],B=[];let D,$,z,F;for(let U in i)D=i[U],_.indexOf(U)!==-1&&(D[2]==="private"?($=M.indexOf(D[3]),$===-1?(z=D[3].createChild([],_),F=u(z),M.push(D[3]),j.push(z),B.push(F),x[U]=[F,U,"private",z]):x[U]=[B[$],U,"private",j[$]]):x[U]=[D[2],D[1]],S[U]=!0),(D[2]==="factory"||D[2]==="type")&&D[1].$scope&&_.forEach(ue=>{D[1].$scope.indexOf(ue)!==-1&&(x[U]=[D[2],D[1]],S[ue]=!0)});_.forEach(U=>{if(!S[U])throw new Error('No provider for "'+U+'". Cannot use provider from the parent!')}),E.unshift(x)}return new bu(E,o)}const d={factory:l,type:p,value:function(E){return E}};function f(E,_){const x=E.__init__||[];return function(){x.forEach(S=>{typeof S=="string"?_.get(S):_.invoke(S)})}}function v(E){const _=E.__exports__;if(_){const x=E.__modules__,S=Object.keys(E).reduce(($,z)=>(z!=="__exports__"&&z!=="__modules__"&&z!=="__init__"&&z!=="__depends__"&&($[z]=E[z]),$),Object.create(null)),M=(x||[]).concat(S),j=h(M),B=Go(function($){return j.get($)});_.forEach(function($){i[$]=[B,$,"private",j]});const D=(E.__init__||[]).slice();return D.unshift(function(){j.init()}),E=Object.assign({},E,{__init__:D}),f(E,j)}return Object.keys(E).forEach(function(x){if(x==="__init__"||x==="__depends__")return;if(E[x][2]==="private"){i[x]=E[x];return}const S=E[x][0],M=E[x][1];i[x]=[d[S],jg(S,M),S]}),f(E,o)}function g(E,_){return E.indexOf(_)!==-1||(E=(_.__depends__||[]).reduce(g,E),E.indexOf(_)!==-1)?E:E.concat(_)}function R(E){const _=E.reduce(g,[]).map(v);let x=!1;return function(){x||(x=!0,_.forEach(S=>S()))}}this.get=s,this.invoke=l,this.instantiate=p,this.createChild=h,this.init=R(e)}function jg(e,t){return e!=="value"&&ac(t)&&(t=Go(t.slice())),t}var Lg=1e3;function fn(e,t){var n=this;t=t||Lg,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,s=r.gfx,c=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}fn.prototype.canRender=function(e){},fn.prototype.drawShape=function(e,t){},fn.prototype.drawConnection=function(e,t){},fn.prototype.getShapePath=function(e){},fn.prototype.getConnectionPath=function(e){};function wi(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function Ig(e){return["M",e.x,e.y]}function cc(e){return["L",e.x,e.y]}function $g(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function zg(e,t){const n=e.length,i=[Ig(e[0])];for(let r=1;rr||r===void 0)&&(r=c+u),(p+l>o||o===void 0)&&(o=p+l)}),{x:n,y:i,height:o-i,width:r-n}}function Gg(e,t){var n={};return k(e,function(i){var r=i;r.waypoints&&(r=Ve(r)),!ie(t.y)&&r.x>t.x&&(n[i.id]=i),!ie(t.x)&&r.y>t.y&&(n[i.id]=i),r.x>t.x&&r.y>t.y&&(ie(t.width)&&ie(t.height)&&r.width+r.x"u"&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Tr(e,t);return Math.abs(r/o)<=i}var qg=2;function Dn(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[r,o]of Object.entries(i))if(Kg(r,n))return o;return!1}function Kg(e,t){const n=t[0];return Oo(t,function(i){return Math.abs(n[e]-i[e])<=qg})}function Cu(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x=1e3&&delete r[o.shift()],o.push(i),r[i]=e.apply(0,n),r[i])}return t}function e0(e){if(!e)return null;var t=qi(e);if(t.arr)return Ar(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return qo(e)&&qo(e[0])&&(i=Ar(e)),i.length||String(e).replace(Xg,function(r,o,a){var s=[],c=o.toLowerCase();for(a.replace(Zg,function(p,l){l&&s.push(+l)}),c=="m"&&s.length>2&&(i.push([o].concat(s.splice(0,2))),c="l",o=o=="m"?"l":"L");s.length>=n[c]&&(i.push([o].concat(s.splice(0,n[c]))),!!n[c]););}),i.toString=qi.toString,t.arr=Ar(i),i}function qi(e){var t=qi.ps=qi.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)dc(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function fc(e,t,n,i){return arguments.length===1&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function ku(){return this.join(",").replace(Yg,"$1")}function Ko(e){var t=Ar(e);return t.toString=ku,t}function Tu(e,t,n,i,r,o,a,s,c){var p=1-c,l=Pu(p,3),u=Pu(p,2),h=c*c,d=h*c,f=l*e+u*3*c*n+p*3*c*c*r+d*a,v=l*t+u*3*c*i+p*3*c*c*o+d*s;return{x:Yo(f),y:Yo(v)}}function Au(e){var t=a0.apply(null,e);return fc(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function ei(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function t0(e,t){return e=fc(e),t=fc(t),ei(t,e.x,e.y)||ei(t,e.x2,e.y)||ei(t,e.x,e.y2)||ei(t,e.x2,e.y2)||ei(e,t.x,t.y)||ei(e,t.x2,t.y)||ei(e,t.x,t.y2)||ei(e,t.x2,t.y2)||(e.xt.x||t.xe.x)&&(e.yt.y||t.ye.y)}function Mu(e,t,n,i,r){var o=-3*t+9*n-9*i+3*r,a=e*o+6*t-12*n+6*i;return e*a-3*t+3*n}function Du(e,t,n,i,r,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var p=c/2,l=12,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,f=0;fvn(r,a)||vn(t,i)vn(o,s))){var c=(e*i-t*n)*(r-a)-(e-n)*(r*s-o*a),p=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),l=(e-n)*(o-s)-(t-i)*(r-a);if(l){var u=Yo(c/l),h=Yo(p/l),d=+u.toFixed(2),f=+h.toFixed(2);if(!(d<+mn(e,n).toFixed(2)||d>+vn(e,n).toFixed(2)||d<+mn(r,a).toFixed(2)||d>+vn(r,a).toFixed(2)||f<+mn(t,i).toFixed(2)||f>+vn(t,i).toFixed(2)||f<+mn(o,s).toFixed(2)||f>+vn(o,s).toFixed(2)))return{x:u,y:h}}}}function Yo(e){return Math.round(e*1e11)/1e11}function i0(e,t,n){var i=Au(e),r=Au(t);if(!t0(i,r))return n?0:[];for(var o=Du.apply(0,e),a=Du.apply(0,t),s=Bu(e)?1:~~(o/5)||1,c=Bu(t)?1:~~(a/5)||1,p=[],l=[],u={},h=n?0:[],d=0;d=0&&B<=1&&D>=0&&D<=1&&(n?h++:h.push({x:M.x,y:M.y,t1:B,t2:D}))}}return h}function r0(e,t,n){e=ju(e),t=ju(t);for(var i,r,o,a,s,c,p,l,u,h,d=n?0:[],f=0,v=e.length;f1&&(R=Ue.sqrt(R),n=R*n,i=R*i);var E=n*n,_=i*i,x=(o==a?-1:1)*Ue.sqrt(Jn((E*_-E*g*g-_*v*v)/(E*g*g+_*v*v))),S=x*n*g/i+(e+s)/2,M=x*-i*v/n+(t+c)/2,j=Ue.asin(((t-M)/i).toFixed(9)),B=Ue.asin(((c-M)/i).toFixed(9));j=eB&&(j=j-Qn*2),!a&&B>j&&(B=B-Qn*2)}var D=B-j;if(Jn(D)>l){var $=B,z=s,F=c;B=j+l*(a&&B>j?1:-1),s=S+n*Ue.cos(B),c=M+i*Ue.sin(B),h=Ou(s,c,n,i,r,0,a,z,F,[B,$,S,M])}D=B-j;var U=Ue.cos(j),ue=Ue.sin(j),It=Ue.cos(B),Re=Ue.sin(B),pe=Ue.tan(D/4),wt=4/3*n*pe,C=4/3*i*pe,m=[e,t],A=[e+wt*ue,t-C*U],O=[s+wt*Re,c-C*It],T=[s,c];if(A[0]=2*m[0]-A[0],A[1]=2*m[1]-A[1],p)return[A,O,T].concat(h);h=[A,O,T].concat(h).join().split(",");for(var L=[],G=0,oe=h.length;G7){d[f].shift();for(var v=d[f];v.length;)a[f]="A",d.splice(f++,0,["C"].concat(v.splice(0,6)));d.splice(f,1),l=n.length}},a=[],s="",c="",p=0,l=n.length;p=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,p=o?"top":s?"bottom":null,l=c?"left":a?"right":null;return l&&p?p+"-"+l:l||p||"intersect"}function mc(e,t,n){var i=l0(e,t);return i.length===1||i.length===2&&Tr(i[0],i[1])<1?ti(i[0]):i.length>1?(i=ln(i,function(r){var o=Math.floor(r.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,r.segment2+"#"+o}),ti(i[n?0:i.length-1])):null}function l0(e,t){return Lu(e,t)}function u0(e){e=e.slice();for(var t=0,n,i,r;e[t];)n=e[t],i=e[t-1],r=e[t+1],Tr(n,r)===0||uc(i,r,n)?e.splice(t,1):t++;return e}function h0(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Qo(e,t){return Math.round(e*t)/t}function $u(e){return ie(e)?e+"px":e}function d0(e){for(;e.parent;)e=e.parent;return e}function f0(e){e=N({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),st(n,{position:"relative",overflow:"hidden",width:$u(e.width),height:$u(e.height)}),t.appendChild(n),n}function zu(e,t,n){const i=Z("g");he(i).add(t);const r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const m0="base",Fu=0,v0=1,y0={shape:["x","y","width","height"],connection:["waypoints"]};function ae(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}ae.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ae.prototype._init=function(e){const t=this._eventBus,n=this._container=f0(e),i=this._svg=Z("svg");Y(i,{width:"100%",height:"100%"}),ee(n,i);const r=this._viewport=zu(i,"viewport");e.deferUpdate&&(this._viewboxChanged=eg(Ct(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:i,viewport:r})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ae.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},ae.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{const t=wu(e);t==="root"?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ae.prototype.getDefaultLayer=function(){return this.getLayer(m0,Fu)},ae.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<"u"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ae.prototype._getChildIndex=function(e){return Gt(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},ae.prototype._createLayer=function(e,t){typeof t>"u"&&(t=v0);const n=this._getChildIndex(t);return{group:zu(this._viewport,"layer-"+e,n),index:t,visible:!0}},ae.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},ae.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&&(Fe(n),t.visible=!1),n},ae.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Fe(t.group))},ae.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ae.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(d0(e))||{}).rootElement:void 0},ae.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},ae.prototype._findPlaneForRoot=function(e){return ye(this._planes,function(t){return t.rootElement===e})},ae.prototype.getContainer=function(){return this._container},ae.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(k([i.gfx,i.secondaryGfx],function(r){r&&(n?he(r).add(t):he(r).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ae.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ae.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ae.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));const n=this.getGraphics(e);return he(n).has(t)},ae.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ae.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ae.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,Fu);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ae.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(t){return t.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},ae.prototype.setRootElement=function(e){if(e===this._rootElement)return;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},ae.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)},ae.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},ae.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})},ae.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=y0[e];if(!Oo(n,function(i){return typeof t[i]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},ae.prototype._setParent=function(e,t,n){Ze(t.children,e,n),e.parent=t},ae.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},ae.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ae.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ae.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e),!!e)return r.fire(t+".remove",{element:e}),i.remove(e),We(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ae.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ae.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ae.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ae.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ae.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ae.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,a,s,c,p;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);const l=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Rr(t,l)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Rr(t),r=a?a.matrix:_g(),s=Qo(r.a,1e3),c=Qo(-r.e||0,1e3),p=Qo(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n},e;return e},ae.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=N({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Hu(t,n)}),{x:n.e,y:n.f}},ae.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===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 r=Ve(e),o=X(r),a=this.viewbox(),s=this.zoom();let c,p;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const l=X(a);if(!(r.width=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},ae.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,p,l;c=i.getCTM();const u=c.a;return t?(a=N(o,t),s=a.matrixTransform(c.inverse()),p=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),l=c.multiply(p)):l=r.scale(e),Hu(this._viewport,l),l},ae.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ae.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:i,y:r,width:o,height:a}},ae.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ki="data-element-id";function Dt(e){this._elements={},this._eventBus=e}Dt.$inject=["eventBus"],Dt.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Y(t,Ki,i),n&&Y(n,Ki,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Dt.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Y(i.gfx,Ki,""),i.secondaryGfx&&Y(i.secondaryGfx,Ki,""),delete t[n])},Dt.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),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Dt.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&Y(t,Ki,i),t},Dt.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&Y(e,Ki);var n=this._elements[t];return n&&n.element},Dt.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Dt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i"u"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function b0(e){return e.__refs_collection===!0}Jo.extend=g0,Jo.isExtended=b0;var Gu=Jo;function x0(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Vu(e,t,n){var i=Gu.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function _0(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(o){if(o!==r){var a=r;r=null,a&&e.unset(a,i,n),r=o,e.set(r,i,n)}}})}function ni(e,t){if(!(this instanceof ni))return new ni(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}ni.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Vu(this,t,e):_0(this,t,e)},ni.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Gu.isExtended(n)||Vu(this,t,e),n},ni.prototype.ensureBound=function(e,t){x0(e,t)||this.bind(e,t)},ni.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},ni.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var E0=ni;vc.exports=E0,vc.exports.Collection=Jo;var w0=vc.exports;const Mr=Ks(w0);var yc=new Mr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Wu=new Mr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Uu=new Mr({name:"attachers",collection:!0},{name:"host"}),qu=new Mr({name:"outgoing",collection:!0},{name:"source"}),Ku=new Mr({name:"incoming",collection:!0},{name:"target"});function Yi(){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)}}),yc.bind(this,"parent"),Wu.bind(this,"labels"),qu.bind(this,"outgoing"),Ku.bind(this,"incoming")}function Dr(){Yi.call(this),yc.bind(this,"children"),Uu.bind(this,"host"),Uu.bind(this,"attachers")}q(Dr,Yi);function Yu(){Yi.call(this),yc.bind(this,"children")}q(Yu,Dr);function Xu(){Dr.call(this),Wu.bind(this,"labelTarget")}q(Xu,Dr);function Zu(){Yi.call(this),qu.bind(this,"source"),Ku.bind(this,"target")}q(Zu,Yi);var S0={connection:Zu,shape:Dr,label:Xu,root:Yu};function C0(e,t){var n=S0[e];if(!n)throw new Error("unknown type: <"+e+">");return N(new n,t)}function R0(e){return e instanceof Yi}function Bn(){this._uid=12}Bn.prototype.createRoot=function(e){return this.create("root",e)},Bn.prototype.createLabel=function(e){return this.create("label",e)},Bn.prototype.createShape=function(e){return this.create("shape",e)},Bn.prototype.createConnection=function(e){return this.create("connection",e)},Bn.prototype.create=function(e,t){return t=N({},t||{}),t.id||(t.id=e+"_"+this._uid++),C0(e,t)};var ea="__fn",Qu=1e3,P0=Array.prototype.slice;function Pt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}Pt.prototype.on=function(e,t,n,i){if(e=le(e)?e:[e],pt(t)&&(i=n,n=t,t=Qu),!ie(t))throw new Error("priority must be a number");var r=n;i&&(r=Ct(n,i),r[ea]=n[ea]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},Pt.prototype.once=function(e,t,n,i){var r=this;if(pt(t)&&(i=n,n=t,t=Qu),!ie(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[ea]=n,this.on(e,t,o)},Pt.prototype.off=function(e,t){e=le(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},Pt.prototype.createEvent=function(e){var t=new Br;return t.init(e),t},Pt.prototype.fire=function(e,t){var n,i,r,o;if(o=P0.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(i=this._listeners[e],!!i){t instanceof Br?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Pt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},Pt.prototype._destroy=function(){this._listeners={}},Pt.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Pt.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=k0(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw r}return i},Pt.prototype._addListener=function(e,t){var n=this._getListeners(e),i;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority or , got "+e);return e=(r?r+":":"")+i,{name:e,prefix:r,localName:i}}function Nt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Nt.prototype.build=function(){return un(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Nt.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},Nt.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(s===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Nt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=mt(r[0],i),a=mt(r[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines},Nt.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Nt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Nt.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},Nt.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},Nt.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Nt.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Nt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Nt.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(k(e.properties,Ct(function(o){o=N({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(e),n[r]=e)};function ii(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,k(e,Ct(this.registerPackage,this))}ii.prototype.getPackage=function(e){return this.packageMap[e]},ii.prototype.getPackages=function(){return this.packages},ii.prototype.registerPackage=function(e){e=N({},e);var t=this.packageMap;rh(t,e,"prefix"),rh(t,e,"uri"),k(e.types,Ct(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},ii.prototype.registerType=function(e,t){e=N({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:N(e.meta||{})});var n=mt(e.name,t.prefix),i=n.name,r={};k(e.properties,Ct(function(o){var a=mt(o.name,n.prefix),s=a.name;_c(o.type)||(o.type=mt(o.type,a.prefix).name),N(o,{ns:a,name:s}),r[s]=o},this)),N(e,{ns:n,name:i,propertiesByName:r}),k(e.extends,Ct(function(o){var a=mt(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},ii.prototype.mapTypes=function(e,t,n){var i=_c(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c,p){var l=mt(c,_c(c)?"":e.prefix);r.mapTypes(l,t,p)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!i)throw new Error("unknown type <"+e.name+">");k(i.superClass,n?a:s),t(i,!n),k(i.traits,a)},ii.prototype.getEffectiveDescriptor=function(e){var t=mt(e),n=new Nt(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},ii.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function rh(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Ci(e){this.model=e}Ci.prototype.set=function(e,t,n){if(!Mt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;N0(n)?i?delete e[r]:delete e.$attrs[Ec(t)]:i?r in e?e[r]=n:oh(e,i,n):e.$attrs[Ec(t)]=n},Ci.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Ec(t)];var i=n.name;return!e[i]&&n.isMany&&oh(e,n,[]),e[i]},Ci.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;n=N({},n,{get:function(){return i}}),delete n.value}Object.defineProperty(e,t,n)},Ci.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Ci.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Ci.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(typeof r<"u"){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw o;typeof console<"u"}return null};function N0(e){return typeof e>"u"}function oh(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Ec(e){return e.replace(/^:/,"")}function Wt(e,t={}){this.properties=new Ci(this),this.factory=new th(this,this.properties),this.registry=new ii(e,this.properties),this.typeCache={},this.config=t}Wt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Wt.prototype.getType=function(e){var t=this.typeCache,n=Mt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Wt.prototype.createAny=function(e,t,n){var i=mt(e),r={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){Z2(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),k(n,function(a,s){rt(a)&&a.value!==void 0?r[a.name]=a.value:r[s]=a}),r},Wt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Wt.prototype.getPackages=function(){return this.registry.getPackages()},Wt.prototype.getElementDescriptor=function(e){return e.$descriptor},Wt.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},Wt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Wt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var O0=String.fromCharCode,j0=Object.prototype.hasOwnProperty,L0=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Nr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Nr).forEach(function(e){Nr[e.toUpperCase()]=Nr[e]});function I0(e,t,n,i){return i?j0.call(Nr,i)?Nr[i]:"&"+i+";":O0(t||parseInt(n,16))}function Ri(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(L0,I0):e}var $0="http://www.w3.org/2001/XMLSchema-instance",z0="xsi",ah="xsi:type",sh="non-whitespace outside of root node";function Zi(e){return new Error(e)}function ch(e){return"missing namespace for prefix <"+e+">"}function na(e){return{get:e,enumerable:!0}}function F0(e){var t={},n;for(n in e)t[n]=e[n];return t}function wc(e){return e+"$uri"}function H0(e){var t={},n,i;for(n in e)i=e[n],t[i]=i,t[wc(i)]=n;return t}function ph(){return{line:0,column:0}}function G0(e){throw e}function lh(e){if(!this)return new lh(e);var t=e&&e.proxy,n,i,r,o,a=G0,s,c,p,l,u=ph,h=!1,d=!1,f=null,v=!1,g;function R(x){x instanceof Error||(x=Zi(x)),f=x,a(x,u)}function E(x){s&&(x instanceof Error||(x=Zi(x)),s(x,u))}this.on=function(x,S){if(typeof S!="function")throw Zi("required args ");switch(x){case"openTag":i=S;break;case"text":n=S;break;case"closeTag":r=S;break;case"error":a=S;break;case"warn":s=S;break;case"cdata":o=S;break;case"attention":l=S;break;case"question":p=S;break;case"comment":c=S;break;default:throw Zi("unsupported event: "+x)}return this},this.ns=function(x){if(typeof x>"u"&&(x={}),typeof x!="object")throw Zi("required args ");var S={},M;for(M in x)S[M]=x[M];return S[$0]=z0,d=!0,g=S,this},this.parse=function(x){if(typeof x!="string")throw Zi("required args ");return f=null,_(x),u=ph,v=!1,f},this.stop=function(){v=!0};function _(x){var S=d?[]:null,M=d?H0(g):null,j,B=[],D=0,$=!1,z=!1,F=0,U=0,ue,It,Re,pe,wt,C,m,A,O,T="",L=0,G;function oe(){if(G!==null)return G;var Se,be,me,nt=d&&M.xmlns,dt=d&&h?[]:null,ke=L,je=T,St=je.length,$t,gt,$e,zt,we,it={},Is={},Ft,Q,Pe;e:for(;ke8)){for((Q<65||Q>122||Q>90&&Q<97)&&Q!==95&&Q!==58&&(E("illegal first char attribute name"),Ft=!0),Pe=ke+1;Pe96&&Q<123||Q>64&&Q<91||Q>47&&Q<59||Q===46||Q===45||Q===95)){if(Q===32||Q<14&&Q>8){E("missing attribute value"),ke=Pe;continue e}if(Q===61)break;E("illegal attribute name char"),Ft=!0}if(we=je.substring(ke,Pe),we==="xmlns:xmlns"&&(E("illegal declaration of xmlns"),Ft=!0),Q=je.charCodeAt(Pe+1),Q===34)Pe=je.indexOf('"',ke=Pe+2),Pe===-1&&(Pe=je.indexOf("'",ke),Pe!==-1&&(E("attribute value quote missmatch"),Ft=!0));else if(Q===39)Pe=je.indexOf("'",ke=Pe+2),Pe===-1&&(Pe=je.indexOf('"',ke),Pe!==-1&&(E("attribute value quote missmatch"),Ft=!0));else for(E("missing attribute value quotes"),Ft=!0,Pe=Pe+1;Pe8));Pe++);for(Pe===-1&&(E("missing closing quotes"),Pe=St,Ft=!0),Ft||($e=je.substring(ke,Pe)),ke=Pe;Pe+18));Pe++)ke===Pe&&(E("illegal character after attribute end"),Ft=!0);if(ke=Pe+1,Ft)continue e;if(we in Is){E("attribute <"+we+"> already defined");continue}if(Is[we]=!0,!d){it[we]=$e;continue}if(h){if(gt=we==="xmlns"?"xmlns":we.charCodeAt(0)===120&&we.substr(0,6)==="xmlns:"?we.substr(6):null,gt!==null){if(Se=Ri($e),be=wc(gt),zt=g[Se],!zt){if(gt==="xmlns"||be in M&&M[be]!==Se)do zt="ns"+D++;while(typeof M[zt]<"u");else zt=gt;g[Se]=zt}M[gt]!==zt&&($t||(M=F0(M),$t=!0),M[gt]=zt,gt==="xmlns"&&(M[wc(zt)]=Se,nt=zt),M[be]=Se),it[we]=$e;continue}dt.push(we,$e);continue}if(Q=we.indexOf(":"),Q===-1){it[we]=$e;continue}if(!(me=M[we.substring(0,Q)])){E(ch(we.substring(0,Q)));continue}we=nt===me?we.substr(Q+1):me+we.substr(Q),we===ah&&(Q=$e.indexOf(":"),Q!==-1?(me=$e.substring(0,Q),me=M[me]||me,$e=me+$e.substring(Q)):$e=nt+":"+$e),it[we]=$e}if(h)for(ke=0,St=dt.length;ke=nt&&(ke=Se.exec(x),!(!ke||(dt=ke[0].length+ke.index,dt>F)));)be+=1,nt=dt;return F==-1?(me=dt,je=x.substring(U)):U===0?je=x.substring(U,F):(me=F-nt,je=U==-1?x.substring(F):x.substring(F,U+1)),{data:je,line:be,column:me}}for(u=se,t&&(O=Object.create({},{name:na(function(){return m}),originalName:na(function(){return A}),attrs:na(oe),ns:na(function(){return M})}));U!==-1;){if(x.charCodeAt(U)===60?F=U:F=x.indexOf("<",U),F===-1){if(B.length)return R("unexpected end of file");if(U===0)return R("missing start tag");U",F),U===-1)return R("unclosed cdata");if(o&&(o(x.substring(F+9,U),u),v))return;U+=3;continue}if(Re===45&&x.charCodeAt(F+3)===45){if(U=x.indexOf("-->",F),U===-1)return R("unclosed comment");if(c&&(c(x.substring(F+4,U),Ri,u),v))return;U+=3;continue}}if(pe===63){if(U=x.indexOf("?>",F),U===-1)return R("unclosed question");if(p&&(p(x.substring(F,U+2),u),v))return;U+=2;continue}for(ue=F+1;;ue++){if(wt=x.charCodeAt(ue),isNaN(wt))return U=-1,R("unclosed tag");if(wt===34)Re=x.indexOf('"',ue+1),ue=Re!==-1?Re:ue;else if(wt===39)Re=x.indexOf("'",ue+1),ue=Re!==-1?Re:ue;else if(wt===62){U=ue;break}}if(pe===33){if(l&&(l(x.substring(F,U+1),Ri,u),v))return;U+=1;continue}if(G={},pe===47){if($=!1,z=!0,!B.length)return R("missing open tag");if(ue=m=B.pop(),Re=F+2+ue.length,x.substring(F+2,Re)!==ue)return R("closing tag mismatch");for(;Re8&&pe<14))return R("close tag")}else{if(x.charCodeAt(U-1)===47?(ue=m=x.substring(F+1,U-1),$=!0,z=!0):(ue=m=x.substring(F+1,U),$=!0,z=!1),!(pe>96&&pe<123||pe>64&&pe<91||pe===95||pe===58))return R("illegal first char nodeName");for(Re=1,It=ue.length;Re96&&pe<123||pe>64&&pe<91||pe>47&&pe<59||pe===45||pe===95||pe==46)){if(pe===32||pe<14&&pe>8){m=ue.substring(0,Re),G=null;break}return R("invalid nodeName")}z||B.push(m)}if(d){if(j=M,$&&(z||S.push(j),G===null&&(h=ue.indexOf("xmlns",Re)!==-1)&&(L=Re,T=ue,oe(),h=!1)),A=m,pe=m.indexOf(":"),pe!==-1){if(C=M[m.substring(0,pe)],!C)return R("missing namespace on <"+A+">");m=m.substr(pe+1)}else C=M.xmlns;C&&(m=C+":"+m)}if($&&(L=Re,T=ue,i&&(t?i(O,Ri,z,u):i(m,oe,Ri,z,u),v)))return;if(z){if(r&&(r(t?O:m,Ri,$,u),v))return;d&&($?M=j:M=S.pop())}U+=1}}}function uh(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var V0={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ia="xsi:type";function hh(e){return e.xml&&e.xml.serialize}function dh(e){return hh(e)===ia}function W0(e){return hh(e)==="property"}function U0(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fh(e,t){return uh(t)?e.prefix+":"+U0(e.localName):e.name}function q0(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&i.indexOf(r)===0?e.prefix+":"+i.slice(r.length):n}function K0(e,t){var n=mt(e),i=t.getPackage(n.prefix);return q0(n,i)}function ri(e){return new Error(e)}function Nn(e){return e.$descriptor}function Y0(e){N(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw ri("expected element");var n=this.elementsById,i=Nn(t),r=i.idProperty,o;if(r&&(o=t.get(r.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw ri("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Or(){}Or.prototype.handleEnd=function(){},Or.prototype.handleText=function(){},Or.prototype.handleNode=function(){};function Sc(){}Sc.prototype=Object.create(Or.prototype),Sc.prototype.handleNode=function(){return this};function Qi(){}Qi.prototype=Object.create(Or.prototype),Qi.prototype.handleText=function(e){this.body=(this.body||"")+e};function jr(e,t){this.property=e,this.context=t}jr.prototype=Object.create(Qi.prototype),jr.prototype.handleNode=function(e){if(this.element)throw ri("expected no sub nodes");return this.element=this.createReference(e),this},jr.prototype.handleEnd=function(){this.element.id=this.body},jr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Cc(e,t){this.element=t,this.propertyDesc=e}Cc.prototype=Object.create(Qi.prototype),Cc.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=xc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function ra(){}ra.prototype=Object.create(Qi.prototype),ra.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 vt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}vt.prototype=Object.create(ra.prototype),vt.prototype.addReference=function(e){this.context.addReference(e)},vt.prototype.handleText=function(e){var t=this.element,n=Nn(t),i=n.bodyProperty;if(!i)throw ri("unexpected body text <"+e+">");Qi.prototype.handleText.call(this,e)},vt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Nn(t),i=n.bodyProperty;i&&e!==void 0&&(e=xc(i.type,e),t.set(i.name,e))},vt.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=Nn(n),r=this.context,o=new n({}),a=this.model,s;return k(t,function(c,p){var l=i.propertiesByName[p],u;l&&l.isReference?l.isMany?(u=c.split(" "),k(u,function(h){r.addReference({element:o,property:l.ns.name,id:h})})):r.addReference({element:o,property:l.ns.name,id:c}):(l?c=xc(l.type,c):p!=="xmlns"&&(s=mt(p,i.ns.prefix),a.getPackage(s.prefix)&&r.addWarning({message:"unknown attribute <"+p+">",element:o,property:p,value:c})),o.set(p,c))}),o},vt.prototype.getPropertyForNode=function(e){var t=e.name,n=mt(t),i=this.type,r=this.model,o=Nn(i),a=n.name,s=o.propertiesByName[a],c,p;if(s&&!s.isAttr)return dh(s)&&(c=e.attributes[ia],c)?(c=K0(c,r),p=r.getType(c),N({},s,{effectiveType:Nn(p).name})):s;var l=r.getPackage(n.prefix);if(l){if(c=fh(n,l),p=r.getType(c),s=ye(o.properties,function(u){return!u.isVirtual&&!u.isReference&&!u.isAttribute&&p.hasType(u.type)}),s)return N({},s,{effectiveType:Nn(p).name})}else if(s=ye(o.properties,function(u){return!u.isReference&&!u.isAttribute&&u.type==="Element"}),s)return s;throw ri("unrecognized element <"+n.name+">")},vt.prototype.toString=function(){return"ElementDescriptor["+Nn(this.type).name+"]"},vt.prototype.valueHandler=function(e,t){return new Cc(e,t)},vt.prototype.referenceHandler=function(e){return new jr(e,this.context)},vt.prototype.handler=function(e){return e==="Element"?new Ji(this.model,e,this.context):new vt(this.model,e,this.context)},vt.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,ih(n))return this.valueHandler(t,i);t.isReference?r=this.referenceHandler(t).handleNode(e):r=this.handler(n).handleNode(e);var o=r.element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(N(o,{element:i}),this.context.addReference(o)):o.$parent=i),r};function Rc(e,t,n){vt.call(this,e,t,n)}Rc.prototype=Object.create(vt.prototype),Rc.prototype.createElement=function(e){var t=e.name,n=mt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&fh(n,o)||t;if(!r.hasType(a))throw ri("unexpected element <"+e.originalName+">");return vt.prototype.createElement.call(this,e)};function Ji(e,t,n){this.model=e,this.context=n}Ji.prototype=Object.create(ra.prototype),Ji.prototype.createElement=function(e){var t=e.name,n=mt(t),i=n.prefix,r=e.ns[i+"$uri"],o=e.attributes;return this.model.createAny(t,r,o)},Ji.prototype.handleChild=function(e){var t=new Ji(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element,r;return i!==void 0&&(r=n.$children=n.$children||[],r.push(i),i.$parent=n),t},Ji.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Pc(e){e instanceof Wt&&(e={model:e}),N(this,{lax:!1},e)}Pc.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof vt?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new Y0(N({},t,{rootHandler:i})),s=new lh({proxy:!0}),c=X0();i.context=a,c.push(i);function p(S,M,j){var B=M(),D=B.line,$=B.column,z=B.data;z.charAt(0)==="<"&&z.indexOf(" ")!==-1&&(z=z.slice(0,z.indexOf(" "))+">");var F="unparsable content "+(z?z+" ":"")+`detected line: `+D+` column: `+$+` nested error: `+S.message;if(j)return a.addWarning({message:F,error:S}),!0;throw ri(F)}function l(S,M){return p(S,M,!0)}function u(){var S=a.elementsById,M=a.references,j,B;for(j=0;B=M[j];j++){var D=B.element,$=S[B.id],z=Nn(D).propertiesByName[B.property];if($||a.addWarning({message:"unresolved reference <"+B.id+">",element:B.element,property:B.property,value:B.id}),z.isMany){var F=D.get(z.name),U=F.indexOf(B);U===-1&&(U=F.length),$?F[U]=$:F.splice(U,1)}else D.set(z.name,$)}}function h(){c.pop().handleEnd()}var d=/^<\?xml /i,f=/ encoding="([^"]+)"/i,v=/^utf-8$/i;function g(S){if(d.test(S)){var M=f.exec(S),j=M&&M[1];!j||v.test(j)||a.addWarning({message:"unsupported document encoding <"+j+">, falling back to UTF-8"})}}function R(S,M){var j=c.peek();try{c.push(j.handleNode(S))}catch(B){p(B,M,o)&&c.push(new Sc)}}function E(S,M){try{c.peek().handleText(S)}catch(j){l(j,M)}}function _(S,M){S.trim()&&E(S,M)}var x=r.getPackages().reduce(function(S,M){return S[M.uri]=M.prefix,S},{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(x).on("openTag",function(S,M,j,B){var D=S.attrs||{},$=Object.keys(D).reduce(function(F,U){var ue=M(D[U]);return F[U]=ue,F},{}),z={name:S.name,originalName:S.originalName,attributes:$,ns:S.ns};R(z,B)}).on("question",g).on("closeTag",h).on("cdata",E).on("text",function(S,M,j){_(M(S),j)}).on("error",p).on("warn",l),new Promise(function(S,M){var j;try{s.parse(e),u()}catch(F){j=F}var B=i.element;!j&&!B&&(j=ri("failed to parse document as <"+i.type.$descriptor.name+">"));var D=a.warnings,$=a.references,z=a.elementsById;return j?(j.warnings=D,M(j)):S({rootElement:B,elementsById:z,references:$,warnings:D})})},Pc.prototype.handler=function(e){return new Rc(this.model,e)};function X0(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var Z0=` `,Q0=/<|>|'|"|&|\n\r|\n/g,mh=/<|>|&/g;function J0(e){var t={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||e&&e.byUri(a)},this.add=function(a,s){n[a.uri]=a,s?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return t[a||"xmlns"]},this.mapPrefix=function(a,s){t[a||"xmlns"]=s},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var s=a.uri,c=this.getNSKey(a);i[c]=this.byUri(s),e&&e.logUsed(a)},this.getUsed=function(a){function s(l){var u=c.getNSKey(l);return i[u]}var c=this,p=[].concat(r,o);return p.filter(s)}}function eb(e){return e.charAt(0).toLowerCase()+e.slice(1)}function tb(e,t){return uh(t)?eb(e):e}function vh(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function yh(e){return Mt(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function nb(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 ib(e,t){return t.isGeneric?N({localName:t.ns.localName},e):N({localName:tb(t.ns.localName,t.$pkg)},e)}function rb(e,t){return N({localName:t.ns.localName},e)}function ob(e){var t=e.$descriptor;return ce(t.properties,function(n){var i=n.name;if(n.isVirtual||!pn(e,i))return!1;var r=e[i];return r===n.default||r===null?!1:n.isMany?r.length:!0})}var ab={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},sb={"<":"lt",">":"gt","&":"amp"};function gh(e,t,n){return e=Mt(e)?e:""+e,e.replace(t,function(i){return"&"+n[i]+";"})}function cb(e){return gh(e,Q0,ab)}function pb(e){return gh(e,mh,sb)}function lb(e){return ce(e,function(t){return t.isAttr})}function ub(e){return ce(e,function(t){return!t.isAttr})}function kc(e){this.tagName=e}kc.prototype.build=function(e){return this.element=e,this},kc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()};function Pi(){}Pi.prototype.serializeValue=Pi.prototype.serializeTo=function(e){e.append(this.escape?pb(this.value):this.value)},Pi.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(mh)!==-1&&(this.escape=!0),this};function Tc(e){this.tagName=e}vh(Tc,Pi),Tc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()};function Ne(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}Ne.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,i,r,o=t.isGeneric;return o?i=this.parseGeneric(e):i=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o||(r=ob(e),this.parseAttributes(lb(r)),this.parseContainments(ub(r))),this.parseGenericAttributes(e,i),this},Ne.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return ib(t,e)},Ne.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return rb(t,e)},Ne.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ne.prototype.nsAttributeName=function(e){var t;if(Mt(e)?t=mt(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}:N({localName:t.localName},n)},Ne.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return k(e,function(r,o){var a;o==="$body"?n.push(new Pi().build({type:"String"},r)):o==="$children"?k(r,function(s){n.push(new Ne(t).build(s))}):o.indexOf("$")!==0&&(a=t.parseNsAttribute(e,o,r),a&&i.push({name:o,value:r}))}),i},Ne.prototype.parseNsAttribute=function(e,t,n){var i=e.$model,r=mt(t),o;if(r.prefix==="xmlns"&&(o={prefix:r.localName,uri:n}),!r.prefix&&r.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}},Ne.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return k(i,function(o,a){var s=n.parseNsAttribute(e,a,o);s&&r.push(s)}),r},Ne.prototype.parseGenericAttributes=function(e,t){var n=this;k(t,function(i){if(i.name!==ia)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){}})},Ne.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;k(e,function(r){var o=i.get(r.name),a=r.isReference,s=r.isMany;if(s||(o=[o]),r.isBody)n.push(new Pi().build(r,o[0]));else if(ih(r.type))k(o,function(l){n.push(new Tc(t.addTagName(t.nsPropertyTagName(r))).build(r,l))});else if(a)k(o,function(l){n.push(new kc(t.addTagName(t.nsPropertyTagName(r))).build(l))});else{var c=dh(r),p=W0(r);k(o,function(l){var u;c?u=new oa(t,r):p?u=new Ne(t,r):u=new Ne(t),n.push(u.build(l))})}})},Ne.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,i;return t||(i=n&&n.getNamespaces(),e||!i?this.namespaces=t=new J0(i):t=i),t},Ne.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix,a=i.byUri(r);return(!a||n)&&i.add(e,t),i.mapPrefix(o,r),e},Ne.prototype.logNamespaceUsed=function(e,t){var n=this.element,i=n.$model,r=this.getNamespaces(t),o=e.prefix,a=e.uri,s,c,p;if(!o&&!a)return{localName:e.localName};if(p=V0[o]||i&&(i.getPackage(o)||{}).uri,a=a||p||r.uriByPrefix(o),!a)throw new Error("no namespace uri given for prefix <"+o+">");if(e=r.byUri(a),!e){for(s=o,c=1;r.uriByPrefix(s);)s=o+"_"+c++;e=this.logNamespace({prefix:s,uri:a},p===a)}return o&&r.mapPrefix(o,a),e},Ne.prototype.parseAttributes=function(e){var t=this,n=this.element;k(e,function(i){var r=n.get(i.name);if(i.isReference)if(!i.isMany)r=r.id;else{var o=[];k(r,function(a){o.push(a.id)}),r=o.join(" ")}t.addAttribute(t.nsAttributeName(i),r)})},Ne.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),yh(e)},Ne.prototype.addAttribute=function(e,t){var n=this.attrs;Mt(t)&&(t=cb(t));var i=tg(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),r={name:e,value:t};i!==-1?n.splice(i,1,r):n.push(r)},Ne.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=nb(n).concat(t)),k(t,function(i){e.append(" ").append(yh(i.name)).append('="').append(i.value).append('"')})},Ne.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Pi;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),k(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()};function oa(e,t){Ne.call(this,e,t)}vh(oa,Ne),oa.prototype.parseNsAttributes=function(e){var t=Ne.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(ia),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},oa.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function hb(){this.value="",this.write=function(e){this.value+=e}}function db(e,t){var n=[""];this.append=function(i){return e.write(i),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 fb(e){e=N({format:!1,preamble:!0},e||{});function t(n,i){var r=i||new hb,o=new db(r,e.format);if(e.preamble&&o.append(Z0),new Ne().build(n).serializeTo(o),!i)return r.value}return{toXML:t}}function aa(e,t){Wt.call(this,e,t)}aa.prototype=Object.create(Wt.prototype),aa.prototype.fromXML=function(e,t,n){Mt(t)||(n=t,t="bpmn:Definitions");var i=new Pc(N({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},aa.prototype.toXML=function(e,t){var n=new fb(t);return new Promise(function(i,r){try{var o=n.toXML(e);return i({xml:o})}catch(a){return r(a)}})};var mb="BPMN20",vb="http://www.omg.org/spec/BPMN/20100524/MODEL",yb="bpmn",gb=[],bb=[{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"}]}],xb=[{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"}]}],_b={tagAlias:"lowerCase",typePrefix:"t"},Eb={name:mb,uri:vb,prefix:yb,associations:gb,types:bb,enumerations:xb,xml:_b},wb="BPMNDI",Sb="http://www.omg.org/spec/BPMN/20100524/DI",Cb="bpmndi",Rb=[{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"]}],Pb=[{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"}]}],kb=[],Tb={name:wb,uri:Sb,prefix:Cb,types:Rb,enumerations:Pb,associations:kb},Ab="DC",Mb="http://www.omg.org/spec/DD/20100524/DC",Db="dc",Bb=[{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}]}],Nb=[],Ob={name:Ab,uri:Mb,prefix:Db,types:Bb,associations:Nb},jb="DI",Lb="http://www.omg.org/spec/DD/20100524/DI",Ib="di",$b=[{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"}]}],zb=[],Fb={tagAlias:"lowerCase"},Hb={name:jb,uri:Lb,prefix:Ib,types:$b,associations:zb,xml:Fb},Gb="bpmn.io colors for BPMN",Vb="http://bpmn.io/schema/bpmn/biocolor/1.0",Wb="bioc",Ub=[{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"}]}],qb=[],Kb=[],Yb={name:Gb,uri:Vb,prefix:Wb,types:Ub,enumerations:qb,associations:Kb},Xb="BPMN in Color",Zb="http://www.omg.org/spec/BPMN/non-normative/color/1.0",Qb="color",Jb=[{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"}]}],ex=[],tx=[],nx={name:Xb,uri:Zb,prefix:Qb,types:Jb,enumerations:ex,associations:tx},ix={bpmn:Eb,bpmndi:Tb,dc:Ob,di:Hb,bioc:Yb,color:nx};function rx(e,t){var n=N({},ix,e);return new aa(n,t)}function yt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function er(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(t>=1&&pt(arguments[t-1])){var n=arguments[t-1],i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then(function(r){var o=Object.keys(r)[0];return n(null,r[o])},function(r){return n(r,r.warnings)})}else return e.apply(this,arguments)}}var ox="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 bh(e){pn(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(ox)}})}function xt(e,t){return e.$instanceOf(t)}function ax(e){return ye(e.rootElements,function(t){return xt(t,"bpmn:Process")||xt(t,"bpmn:Collaboration")})}function sx(e,t){var n={},i=[],r={};function o(T,L){return function(G){T(G,L)}}function a(T){n[T.id]=T}function s(T){return n[T.id]}function c(T,L){var G=T.gfx;if(G)throw new Error(t("already rendered {element}",{element:yt(T)}));return e.element(T,r[T.id],L)}function p(T,L){return e.root(T,r[T.id],L)}function l(T,L){try{var G=r[T.id]&&c(T,L);return a(T),G}catch(oe){u(oe.message,{element:T,error:oe})}}function u(T,L){e.error(T,L)}var h=this.registerDi=function(T){var L=T.bpmnElement;L?r[L.id]?u(t("multiple DI elements defined for {element}",{element:yt(L)}),{element:L}):(r[L.id]=T,bh(L)):u(t("no bpmnElement referenced in {element}",{element:yt(T)}),{element:T})};function d(T){f(T.plane)}function f(T){h(T),k(T.planeElement,v)}function v(T){h(T)}this.handleDefinitions=function(T,L){var G=T.diagrams;if(L&&G.indexOf(L)===-1)throw new Error(t("diagram not part of bpmn:Definitions"));if(!L&&G&&G.length&&(L=G[0]),!L)throw new Error(t("no diagram to display"));r={},d(L);var oe=L.plane;if(!oe)throw new Error(t("no plane for {element}",{element:yt(L)}));var se=oe.bpmnElement;if(!se)if(se=ax(T),se)u(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:yt(oe),rootElement:yt(se)})),oe.bpmnElement=se,h(oe);else throw new Error(t("no process or collaboration to display"));var Se=p(se,oe);if(xt(se,"bpmn:Process")||xt(se,"bpmn:SubProcess"))R(se,Se);else if(xt(se,"bpmn:Collaboration"))A(se,Se),E(T.rootElements,Se);else throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:yt(oe),rootElement:yt(se)}));g(i)};var g=this.handleDeferred=function(){for(var T;i.length;)T=i.shift(),T()};function R(T,L){wt(T,L),$(T.ioSpecification,L),D(T.artifacts,L),a(T)}function E(T,L){var G=ce(T,function(oe){return!s(oe)&&xt(oe,"bpmn:Process")&&oe.laneSets});G.forEach(o(R,L))}function _(T,L){l(T,L)}function x(T,L){k(T,o(_,L))}function S(T,L){l(T,L)}function M(T,L){l(T,L)}function j(T,L){l(T,L)}function B(T,L){l(T,L)}function D(T,L){k(T,function(G){xt(G,"bpmn:Association")?i.push(function(){B(G,L)}):B(G,L)})}function $(T,L){T&&(k(T.dataInputs,o(M,L)),k(T.dataOutputs,o(j,L)))}var z=this.handleSubProcess=function(T,L){wt(T,L),D(T.artifacts,L)};function F(T,L){var G=l(T,L);xt(T,"bpmn:SubProcess")&&z(T,G||L),xt(T,"bpmn:Activity")&&$(T.ioSpecification,L),i.push(function(){k(T.dataInputAssociations,o(S,L)),k(T.dataOutputAssociations,o(S,L))})}function U(T,L){l(T,L)}function ue(T,L){l(T,L)}function It(T,L){i.push(function(){var G=l(T,L);T.childLaneSet&&Re(T.childLaneSet,G||L),O(T)})}function Re(T,L){k(T.lanes,o(It,L))}function pe(T,L){k(T,o(Re,L))}function wt(T,L){C(T.flowElements,L),T.laneSets&&pe(T.laneSets,L)}function C(T,L){k(T,function(G){xt(G,"bpmn:SequenceFlow")?i.push(function(){U(G,L)}):xt(G,"bpmn:BoundaryEvent")?i.unshift(function(){F(G,L)}):xt(G,"bpmn:FlowNode")?F(G,L):xt(G,"bpmn:DataObject")||(xt(G,"bpmn:DataStoreReference")||xt(G,"bpmn:DataObjectReference")?ue(G,L):u(t("unrecognized flowElement {element} in context {context}",{element:yt(G),context:L?yt(L.businessObject):"null"}),{element:G,context:L}))})}function m(T,L){var G=l(T,L),oe=T.processRef;oe&&R(oe,G||L)}function A(T,L){k(T.participants,o(m,L)),D(T.artifacts,L),i.push(function(){x(T.messageFlows,L)})}function O(T){k(T.flowNodeRef,function(L){var G=L.get("lanes");G&&G.push(T)})}}function y(e,t){var n=W(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function de(e,t){return kn(t,function(n){return y(e,n)})}function W(e){return e&&e.businessObject||e}function ge(e){return e&&e.di}function cx(e,t,n){var i,r,o,a,s,c=[];function p(l,u){var h={root:function(g,R){return i.add(g,R)},element:function(g,R,E){return i.add(g,R,E)},error:function(g,R){c.push({message:g,context:R})}},d=new sx(h,o);u=u||l.diagrams&&l.diagrams[0];var f=px(l,u);if(!f)throw new Error(o("no diagram to display"));k(f,function(g){d.handleDefinitions(l,g)});var v=u.plane.bpmnElement.id;a.setRootElement(a.findRoot(v+"_plane")||a.findRoot(v))}return new Promise(function(l,u){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),p(t,n),r.fire("import.render.complete",{error:s,warnings:c}),l({warnings:c})}catch(h){return h.warnings=c,u(h)}})}function px(e,t){if(t){var n=t.plane.bpmnElement,i=n;!y(n,"bpmn:Process")&&!y(n,"bpmn:Collaboration")&&(i=lx(n));var r;y(i,"bpmn:Collaboration")?r=i:r=ye(e.rootElements,function(p){if(y(p,"bpmn:Collaboration"))return ye(p.participants,function(l){return l.processRef===i})});var o=[i];r&&(o=bt(r.participants,function(p){return p.processRef}),o.push(r));var a=xh(o),s=[t],c=[n];return k(e.diagrams,function(p){var l=p.plane.bpmnElement;a.indexOf(l)!==-1&&c.indexOf(l)===-1&&(s.push(p),c.push(l))}),s}}function xh(e){var t=[];return k(e,function(n){n&&(t.push(n),t=t.concat(xh(n.flowElements)))}),t}function lx(e){for(var t=e;t;){if(y(t,"bpmn:Process"))return t;t=t.$parent}}var ux='',_h=ux,Eh={verticalAlign:"middle"},wh={color:"#404040"},hx={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},dx={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},fx={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"},mx='
'+_h+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
',yn;function vx(){yn=Me(mx),st(yn,hx),st(Ae("svg",yn),Eh),st(Ae(".backdrop",yn),dx),st(Ae(".notice",yn),fx),st(Ae(".link",yn),wh,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function yx(){yn||(vx(),Rt.bind(yn,".backdrop","click",function(e){document.body.removeChild(yn)})),document.body.appendChild(yn)}function Ee(e){e=N({},bx,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),_x(this._container),this._init(this._container,this._moddle,e)}q(Ee,Xi),Ee.prototype.importXML=function(e,t){return Ui(this,null,function*(){const n=this;function i(o){const a=n.get("eventBus").createEvent(o);return Object.defineProperty(a,"context",{enumerable:!0,get:function(){return{warnings:o.warnings,references:o.references,elementsById:o.elementsById}}}),a}let r=[];try{e=this._emit("import.parse.start",{xml:e})||e;let o;try{o=yield this._moddle.fromXML(e,"bpmn:Definitions")}catch(u){throw this._emit("import.parse.complete",{error:u}),u}let a=o.rootElement;const s=o.references,c=o.warnings,p=o.elementsById;r=r.concat(c),a=this._emit("import.parse.complete",i({error:null,definitions:a,elementsById:p,references:s,warnings:r}))||a;const l=yield this.importDefinitions(a,t);return r=r.concat(l.warnings),this._emit("import.done",{error:null,warnings:r}),{warnings:r}}catch(o){let a=o;throw r=r.concat(a.warnings||[]),sa(a,r),a=gx(a),this._emit("import.done",{error:a,warnings:a.warnings}),a}})},Ee.prototype.importXML=er(Ee.prototype.importXML),Ee.prototype.importDefinitions=function(e,t){return Ui(this,null,function*(){return this._setDefinitions(e),{warnings:(yield this.open(t)).warnings}})},Ee.prototype.importDefinitions=er(Ee.prototype.importDefinitions),Ee.prototype.open=function(e){return Ui(this,null,function*(){const t=this._definitions;let n=e;if(!t){const r=new Error("no XML imported");throw sa(r,[]),r}if(typeof e=="string"&&(n=xx(t,e),!n)){const r=new Error("BPMNDiagram <"+e+"> not found");throw sa(r,[]),r}try{this.clear()}catch(r){throw sa(r,[]),r}const{warnings:i}=yield cx(this,t,n);return{warnings:i}})},Ee.prototype.open=er(Ee.prototype.open),Ee.prototype.saveXML=function(e){return Ui(this,null,function*(){e=e||{};let t=this._definitions,n,i;try{if(!t)throw new Error("no definitions loaded");t=this._emit("saveXML.start",{definitions:t})||t,i=(yield this._moddle.toXML(t,e)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(o){n=o}const r=n?{error:n}:{xml:i};if(this._emit("saveXML.done",r),n)throw n;return r})},Ee.prototype.saveXML=er(Ee.prototype.saveXML),Ee.prototype.saveSVG=function(){return Ui(this,null,function*(){this._emit("saveSVG.start");let e,t;try{const n=this.get("canvas"),i=n.getActiveLayer(),r=Ae("defs",n._svg),o=gu(i),a=r?""+gu(r)+"":"",s=i.getBBox();e=` '+a+o+""}catch(n){t=n}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}})},Ee.prototype.saveSVG=er(Ee.prototype.saveSVG),Ee.prototype._setDefinitions=function(e){this._definitions=e},Ee.prototype.getModules=function(){return this._modules},Ee.prototype.clear=function(){this.getDefinitions()&&Xi.prototype.clear.call(this)},Ee.prototype.destroy=function(){Xi.prototype.destroy.call(this),dn(this._container)},Ee.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Ee.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Ee.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=Ae(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Ee.prototype.getDefinitions=function(){return this._definitions},Ee.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Ee.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,i,r),s=N(Tn(n,["additionalModules"]),{canvas:N({},n.canvas,{container:e}),modules:a});Xi.call(this,s),n&&n.container&&this.attachTo(n.container)},Ee.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Ee.prototype._createContainer=function(e){const t=Me('
');return st(t,{width:Sh(e.width),height:Sh(e.height),position:e.position}),t},Ee.prototype._createModdle=function(e){const t=N({},this._moddleExtensions,e.moddleExtensions);return new rx(t)},Ee.prototype._modules=[];function sa(e,t){return e.warnings=t,e}function gx(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),e}const bx={width:"100%",height:"100%",position:"relative"};function Sh(e){return e+(ie(e)?"px":"")}function xx(e,t){return t&&ye(e.diagrams,function(n){return n.id===t})||null}function _x(e){const t=''+_h+"",n=Me(t);st(Ae("svg",n),Eh),st(n,wh,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(n),J.bind(n,"click",function(i){yx(),i.preventDefault()})}function Lr(e){Ee.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}q(Lr,Ee),Lr.prototype._createModdle=function(e){var t=Ee.prototype._createModdle.call(this,e);return t.ids=new Vt([32,36,1]),t},Lr.prototype._collectIds=function(e,t){var n=e.$model,i=n.ids,r;i.clear();for(r in t)i.claim(r,t[r])};function ve(e,t){return y(e,"bpmn:CallActivity")?!1:y(e,"bpmn:SubProcess")?(t=t||ge(e),t&&y(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):y(e,"bpmn:Participant")?!!W(e).processRef:!0}function Ex(e){return e&&W(e).isInterrupting!==!1}function Ot(e){return e&&!!W(e).triggeredByEvent}function ca(e,t){var n=W(e).eventDefinitions;return kn(n,function(i){return y(i,t)})}function wx(e){return ca(e,"bpmn:ErrorEventDefinition")}function Sx(e){return ca(e,"bpmn:EscalationEventDefinition")}function Cx(e){return ca(e,"bpmn:CompensateEventDefinition")}var Ir={width:90,height:20},Ch=15;function ki(e){return y(e,"bpmn:Event")||y(e,"bpmn:Gateway")||y(e,"bpmn:DataStoreReference")||y(e,"bpmn:DataObjectReference")||y(e,"bpmn:DataInput")||y(e,"bpmn:DataOutput")||y(e,"bpmn:SequenceFlow")||y(e,"bpmn:MessageFlow")||y(e,"bpmn:Group")}function pa(e){return xe(e.label)}function Rx(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=Px(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)1?A.parallelMultiple?D("bpmn:ParallelMultipleEventDefinition")(m,C,O):D("bpmn:MultipleEventDefinition")(m,C,O):gn(A,"bpmn:MessageEventDefinition")?D("bpmn:MessageEventDefinition")(m,C,O):gn(A,"bpmn:TimerEventDefinition")?D("bpmn:TimerEventDefinition")(m,C,O):gn(A,"bpmn:ConditionalEventDefinition")?D("bpmn:ConditionalEventDefinition")(m,C):gn(A,"bpmn:SignalEventDefinition")?D("bpmn:SignalEventDefinition")(m,C,O):gn(A,"bpmn:EscalationEventDefinition")?D("bpmn:EscalationEventDefinition")(m,C,O):gn(A,"bpmn:LinkEventDefinition")?D("bpmn:LinkEventDefinition")(m,C,O):gn(A,"bpmn:ErrorEventDefinition")?D("bpmn:ErrorEventDefinition")(m,C,O):gn(A,"bpmn:CancelEventDefinition")?D("bpmn:CancelEventDefinition")(m,C,O):gn(A,"bpmn:CompensateEventDefinition")?D("bpmn:CompensateEventDefinition")(m,C,O):gn(A,"bpmn:TerminateEventDefinition")?D("bpmn:TerminateEventDefinition")(m,C,O):null}function F(C,m,A){A=N({size:{width:100}},A);var O=o.createText(m||"",A);return he(O).add("djs-label"),ee(C,O),O}function U(C,m,A){var O=W(m);return F(C,O.name,{box:m,align:A,padding:7,style:{fill:zr(m,p,c)}})}function ue(C,m){var A={width:90,height:30,x:m.width/2+m.x,y:m.height/2+m.y};return F(C,Ut(m),{box:A,fitBox:!0,style:N({},o.getExternalStyle(),{fill:zr(m,p,c)})})}function It(C,m,A){var O=F(C,m,{box:{height:30,width:A.height},align:"center-middle",style:{fill:zr(A,p,c)}}),T=-1*A.height;gc(O,0,-T,270)}var Re=this.handlers={"bpmn:Event":function(C,m,A){return"fillOpacity"in A||(A.fillOpacity=tr),E(C,m.width,m.height,A)},"bpmn:StartEvent":function(C,m,A){var O={fill:fe(m,s),stroke:K(m,c)},T=W(m);T.isInterrupting||(O={strokeDasharray:"6",fill:fe(m,s),stroke:K(m,c)});var L=D("bpmn:Event")(C,m,O);return(!A||A.renderIcon!==!1)&&z(m,C),L},"bpmn:MessageEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:m.width,containerHeight:m.height,position:{mx:.235,my:.315}}),T=A?K(m,c):fe(m,s),L=A?fe(m,s):K(m,c),G=j(C,O,{strokeWidth:1,fill:T,stroke:L});return G},"bpmn:TimerEventDefinition":function(C,m){var A=E(C,m.width,m.height,.2*m.height,{strokeWidth:2,fill:fe(m,s),stroke:K(m,c)}),O=i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.5}});j(C,O,{strokeWidth:2,stroke:K(m,c)});for(var T=0;T<12;T++){var L=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.5}}),G=m.width/2,oe=m.height/2;j(C,L,{strokeWidth:1,transform:"rotate("+T*30+","+oe+","+G+")",stroke:K(m,c)})}return A},"bpmn:EscalationEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.2}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:ConditionalEventDefinition":function(C,m){var A=i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.222}});return j(C,A,{strokeWidth:1,stroke:K(m,c)})},"bpmn:LinkEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.57,my:.263}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:ErrorEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:m.width,containerHeight:m.height,position:{mx:.2,my:.722}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:CancelEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.638,my:-.055}}),T=A?K(m,c):"none",L=j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)});return Ju(L,45),L},"bpmn:CompensateEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.22,my:.5}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:SignalEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.2}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:MultipleEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:m.width,containerHeight:m.height,position:{mx:.222,my:.36}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T})},"bpmn:ParallelMultipleEventDefinition":function(C,m){var A=i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:m.width,containerHeight:m.height,position:{mx:.458,my:.194}});return j(C,A,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)})},"bpmn:EndEvent":function(C,m,A){var O=D("bpmn:Event")(C,m,{strokeWidth:4,fill:fe(m,s),stroke:K(m,c)});return(!A||A.renderIcon!==!1)&&z(m,C),O},"bpmn:TerminateEventDefinition":function(C,m){var A=E(C,m.width,m.height,8,{strokeWidth:4,fill:K(m,c),stroke:K(m,c)});return A},"bpmn:IntermediateEvent":function(C,m,A){var O=D("bpmn:Event")(C,m,{strokeWidth:1.5,fill:fe(m,s),stroke:K(m,c)});return E(C,m.width,m.height,Mc,{strokeWidth:1.5,fill:fe(m,"none"),stroke:K(m,c)}),(!A||A.renderIcon!==!1)&&z(m,C),O},"bpmn:IntermediateCatchEvent":$("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":$("bpmn:IntermediateEvent"),"bpmn:Activity":function(C,m,A){return A=A||{},"fillOpacity"in A||(A.fillOpacity=tr),_(C,m.width,m.height,la,A)},"bpmn:Task":function(C,m){var A={fill:fe(m,s),stroke:K(m,c)},O=D("bpmn:Activity")(C,m,A);return U(C,m,"center-middle"),pe(C,m),O},"bpmn:ServiceTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});j(C,O,{strokeWidth:1,fill:fe(m,s),stroke:K(m,c)});var T=i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}});j(C,T,{strokeWidth:0,fill:fe(m,s)});var L=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return j(C,L,{strokeWidth:1,fill:fe(m,s),stroke:K(m,c)}),A},"bpmn:UserTask":function(C,m){var A=D("bpmn:Task")(C,m),O=15,T=12,L=i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:O,y:T}});j(C,L,{strokeWidth:.5,fill:fe(m,s),stroke:K(m,c)});var G=i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:O,y:T}});j(C,G,{strokeWidth:.5,fill:fe(m,s),stroke:K(m,c)});var oe=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:O,y:T}});return j(C,oe,{strokeWidth:.5,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:ManualTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return j(C,O,{strokeWidth:.5,fill:fe(m,s),stroke:K(m,c)}),A},"bpmn:SendTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return j(C,O,{strokeWidth:1,fill:K(m,c),stroke:fe(m,s)}),A},"bpmn:ReceiveTask":function(C,m){var A=W(m),O=D("bpmn:Task")(C,m),T;return A.instantiate?(E(C,28,28,20*.22,{strokeWidth:1}),T=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):T=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),j(C,T,{strokeWidth:1,fill:fe(m,s),stroke:K(m,c)}),O},"bpmn:ScriptTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return j(C,O,{strokeWidth:1,stroke:K(m,c)}),A},"bpmn:BusinessRuleTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),T=j(C,O);Y(T,{strokeWidth:1,fill:fe(m,"#aaaaaa"),stroke:K(m,c)});var L=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),G=j(C,L);return Y(G,{strokeWidth:1,stroke:K(m,c)}),A},"bpmn:SubProcess":function(C,m,A){A=Ce({fill:fe(m,s),stroke:K(m,c)},A);var O=D("bpmn:Activity")(C,m,A),T=ve(m);return Ot(m)&&Y(O,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),U(C,m,T?"center-top":"center-middle"),T?pe(C,m):pe(C,m,["SubProcessMarker"]),O},"bpmn:AdHocSubProcess":function(C,m){return D("bpmn:SubProcess")(C,m)},"bpmn:Transaction":function(C,m){var A=D("bpmn:SubProcess")(C,m,{strokeWidth:1.5}),O=n.style(["no-fill","no-events"],{stroke:K(m,c),strokeWidth:1.5});return _(C,m.width,m.height,la-3,Mc,O),A},"bpmn:CallActivity":function(C,m){return D("bpmn:SubProcess")(C,m,{strokeWidth:5})},"bpmn:Participant":function(C,m){var A=1.5,O={fillOpacity:tr,fill:fe(m,s),stroke:K(m,c),strokeWidth:A},T=D("bpmn:Lane")(C,m,O),L=ve(m);if(L){S(C,[{x:30,y:0},{x:30,y:m.height}],{stroke:K(m,c),strokeWidth:A});var G=W(m).name;It(C,G,m)}else{var oe=W(m).name;F(C,oe,{box:m,align:"center-middle",style:{fill:zr(m,p,c)}})}var se=!!W(m).participantMultiplicity;return se&&D("ParticipantMultiplicityMarker")(C,m),T},"bpmn:Lane":function(C,m,A){var O=_(C,m.width,m.height,0,Ce({fill:fe(m,s),fillOpacity:Lx,stroke:K(m,c),strokeWidth:1.5},A)),T=W(m);if(T.$type==="bpmn:Lane"){var L=T.name;It(C,L,m)}return O},"bpmn:InclusiveGateway":function(C,m){var A=D("bpmn:Gateway")(C,m);return E(C,m.width,m.height,m.height*.24,{strokeWidth:2.5,fill:fe(m,s),stroke:K(m,c)}),A},"bpmn:ExclusiveGateway":function(C,m){var A=D("bpmn:Gateway")(C,m),O=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:m.width,containerHeight:m.height,position:{mx:.32,my:.3}});return ge(m).isMarkerVisible&&j(C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:ComplexGateway":function(C,m){var A=D("bpmn:Gateway")(C,m),O=i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:m.width,containerHeight:m.height,position:{mx:.46,my:.26}});return j(C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:ParallelGateway":function(C,m){var A=D("bpmn:Gateway")(C,m),O=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:m.width,containerHeight:m.height,position:{mx:.46,my:.2}});return j(C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:EventBasedGateway":function(C,m){var A=W(m),O=D("bpmn:Gateway")(C,m);E(C,m.width,m.height,m.height*.2,{strokeWidth:1,fill:"none",stroke:K(m,c)});var T=A.eventGatewayType,L=!!A.instantiate;function G(){var se=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:m.width,containerHeight:m.height,position:{mx:.36,my:.44}});j(C,se,{strokeWidth:2,fill:fe(m,"none"),stroke:K(m,c)})}if(T==="Parallel"){var oe=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:m.width,containerHeight:m.height,position:{mx:.474,my:.296}});j(C,oe,{strokeWidth:1,fill:"none"})}else T==="Exclusive"&&(L||E(C,m.width,m.height,m.height*.26,{strokeWidth:1,fill:"none",stroke:K(m,c)}),G());return O},"bpmn:Gateway":function(C,m){return x(C,m.width,m.height,{fill:fe(m,s),fillOpacity:tr,stroke:K(m,c)})},"bpmn:SequenceFlow":function(C,m){var A=fe(m,s),O=K(m,c),T=M(C,m.waypoints,{markerEnd:g("sequenceflow-end",A,O),stroke:K(m,c)}),L=W(m),G;return m.source&&(G=m.source.businessObject,L.conditionExpression&&G.$instanceOf("bpmn:Activity")&&Y(T,{markerStart:g("conditional-flow-marker",A,O)}),G.default&&(G.$instanceOf("bpmn:Gateway")||G.$instanceOf("bpmn:Activity"))&&G.default===L&&Y(T,{markerStart:g("conditional-default-flow-marker",A,O)})),T},"bpmn:Association":function(C,m,A){var O=W(m),T=fe(m,s),L=K(m,c);return A=Ce({strokeDasharray:"0, 5",stroke:K(m,c)},A),(O.associationDirection==="One"||O.associationDirection==="Both")&&(A.markerEnd=g("association-end",T,L)),O.associationDirection==="Both"&&(A.markerStart=g("association-start",T,L)),M(C,m.waypoints,A)},"bpmn:DataInputAssociation":function(C,m){var A=fe(m,s),O=K(m,c);return D("bpmn:Association")(C,m,{markerEnd:g("association-end",A,O)})},"bpmn:DataOutputAssociation":function(C,m){var A=fe(m,s),O=K(m,c);return D("bpmn:Association")(C,m,{markerEnd:g("association-end",A,O)})},"bpmn:MessageFlow":function(C,m){var A=W(m),O=ge(m),T=fe(m,s),L=K(m,c),G=M(C,m.waypoints,{markerEnd:g("messageflow-end",T,L),markerStart:g("messageflow-start",T,L),strokeDasharray:"10, 11",strokeWidth:1.5,stroke:K(m,c)});if(A.messageRef){var oe=G.getPointAtLength(G.getTotalLength()/2),se=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:oe.x,y:oe.y}}),Se={strokeWidth:1};O.messageVisibleKind==="initiating"?(Se.fill="white",Se.stroke=$r):(Se.fill="#888",Se.stroke="white");var be=j(C,se,Se),me=A.messageRef.name,nt=F(C,me,{align:"center-top",fitBox:!0,style:{fill:K(m,p)}}),dt=be.getBBox(),ke=nt.getBBox(),je=oe.x-ke.width/2,St=oe.y+dt.height/2+Ix;gc(nt,je,St,0)}return G},"bpmn:DataObject":function(C,m){var A=i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.474,my:.296}}),O=j(C,A,{fill:fe(m,s),fillOpacity:tr,stroke:K(m,c)}),T=W(m);return Dx(T)&&wt(C,m),O},"bpmn:DataObjectReference":$("bpmn:DataObject"),"bpmn:DataInput":function(C,m){var A=i.getRawPath("DATA_ARROW"),O=D("bpmn:DataObject")(C,m);return j(C,A,{strokeWidth:1}),O},"bpmn:DataOutput":function(C,m){var A=i.getRawPath("DATA_ARROW"),O=D("bpmn:DataObject")(C,m);return j(C,A,{strokeWidth:1,fill:$r}),O},"bpmn:DataStoreReference":function(C,m){var A=i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:0,my:.133}}),O=j(C,A,{strokeWidth:2,fill:fe(m,s),fillOpacity:tr,stroke:K(m,c)});return O},"bpmn:BoundaryEvent":function(C,m,A){var O=W(m),T=O.cancelActivity,L={strokeWidth:1.5,fill:fe(m,s),stroke:K(m,c)};T||(L.strokeDasharray="6");var G=Pn(Ce({},L),{fillOpacity:1}),oe=Pn(Ce({},L),{fill:"none"}),se=D("bpmn:Event")(C,m,G);return E(C,m.width,m.height,Mc,oe),(!A||A.renderIcon!==!1)&&z(m,C),se},"bpmn:Group":function(C,m){return _(C,m.width,m.height,la,{stroke:K(m,c),strokeWidth:1.5,strokeDasharray:"10,6,0,6",fill:"none",pointerEvents:"none"})},label:function(C,m){return ue(C,m)},"bpmn:TextAnnotation":function(C,m){var A=_(C,m.width,m.height,0,0,{fill:"none",stroke:"none"}),O=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:0,my:0}});j(C,O,{stroke:K(m,c)});var T=W(m).text||"";return F(C,T,{box:m,align:"left-top",padding:7,style:{fill:zr(m,p,c)}}),A},ParticipantMultiplicityMarker:function(C,m){var A=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:m.width/2/m.width,my:(m.height-15)/m.height}});B("participant-multiplicity",C,A,{strokeWidth:2,fill:fe(m,s),stroke:K(m,c)})},SubProcessMarker:function(C,m){var A=_(C,14,14,0,{strokeWidth:1,fill:fe(m,s),stroke:K(m,c)});kt(A,m.width/2-7.5,m.height-20);var O=i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2-7.5)/m.width,my:(m.height-20)/m.height}});B("sub-process",C,O,{fill:fe(m,s),stroke:K(m,c)})},ParallelMarker:function(C,m,A){var O=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.parallel)/m.width,my:(m.height-20)/m.height}});B("parallel",C,O,{fill:fe(m,s),stroke:K(m,c)})},SequentialMarker:function(C,m,A){var O=i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.seq)/m.width,my:(m.height-19)/m.height}});B("sequential",C,O,{fill:fe(m,s),stroke:K(m,c)})},CompensationMarker:function(C,m,A){var O=i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.compensation)/m.width,my:(m.height-13)/m.height}});B("compensation",C,O,{strokeWidth:1,fill:fe(m,s),stroke:K(m,c)})},LoopMarker:function(C,m,A){var O=i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.loop)/m.width,my:(m.height-7)/m.height}});B("loop",C,O,{strokeWidth:1.5,fill:fe(m,s),stroke:K(m,c),strokeMiterlimit:.5})},AdhocMarker:function(C,m,A){var O=i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.adhoc)/m.width,my:(m.height-15)/m.height}});B("adhoc",C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)})}};function pe(C,m,A){var O=W(m),T=A&&A.indexOf("SubProcessMarker")!==-1,L;T?L={seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:L={seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},k(A,function(se){D(se)(C,m,L)}),O.isForCompensation&&D("CompensationMarker")(C,m,L),O.$type==="bpmn:AdHocSubProcess"&&D("AdhocMarker")(C,m,L);var G=O.loopCharacteristics,oe=G&&G.isSequential;G&&(oe===void 0&&D("LoopMarker")(C,m,L),oe===!1&&D("ParallelMarker")(C,m,L),oe===!0&&D("SequentialMarker")(C,m,L))}function wt(C,m){var A=(m.height-18)/m.height,O=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.33,my:A}});j(C,O,{strokeWidth:2})}this._drawPath=j,this._renderer=D}q(Ti,fn),Ti.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ti.prototype.canRender=function(e){return y(e,"bpmn:BaseElement")},Ti.prototype.drawShape=function(e,t){var n=t.type,i=this._renderer(n);return i(e,t)},Ti.prototype.drawConnection=function(e,t){var n=t.type,i=this._renderer(n);return i(e,t)},Ti.prototype.getShapePath=function(e){return y(e,"bpmn:Event")?Bx(e):y(e,"bpmn:Activity")?Ph(e,la):y(e,"bpmn:Gateway")?Nx(e):Ox(e)};var $x=0,zx={width:150,height:50};function Fx(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function Hx(e){return rt(e)?N({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function Gx(e,t){t.textContent=e;var n;try{var i,r=e==="";return t.textContent=r?"dummy":e,n=t.getBBox(),i={width:n.width+n.x*2,height:n.height},r&&(i.width=0),i}catch(o){return{width:0,height:0}}}function Vx(e,t,n){for(var i=e.shift(),r=i,o;;){if(o=Gx(r,n),o.width=r?o.width:0,r===" "||r===""||o.width1)for(;i=n.shift();)if(i.length+oE?_.width:E},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-d)/2),v-=(s||p[0].height)/4;var g=Z("text");Y(g,i),k(p,function(E){var _;switch(v+=s||E.height,r.horizontal){case"left":_=o.left;break;case"right":_=(a?f:l)-o.right-E.width;break;default:_=Math.max(((a?f:l)-E.width)/2+o.left,0)}var x=Z("tspan");Y(x,{x:_,y:v}),x.textContent=E.text,ee(g,x)}),Fe(u);var R={width:f,height:d};return{dimensions:R,element:g}};function Yx(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var Xx=12,Zx=1.2,Qx=30;function Th(e){var t=N({fontFamily:"Arial, sans-serif",fontSize:Xx,fontWeight:"normal",lineHeight:Zx},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=N({},t,{fontSize:n},e&&e.externalStyle||{}),r=new ua({style:t});this.getExternalLabelBounds=function(o,a){var s=r.getDimensions(a,{box:{width:90,height:30},style:i});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=r.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(Qx,Math.round(s.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Th.$inject=["config.textRenderer"];function Jx(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n=this.pathMap[e],i,r;t.abspos?(i=t.abspos.x,r=t.abspos.y):(i=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/n.height*t.yScaleFactor,s=t.containerWidth/n.width*t.xScaleFactor,c=0;c=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function c_(e){return y(e,"bpmn:Group")}const p_={__depends__:[ha],bpmnImporter:["type",On]},l_={__depends__:[r_,p_]};function Mh(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function nr(e){return e.originalEvent||e.srcEvent}function Dc(e){Mh(e),Mh(nr(e))}function oi(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 Dh(){return/mac/i.test(navigator.platform)}function Bh(e,t){return(nr(e)||e).button===t}function ai(e){return Bh(e,0)}function u_(e){return Bh(e,1)}function ir(e){var t=nr(e)||e;return ai(e)?Dh()?t.metaKey:t.ctrlKey:!1}function Bc(e){var t=nr(e)||e;return ai(e)&&t.shiftKey}function h_(e){return!0}function fa(e){return ai(e)||u_(e)}var Nh=500;function Oh(e,t,n){var i=this;function r(B,D,$){if(!s(B,D)){var z,F,U;$?F=t.getGraphics($):(z=D.delegateTarget||D.target,z&&(F=z,$=t.get(F))),!(!F||!$)&&(U=e.fire(B,{element:$,gfx:F,originalEvent:D}),U===!1&&(D.stopPropagation(),D.preventDefault()))}}var o={};function a(B){return o[B]}function s(B,D){var $=p[B]||ai;return!$(D)}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":h_,"element.mousedown":fa,"element.mouseup":fa,"element.click":fa,"element.dblclick":fa};function l(B,D,$){var z=c[B];if(!z)throw new Error("unmapped DOM event name <"+B+">");return r(z,D,$)}var u="svg, .djs-element";function h(B,D,$,z){var F=o[$]=function(U){r($,U)};z&&(p[$]=z),F.$delegate=Rt.bind(B,u,D,F)}function d(B,D,$){var z=a($);z&&Rt.unbind(B,D,z.$delegate)}function f(B){k(c,function(D,$){h(B,$,D)})}function v(B){k(c,function(D,$){d(B,$,D)})}e.on("canvas.destroy",function(B){v(B.svg)}),e.on("canvas.init",function(B){f(B.svg)}),e.on(["shape.added","connection.added"],function(B){var D=B.element,$=B.gfx;e.fire("interactionEvents.createHit",{element:D,gfx:$})}),e.on(["shape.changed","connection.changed"],Nh,function(B){var D=B.element,$=B.gfx;e.fire("interactionEvents.updateHit",{element:D,gfx:$})}),e.on("interactionEvents.createHit",Nh,function(B){var D=B.element,$=B.gfx;i.createDefaultHit(D,$)}),e.on("interactionEvents.updateHit",function(B){var D=B.element,$=B.gfx;i.updateDefaultHit(D,$)});var g=S("djs-hit djs-hit-stroke"),R=S("djs-hit djs-hit-click-stroke"),E=S("djs-hit djs-hit-all"),_=S("djs-hit djs-hit-no-move"),x={all:E,"click-stroke":R,stroke:g,"no-move":_};function S(B,D){return D=N({stroke:"white",strokeWidth:15},D||{}),n.cls(B,["no-fill","no-border"],D)}function M(B,D){var $=x[D];if(!$)throw new Error("invalid hit type <"+D+">");return Y(B,$),B}function j(B,D){ee(B,D)}this.removeHits=function(B){var D=ec(".djs-hit",B);k(D,Fe)},this.createDefaultHit=function(B,D){var $=B.waypoints,z=B.isFrame,F;return $?this.createWaypointsHit(D,$):(F=z?"stroke":"all",this.createBoxHit(D,F,{width:B.width,height:B.height}))},this.createWaypointsHit=function(B,D){var $=Wo(D);return M($,"stroke"),j(B,$),$},this.createBoxHit=function(B,D,$){$=N({x:0,y:0},$);var z=Z("rect");return M(z,D),Y(z,$),j(B,z),z},this.updateDefaultHit=function(B,D){var $=Ae(".djs-hit",D);if($)return B.waypoints?xu($,B.waypoints):Y($,{width:B.width,height:B.height}),$},this.fire=r,this.triggerMouseEvent=l,this.mouseHandler=a,this.registerEvent=h,this.unregisterEvent=d}Oh.$inject=["eventBus","elementRegistry","styles"];const Fr={__init__:["interactionEvents"],interactionEvents:["type",Oh]};var d_=500,f_=1e3;function Ai(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(o){var a=Z("rect");return Y(a,N({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],d_,function(o){var a=o.element,s=o.gfx,c=Ae(".djs-outline",s);c||(c=i.getOutline(a)||r(),ee(s,c)),i.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=Ae(".djs-outline",s);c||(c=r(),ee(s,c)),i.updateConnectionOutline(c,a)})}Ai.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&k(i,function(r){n=n||r.updateOutline(t,e)}),n||Y(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},Ai.prototype.updateConnectionOutline=function(e,t){var n=Ve(t);Y(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},Ai.prototype.registerProvider=function(e,t){t||(t=e,e=f_),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},Ai.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Ai.prototype.getOutline=function(e){var t,n=this._getProviders();return k(n,function(i){pt(i.getOutline)&&(t=t||i.getOutline(e))}),t},Ai.$inject=["eventBus","styles","elementRegistry"];const jh={__init__:["outline"],outline:["type",Ai]};function rr(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),e.on(["diagram.clear","root.set"],function(i){n.select(null)})}rr.$inject=["eventBus","canvas"],rr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},rr.prototype.get=function(){return this._selectedElements},rr.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},rr.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();le(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter(function(a){var s=r.findRoot(a);return o===s}),t?k(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Lh="hover",Ih="selected",ma=6;function Nc(e,t,n){this._canvas=e;var i=this;this._multiSelectionBox=null;function r(a,s){e.addMarker(a,s)}function o(a,s){e.removeMarker(a,s)}t.on("element.hover",function(a){r(a.element,Lh)}),t.on("element.out",function(a){o(a.element,Lh)}),t.on("selection.changed",function(a){function s(u){o(u,Ih)}function c(u){r(u,Ih)}var p=a.oldSelection,l=a.newSelection;k(p,function(u){l.indexOf(u)===-1&&s(u)}),k(l,function(u){p.indexOf(u)===-1&&c(u)}),i._updateSelectionOutline(l)}),t.on("element.changed",function(a){n.isSelected(a.element)&&i._updateSelectionOutline(n.get())})}Nc.$inject=["canvas","eventBus","selection"],Nc.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Ho(t);var n=e.length>1,i=this._canvas.getContainer();if(he(i)[n?"add":"remove"]("djs-multi-select"),!!n){var r=m_(Ve(e)),o=Z("rect");Y(o,N({rx:3},r)),he(o).add("djs-selection-outline"),ee(t,o)}};function m_(e){return{x:e.x-ma,y:e.y-ma,width:e.width+ma*2,height:e.height+ma*2}}function $h(e,t,n,i){e.on("create.end",500,function(r){var o=r.context,a=o.canExecute,s=o.elements,c=o.hints||{},p=c.autoSelect;if(a){if(p===!1)return;le(p)?t.select(p):t.select(s.filter(v_))}}),e.on("connect.end",500,function(r){var o=r.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id),s=ye(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(r){if(ai(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=ir(r)||Bc(r);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}$h.$inject=["eventBus","selection","canvas","elementRegistry"];function v_(e){return!e.hidden}const bn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Fr,jh],selection:["type",rr],selectionVisuals:["type",Nc],selectionBehavior:["type",$h]};function Oc(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}Oc.prototype.next=function(){return this._prefix+ ++this._counter};var y_=new Oc("ov"),g_=500;function et(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=y_,this._overlayDefaults=N({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=b_(n.getContainer()),this._init()}et.$inject=["config.overlays","eventBus","canvas","elementRegistry"],et.prototype.get=function(e){if(Mt(e)&&(e={id:e}),Mt(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?ce(t.overlays,hn({type:e.type})):t.overlays.slice():[]}else return e.type?ce(this._overlays,hn({type:e.type})):e.id?this._overlays[e.id]:null},et.prototype.add=function(e,t,n){if(rt(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=N({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},et.prototype.remove=function(e){var t=this.get(e)||[];le(t)||(t=[t]);var n=this;k(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(dn(i.html),dn(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},et.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},et.prototype.show=function(){va(this._overlayRoot)},et.prototype.hide=function(){va(this._overlayRoot,!1)},et.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Io(this._overlayRoot)},et.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Ve(t);i=o.x,r=o.y}zh(n,i,r),ft(e.html,"data-container-id",t.id)},et.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,i=e.element,r=t.left,o=t.top;if(t.right!==void 0){var a;i.waypoints?a=Ve(i).width:a=i.width,r=t.right*-1+a}if(t.bottom!==void 0){var s;i.waypoints?s=Ve(i).height:s=i.height,o=t.bottom*-1+s}zh(n,r||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},et.prototype._createOverlayContainer=function(e){var t=Me('
');st(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},et.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Fh(this._overlayRoot,n)},et.prototype._getOverlayContainer=function(e,t){var n=ye(this._overlayContainers,function(i){return i.element===e});return!n&&!t?this._createOverlayContainer(e):n},et.prototype._addOverlay=function(e){var t=e.id,n=e.element,i=e.html,r,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Mt(i)&&(i=Me(i)),o=this._getOverlayContainer(n),r=Me('
'),st(r,{position:"absolute"}),r.appendChild(i),e.type&&Je(r).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();va(r,a===s),e.htmlContainer=r,o.overlays.push(e),o.html.appendChild(r),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},et.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(i!==s||n&&(ot(r)&&r>t.scale||ot(o)&&or&&(a=(1/t.scale||1)*r)),ot(a)&&(s="scale("+a+","+a+")"),Fh(o,s)},et.prototype._updateOverlaysVisibilty=function(e){var t=this;k(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},et.prototype._init=function(){var e=this._eventBus,t=this;function n(i){t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}e.on("canvas.viewbox.changing",function(i){t.hide()}),e.on("canvas.viewbox.changed",function(i){n(i.viewbox)}),e.on(["shape.remove","connection.remove"],function(i){var r=i.element,o=t.get({element:r});k(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(r);if(a){dn(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",g_,function(i){var r=i.element,o=t._getOverlayContainer(r,!0);o&&(k(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(i){var r=t._getOverlayContainer(i.element,!0);r&&Je(r.html)[i.add?"add":"remove"](i.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function b_(e){var t=Me('
');return st(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function zh(e,t,n){st(e,{left:t+"px",top:n+"px"})}function va(e,t){e.style.display=t===!1?"none":""}function Fh(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const ya={__init__:["overlays"],overlays:["type",et]};function Hh(e,t,n,i){e.on("element.changed",function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire(wu(o)+".changed",r)}),e.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),i.updateContainments(o)}),e.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}Hh.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const jc={__init__:["changeSupport"],changeSupport:["type",Hh]};var x_=1e3;function V(e){this._eventBus=e}V.$inject=["eventBus"];function __(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}V.prototype.on=function(e,t,n,i,r,o){if((pt(t)||ie(t))&&(o=r,r=i,i=n,n=t,t=null),pt(n)&&(o=r,r=i,i=n,n=x_),rt(r)&&(o=r,r=!1),!pt(i))throw new Error("handlerFn must be a function");le(e)||(e=[e]);var a=this._eventBus;k(e,function(s){var c=["commandStack",s,t].filter(function(p){return p}).join(".");a.on(c,n,r?__(i,o):i,o)})},V.prototype.canExecute=jn("canExecute"),V.prototype.preExecute=jn("preExecute"),V.prototype.preExecuted=jn("preExecuted"),V.prototype.execute=jn("execute"),V.prototype.executed=jn("executed"),V.prototype.postExecute=jn("postExecute"),V.prototype.postExecuted=jn("postExecuted"),V.prototype.revert=jn("revert"),V.prototype.reverted=jn("reverted");function jn(e){return function(t,n,i,r,o){(pt(t)||ie(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function Lc(e,t){t.invoke(V,this),this.executed(function(n){var i=n.context;i.rootElement?e.setRootElement(i.rootElement):i.rootElement=e.getRootElement()}),this.revert(function(n){var i=n.context;i.rootElement&&e.setRootElement(i.rootElement)})}q(Lc,V),Lc.$inject=["canvas","injector"];const E_={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Lc]};function Hr(e){return CSS.escape(e)}var w_={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ic(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return w_[t]})}var Gh="_plane";function Vh(e){var t=e.id;return S_(t)}function Ln(e){var t=e.id;return y(e,"bpmn:SubProcess")?Wh(t):t}function Mi(e){return Wh(e)}function $c(e){var t=ge(e);return y(t,"bpmndi:BPMNPlane")}function Wh(e){return e+Gh}function S_(e){return e.replace(new RegExp(Gh+"$"),"")}var C_="bjs-breadcrumbs-shown";function Uh(e,t,n){var i=Me('
    '),r=n.getContainer(),o=Je(r);r.appendChild(i);var a=[];e.on("element.changed",function(c){var p=c.element,l=W(p),u=ye(a,function(h){return h===l});u&&s()});function s(c){c&&(a=R_(c));var p=a.map(function(u){var h=Ic(u.name||u.id),d=Me('
  • '+h+"
  • "),f=n.findRoot(Ln(u))||n.findRoot(u.id);if(!f&&y(u,"bpmn:Process")){var v=t.find(function(g){var R=W(g);return R&&R.get("processRef")&&R.get("processRef")===u});f=n.findRoot(v.id)}return d.addEventListener("click",function(){n.setRootElement(f)}),d});i.innerHTML="";var l=p.length>1;o.toggle(C_,l),p.forEach(function(u){i.appendChild(u)})}e.on("root.set",function(c){s(c.element)})}Uh.$inject=["eventBus","elementRegistry","canvas"];function R_(e){for(var t=W(e),n=[],i=t;i;i=i.$parent)(y(i,"bpmn:SubProcess")||y(i,"bpmn:Process"))&&n.push(i);return n.reverse()}function qh(e,t){var n=null,i=new P_;e.on("root.set",function(r){var o=r.element,a=t.viewbox(),s=i.get(o);if(i.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(y(o,"bpmn:Collaboration")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,p=(a.y-s.y)*a.scale;(c!==0||p!==0)&&t.scroll({dx:c,dy:p}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}qh.$inject=["eventBus","canvas"];function P_(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var Kh={x:180,y:160};function Di(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(i,r){n._handleImport(r.definitions)})}Di.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(i){!i.plane||!i.plane.bpmnElement||(t._processToDiagramMap[i.plane.bpmnElement.id]=i)});var n=[];e.diagrams.forEach(function(i){var r=t._createNewDiagrams(i.plane);Array.prototype.push.apply(n,r)}),n.forEach(function(i){t._movePlaneElementsToOrigin(i.plane)})}},Di.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;y(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),T_(a,e)&&i.push({diElement:o,parent:s})}});var r=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,r.push(a)}}),i.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),r},Di.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=k_(e),i={x:n.x-Kh.x,y:n.y-Kh.y};t.forEach(function(r){r.waypoint?r.waypoint.forEach(function(o){o.x=o.x-i.x,o.y=o.y-i.y}):r.bounds&&(r.bounds.x=r.bounds.x-i.x,r.bounds.y=r.bounds.y-i.y)})},Di.prototype._moveToDiPlane=function(e,t){var n=Yh(e),i=n.plane.get("planeElement");i.splice(i.indexOf(e),1),t.get("planeElement").push(e)},Di.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},Di.$inject=["eventBus","moddle"];function Yh(e){return y(e,"bpmndi:BPMNDiagram")?e:Yh(e.$parent)}function k_(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 i=X(n.bounds);t.top=Math.min(i.top,t.top),t.left=Math.min(i.left,t.left)}}),Zo(t)}function T_(e,t){var n=e.$parent;return!(!y(n,"bpmn:SubProcess")||n===t.bpmnElement||de(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var ga=250,A_='',M_="bjs-drilldown-empty";function si(e,t,n,i){V.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",ga,function(o){var a=o.shape;r._canDrillDown(a)?r._addOverlay(a):r._removeOverlay(a)},!0),this.reverted("shape.toggleCollapse",ga,function(o){var a=o.shape;r._canDrillDown(a)?r._addOverlay(a):r._removeOverlay(a)},!0),this.executed(["shape.create","shape.move","shape.delete"],ga,function(o){var a=o.oldParent,s=o.newParent||o.parent,c=o.shape;r._canDrillDown(c)&&r._addOverlay(c),r._updateDrilldownOverlay(a),r._updateDrilldownOverlay(s),r._updateDrilldownOverlay(c)},!0),this.reverted(["shape.create","shape.move","shape.delete"],ga,function(o){var a=o.oldParent,s=o.newParent||o.parent,c=o.shape;r._canDrillDown(c)&&r._addOverlay(c),r._updateDrilldownOverlay(a),r._updateDrilldownOverlay(s),r._updateDrilldownOverlay(c)},!0),t.on("import.render.complete",function(){n.filter(function(o){return r._canDrillDown(o)}).map(function(o){r._addOverlay(o)})})}q(si,V),si.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},si.prototype._canDrillDown=function(e){var t=this._canvas;return y(e,"bpmn:SubProcess")&&t.findRoot(Ln(e))},si.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=W(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Je(i.html).toggle(M_,!r)}},si.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var r=Me('");r.addEventListener("click",function(){t.setRootElement(t.findRoot(Ln(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(e)},si.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},si.$inject=["canvas","eventBus","elementRegistry","overlays"];const D_={__depends__:[ya,jc,E_],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Uh],drilldownCentering:["type",qh],drilldownOverlayBehavior:["type",si],subprocessCompatibility:["type",Di]};function ci(e){Ee.call(this,e)}q(ci,Ee),ci.prototype._modules=[l_,ha,bn,ya,D_],ci.prototype._moddleExtensions={};var B_=["c","C"],N_=["v","V"],O_=["y","Y"],Xh=["z","Z"];function j_(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function jt(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function tt(e,t){return e=le(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function zc(e){return e.shiftKey}function L_(e){return jt(e)&&tt(B_,e)}function I_(e){return jt(e)&&tt(N_,e)}function $_(e){return jt(e)&&!zc(e)&&tt(Xh,e)}function z_(e){return jt(e)&&(tt(O_,e)||tt(Xh,e)&&zc(e))}var ba="keyboard.keydown",F_="keyboard.keyup",Zh="input-handle-modified-keys",H_=1e3;function ct(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),t.on("diagram.init",function(){n._fire("init")}),t.on("attach",function(){e&&e.bindTo&&n.bind(e.bindTo)}),t.on("detach",function(){n.unbind()})}ct.$inject=["config.keyboard","eventBus"],ct.prototype._keydownHandler=function(e){this._keyHandler(e,ba)},ct.prototype._keyupHandler=function(e){this._keyHandler(e,F_)},ct.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var i={keyEvent:e};n=this._eventBus.fire(t||ba,i),n&&e.preventDefault()}},ct.prototype._isEventIgnored=function(e){return e.defaultPrevented?!0:G_(e.target)&&this._isModifiedKeyIgnored(e)},ct.prototype._isModifiedKeyIgnored=function(e){if(!jt(e))return!0;var t=this._getAllowedModifiers(e.target);return t.indexOf(e.key)===-1},ct.prototype._getAllowedModifiers=function(e){var t=Mn(e,"["+Zh+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Zh).split(",")},ct.prototype.bind=function(e){this.unbind(),this._node=e,J.bind(e,"keydown",this._keydownHandler),J.bind(e,"keyup",this._keyupHandler),this._fire("bind")},ct.prototype.getBinding=function(){return this._node},ct.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),J.unbind(e,"keydown",this._keydownHandler),J.unbind(e,"keyup",this._keyupHandler)),this._node=null},ct.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},ct.prototype.addListener=function(e,t,n){pt(e)&&(n=t,t=e,e=H_),this._eventBus.on(n||ba,e,t)},ct.prototype.removeListener=function(e,t){this._eventBus.off(t||ba,e)},ct.prototype.hasModifier=j_,ct.prototype.isCmd=jt,ct.prototype.isShift=zc,ct.prototype.isKey=tt;function G_(e){return e&&(Sr(e,"input, textarea")||e.contentEditable==="true")}var V_=500;function or(e,t){var n=this;e.on("editorActions.init",V_,function(i){var r=i.editorActions;n.registerBindings(t,r)})}or.$inject=["eventBus","keyboard"],or.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){var r=i.keyEvent;if($_(r))return t.trigger("undo"),!0}),n("redo",function(i){var r=i.keyEvent;if(z_(r))return t.trigger("redo"),!0}),n("copy",function(i){var r=i.keyEvent;if(L_(r))return t.trigger("copy"),!0}),n("paste",function(i){var r=i.keyEvent;if(I_(r))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(tt(["+","Add","="],r)&&jt(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(tt(["-","Subtract"],r)&&jt(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(tt("0",r)&&jt(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){var r=i.keyEvent;if(tt(["Backspace","Delete","Del"],r))return t.trigger("removeSelection"),!0})};const Fc={__init__:["keyboard","keyboardBindings"],keyboard:["type",ct],keyboardBindings:["type",or]};var W_={moveSpeed:50,moveSpeedAccelerated:200};function Qh(e,t,n){var i=this;this._config=N({},W_,e||{}),t.addListener(r);function r(o){var a=o.keyEvent,s=i._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,p;switch(a.key){case"ArrowLeft":case"Left":p="left";break;case"ArrowUp":case"Up":p="up";break;case"ArrowRight":case"Right":p="right";break;case"ArrowDown":case"Down":p="down";break}return i.moveCanvas({speed:c,direction:p}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,p=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=p;break;case"up":s=p;break;case"right":a=-p;break;case"down":s=-p;break}n.scroll({dx:a,dy:s})}}Qh.$inject=["config.keyboardMove","keyboard","canvas"];const Jh={__depends__:[Fc],__init__:["keyboardMove"],keyboardMove:["type",Qh]};var U_=/^djs-cursor-.*$/;function xa(e){var t=Je(document.body);t.removeMatching(U_),e&&t.add("djs-cursor-"+e)}function ed(){xa(null)}var q_=5e3;function td(e,t){t=t||"element.click";function n(){return!1}return e.once(t,q_,n),function(){e.off(t,n)}}function Gr(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function tn(e,t){return{x:e.x-t.x,y:e.y-t.y}}var K_=15;function nd(e,t){var n;e.on("element.mousedown",500,function(a){return o(a.originalEvent)});function i(a){var s=n.start,c=n.button,p=oi(a),l=tn(p,s);if(!n.dragging&&Y_(l)>K_&&(n.dragging=!0,c===0&&td(e),xa("grab")),n.dragging){var u=n.last||n.start;l=tn(p,u),t.scroll({dx:l.x,dy:l.y}),n.last=p}a.preventDefault()}function r(a){J.unbind(document,"mousemove",i),J.unbind(document,"mouseup",r),n=null,ed()}function o(a){if(!Mn(a.target,".djs-draggable")){var s=a.button;if(!(s>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:s,start:oi(a)},J.bind(document,"mousemove",i),J.bind(document,"mouseup",r),!0}}this.isActive=function(){return!!n}}nd.$inject=["eventBus","canvas"];function Y_(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const id={__init__:["moveCanvas"],moveCanvas:["type",nd]};function Hc(e){return Math.log(e)/Math.log(10)}function rd(e,t){var n=Hc(e.min),i=Hc(e.max),r=Math.abs(n)+Math.abs(i);return r/t}function X_(e,t){return Math.max(e.min,Math.min(e.max,t))}var Z_=Math.sign||function(e){return e>=0?1:-1},Gc={min:.2,max:4},od=10,Q_=.1,J_=.75;function xn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Ct(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||J_;var i=this;t.on("canvas.init",function(r){i._init(e.enabled!==!1)})}xn.$inject=["config.zoomScroll","eventBus","canvas"],xn.prototype.scroll=function(e){this._canvas.scroll(e)},xn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},xn.prototype.zoom=function(e,t){var n=rd(Gc,od*2);this._totalDelta+=e,Math.abs(this._totalDelta)>Q_&&(this._zoom(e,t,n),this._totalDelta=0)},xn.prototype._handleWheel=function(e){if(!Mn(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n=e.ctrlKey||Dh()&&e.metaKey,i=e.shiftKey,r=-1*this._scale,o;if(n?r*=e.deltaMode===0?.02:.32:r*=e.deltaMode===0?1:16,n){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};o=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Z_(e.deltaY)*r,this.zoom(o,s)}else i?o={dx:r*e.deltaY,dy:0}:o={dx:r*e.deltaX,dy:r*e.deltaY},this.scroll(o)}},xn.prototype.stepZoom=function(e,t){var n=rd(Gc,od);this._zoom(e,t,n)},xn.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Hc(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s=Math.pow(10,a);i.zoom(X_(Gc,s),t)},xn.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return typeof e>"u"&&(e=!i),i!==e&&J[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},xn.prototype._init=function(e){this.toggle(e)};const ad={__init__:["zoomScroll"],zoomScroll:["type",xn]};function Vr(e){ci.call(this,e)}q(Vr,ci),Vr.prototype._navigationModules=[Jh,id,ad],Vr.prototype._modules=[].concat(ci.prototype._modules,Vr.prototype._navigationModules);var sd={exports:{}};(function(e){(function(t,n,i,r){var o=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),s="function",c=Math.round,p=Math.abs,l=Date.now;function u(b,w,P){return setTimeout(_(b,P),w)}function h(b,w,P){return Array.isArray(b)?(d(b,P[w],P),!0):!1}function d(b,w,P){var I;if(b)if(b.forEach)b.forEach(w,P);else if(b.length!==r)for(I=0;I\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",_e=t.console&&(t.console.warn||t.console.log);return _e&&_e.call(t.console,I,te),b.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(b){if(b===r||b===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(b),P=1;P-1}function $(b){return b.trim().split(/\s+/g)}function z(b,w,P){if(b.indexOf&&!P)return b.indexOf(w);for(var I=0;Icn[w]}):I=I.sort()),I}function ue(b,w){for(var P,I,H=w[0].toUpperCase()+w.slice(1),te=0;te1&&!P.firstMultiple?P.firstMultiple=Dy(w):H===1&&(P.firstMultiple=!1);var te=P.firstInput,_e=P.firstMultiple,Ge=_e?_e.center:te.center,cn=w.center=By(I);w.timeStamp=l(),w.deltaTime=w.timeStamp-te.timeStamp,w.angle=Ul(Ge,cn),w.distance=$s(Ge,cn),Pe(P,w),w.offsetDirection=Oy(w.deltaX,w.deltaY);var Ht=Ny(w.deltaTime,w.deltaX,w.deltaY);w.overallVelocityX=Ht.x,w.overallVelocityY=Ht.y,w.overallVelocity=p(Ht.x)>p(Ht.y)?Ht.x:Ht.y,w.scale=_e?R2(_e.pointers,I):1,w.rotation=_e?C2(_e.pointers,I):0,w.maxPointers=P.prevInput?w.pointers.length>P.prevInput.maxPointers?w.pointers.length:P.prevInput.maxPointers:w.pointers.length,S2(P,w);var Rn=b.element;B(w.srcEvent.target,Rn)&&(Rn=w.srcEvent.target),w.target=Rn}function Pe(b,w){var P=w.center,I=b.offsetDelta||{},H=b.prevDelta||{},te=b.prevInput||{};(w.eventType===se||te.eventType===be)&&(H=b.prevDelta={x:te.deltaX||0,y:te.deltaY||0},I=b.offsetDelta={x:P.x,y:P.y}),w.deltaX=H.x+(P.x-I.x),w.deltaY=H.y+(P.y-I.y)}function S2(b,w){var P=b.lastInterval||w,I=w.timeStamp-P.timeStamp,H,te,_e,Ge;if(w.eventType!=me&&(I>oe||P.velocity===r)){var cn=w.deltaX-P.deltaX,Ht=w.deltaY-P.deltaY,Rn=Ny(I,cn,Ht);te=Rn.x,_e=Rn.y,H=p(Rn.x)>p(Rn.y)?Rn.x:Rn.y,Ge=Oy(cn,Ht),b.lastInterval=w}else H=P.velocity,te=P.velocityX,_e=P.velocityY,Ge=P.direction;w.velocity=H,w.velocityX=te,w.velocityY=_e,w.direction=Ge}function Dy(b){for(var w=[],P=0;P=p(w)?b<0?dt:ke:w<0?je:St}function $s(b,w,P){P||(P=zt);var I=w[P[0]]-b[P[0]],H=w[P[1]]-b[P[1]];return Math.sqrt(I*I+H*H)}function Ul(b,w,P){P||(P=zt);var I=w[P[0]]-b[P[0]],H=w[P[1]]-b[P[1]];return Math.atan2(H,I)*180/Math.PI}function C2(b,w){return Ul(w[1],w[0],we)+Ul(b[1],b[0],we)}function R2(b,w){return $s(w[0],w[1],we)/$s(b[0],b[1],we)}var P2={mousedown:se,mousemove:Se,mouseup:be},k2="mousedown",T2="mousemove mouseup";function zs(){this.evEl=k2,this.evWin=T2,this.pressed=!1,it.apply(this,arguments)}E(zs,it,{handler:function(b){var w=P2[b.type];w&se&&b.button===0&&(this.pressed=!0),w&Se&&b.which!==1&&(w=be),this.pressed&&(w&be&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[b],changedPointers:[b],pointerType:L,srcEvent:b}))}});var A2={pointerdown:se,pointermove:Se,pointerup:be,pointercancel:me,pointerout:me},M2={2:O,3:T,4:L,5:G},jy="pointerdown",Ly="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(jy="MSPointerDown",Ly="MSPointerMove MSPointerUp MSPointerCancel");function ql(){this.evEl=jy,this.evWin=Ly,it.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}E(ql,it,{handler:function(b){var w=this.store,P=!1,I=b.type.toLowerCase().replace("ms",""),H=A2[I],te=M2[b.pointerType]||b.pointerType,_e=te==O,Ge=z(w,b.pointerId,"pointerId");H&se&&(b.button===0||_e)?Ge<0&&(w.push(b),Ge=w.length-1):H&(be|me)&&(P=!0),!(Ge<0)&&(w[Ge]=b,this.callback(this.manager,H,{pointers:w,changedPointers:[b],pointerType:te,srcEvent:b}),P&&w.splice(Ge,1))}});var D2={touchstart:se,touchmove:Se,touchend:be,touchcancel:me},B2="touchstart",N2="touchstart touchmove touchend touchcancel";function Iy(){this.evTarget=B2,this.evWin=N2,this.started=!1,it.apply(this,arguments)}E(Iy,it,{handler:function(b){var w=D2[b.type];if(w===se&&(this.started=!0),!!this.started){var P=O2.call(this,b,w);w&(be|me)&&P[0].length-P[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:P[0],changedPointers:P[1],pointerType:O,srcEvent:b})}}});function O2(b,w){var P=F(b.touches),I=F(b.changedTouches);return w&(be|me)&&(P=U(P.concat(I),"identifier",!0)),[P,I]}var j2={touchstart:se,touchmove:Se,touchend:be,touchcancel:me},L2="touchstart touchmove touchend touchcancel";function Fs(){this.evTarget=L2,this.targetIds={},it.apply(this,arguments)}E(Fs,it,{handler:function(b){var w=j2[b.type],P=I2.call(this,b,w);P&&this.callback(this.manager,w,{pointers:P[0],changedPointers:P[1],pointerType:O,srcEvent:b})}});function I2(b,w){var P=F(b.touches),I=this.targetIds;if(w&(se|Se)&&P.length===1)return I[P[0].identifier]=!0,[P,P];var H,te,_e=F(b.changedTouches),Ge=[],cn=this.target;if(te=P.filter(function(Ht){return B(Ht.target,cn)}),w===se)for(H=0;H-1&&I.splice(te,1)};setTimeout(H,$2)}}function F2(b){for(var w=b.srcEvent.clientX,P=b.srcEvent.clientY,I=0;I-1&&this.requireFail.splice(w,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(b){return!!this.simultaneous[b.id]},emit:function(b){var w=this,P=this.state;function I(H){w.manager.emit(H,b)}P=Ei&&I(w.options.event+Wy(P))},tryEmit:function(b){if(this.canEmit())return this.emit(b);this.state=Cn},canEmit:function(){for(var b=0;bw.threshold&&H&w.direction},attrTest:function(b){return sn.prototype.attrTest.call(this,b)&&(this.state&en||!(this.state&en)&&this.directionTest(b))},emit:function(b){this.pX=b.deltaX,this.pY=b.deltaY;var w=Uy(b.direction);w&&(b.additionalEvent=this.options.event+w),this._super.emit.call(this,b)}});function Zl(){sn.apply(this,arguments)}E(Zl,sn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Wi]},attrTest:function(b){return this._super.attrTest.call(this,b)&&(Math.abs(b.scale-1)>this.options.threshold||this.state&en)},emit:function(b){if(b.scale!==1){var w=b.scale<1?"in":"out";b.additionalEvent=this.options.event+w}this._super.emit.call(this,b)}});function Ql(){qn.apply(this,arguments),this._timer=null,this._input=null}E(Ql,qn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Vy]},process:function(b){var w=this.options,P=b.pointers.length===w.pointers,I=b.distancew.time;if(this._input=b,!I||!P||b.eventType&(be|me)&&!H)this.reset();else if(b.eventType&se)this.reset(),this._timer=u(function(){this.state=Un,this.tryEmit()},w.time,this);else if(b.eventType&be)return Un;return Cn},reset:function(){clearTimeout(this._timer)},emit:function(b){this.state===Un&&(b&&b.eventType&be?this.manager.emit(this.options.event+"up",b):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Jl(){sn.apply(this,arguments)}E(Jl,sn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Wi]},attrTest:function(b){return this._super.attrTest.call(this,b)&&(Math.abs(b.rotation)>this.options.threshold||this.state&en)}});function eu(){sn.apply(this,arguments)}E(eu,sn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:$t|gt,pointers:1},getTouchAction:function(){return Ws.prototype.getTouchAction.call(this)},attrTest:function(b){var w=this.options.direction,P;return w&($t|gt)?P=b.overallVelocity:w&$t?P=b.overallVelocityX:w>&&(P=b.overallVelocityY),this._super.attrTest.call(this,b)&&w&b.offsetDirection&&b.distance>this.options.threshold&&b.maxPointers==this.options.pointers&&p(P)>this.options.velocity&&b.eventType&be},emit:function(b){var w=Uy(b.offsetDirection);w&&this.manager.emit(this.options.event+w,b),this.manager.emit(this.options.event,b)}});function Us(){qn.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}E(Us,qn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Yl]},process:function(b){var w=this.options,P=b.pointers.length===w.pointers,I=b.distance1&&(s=!0),h.elements.length}),s)return o[e]=qc(c).center,o;p=t[0],t=ln(t,function(h){return h[i]+h[r]}),l=qc(t),o[e]=u(p,l)}return o},ar.prototype.trigger=function(e,t){var n=this._modeling,i,r=ce(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(i=this._rules.allowed("elements.align",{elements:r}),le(i)&&(r=i),!(r.length<2||!i)){var o=o1[t],a=ln(r,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};const a1={__init__:["alignElements"],alignElements:["type",ar]};var Ea=".entry",s1=1e3,hd=12,c1=300;function _t(e,t,n,i){this._canvas=e,this._eventBus=n,this._overlays=i;var r=ot(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={scale:r},this._current=null,this._init()}_t.$inject=["canvas","config.contextPad","eventBus","overlays"],_t.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?n.length===1?n[0]:n:null;i?e.open(i,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=kn(le(r)?r:[r],function(a){return dd(n,a)});o&&e.open(r,!0)}})},_t.prototype.registerProvider=function(e,t){t||(t=e,e=s1),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},_t.prototype.getEntries=function(e){var t=this._getProviders(),n=le(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return k(t,function(r){if(pt(r[n])){var o=r[n](e);pt(o)?i=o(i):k(o,function(a,s){i[s]=a})}}),i},_t.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=ft(o,"data-action"),r=t.originalEvent||t,e==="mouseover"?this._timeout=setTimeout(()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)},c1):e==="mouseout"&&(clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null)),this.triggerEntry(i,e,r,n)):t.preventDefault()},_t.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(pt(s)){if(t==="click")return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},_t.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},_t.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},_t.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),i=n.html,r;k(t,function(o,a){var s=o.group||"default",c=Me(o.html||'
    '),p;ft(c,"data-action",a),p=Ae("[data-group="+Hr(s)+"]",i),p||(p=Me('
    '),ft(p,"data-group",s),i.appendChild(p)),p.appendChild(c),o.className&&p1(c,o.className),o.title&&ft(c,"title",o.title),o.imageUrl&&(r=Me(""),ft(r,"src",o.imageUrl),r.style.width="100%",r.style.height="100%",c.appendChild(r))}),Je(i).add("open"),this._current={target:e,entries:t,pad:n},this._eventBus.fire("contextPad.open",{current:this._current})},_t.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=Me('
    '),r=this._getPosition(e),o=N({html:i},this._overlaysConfig,r);Rt.bind(i,Ea,"click",function(c){t.trigger("click",c)}),Rt.bind(i,Ea,"dragstart",function(c){t.trigger("dragstart",c)}),Rt.bind(i,Ea,"mouseover",function(c){t.trigger("mouseover",c)}),Rt.bind(i,Ea,"mouseout",function(c){t.trigger("mouseout",c)}),J.bind(i,"mousedown",function(c){c.stopPropagation()});var a=this._canvas.getRootElement();this._overlayId=n.add(a,"context-pad",o);var s=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{target:e,pad:s}),s},_t.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},_t.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return le(e)!==le(n)?!1:le(e)?e.length===n.length&&Oo(e,function(i){return dd(n,i)}):n===e},_t.prototype.isShown=function(){return this.isOpen()&&this._overlays.isShown()},_t.prototype._getPosition=function(e){e=De(e)?l1(e):e;var t=le(e)?e:[e],n=Ve(t);return{position:{left:n.x+n.width+hd,top:n.y-hd/2}}};function p1(e,t){var n=Je(e);t=le(t)?t:t.split(/\s+/g),t.forEach(function(i){n.add(i)})}function dd(e,t){return e.indexOf(t)!==-1}function l1(e){return e.waypoints[e.waypoints.length-1]}const fd={__depends__:[Fr,ya],contextPad:["type",_t]};var md=function(e,t,n,i){var r;t[0]=0;for(var o=1;o=5&&((a||!h&&o===5)&&(c.push(o,0,a,r),o=6),h&&(c.push(o,h,0,r),o=6)),a=""},l=0;l"?(o=1,a=""):a=i+a[0]:s?i===s?s="":a+=i:i==='"'||i==="'"?s=i:i===">"?(p(),o=1):o&&(i==="="?(o=5,r=a,a=""):i==="/"&&(o<5||n[l][u+1]===">")?(p(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):i===" "||i===" "||i===` `||i==="\r"?(p(),o=2):a+=i),o===3&&a==="!--"&&(o=4,c=c[0])}return p(),c}(e)),t),arguments,[])).length>1?t:t[0]}var Qe=u1.bind(nk),sr,qe,Kc,yd,Wr=0,gd=[],wa=[],bd=at.__b,xd=at.__r,_d=at.diffed,Ed=at.__c,wd=at.unmount;function Sa(e,t){at.__h&&at.__h(qe,e,Wr||t),Wr=0;var n=qe.__H||(qe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:wa}),n.__[e]}function Yc(e){return Wr=1,h1(Cd,e)}function h1(e,t,n){var i=Sa(sr++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):Cd(void 0,t),function(s){var c=i.__N?i.__N[0]:i.__[0],p=i.t(c,s);c!==p&&(i.__N=[p,i.__[1]],i.__c.setState({}))}],i.__c=qe,!qe.u)){var r=function(s,c,p){if(!i.__c.__H)return!0;var l=i.__c.__H.__.filter(function(h){return h.__c});if(l.every(function(h){return!h.__N}))return!o||o.call(this,s,c,p);var u=!1;return l.forEach(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(u=!0)}}),!(!u&&i.__c.props===s)&&(!o||o.call(this,s,c,p))};qe.u=!0;var o=qe.shouldComponentUpdate,a=qe.componentWillUpdate;qe.componentWillUpdate=function(s,c,p){if(this.__e){var l=o;o=void 0,r(s,c,p),o=l}a&&a.call(this,s,c,p)},qe.shouldComponentUpdate=r}return i.__N||i.__}function Xc(e,t){var n=Sa(sr++,3);!at.__s&&Jc(n.__H,t)&&(n.__=e,n.i=t,qe.__H.__h.push(n))}function Ca(e,t){var n=Sa(sr++,4);!at.__s&&Jc(n.__H,t)&&(n.__=e,n.i=t,qe.__h.push(n))}function Zc(e){return Wr=5,Ur(function(){return{current:e}},[])}function Ur(e,t){var n=Sa(sr++,7);return Jc(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function cr(e,t){return Wr=8,Ur(function(){return e},t)}function d1(){for(var e;e=gd.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ra),e.__H.__h.forEach(Qc),e.__H.__h=[]}catch(t){e.__H.__h=[],at.__e(t,e.__v)}}at.__b=function(e){qe=null,bd&&bd(e)},at.__r=function(e){xd&&xd(e),sr=0;var t=(qe=e.__c).__H;t&&(Kc===qe?(t.__h=[],qe.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=wa,n.__N=n.i=void 0})):(t.__h.forEach(Ra),t.__h.forEach(Qc),t.__h=[],sr=0)),Kc=qe},at.diffed=function(e){_d&&_d(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(gd.push(t)!==1&&yd===at.requestAnimationFrame||((yd=at.requestAnimationFrame)||f1)(d1)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==wa&&(n.__=n.__V),n.i=void 0,n.__V=wa})),Kc=qe=null},at.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ra),n.__h=n.__h.filter(function(i){return!i.__||Qc(i)})}catch(i){t.some(function(r){r.__h&&(r.__h=[])}),t=[],at.__e(i,n.__v)}}),Ed&&Ed(e,t)},at.unmount=function(e){wd&&wd(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{Ra(i)}catch(r){t=r}}),n.__H=void 0,t&&at.__e(t,n.__v))};var Sd=typeof requestAnimationFrame=="function";function f1(e){var t,n=function(){clearTimeout(i),Sd&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);Sd&&(t=requestAnimationFrame(n))}function Ra(e){var t=qe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),qe=t}function Qc(e){var t=qe;e.__c=e.__(),qe=t}function Jc(e,t){return!e||e.length!==t.length||t.some(function(n,i){return n!==e[i]})}function Cd(e,t){return typeof t=="function"?t(e):t}function Rd(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;to(a,t,"dragstart")} draggable=${!0} >
    ${t.imageUrl&&Qe``||t.imageHtml&&Qe`
    `} ${t.label?Qe` ${t.label} `:null} ${t.description&&Qe` ${t.description} `}
    ${t.documentationRef&&Qe`
    a.stopPropagation()} title="Open element documentation" target="_blank" rel="noopener" >
    `} `}function v1(e){const s=e,{selectedEntry:t,setSelectedEntry:n,entries:i}=s,r=Zy(s,["selectedEntry","setSelectedEntry","entries"]),o=Zc(),a=Ur(()=>y1(i),[i]);return Ca(()=>{const c=o.current;if(!c)return;const p=c.querySelector(".selected");p&&g1(p)},[t]),Qe`
    ${a.map(c=>Qe` ${c.name&&Qe`
    ${c.name}
    `}
      ${c.entries.map(p=>Qe` <${m1} key=${p.id} entry=${p} selected=${p===t} onMouseEnter=${()=>n(p)} onMouseLeave=${()=>n(null)} ...${r} /> `)}
    `)}
    `}function y1(e){const t=[],n=o=>t.find(a=>o.id===a.id),i=o=>!!n(o),r=o=>typeof o=="string"?{id:o}:o;return e.forEach(o=>{const a=o.group?r(o.group):{id:"default"};i(a)?n(a).entries.push(o):t.push(Pn(Ce({},a),{entries:[o]}))}),t}function g1(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}function b1(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:p,entries:l,onOpened:u,onClosed:h}=e,d=Ur(()=>ot(p)?l.length>5:!1,[p,l]),f=Zc(),[v,g]=Yc(""),R=cr((z,F)=>{if(!d)return z;const U=ue=>{if(!F)return(ue.rank||0)>=0;const It=[ue.description||"",ue.label||"",ue.search||""].join("---").toLowerCase();return F.toLowerCase().split(/\s/g).every(Re=>It.includes(Re))};return z.filter(U)},[d]),[E,_]=Yc(R(l,v)),[x,S]=Yc(E[0]),M=cr(z=>{(!x||!z.includes(x))&&S(z[0]),_(z)},[x,_,S]);Xc(()=>{M(R(l,v))},[v,l]),Xc(()=>{const z=F=>{if(F.key==="Escape")return F.preventDefault(),t()};return document.documentElement.addEventListener("keydown",z),()=>{document.documentElement.removeEventListener("keydown",z)}},[]),Ca(()=>{f.current&&f.current.focus()},[]);const j=cr(z=>{let F=E.indexOf(x)+z;F<0&&(F=E.length-1),F>=E.length&&(F=0),S(E[F])},[E,x,S]),B=cr(z=>{if(z.key==="Enter"&&x)return n(z,x);if(z.key==="ArrowUp"||z.key==="Tab"&&z.shiftKey)return j(-1),z.preventDefault();if(z.key==="ArrowDown"||z.key==="Tab")return j(1),z.preventDefault()},[n,t,x,j]),D=cr(z=>{Sr(z.target,"input")&&g(()=>z.target.value)},[g]);Xc(()=>(u(),()=>{h()}),[]);const $=Ur(()=>a||r.length>0,[a,r]);return Qe` <${Pd} onClose=${t} onKeyup=${D} onKeydown=${B} className=${i} position=${o} width=${s} scale=${c} > ${$&&Qe`

    ${a}

    ${r.map(z=>Qe` n(F,z)} title=${z.title||z.label} data-id=${z.id} onMouseEnter=${()=>S(z)} onMouseLeave=${()=>S(null)} > ${z.imageUrl&&Qe``||z.imageHtml&&Qe`
    `} ${z.label?Qe` ${z.label} `:null} `)}
    `} ${l.length>0&&Qe`
    ${d&&Qe` `} <${v1} entries=${E} selectedEntry=${x} setSelectedEntry=${S} onAction=${n} />
    ${E.length===0&&Qe`
    No matching entries found.
    `} `} `}function Pd(e){const{onClose:t,onKeydown:n,onKeyup:i,className:r,children:o,position:a}=e,s=Zc(),c=cr(p=>{Mn(p.target,".djs-popup",!0)||t()},[t]);return Ca(()=>{if(typeof a!="function")return;const p=s.current,l=a(p);p.style.left=`${l.x}px`,p.style.top=`${l.y}px`},[s.current,a]),Ca(()=>{s.current&&s.current.focus()},[]),Qe`
    ${o}
    `}function x1(e){return{transform:`scale(${e.scale})`,width:`${e.width}px`}}function _1(e,t){return Pa("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}var E1="data-id",kd=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],w1=1e3;function He(e,t,n){this._eventBus=t,this._canvas=n,this._current=null;var i=ot(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",r=>{const o=this.isOpen()&&this._current.target;r.element===o&&this._render()})}He.$inject=["config.popupMenu","eventBus","canvas"],He.prototype._render=function(){const{position:e,className:t,entries:n,headerEntries:i,options:r}=this._current,o=Object.entries(n).map(([p,l])=>Ce({id:p},l)),a=Object.entries(i).map(([p,l])=>Ce({id:p},l)),s=e&&(p=>this._ensureVisible(p,e)),c=this._updateScale(this._current.container);ig(Qe` <${b1} onClose=${p=>this.close(p)} onSelect=${(p,l,u)=>this.trigger(p,l,u)} position=${s} className=${t} entries=${o} headerEntries=${a} scale=${c} onOpened=${this._onOpened.bind(this)} onClosed=${this._onClosed.bind(this)} ...${Ce({},r)} /> `,this._current.container)},He.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:r,headerEntries:o}=this._getContext(e,t);this._current={position:n,className:t,target:e,entries:r,headerEntries:o,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},He.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),r=this._getHeaderEntries(e,n);return{entries:i,headerEntries:r,empty:!(Object.keys(i).length||Object.keys(r).length)}},He.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._current=null)},He.prototype.reset=function(){const e=this._current.container;ig(null,e),dn(e)},He.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},He.prototype._onOpened=function(){this._emit("opened")},He.prototype._onClosed=function(){this._emit("closed")},He.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();const i=Me(`
    `);return n.appendChild(i),i},He.prototype._bindAutoClose=function(){this._eventBus.once(kd,this.close,this)},He.prototype._unbindAutoClose=function(){this._eventBus.off(kd,this.close,this)},He.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,i,r=e;return t!==!0&&(t===!1?(n=1,i=1):(n=t.min,i=t.max),ot(n)&&ei&&(r=i)),r},He.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,a=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,a=t.y-i.height):r.x?(o=t.x-i.width,a=t.y):r.y&&t.y `,bottom:` `,center:` `,left:` `,right:` `,top:` `,middle:` `};const Td=S1;var C1=900;function pr(e,t,n,i){e.registerProvider(C1,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}pr.$inject=["contextPad","popupMenu","translate","canvas"],pr.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},pr.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},pr.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`
    ${Td.align}
    `,action:{click:function(t,n){var i=e._getMenuPosition(n);N(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},pr.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,i=n.getBoundingClientRect(),r={x:i.left,y:i.bottom+t};return r};var R1=["left","center","right","top","middle","bottom"];function qr(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}qr.$inject=["popupMenu","alignElements","translate","rules"],qr.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},qr.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},qr.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return k(R1,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Td[o],action:function(){t.trigger(e,o),i.close()}}}),r};function qt(e){V.call(this,e),this.init()}qt.$inject=["eventBus"],q(qt,V),qt.prototype.addRule=function(e,t,n){var i=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){i.canExecute(r,t,function(o,a,s){return n(o)},!0)})},qt.prototype.init=function(){};function ka(e){qt.call(this,e)}ka.$inject=["eventBus"],q(ka,qt),ka.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=ce(t,function(i){return!(i.waypoints||i.host||i.labelTarget)});return n=Uo(n),n.length<2?!1:n})};const P1={__depends__:[a1,fd,ep],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",pr],alignElementsMenuProvider:["type",qr],bpmnAlignElements:["type",ka]};var k1=10,Ad=50,T1=250;function tp(e,t,n,i){for(var r;r=A1(e,n,t);)n=i(t,n,r);return n}function np(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s=o==="x"?"width":"height",c=a.margin,p=a.minDistance;c<0?r[o]=Math.min(i[o]+c-t[s]/2,n[o]-p+c):r[o]=Math.max(i[o]+i[s]+c+t[s]/2,n[o]+p+c)}}),r}}function A1(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=D1(e);return ye(r,function(o){if(o===n)return!1;var a=lt(o,i,k1);return a==="intersect"})}function M1(e,t){t||(t={});function n(f){return f.source===e?1:-1}var i=t.defaultDistance||Ad,r=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||T1,c=t.reference||"start";o||(o=O1);function p(f,v){return r==="n"?c==="start"?X(f).top-X(v).bottom:c==="center"?X(f).top-ne(v).y:X(f).top-X(v).top:r==="w"?c==="start"?X(f).left-X(v).right:c==="center"?X(f).left-ne(v).x:X(f).left-X(v).left:r==="s"?c==="start"?X(v).top-X(f).bottom:c==="center"?ne(v).y-X(f).bottom:X(v).bottom-X(f).bottom:c==="start"?X(v).left-X(f).right:c==="center"?ne(v).x-X(f).right:X(v).right-X(f).right}var l=e.incoming.filter(o).map(function(f){var v=a(f),g=v<0?p(f.source,e):p(e,f.source);return{id:f.source.id,distance:g,weight:v}}),u=e.outgoing.filter(o).map(function(f){var v=a(f),g=v>0?p(e,f.target):p(f.target,e);return{id:f.target.id,distance:g,weight:v}}),h=l.concat(u).reduce(function(f,v){return f[v.id+"__weight_"+v.weight]=v,f},{}),d=Gt(h,function(f,v){var g=v.distance,R=v.weight;return g<0||g>s||(f[String(g)]||(f[String(g)]=0),f[String(g)]+=1*R,(!f.distance||f[f.distance]t.top&&(n=n.concat("n")),e.rightt.left&&(n=n.concat("e")),n}function Aa(e){e.invoke(In,this)}Aa.$inject=["injector"],q(Aa,In),Aa.prototype.resize=function(e,t,n){y(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};function Kr(e){qt.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}Kr.$inject=["eventBus"],q(Kr,qt),Kr.prototype.canResize=function(e,t){return!1};function Ma(e,t){Kr.call(this,e),this._modeling=t}q(Ma,Kr),Ma.$inject=["eventBus","modeling"],Ma.prototype.canResize=function(e,t){if(y(t.di,"bpmndi:BPMNPlane")||!y(t,"bpmn:Participant")&&!y(t,"bpmn:Lane")&&!y(t,"bpmn:SubProcess"))return!1;var n=!0;return k(e,function(i){if(y(i,"bpmn:Lane")||xe(i)){n=!1;return}}),n};const W1={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Aa],bpmnAutoResizeProvider:["type",Ma]};var jd=1500;function Ld(e,t,n){var i=this,r=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=i._findTargetGfx(s),p=c&&e.get(c);c&&p&&(a.stopPropagation(),r.hover({element:p,gfx:c}),r.move(s))}}r&&t.on("drag.start",function(a){t.once("drag.move",jd,function(s){o(s)})}),function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",jd,function(c){s&&t.fire("element.out",{element:s,gfx:a})}),t.on("element.out",function(){a=null,s=null})}(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=oi(a),c=document.elementFromPoint(s.x,s.y),U1(c)}}Ld.$inject=["elementRegistry","eventBus","injector"];function U1(e){return Mn(e,"svg, .djs-element",!0)}const q1={__init__:["hoverFix"],hoverFix:["type",Ld]};var lr=Math.round,Id="djs-drag-active";function Ni(e){e.preventDefault()}function K1(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function Y1(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function $d(e,t,n,i){var r={threshold:5,trapClick:!0},o;function a(_){var x=t.viewbox(),S=t._container.getBoundingClientRect();return{x:x.x+(_.x-S.left)/x.scale,y:x.y+(_.y-S.top)/x.scale}}function s(_,x){x=x||o;var S=e.createEvent(N({},x.payload,x.data,{isTouch:x.isTouch}));return e.fire("drag."+_,S)===!1?!1:e.fire(x.prefix+"."+_,S)}function c(_){var x=_.filter(function(S){return i.get(S.id)});x.length&&n.select(x)}function p(_,x){var S=o.payload,M=o.displacement,j=o.globalStart,B=oi(_),D=tn(B,j),$=o.localStart,z=a(B),F=tn(z,$);if(!o.active&&(x||Y1(D)>o.threshold)){if(N(S,{x:lr($.x+M.x),y:lr($.y+M.y),dx:0,dy:0},{originalEvent:_}),s("start")===!1)return g();o.active=!0,o.keepSelection||(S.previousSelection=n.get(),n.select(null)),o.cursor&&xa(o.cursor),t.addMarker(t.getRootElement(),Id)}Dc(_),o.active&&(N(S,{x:lr(z.x+M.x),y:lr(z.y+M.y),dx:lr(F.x),dy:lr(F.y)},{originalEvent:_}),s("move"))}function l(_){var x,S=!0;o.active&&(_&&(o.payload.originalEvent=_,Dc(_)),S=s("end")),S===!1&&s("rejected"),x=R(S!==!0),s("ended",x)}function u(_){tt("Escape",_)&&(Ni(_),g())}function h(_){var x;o.active&&(x=td(e),setTimeout(x,400),Ni(_)),l(_)}function d(_){p(_)}function f(_){var x=o.payload;x.hoverGfx=_.gfx,x.hover=_.element,s("hover")}function v(_){s("out");var x=o.payload;x.hoverGfx=null,x.hover=null}function g(_){var x;if(o){var S=o.active;S&&s("cancel"),x=R(_),S&&s("canceled",x)}}function R(_){var x,S;s("cleanup"),ed(),o.trapClick?S=h:S=l,J.unbind(document,"mousemove",p),J.unbind(document,"dragstart",Ni),J.unbind(document,"selectstart",Ni),J.unbind(document,"mousedown",S,!0),J.unbind(document,"mouseup",S,!0),J.unbind(document,"keyup",u),J.unbind(document,"touchstart",d,!0),J.unbind(document,"touchcancel",g,!0),J.unbind(document,"touchmove",p,!0),J.unbind(document,"touchend",l,!0),e.off("element.hover",f),e.off("element.out",v),t.removeMarker(t.getRootElement(),Id);var M=o.payload.previousSelection;return _!==!1&&M&&!n.get().length&&c(M),x=o,o=null,x}function E(_,x,S,M){o&&g(!1),typeof x=="string"&&(M=S,S=x,x=null),M=N({},r,M||{});var j=M.data||{},B,D,$,z,F;M.trapClick?z=h:z=l,_?(B=nr(_)||_,D=oi(_),Dc(_),B.type==="dragstart"&&Ni(B)):(B=null,D={x:0,y:0}),$=a(D),x||(x=$),F=K1(B),o=N({prefix:S,data:j,payload:{},globalStart:D,displacement:tn(x,$),localStart:$,isTouch:F},M),M.manual||(F?(J.bind(document,"touchstart",d,!0),J.bind(document,"touchcancel",g,!0),J.bind(document,"touchmove",p,!0),J.bind(document,"touchend",l,!0)):(J.bind(document,"mousemove",p),J.bind(document,"dragstart",Ni),J.bind(document,"selectstart",Ni),J.bind(document,"mousedown",z,!0),J.bind(document,"mouseup",z,!0)),J.bind(document,"keyup",u),e.on("element.hover",f),e.on("element.out",v)),s("init"),M.autoActivate&&p(_,!0)}e.on("diagram.destroy",g),this.init=E,this.move=p,this.hover=f,this.out=v,this.end=l,this.cancel=g,this.context=function(){return o},this.setOptions=function(_){N(r,_)}}$d.$inject=["eventBus","canvas","selection","elementRegistry"];const $n={__depends__:[q1,bn],dragging:["type",$d]};function ur(e,t,n){this._canvas=n,this._opts=N({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}ur.$inject=["config.autoScroll","eventBus","canvas"],ur.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)X1(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){i.startScroll(e)},n.scrollRepeatTimeout))};function X1(e,t,n){return tM-3&&(D=lt(d.target,S),v===M-2?D==="intersect"&&(_.pop(),_[_.length-1]=S):D!=="intersect"&&_.push(R)),h.newWaypoints=d.waypoints=s(d,_),p(h,j,u),h.newSegmentStartIndex=f+j,c(u)}),t.on("connectionSegment.move.hover",function(u){u.context.hover=u.hover,n.addMarker(u.hover,nf)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(u){var h=u.context.hover;h&&n.removeMarker(h,nf)}),t.on("connectionSegment.move.cleanup",function(u){var h=u.context,d=h.connection;h.draggerGfx&&Fe(h.draggerGfx),n.removeMarker(d,rf)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(u){var h=u.context,d=h.connection;d.waypoints=h.originalWaypoints,c(u)}),t.on("connectionSegment.move.end",function(u){var h=u.context,d=h.connection,f=h.newWaypoints,v=h.newSegmentStartIndex;f=f.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var g=l(f,v),R=g.waypoints,E=s(d,R),_=g.segmentOffset,x={segmentMove:{segmentStartIndex:h.segmentStartIndex,newSegmentStartIndex:v+_}};o.updateWaypoints(d,E,x)})}cf.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var fE=Math.abs,pf=Math.round;function mE(e,t,n){n=n===void 0?10:n;var i,r;for(i=0;io-up)return a-c+o}return a}function n(o,a){if(o.waypoints)return sE(a,o);if(o.width)return{x:df(o.width/2+o.x),y:df(o.height/2+o.y)}}function i(o){var a=o.context,s=a.snapPoints,c=a.connection,p=c.waypoints,l=a.segmentStart,u=a.segmentStartIndex,h=a.segmentEnd,d=a.segmentEndIndex,f=a.axis;if(s)return s;var v=[p[u-1],l,h,p[d+1]];return u<2&&v.unshift(n(c.source,o)),d>p.length-3&&v.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},k(v,function(g){g&&(g=g.original||g,f==="y"&&s.horizontal.push(g.y),f==="x"&&s.vertical.push(g.x))}),s}e.on("connectionSegment.move.move",1500,function(o){var a=i(o),s=o.x,c=o.y,p,l;if(a){p=t(a.vertical,s),l=t(a.horizontal,c);var u=s-p,h=c-l;N(o,{dx:o.dx-u,dy:o.dy-h,x:p,y:l}),(u||a.vertical.indexOf(s)!==-1)&&Ke(o,"x",p),(h||a.horizontal.indexOf(c)!==-1)&&Ke(o,"y",l)}});function r(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var p=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},k(p,function(l){l&&(l=l.original||l,a.horizontal.push(l.y),a.vertical.push(l.x))}),a}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!De(s)||!c||!c.x||!c.y||(Ke(o,"x",c.x),Ke(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=r(a),c=a.hover,p=c&&n(c,o),l=o.x,u=o.y,h,d;if(s){h=t(p?s.vertical.concat([p.x]):s.vertical,l),d=t(p?s.horizontal.concat([p.y]):s.horizontal,u);var f=l-h,v=u-d;N(o,{dx:o.dx-f,dy:o.dy-v,x:o.x-f,y:o.y-v}),(f||s.vertical.indexOf(l)!==-1)&&Ke(o,"x",h),(v||s.horizontal.indexOf(u)!==-1)&&Ke(o,"y",d)}})}ff.$inject=["eventBus"];const yE={__depends__:[$n,_n],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Kd],bendpointMove:["type",pp],bendpointMovePreview:["type",tf],connectionSegmentMove:["type",cf],bendpointSnapping:["type",ff]};function mf(e,t,n,i){function r(a,s){return i.allowed("connection.create",{source:a,target:s})}function o(a,s){return r(s,a)}e.on("connect.hover",function(a){var s=a.context,c=s.start,p=a.hover,l;if(s.hover=p,l=s.canExecute=r(c,p),!ng(l)){if(l!==!1){s.source=c,s.target=p;return}l=s.canExecute=o(c,p),!ng(l)&&l!==!1&&(s.source=p,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(a){var s=a.context,c=s.canExecute,p=s.connectionStart,l={x:a.x,y:a.y},u=s.source,h=s.target;if(!c)return!1;var d=null,f={connectionStart:hp(s)?l:p,connectionEnd:hp(s)?p:l};rt(c)&&(d=c),s.connection=n.connect(u,h,d,f)}),this.start=function(a,s,c,p){rt(c)||(p=c,c=ne(s)),t.init(a,"connect",{autoActivate:p,data:{shape:s,context:{start:s,connectionStart:c}}})}}mf.$inject=["eventBus","dragging","modeling","rules"];function hp(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}var gE=1100,bE=900,vf="connect-ok",yf="connect-not-ok";function gf(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(r){var o=r.context,a=o.canExecute,s=o.hover,c=o.source,p=o.start,l=o.startPosition,u=o.target,h=o.connectionStart||l,d=o.connectionEnd||{x:r.x,y:r.y},f=h,v=d;hp(o)&&(f=d,v=h),i.drawPreview(o,a,{source:c||p,target:u||s,connectionStart:f,connectionEnd:v})}),t.on("connect.hover",bE,function(r){var o=r.context,a=r.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?vf:yf)}),t.on(["connect.out","connect.cleanup"],gE,function(r){var o=r.hover;o&&(n.removeMarker(o,vf),n.removeMarker(o,yf))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}gf.$inject=["injector","eventBus","canvas"];const dp={__depends__:[bn,_n,$n],__init__:["connectPreview"],connect:["type",mf],connectPreview:["type",gf]};var xE="djs-dragger";function zn(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}zn.$inject=["injector","canvas","graphicsFactory","elementFactory"],zn.prototype.drawPreview=function(e,t,n){n=n||{};var i=e.connectionPreviewGfx,r=e.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,p=n.connectionEnd,l=n.noLayout,u=n.noCropping,h=n.noNoop,d,f=this;if(i||(i=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Ho(i),r||(r=e.getConnection=_E(function(v,g,R){return f.getConnection(v,g,R)})),t&&(d=r(t,o,a)),!d){!h&&this.drawNoopPreview(i,n);return}d.waypoints=s||[],this._layouter&&!l&&(d.waypoints=this._layouter.layoutConnection(d,{source:o,target:a,connectionStart:c,connectionEnd:p,waypoints:n.waypoints||d.waypoints})),(!d.waypoints||!d.waypoints.length)&&(d.waypoints=[o?ne(o):c,a?ne(a):p]),this._connectionDocking&&(o||a)&&!u&&(d.waypoints=this._connectionDocking.getCroppedWaypoints(d,o,a)),this._graphicsFactory.drawConnection(i,d,{stroke:"var(--element-dragger-color)"})},zn.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||ne(n),o=t.connectionEnd||ne(i),a=this.cropWaypoints(r,o,n,i),s=this.createNoopConnection(a[0],a[1]);ee(e,s)},zn.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return e=n&&mc(o,s,!0)||e,t=i&&mc(a,s,!1)||t,[e,t]},zn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Fe(e.connectionPreviewGfx)},zn.prototype.getConnection=function(e){var t=EE(e);return this._elementFactory.createConnection(t)},zn.prototype.createConnectionPreviewGfx=function(){var e=Z("g");return Y(e,{pointerEvents:"none"}),he(e).add(xE),ee(this._canvas.getActiveLayer(),e),e},zn.prototype.createNoopConnection=function(e,t){return Wo([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function _E(e){var t={};return function(n){var i=JSON.stringify(n),r=t[i];return r||(r=t[i]=e.apply(null,arguments)),r}}function EE(e){return rt(e)?e:{}}const wE={__init__:["connectionPreview"],connectionPreview:["type",zn]};var bf=Math.min,xf=Math.max;function fp(e){e.preventDefault()}function Zr(e){e.stopPropagation()}function SE(e){return e.nodeType===Node.TEXT_NODE}function CE(e){return[].slice.call(e)}function nn(e){this.container=e.container,this.parent=Me('
    '),this.content=Ae("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=Ct(this.autoResize,this),this.handlePaste=Ct(this.handlePaste,this)}nn.prototype.create=function(e,t,n,i){var r=this,o=this.parent,a=this.content,s=this.container;i=this.options=i||{},t=this.style=t||{};var c=un(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);N(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var p=un(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return N(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},p),i.centerVertically&&N(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},p),a.innerText=n,J.bind(a,"keydown",this.keyHandler),J.bind(a,"mousedown",Zr),J.bind(a,"paste",r.handlePaste),i.autoResize&&J.bind(a,"input",this.autoResize),i.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o},nn.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var i;if(e.clipboardData?i=e.clipboardData.getData("text/plain"):i=window.clipboardData.getData("Text"),this.insertText(i),t.autoResize){var r=this.autoResize(n);r&&this.resizeHandler(r)}},nn.prototype.insertText=function(e){e=RE(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)},nn.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,i=t.endContainer,r=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=CE(a.childNodes),c,p;if(SE(a)){var l=n.textContent;n.textContent=l.substring(0,r)+e+l.substring(o),c=n,p=r+e.length}else if(n===this.content&&i===this.content){var u=document.createTextNode(e);this.content.insertBefore(u,s[r]),c=u,p=u.textContent.length}else{var h=s.indexOf(n),d=s.indexOf(i);s.forEach(function(f,v){v===h?f.textContent=n.textContent.substring(0,r)+e+i.textContent.substring(o):v>h&&v<=d&&dn(f)}),c=n,p=r+e.length}c&&p!==void 0&&setTimeout(function(){self.setSelection(c,p)})},nn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
    ');var s,c,p,l,u=function(f){fp(f),Zr(f),s=f.clientX,c=f.clientY;var v=t.getBoundingClientRect();p=v.width,l=v.height,J.bind(document,"mousemove",h),J.bind(document,"mouseup",d)},h=function(f){fp(f),Zr(f);var v=bf(xf(p+f.clientX-s,i),o),g=bf(xf(l+f.clientY-c,r),a);t.style.width=v+"px",t.style.height=g+"px",e.resizeHandler({width:p,height:l,dx:f.clientX-s,dy:f.clientY-c})},d=function(f){fp(f),Zr(f),J.unbind(document,"mousemove",h,!1),J.unbind(document,"mouseup",d,!1)};J.bind(n,"mousedown",u)}N(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},nn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),J.unbind(t,"keydown",this.keyHandler),J.unbind(t,"mousedown",Zr),J.unbind(t,"input",this.autoResize),J.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),dn(n)),dn(e)},nn.prototype.getValue=function(){return this.content.innerText.trim()},nn.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t},nn.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)};function RE(e){return e.replace(/\r\n|\r|\n/g,` `)}function Yt(e,t){this._eventBus=e,this._providers=[],this._textbox=new nn({container:t.getContainer(),keyHandler:Ct(this._handleKey,this),resizeHandler:Ct(this._handleResize,this)})}Yt.$inject=["eventBus","canvas"],Yt.prototype.registerProvider=function(e){this._providers.push(e)},Yt.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))},Yt.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Yt.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Yt.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},Yt.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue(),o=e.context.text;(r!==o||i.height!==n.height||i.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Yt.prototype.getValue=function(){return this._textbox.getValue()},Yt.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;if(t===27)return e.preventDefault(),this.cancel();if(t===13&&!e.shiftKey)return e.preventDefault(),this.complete()},Yt.prototype._handleResize=function(e){this._fire("resize",e)},Yt.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=ye(this._providers,function(i){return(t=i.activate(e))?i:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const _f={__depends__:[Fr],__init__:["directEditing"],directEditing:["type",Yt]};var PE=["marker-start","marker-mid","marker-end"],kE=["circle","ellipse","line","path","polygon","polyline","path","rect"];function pi(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",function(){r.cleanUp()})}pi.$inject=["elementRegistry","eventBus","canvas","styles"],pi.prototype.cleanUp=function(){var e=this;k(e._clonedMarkers,function(t){Fe(t)}),e._clonedMarkers={}},pi.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},pi.prototype.addDragger=function(e,t,n,i="djs-dragger"){n=n||this.getGfx(e);var r=hu(n),o=n.getBoundingClientRect();return this._cloneMarkers(ta(r),i),Y(r,this._styles.cls(i,[],{x:o.top,y:o.left})),ee(t,r),Y(r,"data-preview-support-element-id",e.id),r},pi.prototype.addFrame=function(e,t){var n=Z("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return ee(t,n),Y(n,"data-preview-support-element-id",e.id),n},pi.prototype._cloneMarkers=function(e,t="djs-dragger"){var n=this;if(e.childNodes)for(var i=0;i=120&&N(l,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:p("Divide into two Lanes"),action:{click:g(2)}}}),e.height>=180&&N(l,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three Lanes"),action:{click:g(3)}}})),N(l,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add Lane below"),action:{click:function(_,x){n.addLane(x,"bottom")}}}})}y(u,"bpmn:FlowNode")&&(y(u,"bpmn:EventBasedGateway")?N(l,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append ReceiveTask")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):Vf(u,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?N(l,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):!y(u,"bpmn:EndEvent")&&!u.isForCompensation&&!Vf(u,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!Ot(u)&&N(l,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append EndEvent")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append Gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",p("Append Task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append Intermediate/Boundary Event"))})),a.isEmpty(e,"bpmn-replace")||N(l,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(_,x){var S=N(f(x),{cursor:{x:_.x,y:_.y}});a.open(x,"bpmn-replace",S,{title:p("Change element"),width:300,search:!0})}}}}),y(u,"bpmn:SequenceFlow")&&N(l,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")}),de(u,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(l,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(u.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:h,dragstart:h}}}),y(u,"bpmn:TextAnnotation")&&N(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:h,dragstart:h}}}),de(u,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:h,dragstart:h}}}),y(u,"bpmn:Group")&&N(l,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var E=s.allowed("elements.delete",{elements:[e]});return le(E)&&(E=E[0]===e),E&&N(l,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:d}}}),l};function Vf(e,t,n){var i=e.$instanceOf(t),r=!1,o=e.eventDefinitions||[];return k(o,function(a){a.$type===n&&(r=!0)}),i&&r}function gw(e,t){return e.indexOf(t)!==-1}const bw={__depends__:[_f,fd,bn,dp,ja,sw],__init__:["contextPadProvider"],contextPadProvider:["type",io]};var xw={horizontal:["x","width"],vertical:["y","height"]},Wf=5;function Fn(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var i=t.allowed("elements.distribute",{elements:n});return le(i)?i:i?n:[]})}Fn.$inject=["modeling","rules"],Fn.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},Fn.prototype.trigger=function(e,t){var n=this._modeling,i,r;if(!(e.length<3)&&(this._setOrientation(t),r=this._filterElements(e),i=this._createGroups(r),!(i.length<=2)))return n.distributeElements(i,this._axis,this._dimension),i},Fn.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(k(t,function(o){r=o(r,n,i)}),r):e},Fn.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=ln(e,i);return k(o,function(a,s){var c=n._findRange(a,i,r),p,l=t[t.length-1];l&&n._hasIntersection(l.range,c)?t[t.length-1].elements.push(a):(p={range:c,elements:[a]},t.push(p))}),t},Fn.prototype._setOrientation=function(e){var t=xw[e];this._axis=t[0],this._dimension=t[1]},Fn.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},Fn.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+Wf,max:t+n-Wf}};const _w={__init__:["distributeElements"],distributeElements:["type",Fn]};function Ga(e){qt.call(this,e)}Ga.$inject=["eventBus"],q(Ga,qt),Ga.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=ce(t,function(n){var i=de(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)}),t=Uo(t),t.length<3?!1:t})};var Ew={horizontal:` `,vertical:` `};const Uf=Ew;var ww=900;function ro(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",ww,this)}ro.$inject=["popupMenu","distributeElements","translate","rules"],ro.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},ro.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},ro.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu,r={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:Uf.horizontal,action:function(o,a){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:Uf.vertical,action:function(o,a){t.trigger(e,"vertical"),i.close()}}};return r};const Sw={__depends__:[ep,_w],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",Ga],distributeElementsMenuProvider:["type",ro]};var qf="is not a registered action",Cw="is already registered";function Zt(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Zt.$inject=["eventBus","injector"],Zt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),p=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var l=i.get();if(l.length)return o.copy(l)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(l){r.stepZoom(l.value)}),a&&this.register("zoom",function(l){a.zoom(l.value)}),n&&i&&s&&this.register("removeSelection",function(){var l=i.get();if(l.length){var u=s.allowed("elements.delete",{elements:l}),h;u!==!1&&(le(u)?h=u:h=l,h.length&&n.removeElements(h.slice()))}}),c&&this.register("moveCanvas",function(l){c.moveCanvas(l)}),p&&this.register("moveSelection",function(l){p.moveSelection(l.direction,l.accelerated)})},Zt.prototype.trigger=function(e,t){if(!this._actions[e])throw xp(e,qf);return this._actions[e](t)},Zt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);k(e,function(i,r){n._registerAction(r,i)})},Zt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw xp(e,Cw);this._actions[e]=t},Zt.prototype.unregister=function(e){if(!this.isRegistered(e))throw xp(e,qf);this._actions[e]=void 0},Zt.prototype.getActions=function(){return Object.keys(this._actions)},Zt.prototype.isRegistered=function(e){return!!this._actions[e]};function xp(e,t){return new Error(e+" "+t)}const Rw={__init__:["editorActions"],editorActions:["type",Zt]};function Va(e){e.invoke(Zt,this)}q(Va,Zt),Va.$inject=["injector"],Va.prototype._registerDefaultActions=function(e){Zt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),p=e.get("alignElements",!1),l=e.get("directEditing",!1),u=e.get("searchPad",!1),h=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",function(){var f=t.getRootElement(),v=n.filter(function(g){return g!==f});return i.select(v),v}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),i&&c&&this._registerAction("distributeElements",function(f){var v=i.get(),g=f.type;v.length&&c.trigger(v,g)}),i&&p&&this._registerAction("alignElements",function(f){var v=i.get(),g=[],R=f.type;v.length&&(g=ce(v,function(E){return!y(E,"bpmn:Lane")}),p.trigger(g,R))}),i&&h&&this._registerAction("setColor",function(f){var v=i.get();v.length&&h.setColor(v,f)}),i&&l&&this._registerAction("directEditing",function(){var f=i.get();f.length&&l.activate(f[0])}),u&&this._registerAction("find",function(){u.toggle()}),t&&h&&this._registerAction("moveToOrigin",function(){var f=t.getRootElement(),v,g;y(f,"bpmn:Collaboration")?g=n.filter(function(R){return y(R.parent,"bpmn:Collaboration")}):g=n.filter(function(R){return R!==f&&!y(R.parent,"bpmn:SubProcess")}),v=Ve(g),h.moveElements(g,{x:-v.x,y:-v.y},f)}),i&&d&&this._registerAction("replaceElement",function(f){d.triggerEntry("replace","click",f)})};const Pw={__depends__:[Rw],editorActions:["type",Va]};function Kf(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,i=t.shape;de(i,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}Kf.$inject=["eventBus"];var Wa=10;function _p(e,t,n){return n||(n="round"),Math[n](e/t)*t}var kw=1200,Tw=800;function li(e,t,n){var i=!n||n.active!==!1;this._eventBus=t;var r=this;t.on("diagram.init",Tw,function(){r.setActive(i)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],kw,function(o){var a=o.originalEvent;if(!(!r.active||a&&jt(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(p){var l={},u=Mw(o,p,e);u&&(l.offset=u);var h=Aw(o,p);h&&N(l,h),hr(o,p)||r.snapEvent(o,p,l)})}})}li.prototype.snapEvent=function(e,t,n){var i=this.snapValue(e[t],n);Ke(e,t,i)},li.prototype.getGridSpacing=function(){return Wa},li.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=_p(e,Wa);var i,r;return t&&t.min&&(i=t.min,ie(i)&&(i=_p(i+n,Wa,"ceil"),e=Math.max(e,i))),t&&t.max&&(r=t.max,ie(r)&&(r=_p(r+n,Wa,"floor"),e=Math.min(e,r))),e-=n,e},li.prototype.isActive=function(){return this.active},li.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},li.prototype.toggleActive=function(){this.setActive(!this.active)},li.$inject=["elementRegistry","eventBus","config.gridSnapping"];function Aw(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(Ua(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,p=r.max;return c&&(Ua(t)?Xf(s)?a.x.max=c.left:a.x.min=c.right:Yf(s)?a.y.max=c.top:a.y.min=c.bottom),p&&(Ua(t)?Xf(s)?a.x.min=p.left:a.x.max=p.right:Yf(s)?a.y.min=p.top:a.y.max=p.bottom),a[t]}function Mw(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ie(s[t])||(s||(s=o.snapOffset={}),ie(s[t])||(s[t]=0),!r)||(n.get(r.id)||(Ua(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2)),s[t]}function Ua(e){return e==="x"}function Yf(e){return e.indexOf("n")!==-1}function Xf(e){return e.indexOf("w")!==-1}function Ii(e,t){V.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=r.hints||{},a=o.autoResize;if(a){var s=r.shape,c=r.newBounds;Mt(a)?r.newBounds=n.snapComplex(c,a):r.newBounds=n.snapSimple(s,c)}})}Ii.$inject=["eventBus","gridSnapping","modeling"],q(Ii,V),Ii.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Ii.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Ii.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),N(e,o),e},Ii.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),N(e,o),e};var Dw=2e3;function Zf(e,t){e.on(["spaceTool.move","spaceTool.end"],Dw,function(n){var i=n.context;if(i.initialized){var r=i.axis,o;r==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}Zf.$inject=["eventBus","gridSnapping"];const Bw={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Ii],gridSnappingSpaceToolBehavior:["type",Zf]},Nw={__depends__:[Bw],__init__:["gridSnapping"],gridSnapping:["type",li]};var Ow=2e3;function Qf(e,t){e.on("autoPlace",Ow,function(n){var i=n.source,r=ne(i),o=n.shape,a=Bd(i,o);return["x","y"].forEach(function(s){var c={};a[s]!==r[s]&&(a[s]>r[s]?c.min=a[s]:c.max=a[s],y(o,"bpmn:TextAnnotation")&&(jw(s)?c.offset=-o.width/2:c.offset=-o.height/2),a[s]=t.snapValue(a[s],c))}),a})}Qf.$inject=["eventBus","gridSnapping"];function jw(e){return e==="x"}var Lw=1750;function Jf(e,t,n){t.on(["create.start","shape.move.start"],Lw,function(i){var r=i.context,o=r.shape,a=e.getRootElement();if(!(!y(o,"bpmn:Participant")||!y(a,"bpmn:Process")||!a.children.length)){var s=r.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}Jf.$inject=["canvas","eventBus","gridSnapping"];var Iw=3e3;function qa(e,t,n){V.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],Iw,function(r){var o=r.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||$w(c)&&n.updateWaypoints(a,i.snapMiddleSegments(c))})}qa.$inject=["eventBus","gridSnapping","modeling"],q(qa,V),qa.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var i=1;i3}function zw(e){return e==="h"}function Fw(e){return e==="v"}function Hw(e,t,n){var i=Dn(t,n),r={};return zw(i)&&(r.y=e.snapValue(t.y)),Fw(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=N({},t,r),n=N({},n,r)),[t,n]}const Gw={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Qf],gridSnappingParticipantBehavior:["type",Jf],gridSnappingLayoutConnectionBehavior:["type",qa]},Vw={__depends__:[Nw,Gw],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Kf]};var Ww=30,Uw=30;function oo(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;if(y(r,"bpmn:Lane"))return n._createParticipantHit(r,o);if(y(r,"bpmn:Participant"))return ve(r)?n._createParticipantHit(r,o):n._createDefaultHit(r,o);if(y(r,"bpmn:SubProcess"))return ve(r)?n._createSubProcessHit(r,o):n._createDefaultHit(r,o)})}oo.$inject=["eventBus","interactionEvents"],oo.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},oo.prototype._createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:Ww,height:e.height}),!0},oo.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:Uw}),!0};const qw={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",oo]};function Ka(e){e.invoke(or,this)}q(Ka,or),Ka.$inject=["injector"],Ka.prototype.registerBindings=function(e,t){or.prototype.registerBindings.call(this,e,t);function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("selectElements",function(i){var r=i.keyEvent;if(e.isKey(["a","A"],r)&&e.isCmd(r))return t.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(e.isKey(["f","F"],r)&&e.isCmd(r))return t.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["s","S"],r))return t.trigger("spaceTool"),!0}),n("lassoTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["l","L"],r))return t.trigger("lassoTool"),!0}),n("handTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["h","H"],r))return t.trigger("handTool"),!0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["c","C"],r))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["e","E"],r))return t.trigger("directEditing"),!0}),n("replaceElement",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["r","R"],r))return t.trigger("replaceElement",r),!0})};const Kw={__depends__:[Fc],__init__:["keyboardBindings"],keyboardBindings:["type",Ka]};var Yw={moveSpeed:1,moveSpeedAccelerated:10},Xw=1500,em="left",tm="up",nm="right",im="down",Zw={ArrowLeft:em,Left:em,ArrowUp:tm,Up:tm,ArrowRight:nm,Right:nm,ArrowDown:im,Down:im},Qw={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function rm(e,t,n,i,r){var o=this;this._config=N({},Yw,e||{}),t.addListener(Xw,function(a){var s=a.keyEvent,c=Zw[s.key];if(c&&!t.isCmd(s)){var p=t.isShift(s);return o.moveSelection(c,p),!0}}),this.moveSelection=function(a,s){var c=r.get();if(c.length){var p=this._config[s?"moveSpeedAccelerated":"moveSpeed"],l=Qw[a](p),u=i.allowed("elements.move",{shapes:c});u&&n.moveElements(c,l)}}}rm.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const Jw={__depends__:[Fc,bn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",rm]};var om=10;function ao(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(c,p){var l=c.shape,u=c.direction,h=c.resizeConstraints,d;c.delta=p,d=pw(l,u,p),c.newBounds=uw(d,h),c.canExecute=r.canResize(c)}function a(c){var p=c.resizeConstraints,l=c.minBounds;p===void 0&&(l===void 0&&(l=r.computeMinResizeBox(c)),c.resizeConstraints={min:X(l)})}function s(c){var p=c.shape,l=c.canExecute,u=c.newBounds;if(l){if(u=Iu(u),!eS(p,u))return;n.resizeShape(p,u)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var p={x:c.dx,y:c.dy};o(c.context,p)}),e.on("resize.end",function(c){s(c.context)})}ao.prototype.canResize=function(e){var t=this._rules,n=un(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},ao.prototype.activate=function(e,t,n){var i=this._dragging,r,o;if(typeof n=="string"&&(n={direction:n}),r=N({shape:t},n),o=r.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");i.init(e,am(t,o),"resize",{autoActivate:!0,cursor:tS(o),data:{shape:t,context:r}})},ao.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,i,r;return i=e.minDimensions||{width:om,height:om},r=Gf(t,e.childrenBoxPadding),hw(n,t,i,r)},ao.$inject=["eventBus","rules","modeling","dragging"];function eS(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function am(e,t){var n=ne(e),i=X(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function tS(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var sm="djs-resizing",cm="resize-not-ok",nS=500;function pm(e,t,n){function i(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,sm)),s.width>5&&Y(c,{x:s.x,width:s.width}),s.height>5&&Y(c,{y:s.y,height:s.height}),o.canExecute?he(c).remove(cm):he(c).add(cm)}function r(o){var a=o.shape,s=o.frame;s&&Fe(o.frame),t.removeMarker(a,sm)}e.on("resize.move",nS,function(o){i(o.context)}),e.on("resize.cleanup",function(o){r(o.context)})}pm.$inject=["eventBus","canvas","previewSupport"];var Ya=-6,Xa=8,Za=20,so="djs-resizer",iS=["n","w","s","e","nw","ne","se","sw"];function ui(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&k(a,Ct(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}ui.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){ai(o)&&i.activate(o,e,n)}J.bind(t,"mousedown",r),J.bind(t,"touchstart",r)},ui.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=rS(i),a=Z("g");he(a).add(so),he(a).add(so+"-"+e.id),he(a).add(so+"-"+i),ee(r,a);var s=Z("rect");Y(s,{x:-Xa/2+o.x,y:-Xa/2+o.y,width:Xa,height:Xa}),he(s).add(so+"-visual"),ee(a,s);var c=Z("rect");return Y(c,{x:-Za/2+o.x,y:-Za/2+o.y,width:Za,height:Za}),he(c).add(so+"-hit"),ee(a,c),gc(a,t,n),a},ui.prototype.createResizer=function(e,t){var n=am(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},ui.prototype.addResizer=function(e){var t=this;De(e)||!this._resize.canResize({shape:e})||k(iS,function(n){t.createResizer(e,n)})},ui.prototype.removeResizers=function(){var e=this._getResizersParent();Ho(e)},ui.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},ui.$inject=["eventBus","canvas","selection","resize"];function rS(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Ya:e.indexOf("w")!==-1&&(t.x=Ya),e.indexOf("s")!==-1?t.y=-Ya:e.indexOf("n")!==-1&&(t.y=Ya),t}const lm={__depends__:[_n,$n,Qr],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ao],resizePreview:["type",pm],resizeHandles:["type",ui]};var oS=2e3;function co(e,t,n,i,r,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){i.isActive()&&i.complete()}),e.on(["shape.remove","connection.remove"],oS,function(c){i.isActive(c.element)&&i.cancel()}),e.on(["commandStack.changed"],function(c){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var p=c.context,l=p.shape,u=c.context.canExecute,h=c.isTouch;h||u&&(p.hints&&p.hints.createElementsBehavior===!1||s(l))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,p){(p||de(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||Ep(c))&&i.activate(c)}}co.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],co.prototype.activate=function(e){var t=Ut(e);if(t!==void 0){var n={text:t},i=this.getEditingBBox(e);N(n,i);var r={};return(de(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Ep(e))&&N(r,{centerVertically:!0}),ki(e)&&N(r,{autoResize:!0}),y(e,"bpmn:TextAnnotation")&&N(r,{resizable:!0,autoResize:!0}),N(n,{options:r}),n}},co.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2},o={x:i.x,y:i.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),p=c.fontSize*a,l=c.lineHeight,u=s.fontSize*a,h=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(y(e,"bpmn:Lane")||cS(e))&&(N(o,{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:r.y-30*a/2}),N(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:"rotate(-90deg)"})),(de(e,["bpmn:Task","bpmn:CallActivity"])||sS(e)||Ep(e))&&(N(o,{width:i.width,height:i.height}),N(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),aS(e)&&(N(o,{width:i.width,x:i.x}),N(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var f=90*a,v=7*a,g=4*a;if(n.labelTarget&&(N(o,{width:f,height:i.height+v+g,x:r.x-f/2,y:i.y-v}),N(d,{fontSize:p+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:g+"px"})),ki(n)&&!pa(n)&&!xe(n)){var R=Ac(e),E=t.getAbsoluteBBox({x:R.x,y:R.y,width:0,height:0}),_=p+v+g;N(o,{width:f,height:_,x:E.x-f/2,y:E.y-_/2}),N(d,{fontSize:p+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:g+"px"})}return y(e,"bpmn:TextAnnotation")&&(N(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),N(d,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:u+"px",lineHeight:h})),{bounds:o,style:d}},co.prototype.update=function(e,t,n,i){var r,o;y(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),pS(t)&&(t=null),this._modeling.updateLabel(e,t,r)};function Ep(e){return y(e,"bpmn:SubProcess")&&!ve(e)}function aS(e){return y(e,"bpmn:SubProcess")&&ve(e)}function sS(e){return y(e,"bpmn:Participant")&&!ve(e)}function cS(e){return y(e,"bpmn:Participant")&&ve(e)}function pS(e){return!e||!e.trim()}var um="djs-element-hidden",hm="djs-label-hidden";function dm(e,t,n){var i=this,r=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var p=c.active;if(o=p.element.label||p.element,y(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=Z("g");var l=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),u=i.path=Z("path");Y(u,{d:l,strokeWidth:2,stroke:lS(o)}),ee(s,u),ee(r,s),kt(s,o.x,o.y)}y(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,um):(y(o,"bpmn:Task")||y(o,"bpmn:CallActivity")||y(o,"bpmn:SubProcess")||y(o,"bpmn:Participant"))&&t.addMarker(o,hm)}),e.on("directEditing.resize",function(c){if(y(o,"bpmn:TextAnnotation")){var p=c.height,l=c.dy,u=Math.max(o.height/a.height*(p+l),0),h=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:u,position:{mx:0,my:0}});Y(i.path,{d:h})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var p=c.active;p&&(t.removeMarker(p.element.label||p.element,um),t.removeMarker(o,hm)),o=void 0,a=void 0,s&&(Fe(s),s=void 0)})}dm.$inject=["eventBus","canvas","pathMap"];function lS(e,t){var n=ge(e);return n.get("stroke")||t||"black"}const uS={__depends__:[jc,lm,_f],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",co],labelEditingPreview:["type",dm]};var wp=["top","bottom","left","right"],Qa=10;function Sp(e,t){V.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(r){var o=r.context,a=o.connection,s=a.source,c=a.target,p=o.hints||{};p.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(r){var o=r.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(r){var o=r.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(r){if(pa(r)){var o=fS(r);o&&i(r,o)}}function i(r,o){var a=ne(r),s=r.label,c=ne(s);if(s.parent){var p=X(r),l;switch(o){case"top":l={x:a.x,y:p.top-Qa-s.height/2};break;case"left":l={x:p.left-Qa-s.width/2,y:a.y};break;case"bottom":l={x:a.x,y:p.bottom+Qa+s.height/2};break;case"right":l={x:p.right+Qa+s.width/2,y:a.y};break}var u=tn(l,c);t.moveShape(s,u)}}}q(Sp,V),Sp.$inject=["eventBus","modeling"];function hS(e){var t=e.host,n=ne(e),i=lt(n,t),r;i.indexOf("-")>=0?r=i.split("-"):r=[i];var o=wp.filter(function(a){return r.indexOf(a)===-1});return o}function dS(e){var t=ne(e),n=[].concat(e.incoming.map(function(i){return i.waypoints[i.waypoints.length-2]}),e.outgoing.map(function(i){return i.waypoints[1]})).map(function(i){return fm(t,i)});return n}function fS(e){var t=ne(e.label),n=ne(e),i=fm(n,t);if(mS(i)){var r=dS(e);if(e.host){var o=hS(e);r=r.concat(o)}var a=wp.filter(function(s){return r.indexOf(s)===-1});if(a.indexOf(i)===-1)return a[0]}}function fm(e,t){return lt(t,e,5)}function mS(e){return wp.indexOf(e)!==-1}function Cp(e){V.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,i=t.shape;t.position||(y(i,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-i.height/2}:t.position={x:n.x+n.width+80+i.width/2,y:n.y+n.height/2})},!0)}q(Cp,V),Cp.$inject=["eventBus"];function Rp(e,t){e.invoke(V,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape,o=ce(r.incoming.concat(r.outgoing),function(a){return y(a,"bpmn:Association")});k(o,function(a){t.moveConnection(a,{x:0,y:0},i)})},!0)}q(Rp,V),Rp.$inject=["injector","modeling"];var mm=500;function Ja(e,t){t.invoke(V,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",mm,function(i){var r=i.elements;r=r.filter(function(o){var a=o.host;return vm(o,a)}),r.length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n._replaceShape(r[o],a)})},!0),this.preExecute("elements.move",mm,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];vm(a,o)&&(i.shapes=[n._replaceShape(a,o)])}},!0)}Ja.$inject=["bpmnReplace","injector"],q(Ja,V),Ja.prototype._replaceShape=function(e,t){var n=vS(e),i={type:"bpmn:BoundaryEvent",host:t};return n&&(i.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,i,{layoutConnection:!1})};function vS(e){var t=W(e),n=t.eventDefinitions;return n&&n[0]}function vm(e,t){return!xe(e)&&de(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Pp(e,t){V.call(this,e);function n(i){return ce(i.attachers,function(r){return y(r,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(i){var r=i.context.source,o=i.context.target,a=n(o);y(r,"bpmn:EventBasedGateway")&&y(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(i){var r=i.context.oldSource,o=i.context.newSource;y(r,"bpmn:Gateway")&&y(o,"bpmn:EventBasedGateway")&&k(o.outgoing,function(a){var s=a.target,c=n(s);y(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}Pp.$inject=["eventBus","modeling"],q(Pp,V);function kp(e){e.invoke(V,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;y(i,"bpmn:Lane")&&!y(r,"bpmn:Lane")&&(n.parent=Ta(i,"bpmn:Participant"))})}kp.$inject=["injector"],q(kp,V);function Tp(e,t){V.call(this,e),this.preExecute("shape.create",function(n){var i=n.context,r=i.shape;if(y(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=t.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Tp.$inject=["eventBus","bpmnFactory"],q(Tp,V);var Ap=20,Mp=20,ym=30,es=2e3;function Dp(e,t,n){V.call(this,t),t.on(["create.start","shape.move.start"],es,function(r){var o=r.context,a=o.shape,s=e.getRootElement();if(!(!y(a,"bpmn:Participant")||!y(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(u){return!y(u,"bpmn:Group")&&!xe(u)&&!De(u)});if(c.length){var p=Ve(c),l=yS(a,p);N(a,l),o.createConstraints=gS(a,p)}}}),t.on("create.start",es,function(r){var o=r.context,a=o.shape,s=e.getRootElement(),c=e.getGraphics(s);function p(l){l.element=s,l.gfx=c}y(a,"bpmn:Participant")&&y(s,"bpmn:Process")&&(t.on("element.hover",es,p),t.once("create.cleanup",function(){t.off("element.hover",p)}))});function i(){var r=e.getRootElement();return y(r,"bpmn:Collaboration")?r:n.makeCollaboration()}this.preExecute("elements.create",es,function(r){var o=r.elements,a=r.parent,s=bS(o),c;s&&y(a,"bpmn:Process")&&(r.parent=i(),c=r.hints=r.hints||{},c.participant=s,c.process=a,c.processRef=W(s).get("processRef"))},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;y(a,"bpmn:Participant")&&y(o,"bpmn:Process")&&(r.parent=i(),r.process=o,r.processRef=W(a).get("processRef"))},!0),this.execute("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.shape,c=o.participant;a&&(!c||s===c)&&W(s).set("processRef",W(a))},!0),this.revert("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.processRef||o.processRef,c=r.shape,p=o.participant;a&&(!p||c===p)&&W(c).set("processRef",s)},!0),this.postExecute("shape.create",function(r){var o=r.hints||{},a=r.process||r.hints.process,s=r.shape,c=o.participant;if(a){var p=a.children.slice();c?s===c&&n.moveElements(p,{x:0,y:0},c):n.moveElements(p,{x:0,y:0},s)}},!0)}Dp.$inject=["canvas","eventBus","modeling"],q(Dp,V);function yS(e,t){t={width:t.width+Ap*2+ym,height:t.height+Mp*2};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}function gS(e,t){return t=X(t),{bottom:t.top+e.height/2-Mp,left:t.right-e.width/2+Ap,top:t.bottom-e.height/2+Mp,right:t.left+e.width/2-Ap-ym}}function bS(e){return ye(e,function(t){return y(t,"bpmn:Participant")})}var gm="__targetRef_placeholder";function Bp(e,t){V.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],bm(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],bm(o));function n(a,s,c){var p=a.get("dataInputAssociations");return ye(p,function(l){return l!==c&&l.targetRef===s})}function i(a,s){var c=a.get("properties"),p=ye(c,function(l){return l.name===gm});return!p&&s&&(p=t.create("bpmn:Property",{name:gm}),Ze(c,p)),p}function r(a,s){var c=i(a);c&&(n(a,c,s)||We(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,p=c.businessObject,l=c.target,u=l&&l.businessObject,h=s.newTarget,d=h&&h.businessObject,f=s.oldTarget||s.target,v=f&&f.businessObject,g=c.businessObject,R;v&&v!==u&&r(v,p),d&&d!==u&&r(d,p),u?(R=i(u,!0),g.targetRef=R):g.targetRef=null}}Bp.$inject=["eventBus","bpmnFactory"],q(Bp,V);function bm(e){return function(t){var n=t.context,i=n.connection;if(y(i,"bpmn:DataInputAssociation"))return e(t)}}function ts(e){this._bpmnUpdater=e}ts.$inject=["bpmnUpdater"],ts.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},ts.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]};function Np(e,t,n,i){V.call(this,i),t.registerHandler("dataStore.updateContainment",ts);function r(){return n.filter(function(s){return y(s,"bpmn:Participant")&&W(s).processRef})[0]}function o(s){return s.children.filter(function(c){return y(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var p=s.businessObject||s;if(c=c||r(),c){var l=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:p,dataStoreDi:ge(s),newSemanticParent:l.processRef||l,newDiParent:ge(c)})}}this.preExecute("shape.create",function(s){var c=s.context,p=c.shape;y(p,"bpmn:DataStoreReference")&&p.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,p=c.shapes,l=p.filter(function(u){return y(u,"bpmn:DataStoreReference")});l.length&&(c.hints||(c.hints={}),c.hints.autoResize=p.filter(function(u){return!y(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,p=c.shape,l=p.parent;y(p,"bpmn:DataStoreReference")&&p.type!=="label"&&y(l,"bpmn:Collaboration")&&a(p)}),this.postExecute("shape.move",function(s){var c=s.context,p=c.shape,l=c.oldParent,u=p.parent;if(!y(l,"bpmn:Collaboration")&&y(p,"bpmn:DataStoreReference")&&p.type!=="label"&&y(u,"bpmn:Collaboration")){var h=y(l,"bpmn:Participant")?l:_S(l,"bpmn:Participant");a(p,h)}}),this.postExecute("shape.delete",function(s){var c=s.context,p=c.shape,l=e.getRootElement();de(p,["bpmn:Participant","bpmn:SubProcess"])&&y(l,"bpmn:Collaboration")&&o(l).filter(function(u){return xS(u,p)}).forEach(function(u){a(u)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,p=c.oldRoot,l=c.newRoot,u=o(p);u.forEach(function(h){y(l,"bpmn:Process")&&a(h,l)})})}Np.$inject=["canvas","commandStack","elementRegistry","eventBus"],q(Np,V);function xS(e,t){for(var n=e.businessObject||e,i=t.businessObject||t;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}function _S(e,t){for(;e.parent;){if(y(e.parent,t))return e.parent;e=e.parent}}var ES=500;function Op(e,t){V.call(this,e);function n(i,r){var o=Li(r),a=[],s=[];if(Si(o,function(u){return u.y>i.y?s.push(u):a.push(u),u.children}),!!o.length){var c;s.length&&a.length?c=i.height/2:c=i.height;var p,l;a.length&&(p=t.calculateAdjustments(a,"y",c,i.y-10),t.makeSpace(p.movingShapes,p.resizingShapes,{x:0,y:c},"s")),s.length&&(l=t.calculateAdjustments(s,"y",-c,i.y+i.height+10),t.makeSpace(l.movingShapes,l.resizingShapes,{x:0,y:-c},"n"))}}this.postExecuted("shape.delete",ES,function(i){var r=i.context,o=r.hints,a=r.shape,s=r.oldParent;y(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}Op.$inject=["eventBus","spaceTool"],q(Op,V);var xm=500;function ns(e,t){t.invoke(V,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",xm,function(i){var r=i.elements;r.filter(function(o){var a=o.host;return _m(o,a)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n._replaceShape(r[o])})},!0),this.preExecute("elements.move",xm,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,s){var c=a.host;_m(a,SS(r,c)?c:o)&&(r[s]=n._replaceShape(a))})},!0)}ns.$inject=["bpmnReplace","injector"],q(ns,V),ns.prototype._replaceShape=function(e){var t=wS(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function wS(e){var t=W(e),n=t.eventDefinitions;return n&&n[0]}function _m(e,t){return!xe(e)&&y(e,"bpmn:BoundaryEvent")&&!t}function SS(e,t){return e.indexOf(t)!==-1}function jp(e,t,n){V.call(this,e);function i(r,o,a){var s=o.waypoints,c,p,l,u,h,d,f,v=r.outgoing.slice(),g=r.incoming.slice(),R;ie(a.width)?R=ne(a):R=a;var E=op(s,R);if(E){if(c=s.slice(0,E.index),p=s.slice(E.index+(E.bendpoint?1:0)),!c.length||!p.length)return;l=E.bendpoint?s[E.index]:R,(c.length===1||!Em(r,c[c.length-1]))&&c.push(wm(l)),(p.length===1||!Em(r,p[0]))&&p.unshift(wm(l))}u=o.source,h=o.target,t.canConnect(u,r,o)&&(n.reconnectEnd(o,r,c||R),d=o),t.canConnect(r,h,o)&&(d?f=n.connect(r,h,{type:o.type,waypoints:p}):(n.reconnectStart(o,r,p||R),f=o));var _=[].concat(d&&ce(g,function(x){return x.source===d.source})||[],f&&ce(v,function(x){return x.target===f.target})||[]);_.length&&n.removeElements(_)}this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,s=r.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(r.newParent=o=o.parent);var p=ne(c),l={x:p.x+s.x,y:p.y+s.y},u=ye(o.children,function(h){var d=t.canInsert(a,h);return d&&op(h.waypoints,l)});u&&(r.targetFlow=u,r.position=l)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,s=r.position;a&&i(o[0],a,s)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;t.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,s=r.position;a&&i(o,a,s)},!0)}q(jp,V),jp.$inject=["eventBus","bpmnRules","modeling"];function Em(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function wm(e){return N({},e)}function Lp(e,t){V.call(this,e),this.preExecuted("connection.create",function(n){var i=n.context,r=i.connection,o=i.source,a=i.target,s=i.hints;if(!(s&&s.createElementsBehavior===!1)&&fr(r)){var c=[];y(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(fr):c=a.incoming.filter(function(p){return fr(p)&&y(p.source,"bpmn:EventBasedGateway")}),c.forEach(function(p){t.removeConnection(p)})}}),this.preExecuted("shape.replace",function(n){var i=n.context,r=i.newShape;if(y(r,"bpmn:EventBasedGateway")){var o=r.outgoing.filter(fr).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(fr).forEach(function(s){const c=a.incoming.filter(fr).filter(function(p){return p.source===r});(s.source!==r||c.length>1)&&t.removeConnection(s)})})}})}Lp.$inject=["eventBus","modeling"],q(Lp,V);function fr(e){return y(e,"bpmn:SequenceFlow")}var is=1500,CS=2e3;function Sm(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],is,function(i){var r=i.context,o=r.shape||i.shape,a=i.hover;y(a,"bpmn:Lane")&&!de(o,["bpmn:Lane","bpmn:Participant"])&&(i.hover=on(a),i.hoverGfx=e.getGraphics(i.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||y(o,"bpmn:Group"))&&(i.hover=s,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],is,function(i){var r=i.hover;y(r,"bpmn:Lane")&&(i.hover=on(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],is,function(i){var r=i.context,o=i.hover,a=r.type;y(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=on(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],is,function(i){var r=i.context,o=r.start;y(o,"bpmn:Lane")&&(r.start=on(o)||o)}),t.on("shape.move.start",CS,function(i){var r=i.shape;y(r,"bpmn:Lane")&&(i.shape=on(r)||r)})}Sm.$inject=["elementRegistry","eventBus","canvas"];function RS(e){return e.create("bpmn:Category")}function PS(e){return e.create("bpmn:CategoryValue")}function kS(e,t,n){return Ze(t.get("categoryValue"),e),e.$parent=t,Ze(n.get("rootElements"),t),t.$parent=n,e}function TS(e){var t=e.$parent;return t&&(We(t.get("categoryValue"),e),e.$parent=null),e}function AS(e){var t=e.$parent;return t&&(We(t.get("rootElements"),e),e.$parent=null),e}var Cm=770;function Ip(e,t,n,i,r,o){r.invoke(V,this);function a(){return n.filter(function(f){return y(f,"bpmn:Group")})}function s(f,v){return f.some(function(g){var R=W(g),E=R.categoryValueRef&&R.categoryValueRef.$parent;return E===v})}function c(f,v){return f.some(function(g){var R=W(g);return R.categoryValueRef===v})}function p(f,v,g){var R=a().filter(function(E){return E.businessObject!==g});v&&!s(R,v)&&AS(v),f&&!c(R,f)&&TS(f)}function l(f,v){return kS(f,v,t.getDefinitions())}function u(f,v){var g=W(f),R=g.categoryValueRef;R||(R=g.categoryValueRef=v.categoryValue=v.categoryValue||PS(e));var E=R.$parent;E||(E=R.$parent=v.category=v.category||RS(e)),l(R,E,t.getDefinitions())}function h(f,v){var g=v.category,R=v.categoryValue,E=W(f);R?(E.categoryValueRef=null,p(R,g,E)):p(null,E.categoryValueRef.$parent,E)}this.execute("label.create",function(f){var v=f.context,g=v.labelTarget;y(g,"bpmn:Group")&&u(g,v)}),this.revert("label.create",function(f){var v=f.context,g=v.labelTarget;y(g,"bpmn:Group")&&h(g,v)}),this.execute("shape.delete",function(f){var v=f.context,g=v.shape,R=W(g);if(!(!y(g,"bpmn:Group")||g.labelTarget)){var E=v.categoryValue=R.categoryValueRef,_;E&&(_=v.category=E.$parent,p(E,_,R),R.categoryValueRef=null)}}),this.reverted("shape.delete",function(f){var v=f.context,g=v.shape;if(!(!y(g,"bpmn:Group")||g.labelTarget)){var R=v.category,E=v.categoryValue,_=W(g);E&&(_.categoryValueRef=E,l(E,R))}}),this.execute("shape.create",function(f){var v=f.context,g=v.shape;!y(g,"bpmn:Group")||g.labelTarget||W(g).categoryValueRef&&u(g,v)}),this.reverted("shape.create",function(f){var v=f.context,g=v.shape;!y(g,"bpmn:Group")||g.labelTarget||W(g).categoryValueRef&&h(g,v)});function d(f,v){var g=e.create(f.$type);return o.copyElement(f,g,null,v)}i.on("copyPaste.copyElement",Cm,function(f){var v=f.descriptor,g=f.element;if(!(!y(g,"bpmn:Group")||g.labelTarget)){var R=W(g);if(R.categoryValueRef){var E=R.categoryValueRef;v.categoryValue=d(E,!0),E.$parent&&(v.category=d(E.$parent,!0))}}}),i.on("copyPaste.pasteElement",Cm,function(f){var v=f.descriptor,g=v.businessObject,R=v.categoryValue,E=v.category;R&&(R=g.categoryValueRef=d(R)),E&&(R.$parent=d(E)),delete v.category,delete v.categoryValue})}Ip.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],q(Ip,V);function $p(e,t,n,i){var r,o,a,s,c;return r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y),r==0?null:(o=e.y-n.y,a=e.x-n.x,c=(i.x-n.x)*o-(i.y-n.y)*a,s=c/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Rm(e){function t(i,r,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=$p(i,r,o,a),p=$p(i,r,o,s),l;c&&p?Pm(c,o)>Pm(p,o)?l=p:l=c:l=c||p,i.original=l}function n(i){var r=i.waypoints;t(r[0],r[1],ne(i.source)),t(r[r.length-1],r[r.length-2],ne(i.target))}e.on("bpmnElement.added",function(i){var r=i.element;r.waypoints&&n(r)})}Rm.$inject=["eventBus"];function Pm(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function zp(e){V.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=n.context.shape,r=W(i),o=ge(i);de(r,t)&&!o.get("isHorizontal")&&o.set("isHorizontal",!0)})}zp.$inject=["eventBus"],q(zp,V);var km=Math.sqrt,Tm=Math.min,MS=Math.max,Am=Math.abs;function Mm(e){return Math.pow(e,2)}function po(e,t){return km(Mm(e.x-t.x)+Mm(e.y-t.y))}function DS(e,t){var n=0,i,r,o,a,s,c,p,l,u,h,d;for(n=0;n line intersections");p.length===1&&(l={type:"bendpoint",position:p[0],segmentIndex:n,bendpointIndex:Bm(i,p[0])?n:n+1}),p.length===2&&(s=OS(p[0],p[1]),l={type:"segment",position:s,segmentIndex:n,relativeLocation:po(i,s)/po(i,r)}),u=po(l.position,e),(!d||h>u)&&(d=l,h=u)}return d}function BS(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,p=r*a+o*s,l=a*a+s*s-i*i,u=p/c,h=l/c,d=u*u-h;if(d<0&&d>-1e-6&&(d=0),d<0)return[];var f=km(d),v=-u+f,g=-u-f,R={x:e.x-r*v,y:e.y-o*v};if(d===0)return[R];var E={x:e.x-r*g,y:e.y-o*g};return[R,E].filter(function(_){return NS(_,e,t)})}function NS(e,t,n){return Dm(e.x,t.x,n.x)&&Dm(e.y,t.y,n.y)}function Dm(e,t,n){return e>=Tm(t,n)-rs&&e<=MS(t,n)+rs}function OS(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var rs=.1;function Bm(e,t){return Am(e.x-t.x)<=rs&&Am(e.y-t.y)<=rs}function jS(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o=p&&(l=c?r+1:r-1),rt.length-2||p===null)return a;var l=jm(n,c),u=jm(t,p),h=s.position,d=IS(l,h),f=LS(l,u);if(s.type==="bendpoint"){var v=t.length-n.length,g=s.bendpointIndex,R=n[g];if(t.indexOf(R)!==-1)return a;if(v===0){var E=t[g];return r=E.x-s.position.x,o=E.y-s.position.y,{delta:{x:r,y:o},point:{x:e.x+r,y:e.y+o}}}v<0&&g!==0&&g{W(a.context.element)===a.context.moddleElement&&r(a)});function r(a){var s=a.context,c=s.element,p=s.properties;if(Im in p&&t.updateLabel(c,p[Im]),$m in p&&y(c,"bpmn:TextAnnotation")){var l=i.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},p[$m]||"");t.updateLabel(c,p.text,l)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var p=s.shape||s.connection;xe(p)||!ki(p)||Ut(p)&&t.updateLabel(p,Ut(p))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,p=s.hints||{};c&&p.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,p=c.label,l=N({},s.hints),u=s.newWaypoints||c.waypoints,h=s.oldWaypoints;return typeof l.startChanged>"u"&&(l.startChanged=!!l.connectionStart),typeof l.endChanged>"u"&&(l.endChanged=!!l.connectionEnd),$S(p,u,h,l)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var p=s.connection,l=p.label,u;!l||!l.parent||(u=o(a),t.moveShape(l,u))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,p=s.oldShape,l=W(c);l&&ki(l)&&p.label&&c.label&&(c.label.x=p.label.x,c.label.y=p.label.y)}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,p=s.newBounds,l=s.oldBounds;if(pa(c)){var u=c.label,h=ne(u),d=US(l),f=WS(h,d),v=VS(f,l,p);t.moveShape(u,v)}})}q(Fp,V),Fp.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function VS(e,t,n){var i=lo(e,t,n);return ti(tn(i,e))}function WS(e,t){if(t.length){var n=qS(e,t);return ap(e,n)}}function US(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function qS(e,t){var n=t.map(function(r){return{line:r,distance:Gd(e,r)}}),i=ln(n,"distance");return i[0].line}function KS(e,t,n,i){return Nm(e,t,n,i).point}function Hp(e,t){V.call(this,e);function n(i,r){var o=i.context,a=o.connection,s=N({},o.hints),c=o.newWaypoints||a.waypoints,p=o.oldWaypoints;return typeof s.startChanged>"u"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged>"u"&&(s.endChanged=!!s.connectionEnd),KS(r,c,p,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var p=c.waypoints[c.waypoints.length-1],l=n(i,p),u=[].concat(c.waypoints.slice(0,-1),[l]);t.updateWaypoints(c,u)}),a.forEach(function(c){var p=c.waypoints[0],l=n(i,p),u=[].concat([l],c.waypoints.slice(1));t.updateWaypoints(c,u)})}),this.postExecute(["connection.move"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming,c=r.delta;s.forEach(function(p){var l=p.waypoints[p.waypoints.length-1],u={x:l.x+c.x,y:l.y+c.y},h=[].concat(p.waypoints.slice(0,-1),[u]);t.updateWaypoints(p,h)}),a.forEach(function(p){var l=p.waypoints[0],u={x:l.x+c.x,y:l.y+c.y},h=[].concat([u],p.waypoints.slice(1));t.updateWaypoints(p,h)})})}q(Hp,V),Hp.$inject=["eventBus","modeling"];function os(e,t,n){var i=ss(e),r=Fm(i,t),o=i[0];return r.length?r[r.length-1]:lo(o.original||o,n,t)}function as(e,t,n){var i=ss(e),r=Fm(i,t),o=i[i.length-1];return r.length?r[0]:lo(o.original||o,n,t)}function Gp(e,t,n){var i=ss(e),r=zm(t,n),o=i[0];return lo(o.original||o,r,t)}function Vp(e,t,n){var i=ss(e),r=zm(t,n),o=i[i.length-1];return lo(o.original||o,r,t)}function zm(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ss(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Fm(e,t){var n=bt(e,XS);return ce(n,function(i){return YS(i,t)})}function YS(e,t){return lt(t,e,1)==="intersect"}function XS(e){return e.original||e}function Wp(e,t){V.call(this,e),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(ZS(i,r)){var o=QS(i);o.incoming.forEach(function(a){var s=as(a,r,i);t.reconnectEnd(a,r,s)}),o.outgoing.forEach(function(a){var s=os(a,r,i);t.reconnectStart(a,r,s)})}},!0)}Wp.$inject=["eventBus","modeling"],q(Wp,V);function ZS(e,t){return y(e,"bpmn:Participant")&&ve(e)&&y(t,"bpmn:Participant")&&!ve(t)}function QS(e){var t=Pr([e],!1),n=[],i=[];return t.forEach(function(r){r!==e&&(r.incoming.forEach(function(o){y(o,"bpmn:MessageFlow")&&n.push(o)}),r.outgoing.forEach(function(o){y(o,"bpmn:MessageFlow")&&i.push(o)}))},[]),{incoming:n,outgoing:i}}var JS="flow elements must be children of pools/participants";function Hm(e,t,n){function i(r,o,a){t.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:a||2e3,html:"
    "+o+"
    "})}e.on(["shape.move.rejected","create.rejected"],function(r){var o=r.context,a=o.shape,s=o.target;y(s,"bpmn:Collaboration")&&y(a,"bpmn:FlowNode")&&i(r,n(JS))})}Hm.$inject=["eventBus","tooltips","translate"];function Up(e,t){V.call(this,e),this.preExecute("shape.resize",function(n){var i=n.shape,r=ge(i),o=r&&r.get("label"),a=o&&o.get("bounds");a&&t.updateModdleProperties(i,o,{bounds:void 0})},!0)}q(Up,V),Up.$inject=["eventBus","modeling"];function qp(e,t,n){V.call(this,e),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(!(r.incoming.length!==1||r.outgoing.length!==1)){var o=r.incoming[0],a=r.outgoing[0];if(!(!y(o,"bpmn:SequenceFlow")||!y(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=eC(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}q(qp,V),qp.$inject=["eventBus","bpmnRules","modeling"];function mr(e){return e.original||e}function eC(e,t){var n=$p(mr(e[e.length-2]),mr(e[e.length-1]),mr(t[1]),mr(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[mr(e[0]),mr(t[t.length-1])]}function Kp(e,t){V.call(this,e),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;y(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;i&&!i.businessObject.participants.length&&t.makeProcess()},!0)}Kp.$inject=["eventBus","modeling"],q(Kp,V);function Yp(e,t,n,i){V.call(this,e);var r=i.get("dragging",!1);function o(c){var p=c.source,l=c.target,u=c.parent;if(u){var h,d;y(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(p,l)||(d=!0),n.canConnectMessageFlow(p,l)&&(h="bpmn:MessageFlow")),y(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(p,l)||(d=!0),n.canConnectSequenceFlow(p,l)&&(h="bpmn:SequenceFlow")),y(c,"bpmn:Association")&&!n.canConnectAssociation(p,l)&&(d=!0),d&&t.removeConnection(c),h&&t.connect(p,l,{type:h,waypoints:c.waypoints.slice()})}}function a(c){var p=c.context,l=p.connection,u=p.newSource||l.source,h=p.newTarget||l.target,d,f;d=n.canConnect(u,h),!(!d||d.type===l.type)&&(f=t.connect(u,h,{type:d.type,waypoints:l.waypoints.slice()}),t.removeConnection(l),p.connection=f,r&&s(l,f))}function s(c,p){var l=r.context(),u=l&&l.payload.previousSelection,h;!u||!u.length||(h=u.indexOf(c),h!==-1&&u.splice(h,1,p))}this.postExecuted("elements.move",function(c){var p=c.closure,l=p.allConnections;k(l,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var p=c.context,l=p.properties,u=p.element,h=u.businessObject,d;l.default&&(d=ye(u.outgoing,hn({id:u.businessObject.default.id})),d&&t.updateProperties(d,{conditionExpression:void 0})),l.conditionExpression&&h.sourceRef.default===h&&t.updateProperties(u.source,{default:void 0})})}q(Yp,V),Yp.$inject=["eventBus","modeling","bpmnRules","injector"];function cs(e,t,n,i,r,o){i.invoke(V,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,p=s.elements,l=Gt(p,function(u,h){var d=t.canReplace([h],h.host||h.parent||c);return d?u.concat(d.replacements):u},[]);l.length&&this._replaceElements(p,l)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,p=s.newHost,l=[];k(s.closure.topLevel,function(h){Ot(h)?l=l.concat(h.children):l=l.concat(h)}),l.length===1&&p&&(c=p);var u=t.canReplace(l,c);u&&this._replaceElements(l,u.replacements,p)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,p=s.newShape,l=c.attachers,u;l&&l.length&&(u=t.canReplace(l,p),this._replaceElements(l,u.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,p=s.newShape;r.unclaimId(c.businessObject.id,c.businessObject),r.updateProperties(p,{id:c.id})})}q(cs,V),cs.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;k(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=i.replaceElement(s,a,{select:!1})}),t&&r.select(e)},cs.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var tC=1500,nC={width:140,height:120},$i={width:300,height:60},uo={width:300,height:150},Gm={width:140,height:120},Vm={width:50,height:30};function Wm(e){e.on("resize.start",tC,function(t){var n=t.context,i=n.shape,r=n.direction,o=n.balanced;(y(i,"bpmn:Lane")||y(i,"bpmn:Participant"))&&(n.resizeConstraints=pC(i,r,o)),y(i,"bpmn:Participant")&&(n.minDimensions=uo),y(i,"bpmn:SubProcess")&&ve(i)&&(n.minDimensions=Gm),y(i,"bpmn:TextAnnotation")&&(n.minDimensions=Vm)})}Wm.$inject=["eventBus"];var ps=Math.abs,iC=Math.min,rC=Math.max;function Um(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function ls(e,t,n){return Um(e,t,n,iC)}function us(e,t,n){return Um(e,t,n,rC)}var oC=20,aC=50,sC=20,cC=20;function pC(e,t,n){var i=on(e),r=!0,o=!0,a=Ha(i,[i]),s=X(e),c={},p={};/e/.test(t)?p.right=s.left+$i.width:/w/.test(t)&&(p.left=s.right-$i.width),a.forEach(function(u){var h=X(u);/n/.test(t)&&(h.tops.bottom+10&&(o=!1),n&&ps(s.bottom-h.top)<10&&ls(c,"bottom",h.bottom-$i.height),ps(s.bottom-h.bottom)<5&&us(p,"bottom",h.top+$i.height))});var l=i.children.filter(function(u){return!u.hidden&&!u.waypoints&&(y(u,"bpmn:FlowElement")||y(u,"bpmn:Artifact"))});return l.forEach(function(u){var h=X(u);r&&/n/.test(t)&&ls(p,"top",h.top-sC),/e/.test(t)&&us(p,"right",h.right+oC),o&&/s/.test(t)&&us(p,"bottom",h.bottom+cC),/w/.test(t)&&ls(p,"left",h.left-aC)}),{min:p,max:c}}var qm=1001;function Km(e,t){e.on("resize.start",qm+500,function(n){var i=n.context,r=i.shape;(y(r,"bpmn:Lane")||y(r,"bpmn:Participant"))&&(i.balanced=!ir(n))}),e.on("resize.end",qm,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(y(r,"bpmn:Lane")||y(r,"bpmn:Participant"))return o&&(a=Iu(a),t.resizeLane(r,a,i.balanced)),!1})}Km.$inject=["eventBus","modeling"];var lC=500;function Xp(e,t,n,i,r){n.invoke(V,this);function o(l){return de(l,["bpmn:ReceiveTask","bpmn:SendTask"])||uC(l,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(l){var u=e.getDefinitions(),h=u.get("rootElements");return!!ye(h,hn({id:l.id}))}function s(l){if(y(l,"bpmn:ErrorEventDefinition"))return"errorRef";if(y(l,"bpmn:EscalationEventDefinition"))return"escalationRef";if(y(l,"bpmn:MessageEventDefinition"))return"messageRef";if(y(l,"bpmn:SignalEventDefinition"))return"signalRef"}function c(l){if(de(l,["bpmn:ReceiveTask","bpmn:SendTask"]))return l.get("messageRef");var u=l.get("eventDefinitions"),h=u[0];return h.get(s(h))}function p(l,u){if(de(l,["bpmn:ReceiveTask","bpmn:SendTask"]))return l.set("messageRef",u);var h=l.get("eventDefinitions"),d=h[0];return d.set(s(d),u)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(l){var u=l.shape||l.element;if(o(u)){var h=W(u),d=c(h),f;d&&!a(d)&&(f=e.getDefinitions().get("rootElements"),Ze(f,d),l.addedRootElement=d)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(l){var u=l.addedRootElement;if(u){var h=e.getDefinitions().get("rootElements");We(h,u)}},!0),t.on("copyPaste.copyElement",function(l){var u=l.descriptor,h=l.element;if(!(h.labelTarget||!o(h))){var d=W(h),f=c(d);f&&(u.referencedRootElement=f)}}),t.on("copyPaste.pasteElement",lC,function(l){var u=l.descriptor,h=u.businessObject,d=u.referencedRootElement;d&&(a(d)||(d=i.copyElement(d,r.create(d.$type))),p(h,d),delete u.referencedRootElement)})}Xp.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],q(Xp,V);function uC(e,t){return le(t)||(t=[t]),kn(t,function(n){return ca(e,n)})}var hC=Math.max;function Ym(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return k(n,function(a){var s=a.id;y(a,"bpmn:Participant")&&(dC(i)?o[s]=uo:o[s]={width:uo.width,height:fC(a,r)}),y(a,"bpmn:SubProcess")&&ve(a)&&(o[s]=Gm),y(a,"bpmn:TextAnnotation")&&(o[s]=Vm),y(a,"bpmn:Group")&&(o[s]=nC)}),o})}Ym.$inject=["eventBus"];function dC(e){return e==="x"}function fC(e,t){var n;return mC(e)?(n=vC(e,t),hC(uo.height,n)):uo.height}function mC(e){return!!Li(e).length}function vC(e,t){var n=Li(e),i;return i=Xm(n,t),e.height-i.height+$i.height}function Xm(e,t){var n,i,r;for(n=0;n=i.y&&t<=i.y+i.height)return r=Li(i),r.length?Xm(r,t):i}var Zm=400,yC=600,Qm={x:180,y:160};function hi(e,t,n,i,r,o,a){V.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(u){return y(u,"bpmn:SubProcess")&&!ve(u)}function p(u){var h=u.shape,d=u.newRootElement,f=W(h);d=s._addDiagram(d||f),u.newRootElement=e.addRootElement(d)}function l(u){var h=u.shape,d=W(h);s._removeDiagram(d);var f=u.newRootElement=a.get(Ln(d));e.removeRootElement(f)}this.executed("shape.create",function(u){var h=u.shape;c(h)&&p(u)},!0),this.postExecuted("shape.create",function(u){var h=u.shape,d=u.newRootElement;!d||!h.children||(s._showRecursively(h.children),s._moveChildrenToShape(h,d))},!0),this.reverted("shape.create",function(u){var h=u.shape;c(h)&&l(u)},!0),this.preExecuted("shape.delete",function(u){var h=u.shape;if(c(h)){var d=a.get(Ln(h));d&&n.removeElements(d.children.slice())}},!0),this.executed("shape.delete",function(u){var h=u.shape;c(h)&&l(u)},!0),this.reverted("shape.delete",function(u){var h=u.shape;c(h)&&p(u)},!0),this.preExecuted("shape.replace",function(u){var h=u.oldShape,d=u.newShape;!c(h)||!c(d)||(u.oldRoot=e.removeRootElement(Ln(h)))},!0),this.postExecuted("shape.replace",function(u){var h=u.newShape,d=u.oldRoot,f=e.findRoot(Ln(h));if(!(!d||!f)){var v=d.children;n.moveElements(v,{x:0,y:0},f)}},!0),this.executed("element.updateProperties",function(u){var h=u.element;if(y(h,"bpmn:SubProcess")){var d=u.properties,f=u.oldProperties,v=f.id,g=d.id;if(v!==g){if($c(h)){a.updateId(h,Mi(g)),a.updateId(v,g);return}var R=a.get(Mi(v));R&&a.updateId(Mi(v),Mi(g))}}},!0),this.reverted("element.updateProperties",function(u){var h=u.element;if(y(h,"bpmn:SubProcess")){var d=u.properties,f=u.oldProperties,v=f.id,g=d.id;if(v!==g){if($c(h)){a.updateId(h,Mi(v)),a.updateId(g,v);return}var R=a.get(Mi(g));R&&a.updateId(R,Mi(v))}}},!0),t.on("element.changed",function(u){var h=u.element;if($c(h)){var d=h,f=a.get(Vh(d));!f||f===d||t.fire("element.changed",{element:f})}}),this.executed("shape.toggleCollapse",Zm,function(u){var h=u.shape;y(h,"bpmn:SubProcess")&&(ve(h)?l(u):(p(u),s._showRecursively(h.children)))},!0),this.reverted("shape.toggleCollapse",Zm,function(u){var h=u.shape;y(h,"bpmn:SubProcess")&&(ve(h)?l(u):(p(u),s._showRecursively(h.children)))},!0),this.postExecuted("shape.toggleCollapse",yC,function(u){var h=u.shape;if(y(h,"bpmn:SubProcess")){var d=u.newRootElement;d&&(ve(h)?s._moveChildrenToShape(d,h):s._moveChildrenToShape(h,d))}},!0),t.on("copyPaste.createTree",function(u){var h=u.element,d=u.children;if(c(h)){var f=Ln(h),v=a.get(f);v&&d.push.apply(d,v.children)}}),t.on("copyPaste.copyElement",function(u){var h=u.descriptor,d=u.element,f=u.elements,v=d.parent,g=y(ge(v),"bpmndi:BPMNPlane");if(g){var R=Vh(v),E=ye(f,function(_){return _.id===R});E&&(h.parent=E.id)}}),t.on("copyPaste.pasteElement",function(u){var h=u.descriptor;h.parent&&(c(h.parent)||h.parent.hidden)&&(h.hidden=!0)})}q(hi,V),hi.prototype._moveChildrenToShape=function(e,t){var n=this._modeling,i=e.children,r;if(i){i=i.concat(i.reduce(function(p,l){return l.label&&l.label.parent!==e?p.concat(l.label):p},[]));var o=i.filter(function(p){return!p.hidden});if(!o.length){n.moveElements(i,{x:0,y:0},t,{autoResize:!1});return}var a=Ve(o);if(!t.x)r={x:Qm.x-a.x,y:Qm.y-a.y};else{var s=ne(t),c=ne(a);r={x:s.x-c.x,y:s.y-c.y}}n.moveElements(i,r,t,{autoResize:!1})}},hi.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach(function(r){r.hidden=!!t,i=i.concat(r),r.children&&(i=i.concat(n._showRecursively(r.children,r.collapsed||t)))}),i},hi.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e},hi.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});i.$parent=r;var o=n.createRoot({id:Ln(e),type:e.$type,di:i,businessObject:e,collapsed:!0});return o},hi.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,i=ye(n,function(r){return r.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(i),1),i},hi.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function Zp(e,t){e.invoke(V,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(!(!y(r,"bpmn:SubProcess")||!(y(i,"bpmn:Task")||y(i,"bpmn:CallActivity"))||!ve(r))){var o=gC(r);t.createShape({type:"bpmn:StartEvent"},o,r)}})}Zp.$inject=["injector","modeling"],q(Zp,V);function gC(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function Qp(e,t){V.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var i=n.shape;if(ve(i))return;var r=Pr(i);r.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();k(s,function(p){o(p,!0)}),k(c,function(p){o(p,!1)})});function o(a,s){r.indexOf(a.source)!==-1&&r.indexOf(a.target)!==-1||(s?t.reconnectEnd(a,i,ne(i)):t.reconnectStart(a,i,ne(i)))}},!0)}q(Qp,V),Qp.$inject=["eventBus","modeling"];var Jp=500;function el(e,t,n){V.call(this,e);function i(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function r(a,s){var c=a.children,p=s,l,u;return l=bC(c).concat([a]),u=Gf(l),u?(p.width=Math.max(u.width,p.width),p.height=Math.max(u.height,p.height),p.x=u.x+(u.width-p.width)/2,p.y=u.y+(u.height-p.height)/2):(p.x=a.x+(a.width-p.width)/2,p.y=a.y+(a.height-p.height)/2),p}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],Jp,function(a){var s=a.context,c=s.shape;y(c,"bpmn:SubProcess")&&(c.collapsed?ge(c).isExpanded=!1:(i(c.children),ge(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],Jp,function(a){var s=a.context,c=s.shape;c.collapsed?ge(c).isExpanded=!1:ge(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],Jp,function(a){var s=a.context.shape,c=t.getDefaultSize(s),p;s.collapsed?p=o(s,c):p=r(s,c),n.resizeShape(s,p,null,{autoResize:s.collapsed?!1:"nwse"})})}q(el,V),el.$inject=["eventBus","elementFactory","modeling"];function bC(e){return e.filter(function(t){return!t.hidden})}function tl(e,t,n,i){t.invoke(V,this),this.preExecute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.businessObject;xe(a)||(y(a,"bpmn:Participant")&&ve(a)&&n.ids.unclaim(s.processRef.id),i.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(r){var o=r.context,a=o.connection,s=a.businessObject;i.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var r=e.getRootElement(),o=r.businessObject;y(r,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}q(tl,V),tl.$inject=["canvas","injector","moddle","modeling"];function nl(e,t){V.call(this,e),this.preExecute("connection.delete",function(n){var i=n.context,r=i.connection,o=r.source;xC(r,o)&&t.updateProperties(o,{default:null})})}q(nl,V),nl.$inject=["eventBus","modeling"];function xC(e,t){if(!y(e,"bpmn:SequenceFlow"))return!1;var n=W(t),i=W(e);return n.get("default")===i}var _C=500,EC=5e3;function il(e,t,n){V.call(this,e);var i;function r(){return i=i||new wC,i.enter(),i}function o(){if(!i)throw new Error(n("out of bounds release"));return i}function a(){if(!i)throw new Error(n("out of bounds release"));var c=i.leave();return c&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null),c}var s=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(s,EC,function(c){r()}),this.postExecuted(s,_C,function(c){a()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(c){var p=c.context,l=p.shape,u=o();l.labelTarget||(y(l,"bpmn:Lane")&&u.addLane(l),y(l,"bpmn:FlowNode")&&u.addFlowNode(l))})}il.$inject=["eventBus","modeling","translate"],q(il,V);function wC(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}const SC={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior"],adaptiveLabelPositioningBehavior:["type",Sp],appendBehavior:["type",Cp],associationBehavior:["type",Rp],attachEventBehavior:["type",Ja],boundaryEventBehavior:["type",Pp],createBehavior:["type",kp],createDataObjectBehavior:["type",Tp],createParticipantBehavior:["type",Dp],dataInputAssociationBehavior:["type",Bp],dataStoreBehavior:["type",Np],deleteLaneBehavior:["type",Op],detachEventBehavior:["type",ns],dropOnFlowBehavior:["type",jp],eventBasedGatewayBehavior:["type",Lp],fixHoverBehavior:["type",Sm],groupBehavior:["type",Ip],importDockingFix:["type",Rm],isHorizontalFix:["type",zp],labelBehavior:["type",Fp],layoutConnectionBehavior:["type",Hp],messageFlowBehavior:["type",Wp],modelingFeedback:["type",Hm],removeElementBehavior:["type",qp],removeEmbeddedLabelBoundsBehavior:["type",Up],removeParticipantBehavior:["type",Kp],replaceConnectionBehavior:["type",Yp],replaceElementBehaviour:["type",cs],resizeBehavior:["type",Wm],resizeLaneBehavior:["type",Km],rootElementReferenceBehavior:["type",Xp],spaceToolBehavior:["type",Ym],subProcessPlaneBehavior:["type",hi],subProcessStartEventBehavior:["type",Zp],toggleCollapseConnectionBehaviour:["type",Qp],toggleElementCollapseBehaviour:["type",el],unclaimIdBehavior:["type",tl],unsetDefaultFlowBehavior:["type",nl],updateFlowNodeRefsBehavior:["type",il]};function Jm(e,t){var n=lt(e,t,-15);return n!=="intersect"?n:null}function ut(e){qt.call(this,e)}q(ut,qt),ut.$inject=["eventBus"],ut.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return CC(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent,o=i.targetAttach;if(o)return!1;r&&(n.parent=r);try{return hs(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,i=e.target;return hs(n,i,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return cv(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return De(i)&&!ds(t,i)?!1:Oo(t,function(r){return De(r)?hs(r.source,r.target,r):r.host?ho(r,r.host,null,n):pl(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return ho(n,t,null,i)||av(n,t,i)||sv(n,t)||ds(n,t)}),this.addRule("shape.create",function(e){return pl(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return ho(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return hv(n,t)})},ut.prototype.canConnectMessageFlow=lv,ut.prototype.canConnectSequenceFlow=uv,ut.prototype.canConnectDataAssociation=ll,ut.prototype.canConnectAssociation=pv,ut.prototype.canMove=sv,ut.prototype.canAttach=ho,ut.prototype.canReplace=av,ut.prototype.canDrop=yr,ut.prototype.canInsert=ds,ut.prototype.canCreate=pl,ut.prototype.canConnect=hs,ut.prototype.canResize=cv,ut.prototype.canCopy=hv;function CC(e){return rl(e)?null:de(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function rl(e){return!e||xe(e)}function RC(e,t){return e===t}function ev(e){do{if(y(e,"bpmn:Process"))return W(e);if(y(e,"bpmn:Participant"))return W(e).processRef||W(e)}while(e=e.parent)}function ol(e){return y(e,"bpmn:TextAnnotation")}function al(e){return y(e,"bpmn:Group")&&!e.labelTarget}function sl(e){return y(e,"bpmn:BoundaryEvent")&&En(e,"bpmn:CompensateEventDefinition")}function vr(e){return W(e).isForCompensation}function PC(e,t){var n=ev(e),i=ev(t);return n===i}function kC(e){return y(e,"bpmn:InteractionNode")&&!y(e,"bpmn:BoundaryEvent")&&(!y(e,"bpmn:Event")||y(e,"bpmn:ThrowEvent")&&nv(e,"bpmn:MessageEventDefinition"))}function TC(e){return y(e,"bpmn:InteractionNode")&&!vr(e)&&(!y(e,"bpmn:Event")||y(e,"bpmn:CatchEvent")&&nv(e,"bpmn:MessageEventDefinition"))&&!(y(e,"bpmn:BoundaryEvent")&&!En(e,"bpmn:MessageEventDefinition"))}function tv(e){for(var t=e;t=t.parent;){if(y(t,"bpmn:FlowElementsContainer"))return W(t);if(y(t,"bpmn:Participant"))return W(t).processRef}return null}function AC(e,t){var n=tv(e),i=tv(t);return n===i}function En(e,t){var n=W(e);return!!ye(n.eventDefinitions||[],function(i){return y(i,t)})}function nv(e,t){var n=W(e);return(n.eventDefinitions||[]).every(function(i){return y(i,t)})}function MC(e){return y(e,"bpmn:FlowNode")&&!y(e,"bpmn:EndEvent")&&!Ot(e)&&!(y(e,"bpmn:IntermediateThrowEvent")&&En(e,"bpmn:LinkEventDefinition"))&&!sl(e)&&!vr(e)}function DC(e){return y(e,"bpmn:FlowNode")&&!y(e,"bpmn:StartEvent")&&!y(e,"bpmn:BoundaryEvent")&&!Ot(e)&&!(y(e,"bpmn:IntermediateCatchEvent")&&En(e,"bpmn:LinkEventDefinition"))&&!vr(e)}function BC(e){return y(e,"bpmn:ReceiveTask")||y(e,"bpmn:IntermediateCatchEvent")&&(En(e,"bpmn:MessageEventDefinition")||En(e,"bpmn:TimerEventDefinition")||En(e,"bpmn:ConditionalEventDefinition")||En(e,"bpmn:SignalEventDefinition"))}function NC(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function cl(e,t){var n=NC(t);return n.indexOf(e)!==-1}function hs(e,t,n){if(rl(e)||rl(t))return null;if(!y(n,"bpmn:DataAssociation")){if(lv(e,t))return{type:"bpmn:MessageFlow"};if(uv(e,t))return{type:"bpmn:SequenceFlow"}}var i=ll(e,t);return i||(sl(e)&&vr(t)?{type:"bpmn:Association",associationDirection:"One"}:pv(e,t)?{type:"bpmn:Association"}:!1)}function yr(e,t){return xe(e)||al(e)?!0:y(t,"bpmn:Participant")&&!ve(t)?!1:y(e,"bpmn:Participant")?y(t,"bpmn:Process")||y(t,"bpmn:Collaboration"):de(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:y(e,"bpmn:Lane")?y(t,"bpmn:Participant")||y(t,"bpmn:Lane"):y(e,"bpmn:BoundaryEvent")&&!OC(e)?!1:y(e,"bpmn:FlowElement")&&!y(e,"bpmn:DataStoreReference")?y(t,"bpmn:FlowElementsContainer")?ve(t):de(t,["bpmn:Participant","bpmn:Lane"]):y(e,"bpmn:DataStoreReference")&&y(t,"bpmn:Collaboration")?kn(W(t).get("participants"),function(n){return!!n.get("processRef")}):de(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?de(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):y(e,"bpmn:MessageFlow")?y(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function OC(e){return W(e).cancelActivity&&(iv(e)||rv(e))}function jC(e){return!xe(e)&&y(e,"bpmn:BoundaryEvent")}function LC(e){return y(e,"bpmn:Lane")}function IC(e){return jC(e)||y(e,"bpmn:IntermediateThrowEvent")&&iv(e)?!0:y(e,"bpmn:IntermediateCatchEvent")&&rv(e)}function iv(e){var t=W(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function rv(e){return ov(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function ov(e,t){return t.some(function(n){return En(e,n)})}function $C(e){return y(e,"bpmn:ReceiveTask")&&ye(e.incoming,function(t){return y(t.source,"bpmn:EventBasedGateway")})}function ho(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return xe(r)||!IC(r)||Ot(t)||!y(t,"bpmn:Activity")||vr(t)||i&&!Jm(i,t)||$C(t)?!1:"attach"}function av(e,t,n){if(!t)return!1;var i={replacements:[]};return k(e,function(r){Ot(t)||y(r,"bpmn:StartEvent")&&r.type!=="label"&&yr(r,t)&&(Ex(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(wx(r)||Sx(r)||Cx(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),ov(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&y(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),y(t,"bpmn:Transaction")||En(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(y(r,"bpmn:EndEvent")&&yr(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),y(r,"bpmn:BoundaryEvent")&&ho(r,t,null,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),i.replacements.length?i:!1}function sv(e,t){return kn(e,LC)?!1:t?e.every(function(n){return yr(n,t)}):!0}function pl(e,t,n,i){return t?xe(e)||al(e)?!0:RC(n,t)||n&&cl(n,t)?!1:yr(e,t)||ds(e,t):!1}function cv(e,t){return y(e,"bpmn:SubProcess")?ve(e)&&(!t||t.width>=100&&t.height>=80):y(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:y(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!(ol(e)||al(e))}function zC(e,t){var n=ol(e),i=ol(t);return(n||i)&&n!==i}function pv(e,t){return sl(e)&&vr(t)?!0:cl(t,e)||cl(e,t)?!1:zC(e,t)?!0:!!ll(e,t)}function lv(e,t){return dv(e)&&!dv(t)?!1:kC(e)&&TC(t)&&!PC(e,t)}function uv(e,t){return MC(e)&&DC(t)&&AC(e,t)&&!(y(e,"bpmn:EventBasedGateway")&&!BC(t))}function ll(e,t){return de(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&de(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:de(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&de(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function ds(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source===e||t.target===e?!1:de(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!xe(t)&&y(e,"bpmn:FlowNode")&&!y(e,"bpmn:BoundaryEvent")&&yr(e,t.parent)}function FC(e,t){return e&&t&&e.indexOf(t)!==-1}function hv(e,t){return xe(t)?!0:!(y(t,"bpmn:Lane")&&!FC(e,t.parent))}function dv(e){return Ta(e,"bpmn:Process")||Ta(e,"bpmn:Collaboration")}const HC={__depends__:[_n],__init__:["bpmnRules"],bpmnRules:["type",ut]};var GC=2e3;function fv(e,t){e.on("saveXML.start",GC,n);function n(){var i=t.getRootElements();k(i,function(r){var o=ge(r),a,s;a=Pr([r],!1),a=ce(a,function(c){return c!==r&&!c.labelTarget}),s=bt(a,ge),o.set("planeElement",s)})}}fv.$inject=["eventBus","canvas"];const VC={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",fv]};function fs(e){V.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}fs.prototype.getOrdering=function(e,t){return null},q(fs,V);function ul(e,t,n){fs.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(s){if(s.labelTarget)return{level:10};var c=ye(i,function(p){return de(s,[p.type])});return c&&c.order||{level:1}}function o(s){var c=s.order;if(c||(s.order=c=r(s)),!c)throw new Error("no order for <"+s.id+">");return c}function a(s,c,p){for(var l=c;l&&!de(l,p);)l=l.parent;if(!l)throw new Error("no parent for <"+s.id+"> in <"+(c&&c.id)+">");return l}this.getOrdering=function(s,c){if(s.labelTarget)return{parent:t.findRoot(c)||t.getRootElement(),index:-1};var p=o(s);p.containers&&(c=a(s,c,p.containers));var l=c.children.indexOf(s),u=tg(c.children,function(h){return!s.labelTarget&&h.labelTarget?!1:p.level0)return"e";if(t<0)return"w"}if(e==="y"){if(t>0)return"s";if(t<0)return"n"}return null}function YC(e,t){var n=[];return k(e.concat(t),function(i){var r=i.incoming,o=i.outgoing;k(r.concat(o),function(a){var s=a.source,c=a.target;(fo(e,s)||fo(e,c)||fo(t,s)||fo(t,c))&&(fo(n,a)||n.push(a))})}),n}function fo(e,t){return e.indexOf(t)!==-1}function XC(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var hl=Math.abs,ZC=Math.round,Hn={x:"width",y:"height"},mv="crosshair",di={n:"top",w:"left",s:"bottom",e:"right"},QC=1500,vs={n:"s",w:"e",s:"n",e:"w"},ys=20;function Qt(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",QC,function(c){var p=c.context,l=p.initialized;l||(l=p.initialized=s.init(c,p)),l&&yv(c)}),n.on("spaceTool.end",function(c){var p=c.context,l=p.axis,u=p.direction,h=p.movingShapes,d=p.resizingShapes,f=p.start;if(p.initialized){yv(c);var v={x:0,y:0};v[l]=ZC(c["d"+l]),s.makeSpace(h,d,v,u,f),n.once("spaceTool.ended",function(g){s.activateSelection(g.originalEvent,!0,!0)})}})}Qt.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Qt.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:mv,data:{context:{reactivate:n}},trapClick:!1})},Qt.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:mv,data:{context:{}}})},Qt.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Qt.prototype.init=function(e,t){var n=hl(e.dx)>hl(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(hl(i)<5)return!1;i<0&&(i*=-1),ir(e)&&(i*=-1);var o=KC(n,i),a=this._canvas.getRootElement();!Bc(e)&&e.hover&&(a=e.hover);var s=[...Pr(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),p=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}),l=JC(c,n,o,r,p);return N(t,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),xa("resize-"+(n==="x"?"ew":"ns")),!0},Qt.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function p(h){o.includes(h)||o.push(h);var d=h.label;d&&!o.includes(d)&&o.push(d)}function l(h){a.includes(h)||a.push(h)}k(e,function(h){if(!(!h.parent||xe(h))){if(De(h)){c.push(h);return}var d=h[t],f=d+h[Hn[t]];if(eR(h)&&(n>0&&ne(h)[t]>i||n<0&&ne(h)[t]0&&d>i||n<0&&fi&&r.allowed("shape.resize",{shape:h})){l(h);return}}}),k(o,function(h){var d=h.attachers;d&&k(d,function(f){p(f)})});var u=o.concat(a);return k(s,function(h){var d=h.host;Fi(u,d)&&p(h)}),u=o.concat(a),k(c,function(h){var d=h.source,f=h.target,v=h.label;Fi(u,d)&&Fi(u,f)&&v&&p(v)}),{movingShapes:o,resizingShapes:a}},Qt.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Qt.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function vv(e){return{top:e.top-ys,right:e.right+ys,bottom:e.bottom+ys,left:e.left-ys}}function yv(e){var t=e.context,n=t.spaceToolConstraints;if(n){var i,r;ie(n.left)&&(i=Math.max(e.x,n.left),e.dx=e.dx+i-e.x,e.x=i),ie(n.right)&&(i=Math.min(e.x,n.right),e.dx=e.dx+i-e.x,e.x=i),ie(n.top)&&(r=Math.max(e.y,n.top),e.dy=e.dy+r-e.y,e.y=r),ie(n.bottom)&&(r=Math.min(e.y,n.bottom),e.dy=e.dy+r-e.y,e.y=r)}}function JC(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s={},c,p;return k(a,function(l){var u=l.attachers,h=l.children,d=X(l),f=ce(h,function($){return!De($)&&!xe($)&&!Fi(o,$)&&!Fi(a,$)}),v=ce(h,function($){return!De($)&&!xe($)&&Fi(o,$)}),g,R,E,_=[],x=[],S,M,j,B;f.length&&(R=vv(X(Ve(f))),g=i-d[di[n]]+R[di[n]],n==="n"?s.bottom=p=ie(p)?Math.min(p,g):g:n==="w"?s.right=p=ie(p)?Math.min(p,g):g:n==="s"?s.top=c=ie(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ie(c)?Math.max(c,g):g)),v.length&&(E=vv(X(Ve(v))),g=i-E[di[vs[n]]]+d[di[vs[n]]],n==="n"?s.bottom=p=ie(p)?Math.min(p,g):g:n==="w"?s.right=p=ie(p)?Math.min(p,g):g:n==="s"?s.top=c=ie(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ie(c)?Math.max(c,g):g)),u&&u.length&&(u.forEach(function($){Fi(o,$)?_.push($):x.push($)}),_.length&&(S=X(Ve(_.map(ne))),M=d[di[vs[n]]]-(S[di[vs[n]]]-i)),x.length&&(j=X(Ve(x.map(ne))),B=j[di[n]]-(d[di[n]]-i)),n==="n"?(g=Math.min(M||1/0,B||1/0),s.bottom=p=ie(p)?Math.min(p,g):g):n==="w"?(g=Math.min(M||1/0,B||1/0),s.right=p=ie(p)?Math.min(p,g):g):n==="s"?(g=Math.max(M||-1/0,B||-1/0),s.top=c=ie(c)?Math.max(c,g):g):n==="e"&&(g=Math.max(M||-1/0,B||-1/0),s.left=c=ie(c)?Math.max(c,g):g));var D=r&&r[l.id];D&&(n==="n"?(g=i+l[Hn[t]]-D[Hn[t]],s.bottom=p=ie(p)?Math.min(p,g):g):n==="w"?(g=i+l[Hn[t]]-D[Hn[t]],s.right=p=ie(p)?Math.min(p,g):g):n==="s"?(g=i-l[Hn[t]]+D[Hn[t]],s.top=c=ie(c)?Math.max(c,g):g):n==="e"&&(g=i-l[Hn[t]]+D[Hn[t]],s.left=c=ie(c)?Math.max(c,g):g))}),s}}function Fi(e,t){return e.indexOf(t)!==-1}function eR(e){return!!e.host}var dl="djs-dragging",gv="djs-resizing",tR=250,gs=Math.max;function bv(e,t,n,i,r){function o(a,s){k(a,function(c){r.addDragger(c,s),n.addMarker(c,dl)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,p={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},l=Z("g");Y(l,i.cls("djs-crosshair-group",["no-events"])),ee(s,l);var u=Z("path");Y(u,"d",p.x),he(u).add("djs-crosshair"),ee(l,u);var h=Z("path");Y(h,"d",p.y),he(h).add("djs-crosshair"),ee(l,h),c.crosshairGroup=l}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;kt(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&Fe(c)}),e.on("spaceTool.move",tR,function(a){var s=a.context,c=s.line,p=s.axis,l=s.movingShapes,u=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var h=n.getLayer("space");c=Z("path"),Y(c,"d","M0,0 L0,0"),he(c).add("djs-crosshair"),ee(h,c),s.line=c;var d=Z("g");Y(d,i.cls("djs-drag-group",["no-events"])),ee(n.getActiveLayer(),d),o(l,d);var f=s.movingConnections=t.filter(function(x){var S=!1;k(l,function(D){k(D.outgoing,function($){x===$&&(S=!0)})});var M=!1;k(l,function(D){k(D.incoming,function($){x===$&&(M=!0)})});var j=!1;k(u,function(D){k(D.outgoing,function($){x===$&&(j=!0)})});var B=!1;return k(u,function(D){k(D.incoming,function($){x===$&&(B=!0)})}),De(x)&&(S||j)&&(M||B)});o(f,d),s.dragGroup=d}if(!s.frameGroup){var v=Z("g");Y(v,i.cls("djs-frame-group",["no-events"])),ee(n.getActiveLayer(),v);var g=[];k(u,function(x){var S=r.addFrame(x,v),M=S.getBBox();g.push({element:S,initialBounds:M}),n.addMarker(x,gv)}),s.frameGroup=v,s.frames=g}var R={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};Y(c,{d:R[p]});var E={x:"y",y:"x"},_={x:a.dx,y:a.dy};_[E[s.axis]]=0,kt(s.dragGroup,_.x,_.y),k(s.frames,function(x){var S=x.element,M=x.initialBounds,j,B;s.direction==="e"?Y(S,{width:gs(M.width+_.x,5)}):(j=gs(M.width-_.x,5),Y(S,{width:j,x:M.x+M.width-j})),s.direction==="s"?Y(S,{height:gs(M.height+_.y,5)}):(B=gs(M.height-_.y,5),Y(S,{height:B,y:M.y+M.height-B}))})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,p=s.movingConnections,l=s.resizingShapes,u=s.line,h=s.dragGroup,d=s.frameGroup;k(c,function(f){n.removeMarker(f,dl)}),k(p,function(f){n.removeMarker(f,dl)}),h&&(Fe(u),Fe(h)),k(l,function(f){n.removeMarker(f,gv)}),d&&Fe(d)})}bv.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const nR={__init__:["spaceToolPreview"],__depends__:[$n,_n,ms,Qr,eo],spaceTool:["type",Qt],spaceToolPreview:["type",bv]};function bs(e){e.invoke(Qt,this)}bs.$inject=["injector"],q(bs,Qt),bs.prototype.calculateAdjustments=function(e,t,n,i){var r=Qt.prototype.calculateAdjustments.call(this,e,t,n,i);return r.resizingShapes=r.resizingShapes.filter(function(o){return!(y(o,"bpmn:TextAnnotation")||t==="y"&&iR(o))}),r};function iR(e){return y(e,"bpmn:Participant")&&!W(e).processRef}const xv={__depends__:[nR],spaceTool:["type",bs]};function Oe(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Oe.$inject=["eventBus","injector"],Oe.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Oe.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Oe.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Oe.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Oe.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Oe.prototype.register=function(e,t){this._setHandler(e,t)},Oe.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Oe.prototype.canUndo=function(){return!!this._getUndoAction()},Oe.prototype.canRedo=function(){return!!this._getRedoAction()},Oe.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Oe.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Oe.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},Oe.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const o of i)if(r=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return r},Oe.prototype._createId=function(){return this._uid++},Oe.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Oe.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},Oe.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in or phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Oe.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:Q2("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Oe.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=le(e)?e:[e],t.dirty=t.dirty.concat(e))},Oe.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Oe.prototype._revertedAction=function(e){this._stackIdx--},Oe.prototype._getHandler=function(e){return this._handlerMap[e]},Oe.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const rR={commandStack:["type",Oe]};var oR=new Oc("tt");function aR(e){var t=Me('
    ');return st(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function sR(e,t,n){st(e,{left:t+"px",top:n+"px"})}function fl(e,t){e.style.display=t===!1?"none":""}var _v="djs-tooltip",ml="."+_v;function Et(e,t){this._eventBus=e,this._canvas=t,this._ids=oR,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=aR(t.getContainer());var n=this;Rt.bind(this._tooltipRoot,ml,"mousedown",function(i){i.stopPropagation()}),Rt.bind(this._tooltipRoot,ml,"mouseover",function(i){n.trigger("mouseover",i)}),Rt.bind(this._tooltipRoot,ml,"mouseout",function(i){n.trigger("mouseout",i)}),this._init()}Et.$inject=["eventBus","canvas"],Et.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=N({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},Et.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(ft(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Et.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},Et.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},Et.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},Et.prototype.remove=function(e){var t=this.get(e);t&&(dn(t.html),dn(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},Et.prototype.show=function(){fl(this._tooltipRoot)},Et.prototype.hide=function(){fl(this._tooltipRoot,!1)},Et.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Et.prototype._addTooltip=function(e){var t=e.id,n=e.html,i,r=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),Mt(n)&&(n=Me(n)),i=Me('
    '),st(i,{position:"absolute"}),i.appendChild(n),e.type&&Je(i).add("djs-tooltip-"+e.type),e.className&&Je(i).add(e.className),e.htmlContainer=i,r.appendChild(i),this._tooltips[t]=e,this._updateTooltip(e)},Et.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;sR(n,t.x,t.y)},Et.prototype._updateTooltipVisibilty=function(e){k(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom"u"&&(e[t]=0)})}function vo(e,t){this._canvas=e,this._modeling=t}vo.$inject=["canvas","modeling"],vo.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;fi(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),fi(n.outgoing,function(i){t.removeConnection(i,{nested:!0})})},vo.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=lc(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},vo.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,Ze(n.children,t,i),this._canvas.addConnection(t,n),t};function xl(e,t){this._modeling=e,this._elementRegistry=t}xl.$inject=["modeling","elementRegistry"],xl.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,i=e.elements;k(i,function(r){n.get(r.id)&&(r.waypoints?t.removeConnection(r):t.removeShape(r))})};function yo(e,t){this._canvas=e,this._modeling=t}yo.$inject=["canvas","modeling"],yo.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;fi(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),fi(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),fi(n.children,function(i){De(i)?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},yo.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=lc(i.children,n),t.removeShape(n),n},yo.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return Ze(i.children,n,r),t.addShape(n,i),n};function Ss(e){this._modeling=e}Ss.$inject=["modeling"];var kv={x:"y",y:"x"};Ss.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(g,R){g.range.min=Math.min(R[i],g.range.min),g.range.max=Math.max(R[i]+R[r],g.range.max)}function a(g){return g[i]+g[r]/2}function s(g){return g.length-1}function c(g){return g.max-g.min}function p(g,R){var E={y:0};E[i]=g-a(R),E[i]&&(E[kv[i]]=0,t.moveElements([R],E,R.parent))}var l=n[0],u=s(n),h=n[u],d,f,v=0;k(n,function(g,R){var E,_,x;if(g.elements.length<2){R&&R!==n.length-1&&(o(g,g.elements[0]),v+=c(g.range));return}E=ln(g.elements,i),_=E[0],R===u&&(_=E[s(E)]),x=a(_),g.range=null,k(E,function(S){if(p(x,S),g.range===null){g.range={min:S[i],max:S[i]+S[r]};return}o(g,S)}),R&&R!==n.length-1&&(v+=c(g.range))}),f=Math.abs(h.range.min-l.range.max),d=Math.round((f-v)/(n.length-1)),!(dt;if(/n|w/.test(n))return e[i] required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||PR(n,ru(i));return Iv(n,i),e.oldProperties=o,e.changed=r,r},_o.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Iv(n,t),i},_o.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return y(e,"bpmn:DataObject")?kR(e,t):[]};function PR(e,t){return Gt(t,function(n,i){return n[i]=e.get(i),n},{})}function Iv(e,t){k(t,function(n,i){e.set(i,n)})}function kR(e,t){return t.filter(function(n){return y(n,"bpmn:DataObjectReference")&&W(n).dataObjectRef===e})}var Eo="default",Vn="id",$v="di",TR={width:0,height:0};function wo(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}wo.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],wo.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=t.businessObject,s=NR(e.properties),c=e.oldProperties||AR(t,s);return zv(s,a)&&(o.unclaim(a[Vn]),r.updateId(t,s[Vn]),o.claim(s[Vn],a)),Eo in s&&(s[Eo]&&n.push(r.get(s[Eo].id)),a[Eo]&&n.push(r.get(a[Eo].id))),Fv(t,s),e.oldProperties=c,e.changed=n,n},wo.prototype.postExecute=function(e){var t=e.element,n=t.label,i=n&&W(n).name;if(i){var r=this._textRenderer.getExternalLabelBounds(n,i);this._modeling.resizeShape(n,r,TR)}},wo.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Fv(t,i),zv(n,r)&&(a.unclaim(n[Vn]),o.updateId(t,i[Vn]),a.claim(i[Vn],r)),e.changed};function zv(e,t){return Vn in e&&e[Vn]!==t[Vn]}function AR(e,t){var n=ru(t),i=e.businessObject,r=ge(e);return Gt(n,function(o,a){return a!==$v?o[a]=i.get(a):o[a]=MR(r,ru(t.di)),o},{})}function MR(e,t){return Gt(t,function(n,i){return n[i]=e&&e.get(i),n},{})}function Fv(e,t){var n=e.businessObject,i=ge(e);k(t,function(r,o){o!==$v?n.set(o,r):i&&DR(i,r)})}function DR(e,t){k(t,function(n,i){e.set(i,n)})}var BR=["default"];function NR(e){var t=N({},e);return BR.forEach(function(n){n in e&&(t[n]=W(t[n]))}),t}function Ts(e,t){this._canvas=e,this._modeling=t}Ts.$inject=["canvas","modeling"],Ts.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=ge(r);return t.setRootElement(n),t.removeRootElement(r),Ze(a.rootElements,i),i.$parent=a,We(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},Ts.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=ge(n);return t.setRootElement(r),t.removeRootElement(n),We(a.rootElements,i),i.$parent=null,Ze(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]};function Sl(e,t){this._modeling=e,this._spaceTool=t}Sl.$inject=["modeling","spaceTool"],Sl.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=on(i),a=o===i,s=a?i:i.parent,c=Li(s);c.length||n.createShape({type:"bpmn:Lane"},{x:i.x+dr,y:i.y,width:i.width-dr,height:i.height},s);var p=[];Si(o,function(v){return p.push(v),v.label&&p.push(v.label),v===i?[]:ce(v.children,function(g){return g!==i})});var l=r==="top"?-120:120,u=r==="top"?i.y:i.y+i.height,h=u+(r==="top"?10:-10),d=r==="top"?"n":"s",f=t.calculateAdjustments(p,"y",l,h);t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:l},d,h),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?dr:0),y:u-(r==="top"?120:0),width:i.width-(a?dr:0),height:120},s)};function Cl(e,t){this._modeling=e,this._translate=t}Cl.$inject=["modeling","translate"],Cl.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=Li(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s=Math.round(i.height/r),c,p,l,u,h;for(h=0;h0||o.bottom<0?-p:p,d=n.calculateAdjustments(s,"y",h,l),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},u)),(o.left||o.right)&&(p=o.right||o.left,l=e.x+(o.right?e.width:0)+(o.right?-10:100),u=o.right?"e":"w",h=o.left>0||o.right<0?-p:p,d=n.calculateAdjustments(c,"x",h,l),n.makeSpace(d.movingShapes,d.resizingShapes,{x:p,y:0},u))};var Co="flowNodeRef",Rl="lanes";function Ro(e){this._elementRegistry=e}Ro.$inject=["elementRegistry"],Ro.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(l,u){var h=X(u),d={x:l.x+l.width/2,y:l.y+l.height/2};return d.x>h.left&&d.xh.top&&d.y"u"&&(h=t.getExternalLabelBounds(l,f)),h&&e.resizeShape(l,h,IR)}}this.preExecute=r,this.execute=o,this.revert=a,this.postExecute=s}Hv.$inject=["modeling","textRenderer","bpmnFactory"];function Gv(e){return!e||!e.trim()}function ht(e,t,n,i){Te.call(this,e,t,n),this._bpmnRules=i}q(ht,Te),ht.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],ht.prototype.getHandlers=function(){var e=Te.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=_o,e["element.updateProperties"]=wo,e["canvas.updateRoot"]=Ts,e["lane.add"]=Sl,e["lane.resize"]=So,e["lane.split"]=Cl,e["lane.updateRefs"]=Ro,e["id.updateClaim"]=As,e["element.setColor"]=Pl,e["element.updateLabel"]=Hv,e},ht.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},ht.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),!!n)return this.createConnection(e,t,n,e.parent,i)},ht.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},ht.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},ht.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},ht.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},ht.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},ht.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},ht.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};this._commandStack.execute("canvas.updateRoot",t)},ht.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},ht.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},ht.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},ht.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};function Vv(){}Vv.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||ne(t.source||e.source),t.connectionEnd||ne(t.target||e.target)]};var Ms=20,$R=5,Ds=Math.round,Wv=20,zR={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function FR(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function HR(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function Uv(e,t,n){var i=lt(t,e,$R),r=n.split(":")[0],o=Ds((t.x-e.x)/2+e.x),a=Ds((t.y-e.y)/2+e.y),s,c,p=HR(r,i),l=/h|r|l/.test(r),u=!1,h=!1;return p?(s=l?{x:o,y:e.y}:{x:e.x,y:a},c=l?"h:h":"v:v"):(u=FR(i,r),c=l?"h:v":"v:h",u?l?(h=a===e.y,s={x:e.x+Ms*(/l/.test(r)?-1:1),y:h?a+Ms:a}):(h=o===e.x,s={x:h?o+Ms:o,y:e.y+Ms*(/t/.test(r)?-1:1)}):s={x:o,y:a}),{waypoints:kl(e,s,c).concat(s),directions:c,turnNextDirections:h}}function GR(e,t,n){return Uv(e,t,n)}function VR(e,t,n){var i=Uv(t,e,qv(n));return{waypoints:i.waypoints.slice().reverse(),directions:qv(i.directions),turnNextDirections:i.turnNextDirections}}function WR(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(i=i=="h"?"v":"h");var r=n+":"+i,o=kl(e.waypoints[e.waypoints.length-1],t.waypoints[0],r);return{waypoints:o,directions:r}}function qv(e){return e.split(":").reverse().join(":")}function UR(e,t,n){var i=Ds((t.x-e.x)/2+e.x),r=Ds((t.y-e.y)/2+e.y);if(n==="h:v")return[{x:t.x,y:e.y}];if(n==="v:h")return[{x:e.x,y:t.y}];if(n==="h:h")return[{x:i,y:e.y},{x:i,y:t.y}];if(n==="v:v")return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function kl(e,t,n){if(n=n||"h:h",!tP(n))throw new Error("unknown directions: <"+n+">: must be specified as : with start/end in { h,v,t,r,b,l }");if(Yv(n)){var i=GR(e,t,n),r=VR(e,t,n),o=WR(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return UR(e,t,n)}function qR(e,t,n){var i=kl(e,t,n);return i.unshift(e),i.push(t),Zv(i)}function KR(e,t,n,i,r){var o=r&&r.preferredLayouts||[],a=ek(o,"straight")[0]||"h:h",s=zR[a]||0,c=lt(e,t,s),p=eP(c,a);n=n||ne(e),i=i||ne(t);var l=p.split(":"),u=Xv(n,e,l[0],nP(c)),h=Xv(i,t,l[1],c);return qR(u,h,p)}function YR(e,t,n,i,r,o){le(n)&&(r=n,o=i,n=ne(e),i=ne(t)),o=N({preferredLayouts:[]},o),r=r||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&ZR(e,t,n,i,o),c||(c=o.connectionEnd&&JR(t,e,i,r),c)||(c=o.connectionStart&&QR(e,t,n,r),c)?c:!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:KR(e,t,n,i,o)}function XR(e,t,n){return e>=t&&e<=n}function Kv(e,t,n){var i={x:"width",y:"height"};return XR(t[e],n[e],n[e]+n[i[e]])}function ZR(e,t,n,i,r){var o={},a,s;return s=lt(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),r.preserveDocking==="target"?Kv(a,i,e)?(o[a]=i[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:i.x,y:i.y}]):null:Kv(a,n,t)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y,original:{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y}}]):null):null}function QR(e,t,n,i){return Tl(e,t,n,i)}function JR(e,t,n,i){var r=i.slice().reverse();return r=Tl(e,t,n,r),r?r.reverse():null}function Tl(e,t,n,i){function r(l){return l.length<3?!0:l.length>4?!1:!!ye(l,function(u,h){var d=l[h-1];return d&&Tr(u,d)<3})}function o(l,u,h){var d=Dn(u,l);switch(d){case"v":return{x:h.x,y:l.y};case"h":return{x:l.x,y:h.y}}return{x:l.x,y:l.y}}function a(l,u,h){var d;for(d=l.length-2;d!==0;d--)if(Cu(l[d],u,Wv)||Cu(l[d],h,Wv))return l.slice(d);return l}if(r(i))return null;var s=i[0],c=i.slice(),p;return c[0]=n,c[1]=o(c[1],s,n),p=a(c,e,t),p!==c&&(c=Tl(e,t,n,p)),c&&Dn(c)?null:c}function eP(e,t){if(Yv(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function tP(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function Yv(e){return e&&/t|r|b|l/.test(e)}function nP(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function Xv(e,t,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Zv(e){return e.reduce(function(t,n,i){var r=t[t.length-1],o=e[i+1];return uc(r,o,n,0)||t.push(n),t},[])}var iP=-10,rP=40,Al={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Bs={top:"t",right:"r",bottom:"b",left:"l"};function Ml(){}q(Ml,Vv),Ml.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,i=t.target||e.target,r=t.waypoints||e.waypoints,o=t.connectionStart,a=t.connectionEnd,s,c;return o||(o=Qv(r&&r[0],n)),a||(a=Qv(r&&r[r.length-1],i)),(y(e,"bpmn:Association")||y(e,"bpmn:DataAssociation"))&&r&&!Jv(n,i)?[].concat([o],r.slice(1,-1),[a]):(y(e,"bpmn:MessageFlow")?s=aP(n,i):(y(e,"bpmn:SequenceFlow")||Jv(n,i))&&(n===i?s={preferredLayouts:fP(n,e)}:y(n,"bpmn:BoundaryEvent")?s={preferredLayouts:mP(n,i,a)}:Po(n)||Po(i)?s=cP(n):y(n,"bpmn:Gateway")?s={preferredLayouts:["v:h"]}:y(i,"bpmn:Gateway")?s={preferredLayouts:["h:v"]}:s={preferredLayouts:["h:h"]}),s&&(s=N(s,t),c=Zv(YR(n,i,o,a,r,s))),c||[o,a])};function oP(e){var t=e.host;return lt(ne(e),t,iP)}function aP(e,t){return{preferredLayouts:["straight","v:v"],preserveDocking:sP(e,t)}}function sP(e,t){return y(t,"bpmn:Participant")?"source":y(e,"bpmn:Participant")?"target":Po(t)?"source":Po(e)||y(t,"bpmn:Event")?"target":y(e,"bpmn:Event")?"source":null}function cP(e){return{preferredLayouts:["straight","h:h"],preserveDocking:pP(e)}}function pP(e){return Po(e)?"target":"source"}function Qv(e,t){return e?e.original||e:ne(t)}function Jv(e,t){return y(t,"bpmn:Activity")&&y(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Po(e){return y(e,"bpmn:SubProcess")&&ve(e)}function ko(e,t){return e===t}function lP(e,t){return t.indexOf(e)!==-1}function To(e){var t=/right|left/.exec(e);return t&&t[0]}function Gi(e){var t=/top|bottom/.exec(e);return t&&t[0]}function uP(e,t){return Al[e]===t}function hP(e,t){var n=To(e),i=Al[n];return t.indexOf(i)!==-1}function dP(e,t){var n=Gi(e),i=Al[n];return t.indexOf(i)!==-1}function Dl(e){return e==="right"||e==="left"}function fP(e,t){var n=t.waypoints,i=n&&n.length&<(n[0],e);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function mP(e,t,n){var i=ne(e),r=ne(t),o=oP(e),a,s,c=ko(e.host,t),p=lP(o,["top","right","bottom","left"]),l=lt(r,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return c?vP(o,p,e,t,n):(a=yP(o,l,p),s=gP(o,l,p),[a+":"+s])}function vP(e,t,n,i,r){var o=t?e:Gi(e),a=Bs[o],s;return t?Dl(e)?s=ey("y",n,i,r)?"h":"b":s=ey("x",n,i,r)?"v":"l":s="v",[a+":"+s]}function ey(e,t,n,i){var r=rP;return!(Bl(e,i,n,r)||Bl(e,i,{x:n.x+n.width,y:n.y+n.height},r)||Bl(e,i,ne(t),r))}function Bl(e,t,n,i){return Math.abs(t[e]-n[e])
    '),ft(o,"data-group",r),e.appendChild(o));var a=n.html||(n.separator?'
    ':'
    '),s=Me(a);if(o.appendChild(s),!n.separator&&(ft(s,"data-action",i),n.title&&ft(s,"title",n.title),n.className&&MP(s,n.className),n.imageUrl)){var c=Me("");ft(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()},Ye.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=ft(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},Ye.prototype.triggerEntry=function(e,t,n,i){var r=this._entries,o,a;if(o=r[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(pt(a)){if(t==="click")return a(n,i)}else if(a[t])return a[t](n,i);n.preventDefault()}},Ye.prototype._layoutChanged=function(){this._toggleState({})},Ye.prototype._needsCollapse=function(e,t){var n=50,i=Object.keys(t).length*46;return e=n.x&&t.yn.x&&t.y<=n.y?i={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x=n.y?i={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?i={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:i={x:n.x,y:n.y,width:0,height:0},i}const NP={__depends__:[ms,eo],__init__:["lassoTool"],lassoTool:["type",Vi]};var Il=1500,dy="grab";function gr(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",Il,function(c){if(ir(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(Il,function(c){if(!(!fy(c.keyEvent)||a.isActive())){var p=a._mouse.getLastMoveEvent();a.activateMove(p,!!p)}},"keyboard.keydown"),s&&s.addListener(Il,function(c){!fy(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var p=c.originalEvent.target;if(!c.hover&&!(p instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var p=t.viewbox().scale;t.scroll({dx:c.dx*p,dy:c.dy*p})}),e.on("hand.move.end",function(c){var p=c.context,l=p.reactivate;return!ir(c)&&l&&e.once("hand.move.ended",function(u){a.activateHand(u.originalEvent,!0,!0)}),!1})}gr.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],gr.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:dy,data:{context:n||{}}})},gr.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:dy,data:{context:{reactivate:n}}})},gr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},gr.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function fy(e){return tt("Space",e)}const OP={__depends__:[ms,eo],__init__:["handTool"],handTool:["type",gr]};var my="connect-ok",vy="connect-not-ok";function br(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var p=c.context,l=c.hover,u=p.canStartConnect=s.canStartConnect(l);u!==null&&(p.startTarget=l,i.addMarker(l,u?my:vy))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var p=c.context.startTarget,l=c.context.canStartConnect;p&&i.removeMarker(p,l?my:vy)}),e.on(["global-connect.ended"],function(c){var p=c.context,l=p.startTarget,u={x:c.x,y:c.y},h=s.canStartConnect(l);if(h)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,l,u)}),!1})}br.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],br.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},br.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},br.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},br.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const jP={__depends__:[dp,_n,$n,ms,eo],globalConnect:["type",br]};function $l(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}$l.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],$l.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(u,h,d,f,v){function g(E){var _=n.createShape(N({type:u},v));if(v){var x=ge(_);x.isExpanded=v.isExpanded}t.start(E,_)}var R=u.replace(/^bpmn:/,"");return{group:h,className:d,title:f||s("Create {type}",{type:R}),action:{dragstart:g,click:g}}}function p(u){var h=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:h});t.start(u,[h,d],{hints:{autoSelect:[h]}})}function l(u){t.start(u,n.createParticipantShape())}return N(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate the hand tool"),action:{click:function(u){o.activateHand(u)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate the lasso tool"),action:{click:function(u){r.activateSelection(u)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate the create/remove space tool"),action:{click:function(u){i.activateSelection(u)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate the global connect tool"),action:{click:function(u){a.start(u)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create StartEvent")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create Intermediate/Boundary Event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create EndEvent")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create Gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create Task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create DataObjectReference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded SubProcess"),action:{dragstart:p,click:p}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create Pool/Participant"),action:{dragstart:l,click:l}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create Group"))}),e};const LP={__depends__:[BP,ja,xv,NP,OP,jP,ha],__init__:["paletteProvider"],paletteProvider:["type",$l]};var IP=250;function zl(e,t,n,i,r){V.call(this,e);function o(s){var c=s.canExecute.replacements;k(c,function(p){var l=p.oldElementId,u={type:p.newElementType};if(!s.visualReplacements[l]){var h=t.get(l);N(u,{x:h.x,y:h.y});var d=n.createShape(u);i.addShape(d,h.parent);var f=Ae('[data-element-id="'+Hr(h.id)+'"]',s.dragGroup);f&&Y(f,{display:"none"});var v=r.addDragger(d,s.dragGroup);s.visualReplacements[l]=v,i.removeShape(d)}})}function a(s){var c=s.visualReplacements;k(c,function(p,l){var u=Ae('[data-element-id="'+Hr(l)+'"]',s.dragGroup);u&&Y(u,{display:"inline"}),p.remove(),c[l]&&delete c[l]})}e.on("shape.move.move",IP,function(s){var c=s.context,p=c.canExecute;c.visualReplacements||(c.visualReplacements={}),p&&p.replacements?o(c):a(c)})}zl.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],q(zl,V);const $P={__depends__:[Qr],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",zl]};var zP=1250,Fl=40,FP=20,HP=10,yy=20,gy=["x","y"],GP=Math.abs;function by(e){e.on(["connect.hover","connect.move","connect.end"],zP,function(t){var n=t.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&jt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&VP(t,o,KP(o)),o&&qP(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Kt(r),de(o,["bpmn:Event","bpmn:Gateway"])&&xy(t,Kt(o)),de(o,["bpmn:Task","bpmn:SubProcess"])&&WP(t,o),y(a,"bpmn:BoundaryEvent")&&s===a.host&&UP(t)):_y(i,"bpmn:MessageFlow")?(y(r,"bpmn:Event")&&(n.connectionStart=Kt(r)),y(o,"bpmn:Event")&&xy(t,Kt(o))):n.connectionStart=n.initialConnectionStart)})}by.$inject=["eventBus"];function VP(e,t,n){gy.forEach(function(i){var r=Ey(i,t);e[i]t[i]+r-n&&Ke(e,i,t[i]+r-n)})}function WP(e,t){var n=Kt(t);gy.forEach(function(i){YP(e,t,i)&&Ke(e,i,n[i])})}function UP(e){var t=e.context,n=t.source,i=t.target;if(!XP(t)){var r=Kt(n),o=lt(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],p;GP(c-r[s])r[s]?p=r[s]+Fl:p=r[s]-Fl,Ke(e,s,p))})}}function xy(e,t){Ke(e,"x",t.x),Ke(e,"y",t.y)}function _y(e,t){return e&&e.type===t}function qP(e,t){return kn(t,function(n){return _y(e,n)})}function Ey(e,t){return e==="x"?t.width:t.height}function KP(e){return y(e,"bpmn:Task")?HP:FP}function YP(e,t,n){return e[n]>t[n]+yy&&e[n]=e.x||r&&r<=e.x)&&Ke(e,"x",e.x),(i&&i>=e.y||o&&o<=e.y)&&Ke(e,"y",e.y)}}function Sy(e,t){return e.indexOf(t)!==-1}function Cy(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var i2=1250;function Ao(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.on(["resize.move","resize.end"],i2,function(i){var r=i.context,o=r.shape,a=o.parent,s=r.direction,c=r.snapContext;if(!(i.originalEvent&&jt(i.originalEvent))&&!hr(i)){var p=c.pointsForTarget(a);p.initialized||(p=n.addSnapTargetPoints(p,o,a,s),p.initialized=!0),a2(s)&&Ke(i,"x",i.x),s2(s)&&Ke(i,"y",i.y),t.snap(i,p)}}),e.on(["resize.cleanup"],function(){t.hide()})}Ao.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new xi);var o=Ry(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Ao.prototype.addSnapTargetPoints=function(e,t,n,i){var r=this.getSnapTargets(t,n);return k(r,function(o){e.add("corner",uf(o)),e.add("corner",lf(o))}),e.add("corner",Ry(t,i)),e},Ao.$inject=["eventBus","snapping"],Ao.prototype.getSnapTargets=function(e,t){return hf(t).filter(function(n){return!r2(n,e)&&!De(n)&&!o2(n)&&!xe(n)})};function Ry(e,t){var n=ne(e),i=X(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function r2(e,t){return e.host===t}function o2(e){return!!e.hidden}function a2(e){return e==="n"||e==="s"}function s2(e){return e==="e"||e==="w"}var c2=7,p2=1e3;function _i(e){this._canvas=e,this._asyncHide=eg(Ct(this.hide,this),p2)}_i.$inject=["canvas"],_i.prototype.snap=function(e,t){var n=e.context,i=n.snapContext,r=i.getSnapLocations(),o={x:hr(e,"x"),y:hr(e,"y")};k(r,function(a){var s=i.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(k(["x","y"],function(p){var l;o[p]||(l=t.snap(c,a,p,c2),l!==void 0&&(o[p]={value:l,originValue:l-s[p]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),k(["x","y"],function(a){var s=o[a];rt(s)&&Ke(e,a,s.originValue)})},_i.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=Z("path");return Y(n,{d:"M0,0 L0,0"}),he(n).add("djs-snap-line"),ee(t,n),{update:function(i){ie(i)?e==="horizontal"?Y(n,{d:"M-100000,"+i+" L+100000,"+i,display:""}):Y(n,{d:"M "+i+",-100000 L "+i+", +100000",display:""}):Y(n,{display:"none"})}}},_i.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},_i.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},_i.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},_i.prototype.hide=function(){k(this._snapLines,function(e){e.update()})};const l2={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",wn],resizeSnapping:["type",Ao],snapping:["type",_i]},u2={__depends__:[l2],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",by],createMoveSnapping:["type",xr]};function re(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=Me(re.BOX_HTML),this._searchInput=Ae(re.INPUT_SELECTOR,this._container),this._resultsContainer=Ae(re.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}re.$inject=["canvas","eventBus","overlays","selection"],re.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Rt.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close()}),t(this._container,re.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,re.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,re.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,re.INPUT_SELECTOR,"keydown",function(n){tt("ArrowUp",n)&&n.preventDefault(),tt("ArrowDown",n)&&n.preventDefault()}),t(this._container,re.INPUT_SELECTOR,"keyup",function(n){if(tt("Escape",n))return e.close();if(tt("Enter",n)){var i=e._getCurrentResult();return i?e._select(i):e.close()}if(tt("ArrowUp",n))return e._scrollToDirection(!0);if(tt("ArrowDown",n))return e._scrollToDirection();tt(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})},re.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Rt.unbind(e.el,e.type,e.listener)})},re.prototype._search=function(e){var t=this;if(this._clearResults(),!(!e||e==="")){var n=this._searchProvider.find(e);if(n.length){n.forEach(function(r){var o=r.element.id,a=t._createResultNode(r,o);t._results[o]={element:r.element,node:a}});var i=Ae(re.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},re.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},re.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t0&&Py(n,e.primaryTokens,re.RESULT_PRIMARY_HTML),Py(n,e.secondaryTokens,re.RESULT_SECONDARY_HTML),ft(n,re.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},re.prototype.registerProvider=function(e){this._searchProvider=e},re.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,Je(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},re.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,Je(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},re.prototype.toggle=function(){this.isOpen()?this.close():this.open()},re.prototype.isOpen=function(){return this._open},re.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Je(t).remove(re.RESULT_SELECTED_CLASS);var n=ft(e,re.RESULT_ID_ATTRIBUTE),i=this._results[n].element;Je(e).add(re.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},re.prototype._select=function(e){var t=ft(e,re.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},re.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=Ve(e),n=h2(t);this._overlayId=this._overlays.add(e,n)}};function h2(e){var t=6,n=e.width+t*2,i=e.height+t*2,r={width:n+"px",height:i+"px"},o=Me('
    ');return st(o,r),{position:{bottom:i-t,right:n-t},show:!0,html:o}}function Py(e,t,n){var i=d2(t),r=Me(n);r.innerHTML=i,e.appendChild(r)}function d2(e){var t="";return e.forEach(function(n){n.matched?t+=''+Ic(n.matched)+"":t+=Ic(n.normal)}),t!==""?t:null}re.CONTAINER_SELECTOR=".djs-search-container",re.INPUT_SELECTOR=".djs-search-input input",re.RESULTS_CONTAINER_SELECTOR=".djs-search-results",re.RESULT_SELECTOR=".djs-search-result",re.RESULT_SELECTED_CLASS="djs-search-result-selected",re.RESULT_SELECTED_SELECTOR="."+re.RESULT_SELECTED_CLASS,re.RESULT_ID_ATTRIBUTE="data-result-id",re.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",re.OVERLAY_CLASS="djs-search-overlay",re.BOX_HTML='
    ',re.RESULT_HTML='
    ',re.RESULT_PRIMARY_HTML='
    ',re.RESULT_SECONDARY_HTML='

    ';const f2={__depends__:[ya,bn],searchPad:["type",re]};function Hl(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}Hl.$inject=["elementRegistry","searchPad","canvas"],Hl.prototype.find=function(e){var t=this._canvas.getRootElement(),n=this._elementRegistry.filter(function(i){return!i.labelTarget});return n=ce(n,function(i){return i!==t}),n=bt(n,function(i){return{primaryTokens:Ty(Ut(i),e),secondaryTokens:Ty(i.id,e),element:i}}),n=ce(n,function(i){return ky(i.primaryTokens)||ky(i.secondaryTokens)}),n=ln(n,function(i){return Ut(i.element)+i.element.id}),n};function ky(e){var t=ce(e,function(n){return!!n.matched});return t.length>0}function Ty(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(r!==0&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+ry(n,o.type));return r&&r.drawShape instanceof Function?r.drawShape(t,n,this.bpmnRenderer):this.bpmnRenderer.drawShape(t,n)}getShapePath(t){return y(t,"bpmn:Task")?Ph(t,g2):this.bpmnRenderer.getShapePath(t)}}Qy(Vl,"$inject"),Vl.$inject=["eventBus","bpmnRenderer","config.paletteEntries"];function an(e,t){const n=js(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function js(e){return e&&e.businessObject||e}function b2(e){return an(e,"bpmn:CallActivity")?!1:an(e,"bpmn:SubProcess")?!!js(e).di.isExpanded:an(e,"bpmn:Participant")?!!js(e).processRef:!0}function x2(e){return e&&!!js(e).triggeredByEvent}function Ls(e,t){return kn(t,function(n){return an(e,n)})}function _2(e){return e.children.filter(function(t){return an(t,"bpmn:Lane")})}const{t:Wn}=Jy();function Wl(e,t,n,i,r,o,a,s,c,p,l){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=p,this._rules=l,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1))}Wl.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","rules"],Wl.prototype.getContextPadEntries=function(e){const t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._autoPlace,s={};if(e.type==="label")return s;if(an(e,"bpmn:EndEvent")||an(e,"bpmn:SequenceFlow"))return{delete:{group:"event2",className:"bpmn-icon-trash",title:Ie(Wn("\u5220\u9664")),action:{click:l}},connect:{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},replace:{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.gateway":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.append-task":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.intermediate-event":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.text-annotation":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}}};const c=e.businessObject;function p(d,f){r.start(d,f)}function l(){n.removeElements([e])}function u(d,f,v,g){typeof v!="string"&&(g=v,v=Ie("Append {type}",{type:d.replace(/^bpmn:/,"")}));function R(E,_){const x=i.createShape(N({type:d},g));o.start(E,x,{source:_})}return{group:"event1",className:f,title:v,action:{dragstart:R,click:a?function(E,_){const x=i.createShape(N({type:d},g));a.append(_,x)}:R}}}function h(d){return function(f,v){n.splitLane(v,d),t.open(v,!0)}}if(Ls(c,["bpmn:Lane","bpmn:Participant"])&&b2(c)&&(_2(e).length<2&&(e.height>=120&&N(s,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:Ie("Divide into two Lanes"),action:{click:h(2)}}}),e.height>=180&&N(s,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:Ie("Divide into three Lanes"),action:{click:h(3)}}})),N(s,{})),Ls(c,["bpmn:Lane","bpmn:Participant"]),an(c,"bpmn:FlowNode")&&(an(c,"bpmn:EventBasedGateway")||Ay(c,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")||!an(c,"bpmn:EndEvent")&&!c.isForCompensation&&!Ay(c,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!x2(c)&&N(s,{"append.end-event":u("bpmn:EndEvent","bpmn-icon-end-event-none",Ie(Wn("\u521B\u5EFA\u7ED3\u675F\u8282\u70B9"))),"append.script-task":u("bpmn:ScriptTask","bpmn-icon-script",Ie(Wn("\u521B\u5EFA\u811A\u672C\u8282\u70B9"))),"append.user-task":u("bpmn:UserTask","bpmn-icon-user",Ie(Wn("\u521B\u5EFA\u7528\u6237\u8282\u70B9"))),"append.exclusive-gateway":u("bpmn:ExclusiveGateway","bpmn-icon-gateway-xor",Ie(Wn("\u4E92\u65A5\u7F51\u5173"))),"append.inclusive-gateway":u("bpmn:InclusiveGateway","bpmn-icon-gateway-or",Ie(Wn("\u76F8\u5BB9\u7F51\u5173"))),"append.parallel-gateway":u("bpmn:ParallelGateway","bpmn-icon-gateway-parallel",Ie(Wn("\u5E76\u884C\u7F51\u5173"))),connect:{group:"event2",className:"bpmn-icon-connection-multi",title:Ie(Wn("\u8FDE\u63A5\u7EBF")),action:{click:p,dragstart:p}},delete:{group:an(e,"bpmn:StartEvent")?"none":"event2",className:"bpmn-icon-trash",title:Ie(Wn("\u5220\u9664")),action:{click:l}}})),Ls(c,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])){const d={group:"none",className:"",title:Ie(""),action:{}};N(s,{"append.text-annotation":d,"append.gateway":d,"append.append-task":d,"append.intermediate-event":d,replace:d})}return s};function Ay(e,t,n){const i=e.$instanceOf(t);let r=!1;const o=e.eventDefinitions||[];return k(o,function(a){a.$type===n&&(r=!0)}),i&&r}function My(e){e.on(["create.init"],function(t){}),e.on(["create.init","shape.move.init"],function(t){const n=t.context,i=t.shape;Ls(i,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}My.$inject=["eventBus"];const E2={__init__:["paletteProvider","customRenderer","customContextPad","bpmnGridSnapping"],paletteProvider:["type",Gl],customRenderer:["type",Vl],customContextPad:["type",Wl],bpmnGridSnapping:["type",My]};jo=function(e){Lt.call(this,e),this._customElements=[]},Le(jo,Lt);const w2=[E2];jo.prototype._modules=[].concat(jo.prototype._modules,w2)}));export{jo as C,ik as __tla};