import{_ as jl}from"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import{e as Nh,a$ as Ih,cW as hx,cu as Dh,cx as Bh,bO as mx,bP as fx,bX as vx,r as G,bx as Oh,w as nt,a_ as ko,f as Ll,ad as Ot,d as Ze,o as X,c as Ae,j as Qa,n as Ar,a as P,_ as jh,b0 as Hn,dc as yx,C as De,O as ve,D as Vl,k as M,B as j,d4 as gx,b1 as bx,a2 as xx,aW as Ex,P as Xi,ae as es,dd as wx,q as _x,s as Sx,de as kr,df as Lh,dg as Cx,dh as Tx,b as Pr,by as An,a1 as Ax,F as st,g as ue,h as we,I as Mt,di as kx,b9 as Mr,bs as Px,dj as Mx,V as kn,aF as Rt,i as Xt,ci as Be,$ as hi,R as mi,S as Yt,W as dn,A as Fl,a7 as hn,X as Rr,Y as Nr,Z as Vh,a3 as $l,N as Po,Q as Fh,bV as Mo,l as Rx,bo as Nx,aP as Ix,an as $h,U as ts,aU as zl,aB as Dx,aH as Bx}from"./index-BP6bNRoi.js";import{_ as Ox}from"./XTextButton-B6L8upsJ.js";import{_ as Ir}from"./XButton-BfzTlH8o.js";import{a as jx}from"./index-CeFKtjBg.js";import{E as Lx}from"./el-tree-select-pYALMRc9.js";import{h as Vx,d as Fx}from"./tree-BBZY150N.js";import{g as $x}from"./index-NsInNyZ_.js";import{g as zx}from"./index-BdNokKwC.js";import{g as Gx}from"./index-DkNlrmPs.js";import{g as Ux}from"./index-vFgEqmZu.js";import{g as Hx}from"./index-Y1ylnZaQ.js";import{_ as zh}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{_ as Gh}from"./index.vue_vue_type_script_setup_true_lang-sJUY8qtC.js";import{C as Uh}from"./constants-CuOBQ73z.js";import{P as qx}from"./index-ox_WxZBR.js";import{E as Hh}from"./el-drawer-CuGR_O5R.js";import{_ as Wx}from"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import{P as Kx}from"./index-BRcqC2Y4.js";import{f as Dr}from"./formatTime-DwR9f7DP.js";const qh=e=>mx(e)||fx(e)||vx(e),Xx=Nh({accordion:Boolean,modelValue:{type:Ih([Array,String,Number]),default:()=>hx([])}}),Yx={[Dh]:qh,[Bh]:qh},Wh=Symbol("collapseContextKey"),Jx=Ze({name:"ElCollapse"}),Zx=Ze({...Jx,props:Xx,emits:Yx,setup(e,{expose:t,emit:n}){const i=e,{activeNames:r,setActiveNames:o}=((c,l)=>{const u=G(Oh(c.modelValue)),p=h=>{u.value=h;const v=c.accordion?u.value[0]:u.value;l(Dh,v),l(Bh,v)};return nt(()=>c.modelValue,()=>u.value=Oh(c.modelValue),{deep:!0}),ko(Wh,{activeNames:u,handleItemClick:h=>{if(c.accordion)p([u.value[0]===h?"":h]);else{const v=[...u.value],f=v.indexOf(h);f>-1?v.splice(f,1):v.push(h),p(v)}}}),{activeNames:u,setActiveNames:p}})(i,n),{rootKls:a}=(()=>{const c=Ll("collapse");return{rootKls:Ot(()=>c.b())}})();return t({activeNames:r,setActiveNames:o}),(c,l)=>(X(),Ae("div",{class:Ar(P(a))},[Qa(c.$slots,"default")],2))}});var Qx=jh(Zx,[["__file","collapse.vue"]]);const eE=Nh({title:{type:String,default:""},name:{type:Ih([String,Number]),default:void 0},disabled:Boolean}),tE=["id","aria-expanded","aria-controls","aria-describedby","tabindex"],nE=["id","aria-hidden","aria-labelledby"],iE=Ze({name:"ElCollapseItem"}),rE=Ze({...iE,props:eE,setup(e,{expose:t}){const n=e,{focusing:i,id:r,isActive:o,handleFocus:a,handleHeaderClick:c,handleEnterClick:l}=(x=>{const E=Hn(Wh),{namespace:_}=Ll("collapse"),w=G(!1),S=G(!1),D=yx(),s=Ot(()=>D.current++),d=Ot(()=>{var C;return(C=x.name)!=null?C:`${_.value}-id-${D.prefix}-${P(s)}`}),m=Ot(()=>E==null?void 0:E.activeNames.value.includes(P(d)));return{focusing:w,id:s,isActive:m,handleFocus:()=>{setTimeout(()=>{S.value?S.value=!1:w.value=!0},50)},handleHeaderClick:()=>{x.disabled||(E==null||E.handleItemClick(P(d)),w.value=!1,S.value=!0)},handleEnterClick:()=>{E==null||E.handleItemClick(P(d))}}})(n),{arrowKls:u,headKls:p,rootKls:h,itemWrapperKls:v,itemContentKls:f,scopedContentId:y,scopedHeadId:g}=((x,{focusing:E,isActive:_,id:w})=>{const S=Ll("collapse"),D=Ot(()=>[S.b("item"),S.is("active",P(_)),S.is("disabled",x.disabled)]),s=Ot(()=>[S.be("item","header"),S.is("active",P(_)),{focusing:P(E)&&!x.disabled}]);return{arrowKls:Ot(()=>[S.be("item","arrow"),S.is("active",P(_))]),headKls:s,rootKls:D,itemWrapperKls:Ot(()=>S.be("item","wrap")),itemContentKls:Ot(()=>S.be("item","content")),scopedContentId:Ot(()=>S.b(`content-${P(w)}`)),scopedHeadId:Ot(()=>S.b(`head-${P(w)}`))}})(n,{focusing:i,isActive:o,id:r});return t({isActive:o}),(x,E)=>(X(),Ae("div",{class:Ar(P(h))},[De("button",{id:P(g),class:Ar(P(p)),"aria-expanded":P(o),"aria-controls":P(y),"aria-describedby":P(y),tabindex:x.disabled?-1:0,type:"button",onClick:E[0]||(E[0]=(..._)=>P(c)&&P(c)(..._)),onKeydown:E[1]||(E[1]=xx(Ex((..._)=>P(l)&&P(l)(..._),["stop","prevent"]),["space","enter"])),onFocus:E[2]||(E[2]=(..._)=>P(a)&&P(a)(..._)),onBlur:E[3]||(E[3]=_=>i.value=!1)},[Qa(x.$slots,"title",{},()=>[ve(Vl(x.title),1)]),M(P(bx),{class:Ar(P(u))},{default:j(()=>[M(P(gx))]),_:1},8,["class"])],42,tE),M(P(wx),null,{default:j(()=>[Xi(De("div",{id:P(y),role:"region",class:Ar(P(v)),"aria-hidden":!P(o),"aria-labelledby":P(g)},[De("div",{class:Ar(P(f))},[Qa(x.$slots,"default")],2)],10,nE),[[es,P(o)]])]),_:3})],2))}});var Kh=jh(rE,[["__file","collapse-item.vue"]]);const oE=_x(Qx,{CollapseItem:Kh}),aE=Sx(Kh);var Gl={exports:{}};typeof Object.create=="function"?Gl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Gl.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};const ae=kr(Gl.exports);var Xh,Ul,sE=(Xh=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;var a=r-Math.floor(r),c="";for(o=0;o=Math.pow(2,n)?t(n,i):c};t.rack=function(n,i,r){var o=function(c){var l=0;do{if(l++>10){if(!r)throw new Error("too many ID collisions, use more bits");n+=r}var u=t(n,i)}while(Object.hasOwnProperty.call(a,u));return a[u]=c,u},a=o.hats={};return o.get=function(c){return o.hats[c]},o.set=function(c,l){return o.hats[c]=l,o},o.bits=n||128,o.base=i||16,o}},Xh(Ul={exports:{}},Ul.exports),Ul.exports);function Pn(e){if(!(this instanceof Pn))return new Pn(e);e=e||[128,36,1],this._seed=e.length?sE.rack(e[0],e[1],e[2]):e}function ns(e){return Array.prototype.concat.apply([],e)}Pn.prototype.next=function(e){return this._seed(e||!0)},Pn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},Pn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Pn.prototype.assigned=function(e){return this._seed.get(e)||!1},Pn.prototype.unclaim=function(e){delete this._seed.hats[e]},Pn.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Ro=Object.prototype.toString,cE=Object.prototype.hasOwnProperty;function No(e){return e===void 0}function Mn(e){return e!==void 0}function Yh(e){return e==null}function Se(e){return Ro.call(e)==="[object Array]"}function Tt(e){return Ro.call(e)==="[object Object]"}function fe(e){return Ro.call(e)==="[object Number]"}function At(e){var t=Ro.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Br(e){return Ro.call(e)==="[object String]"}function fi(e,t){return cE.call(e,t)}function je(e,t){var n;return t=Wl(t),F(e,function(i,r){if(t(i,r))return n=i,!1}),n}function Ee(e,t){var n=[];return F(e,function(i,r){t(i,r)&&n.push(i)}),n}function F(e,t){var n;if(!No(e)){var i=Se(e)?dE:pE;for(var r in e)if(fi(e,r)&&t(n=e[r],i(r))===!1)return n}}function lE(e,t){return No(e)?[]:(function(n){if(!Se(n))throw new Error("must supply array")}(e),t=Wl(t),e.filter(function(n,i){return!t(n,i)}))}function Gt(e,t,n){return F(e,function(i,r){n=t(n,i,r)}),n}function Or(e,t){return!!Gt(e,function(n,i,r){return n&&t(i,r)},!0)}function Yi(e,t){return!!je(e,t)}function ht(e,t){var n=[];return F(e,function(i,r){n.push(t(i,r))}),n}function is(e){return e&&Object.keys(e)||[]}function Io(e){return is(e).length}function Hl(e){return ht(e,function(t){return t})}function jr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=ql(t),F(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function Jh(e){e=ql(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r0)return c(v);e.apply(r,i),l()}function c(p){n=setTimeout(a,p)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){o=Date.now();for(var p=arguments.length,h=new Array(p),v=0;v1?t-1:0),i=1;i
a',im=!Yl.getElementsByTagName("link").length,Yl=void 0);var lt={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:im?[1,"X
","
"]:[0,"",""]};function Ye(e,t){return(t=t||document).querySelector(e)}function Jl(e,t){return(t=t||document).querySelectorAll(e)}function Nn(e){e.parentNode&&e.parentNode.removeChild(e)}function pe(e,t){return function(n,i){i.appendChild(function(r,o){if(r.ownerDocument!==o.ownerDocument)try{return o.ownerDocument.importNode(r,!0)}catch{}return r}(n,i))}(t,e),e}lt.td=lt.th=[3,"","
"],lt.option=lt.optgroup=[1,'"],lt.thead=lt.tbody=lt.colgroup=lt.caption=lt.tfoot=[1,"","
"],lt.polyline=lt.ellipse=lt.polygon=lt.circle=lt.text=lt.line=lt.path=lt.rect=lt.g=[1,'',""];var Zl=2,rm={"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":Zl,"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":Zl,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function om(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=rm[i];r?(r===Zl&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function W(e,t,n){if(typeof t=="string"){if(n===void 0)return function(i,r){return rm[r]?i.style[r]:i.getAttributeNS(null,r)}(e,t);om(e,t,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)om(i,a,r[a])})(e,t);return e}function Ql(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n"+e+"",t=!0);var n=function(o){var a;return(a=new DOMParser).async=!1,a.parseFromString(o,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function se(e,t){var n;return e.charAt(0)==="<"?(n=bE(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(tu.svg,e),t&&W(n,t),n}var nu=null;function lm(){return nu===null&&(nu=se("svg")),nu}function um(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Do(e){return lm().createSVGTransform()}var pm=/([&<>]{1})/g,xE=/([\n\r"]{1})/g,EE={"&":"&","<":"<",">":">",'"':"'"};function iu(e,t){return e.replace(t,function(n,i){return EE[i]||i})}function dm(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(iu(e.textContent,pm));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(a=e.childNodes).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 hm(e,t){return function(n){for(var i=n.firstChild,r=[];i;)dm(i,r),i=i.nextSibling;return r.join("")}(e)}function wE(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Bo(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(i,r){var o,a;for(i.clear(),o=0;a=r[o];o++)i.appendItem(wE(i,a))}(n,t)),n.consolidate()}var _E=/^class /;function ru(e){return Object.prototype.toString.call(e)==="[object Array]"}function ou(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function as(){var e=Array.prototype.slice.call(arguments);e.length===1&&ru(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var SE=/constructor\s*[^(]*\(\s*([^)]*)\)/m,CE=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,TE=/\/\*([^*]*)\*\//m;function AE(e){if(typeof e!="function")throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(n){return _E.test(n.toString())}(e)?SE:CE);return t&&t[1]&&t[1].split(",").map(function(n){return(t=n.match(TE))?t[1].trim():n.trim()})||[]}function kE(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}function au(e,t){t=t||{get:function(f,y){if(n.push(f),y===!1)return null;throw a('No provider for "'+f+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(f){var y=n.join(" -> ");return n.length=0,new Error(y?f+" (Resolving: "+y+")":f)},c=function(f,y){if(!i[f]&&f.indexOf(".")!==-1){for(var g=f.split("."),x=c(g.shift());g.length;)x=x[g.shift()];return x}if(ou(r,f))return r[f];if(ou(i,f)){if(n.indexOf(f)!==-1)throw n.push(f),a("Cannot resolve circular dependency!");return n.push(f),r[f]=i[f][0](i[f][1]),n.pop(),r[f]}return t.get(f,y)},l=function(f,y){if(y===void 0&&(y={}),typeof f!="function"){if(!ru(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=as(f.slice())}return{fn:f,dependencies:(f.$inject||AE(f)).map(function(g){return ou(y,g)?y[g]:c(g)})}},u=function(f){var y=l(f),g=y.fn,x=y.dependencies;return new(Function.prototype.bind.apply(g,[null].concat(x)))},p=function(f,y,g){var x=l(f,g),E=x.fn,_=x.dependencies;return E.apply(y,_)},h=function(f){return as(function(y){return f.get(y)})},v={factory:p,type:u,value:function(f){return f}};e.forEach(function(f){function y(_,w){return _!=="value"&&ru(w)&&(w=as(w.slice())),w}if(f instanceof kE)f.forEach(function(_){var w=_[0],S=_[1],D=_[2];i[w]=[v[S],y(S,D),S]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(_,w){return w.substring(0,2)!=="__"&&(_[w]=f[w]),_},Object.create(null)),x=new au((f.__modules__||[]).concat([g]),o),E=as(function(_){return x.get(_)});f.__exports__.forEach(function(_){i[_]=[E,_,"private",x]})}else Object.keys(f).forEach(function(_){if(f[_][2]!=="private"){var w=f[_][0],S=f[_][1];i[_]=[v[w],y(w,S),w]}else i[_]=f[_]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,y){if(y&&y.length){var g,x,E,_,w=Object.create(null),S=Object.create(null),D=[],s=[],d=[];for(var m in i)g=i[m],y.indexOf(m)!==-1&&(g[2]==="private"?(x=D.indexOf(g[3]))===-1?(E=g[3].createChild([],y),_=h(E),D.push(g[3]),s.push(E),d.push(_),w[m]=[_,m,"private",E]):w[m]=[d[x],m,"private",s[x]]:w[m]=[g[2],g[1]],S[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||y.forEach(function(C){g[1].$scope.indexOf(C)!==-1&&(w[m]=[g[2],g[1]],S[C]=!0)});y.forEach(function(C){if(!S[C])throw new Error('No provider for "'+C+'". Cannot use provider from the parent!')}),f.unshift(w)}return new au(f,o)}}var PE=1e3;function Wn(e,t){var n=this;t=t||PE,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,c=r.gfx,l=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(c,a,l):n.drawConnection(c,a,l)}),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)})}function Vr(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function mm(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function su(e,t){var n=se("polyline");return W(n,{points:mm(e)}),t&&W(n,t),n}function fm(e){return Ee(e,function(t){return!je(e,function(n){return n!==t&&vm(t,n)})})}function vm(e,t){if(t){if(e===t)return t;if(e.parent)return vm(e.parent,t)}}function ym(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function Zi(e,t,n){n=n||0,Se(e)||(e=[e]),F(e,function(i,r){var o=t(i,r,n);Se(o)&&o.length&&Zi(o,t,n+1)})}function ss(e,t){return function(n,i){var r=[],o=[];return Zi(n,function(a,c,l){ym(r,a,i);var u=a.children;if(u&&ym(o,u,i))return u}),r}(e,!t)}function gt(e,t){var n,i,r,o;return t=!!t,Se(e)||(e=[e]),F(e,function(a){var c=a;a.waypoints&&!t&&(c=gt(a.waypoints,!0));var l=c.x,u=c.y,p=c.height||0,h=c.width||0;(lr||r===void 0)&&(r=l+h),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:i,height:o-i,width:r-n}}function gm(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function bm(e){return!(!e||!e.isFrame)}function Oo(e,t){return z({},e||{},t||{})}Wn.prototype.canRender=function(){},Wn.prototype.drawShape=function(){},Wn.prototype.drawConnection=function(){},Wn.prototype.getShapePath=function(){},Wn.prototype.getConnectionPath=function(){};function bi(e,t){Wn.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}ae(bi,Wn),bi.prototype.canRender=function(){return!0},bi.prototype.drawShape=function(e,t,n){var i=se("rect");return W(i,{x:0,y:0,width:t.width||0,height:t.height||0}),bm(t)?W(i,z({},this.FRAME_STYLE,n||{})):W(i,z({},this.SHAPE_STYLE,n||{})),pe(e,i),i},bi.prototype.drawConnection=function(e,t,n){var i=su(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return pe(e,i),i},bi.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Vr([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},bi.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([t===0?"M":"L",n.x,n.y]);return Vr(r)},bi.$inject=["eventBus","styles"];const ME={__init__:["defaultRenderer"],defaultRenderer:["type",bi],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){Se(n)||i||(i=n,n=[]);var r=Gt(n,function(o,a){return z(o,e[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return Se(i)||(r=i,i=[]),t.style(i||[],z({},r,n||{}))}}]};function Qe(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function et(e,t,n){if(e&&t){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n||n===-1)return;e.splice(i,1)}n!==-1?e.splice(n,0,t):e.push(t)}}function cu(e,t){return e&&t?e.indexOf(t):-1}function jo(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function lu(e,t,n,i){if(i===void 0&&(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=jo(e,t);return Math.abs(r/o)<=i}var xm=2;function Kn(e,t){var n;return function(i,r){var o;o=Se(i)?i:[i,r];var a=o.slice().shift();return Or(o,function(c){return Math.abs(a.y-c.y)<=xm})}(n=Se(e)?e:[e,t])?"h":!!function(i,r){var o;o=Se(i)?i:[i,r];var a=o.slice().shift();return Or(o,function(c){return Math.abs(a.x-c.x)<=xm})}(n)&&"v"}function Em(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Am(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function km(e,t,n,i,r,o,a,c,l){l==null&&(l=1);for(var u=(l=l>1?1:l<0?0:l)/2,p=[-.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],v=0,f=0;f<12;f++){var y=u*p[f]+u,g=Am(y,e,n,r,a),x=Am(y,t,i,o,c),E=g*g+x*x;v+=h[f]*tt.sqrt(E)}return u*v}function DE(e,t,n,i,r,o,a,c){if(!(Dn(e,n)Dn(r,a)||Dn(t,i)Dn(o,c))){var l=(e*i-t*n)*(o-c)-(t-i)*(r*c-o*a),u=(e-n)*(o-c)-(t-i)*(r-a);if(u){var p=us(((e*i-t*n)*(r-a)-(e-n)*(r*c-o*a))/u),h=us(l/u),v=+p.toFixed(2),f=+h.toFixed(2);if(!(v<+In(e,n).toFixed(2)||v>+Dn(e,n).toFixed(2)||v<+In(r,a).toFixed(2)||v>+Dn(r,a).toFixed(2)||f<+In(t,i).toFixed(2)||f>+Dn(t,i).toFixed(2)||f<+In(o,c).toFixed(2)||f>+Dn(o,c).toFixed(2)))return{x:p,y:h}}}}function us(e){return Math.round(1e11*e)/1e11}function BE(e,t,n){if(!function(m,C){return m=du(m),wi(C=du(C),m.x,m.y)||wi(C,m.x2,m.y)||wi(C,m.x,m.y2)||wi(C,m.x2,m.y2)||wi(m,C.x,C.y)||wi(m,C.x2,C.y)||wi(m,C.x,C.y2)||wi(m,C.x2,C.y2)||(m.xC.x||C.xm.x)&&(m.yC.y||C.ym.y)}(Tm(e),Tm(t)))return n?0:[];for(var i=km.apply(0,e),r=km.apply(0,t),o=Pm(e)?1:~~(i/5)||1,a=Pm(t)?1:~~(r/5)||1,c=[],l=[],u={},p=n?0:[],h=0;h=0&&s<=1&&d>=0&&d<=1&&(n?p++:p.push({x:D.x,y:D.y,t1:s,t2:d}))}}return p}function OE(e){var t=Fr(e);if(t.abs)return ls(t.abs);if(cs(e)&&cs(e&&e[0])||(e=function(E){if(!E)return null;var _=Fr(E);if(_.arr)return Lo(_.arr);var w={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},S=[];return cs(E)&&cs(E[0])&&(S=Lo(E)),S.length||String(E).replace(NE,function(D,s,d){var m=[],C=s.toLowerCase();for(d.replace(IE,function(R,I){I&&m.push(+I)}),C=="m"&&m.length>2&&(S.push([s].concat(m.splice(0,2))),C="l",s=s=="m"?"l":"L");m.length>=w[C]&&(S.push([s].concat(m.splice(0,w[C]))),w[C]););}),S.toString=Fr.toString,_.arr=Lo(S),S}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,l=0;e[0][0]=="M"&&(a=r=+e[0][1],c=o=+e[0][2],l++,i[0]=["M",r,o]);for(var u,p,h=l,v=e.length;h=1e3&&delete Ue[Xe.shift()],Xe.push(ye),Ue[ye]=h.apply(0,Ve),Ue[ye])});if(u)m=u[0],C=u[1],s=u[2],d=u[3];else{e=(p=g(e,t,-f)).x,t=p.y;var x=(e-(c=(p=g(c,l,-f)).x))/2,E=(t-(l=p.y))/2,_=x*x/(n*n)+E*E/(i*i);_>1&&(n*=_=tt.sqrt(_),i*=_);var w=n*n,S=i*i,D=(o==a?-1:1)*tt.sqrt(Ei((w*S-w*E*E-S*x*x)/(w*E*E+S*x*x))),s=D*n*E/i+(e+c)/2,d=D*-i*x/n+(t+l)/2,m=tt.asin(((t-d)/i).toFixed(9)),C=tt.asin(((l-d)/i).toFixed(9));(m=eC&&(m-=2*xi),!a&&C>m&&(C-=2*xi)}var R=C-m;if(Ei(R)>v){var I=C,N=c,L=l;C=m+v*(a&&C>m?1:-1),y=Rm(c=s+n*tt.cos(C),l=d+i*tt.sin(C),n,i,r,0,a,N,L,[C,I,s,d])}R=C-m;var T=tt.cos(m),b=tt.sin(m),B=tt.cos(C),V=tt.sin(C),H=tt.tan(R/4),q=4/3*n*H,J=4/3*i*H,Q=[e,t],oe=[e+q*b,t-J*T],ie=[c+q*V,l-J*B],he=[c,l];if(oe[0]=2*Q[0]-oe[0],oe[1]=2*Q[1]-oe[1],u)return[oe,ie,he].concat(y);for(var Ne=[],ee=0,Z=(y=[oe,ie,he].concat(y).join().split(",")).length;ee7){f[y].shift();for(var g=f[y];g.length;)a[y]="A",f.splice(y++,0,["C"].concat(g.splice(0,6)));f.splice(y,1),p=n.length}},a=[],c="",l="",u=0,p=n.length;u=r.right,c=i.top-n.y>=r.bottom,l=o?"top":c?"bottom":null,u=i.right+n.x<=r.left?"left":a?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function mu(e,t,n){var i=Im(e,t);return i.length===1||i.length===2&&jo(i[0],i[1])<1?Qi(i[0]):i.length>1?(i=mn(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),Qi(i[n?0:i.length-1])):null}function ds(e,t){return Math.round(e*t)/t}function Bm(e){return fe(e)?e+"px":e}function Om(e,t,n){var i=se("g");Ce(i).add(t);var r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var hs="base",fu="djs-element-hidden",LE={shape:["x","y","width","height"],connection:["waypoints"]};function be(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function jm(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}be.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],be.prototype._init=function(e){var t=this._eventBus,n=this._container=function(o){var a=(o=z({},{width:"100%",height:"100%"},o)).container||document.body,c=document.createElement("div");return c.setAttribute("class","djs-container"),z(c.style,{position:"relative",overflow:"hidden",width:Bm(o.width),height:Bm(o.height)}),a.appendChild(c),c}(e),i=this._svg=se("svg");W(i,{width:"100%",height:"100%"}),pe(n,i);var r=this._viewport=Om(i,"viewport");this._layers={},this._planes={},e.deferUpdate!==!1&&(this._viewboxChanged=Zh(qn(this._viewboxChanged,this),300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:i,viewport:r})},this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},be.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},be.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=gm(t);n==="root"?e.setRootElementForPlane(null,e.findPlane(t),!0):e._removeElement(t,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},be.prototype.getDefaultLayer=function(){return this.getLayer(hs,0)},be.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),t!==void 0&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},be.prototype._createLayer=function(e,t){t===void 0&&(t=1);var n=Gt(this._layers,function(i,r){return t>=r.index&&i++,i},0);return{group:Om(this._viewport,"layer-"+e,n),index:t}},be.prototype.getPlane=function(e){if(!e)throw new Error("must specify a name");return this._planes[e]},be.prototype.createPlane=function(e,t){if(!e)throw new Error("must specify a name");if(this._planes[e])throw new Error("plane "+e+" already exists");t||(t={id:"__implicitroot"+e,children:[],isImplicit:!0});var n=this.getLayer(e,0);Ce(n).add(fu);var i=this._planes[e]={layer:n,name:e,rootElement:null};return this.setRootElementForPlane(t,i),i},be.prototype.setActivePlane=function(e){if(!e)throw new Error("must specify a plane");return typeof e=="string"&&(e=this.getPlane(e)),this._activePlane&&Ce(this._activePlane.layer).add(fu),this._activePlane=e,Ce(e.layer).remove(fu),e.rootElement&&this._elementRegistry.updateGraphics(e.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:e}),e},be.prototype.getActiveLayer=function(){return this.getActivePlane().layer},be.prototype.getActivePlane=function(){var e=this._activePlane;return e||(e=this.createPlane(hs),this.setActivePlane(hs)),e},be.prototype.findPlane=function(e){typeof e=="string"&&(e=this._elementRegistry.get(e));var t=function(n){for(;n.parent;)n=n.parent;return n}(e);return je(this._planes,function(n){return n.rootElement===t})},be.prototype.getContainer=function(){return this._container},be.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(F([i.gfx,i.secondaryGfx],function(r){r&&(n?Ce(r).add(t):Ce(r).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},be.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},be.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},be.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),Ce(this.getGraphics(e)).has(t)},be.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},be.prototype.getRootElement=function(){return this.getActivePlane().rootElement},be.prototype.setRootElement=function(e,t){var n=this._activePlane;if(n)return this.setRootElementForPlane(e,n,t);var i=this.createPlane(hs,e);return this.setActivePlane(i),i.rootElement},be.prototype.setRootElementForPlane=function(e,t,n){typeof t=="string"&&(t=this.getPlane(t)),e&&this._ensureValid("root",e);var i=t.rootElement,r=this._elementRegistry,o=this._eventBus;if(i){if(!n)throw new Error("rootElement already set, need to specify override");o.fire("root.remove",{element:i}),o.fire("root.removed",{element:i}),r.remove(i)}if(e){var a=t.layer;o.fire("root.add",{element:e}),r.add(e,a),o.fire("root.added",{element:e,gfx:a}),t===this._activePlane&&this._elementRegistry.updateGraphics(e,this._svg,!0)}return t.rootElement=e,e},be.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 with id "+t.id+" already exists");var n=LE[e],i=Or(n,function(r){return t[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},be.prototype._setParent=function(e,t,n){et(t.children,e,n),e.parent=t},be.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var 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},be.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},be.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},be.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Qe(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},be.prototype.removeShape=function(e){return this._removeElement(e,"shape")},be.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},be.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},be.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},be.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},be.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a,c=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(l.width/e.width,l.height/e.height);var u=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);Bo(c,u)}),e):(t=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=Bo(c))?i.matrix:function(u,p,h,v,f,y){var g=lm().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return um(g,u);case 6:return um(g,{a:u,b:p,c:h,d:v,e:f,f:y})}}(),r=ds(n.a,1e3),o=ds(-n.e||0,1e3),a=ds(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:l})},be.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),jm(t,n)}),{x:n.e,y:n.f}},be.prototype.scrollToElement=function(e,t){var n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));var i=this.findPlane(e);i!==this._activePlane&&this.setActivePlane(i),t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var r,o,a=gt(e),c=ce(a),l=this.viewbox(),u=this.zoom();l.y+=t.top/u,l.x+=t.left/u,l.width-=(t.right+t.left)/u,l.height-=(t.bottom+t.top)/u;var p=ce(l);if(a.width=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},be.prototype._setZoom=function(e,t){var n,i,r,o,a=this._svg,c=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(i=c.getCTM()).a;return t?(n=z(u,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/p*e).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(e),jm(this._viewport,o),o},be.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},be.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();return e.waypoints?t=this.getGraphics(e).getBBox():t=e,{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},be.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var $r="data-element-id";function qt(e){this._elements={},this._eventBus=e}qt.$inject=["eventBus"],qt.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),W(t,$r,i),n&&W(n,$r,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},qt.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(W(i.gfx,$r,""),i.secondaryGfx&&W(i.secondaryGfx,$r,""),delete t[n])},qt.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)},qt.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,W(t,$r,i),t},qt.prototype.get=function(e){var t;t=typeof e=="string"?e:e&&W(e,$r);var n=this._elements[t];return n&&n.element},qt.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},qt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i in ref");t=this.props[t]}t.collection?Vm(this,t,e):function(n,i,r){var o=i.inverse,a=r[i.name];Object.defineProperty(r,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return a},set:function(c){if(c!==a){var l=a;a=null,l&&n.unset(l,o,r),a=c,n.set(a,o,r)}}})}(this,t,e)},_i.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Lm.isExtended(n)||Vm(this,t,e),n},_i.prototype.ensureBound=function(e,t){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(e,t)||this.bind(e,t)},_i.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},_i.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var VE=_i;vu.exports=VE,vu.exports.Collection=ms;const zr=kr(vu.exports);var Fm=new zr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),$m=new zr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zm=new zr({name:"attachers",collection:!0},{name:"host"}),Gm=new zr({name:"outgoing",collection:!0},{name:"source"}),Um=new zr({name:"incoming",collection:!0},{name:"target"});function Vo(){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)}}),Fm.bind(this,"parent"),$m.bind(this,"labels"),Gm.bind(this,"outgoing"),Um.bind(this,"incoming")}function Gr(){Vo.call(this),Fm.bind(this,"children"),zm.bind(this,"host"),zm.bind(this,"attachers")}function Hm(){Gr.call(this)}function fs(){Gr.call(this),$m.bind(this,"labelTarget")}function qm(){Vo.call(this),Gm.bind(this,"source"),Um.bind(this,"target")}ae(Gr,Vo),ae(Hm,Gr),ae(fs,Gr),ae(qm,Vo);var FE={connection:qm,shape:Gr,label:fs,root:Hm};function Xn(){this._uid=12}Xn.prototype.createRoot=function(e){return this.create("root",e)},Xn.prototype.createLabel=function(e){return this.create("label",e)},Xn.prototype.createShape=function(e){return this.create("shape",e)},Xn.prototype.createConnection=function(e){return this.create("connection",e)},Xn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(n,i){var r=FE[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(e,t)};var vs="__fn",$E=Array.prototype.slice;function jt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Fo(){}function ys(e){return e.childNodes[0]}function yu(e,t,n,i,r){var o=Do();o.setTranslate(t,n);var a=Do();a.setRotate(i||0,0,0);var c=Do();c.setScale(1,1),Bo(e,[o,a,c])}function Lt(e,t,n){var i=Do();i.setTranslate(t,n),Bo(e,i)}function Wm(e,t){var n=Do();n.setRotate(t,0,0),Bo(e,n)}function Wt(e,t){this._eventBus=e,this._elementRegistry=t}function Km(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}jt.prototype.on=function(e,t,n,i){if(e=Se(e)?e:[e],At(t)&&(i=n,n=t,t=1e3),!fe(t))throw new Error("priority must be a number");var r=n;i&&((r=qn(n,i))[vs]=n[vs]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},jt.prototype.once=function(e,t,n,i){var r=this;if(At(t)&&(i=n,n=t,t=1e3),!fe(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[vs]=n,this.on(e,t,o)},jt.prototype.off=function(e,t){e=Se(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},jt.prototype.createEvent=function(e){var t=new Fo;return t.init(e),t},jt.prototype.fire=function(e,t){var n,i,r,o;if(o=$E.call(arguments),typeof e=="object"&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Fo?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},jt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},jt.prototype._destroy=function(){this._listeners={}},jt.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},jt.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},jt.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority=0}e.forEach(function o(a){i(a)||((a.__depends__||[]).forEach(o),i(a)||(function(c){t.push(c)}(a),(a.__init__||[]).forEach(function(c){n.push(c)})))});var r=new au(t);return n.forEach(function(o){try{r[typeof o=="string"?"get":"invoke"](o)}catch(a){throw console.error("Failed to instantiate component"),console.error(a.stack),a}}),r}function Ur(e,t){this.injector=t=t||function(n){return GE([{config:["value",n=n||{}]},zE].concat(n.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}Ur.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ur.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var UE=Object.prototype.toString;function gu(){return gu=Object.assign||function(e){for(var t=1;t1?t-1:0),i=1;i1?t-1:0),i=1;i or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Jt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Si(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,vn(e,Hr(this.registerPackage,this))}function ef(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function qr(e){this.model=e}function tf(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Zt(e){this.properties=new qr(this),this.factory=new Jm(this,this.properties),this.registry=new Si(e,this.properties),this.typeCache={}}Jt.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),vn(t,function(r){r in i&&(n[r]=e[r])}),n;var e,t,n,i},Jt.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)},Jt.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 c=r.indexOf(e);if(c===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(t,n?void 0:c,a),o[i.name]=o[i.localName]=t},Jt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Nt(r[0],i),a=Nt(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,e,n),delete e.redefines},Jt.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},Jt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Jt.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},Jt.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},Jt.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")},Jt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Jt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(vn(e.properties,Hr(function(o){o=er({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,c=o.redefines;a||c?this.redefineProperty(o,a||c,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(e),n[r]=e)},Si.prototype.getPackage=function(e){return this.packageMap[e]},Si.prototype.getPackages=function(){return this.packages},Si.prototype.registerPackage=function(e){e=er({},e);var t=this.packageMap;ef(t,e,"prefix"),ef(t,e,"uri"),vn(e.types,Hr(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Si.prototype.registerType=function(e,t){var n=Nt((e=er({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:er(e.meta||{})})).name,t.prefix),i=n.name,r={};vn(e.properties,Hr(function(o){var a=Nt(o.name,n.prefix),c=a.name;_u(o.type)||(o.type=Nt(o.type,a.prefix).name),er(o,{ns:a,name:c}),r[c]=o},this)),er(e,{ns:n,name:i,propertiesByName:r}),vn(e.extends,Hr(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Si.prototype.mapTypes=function(e,t,n){var i=_u(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=Nt(c,_u(c)?"":e.prefix);r.mapTypes(u,t,l)}if(!i)throw new Error("unknown type <"+e.name+">");vn(i.superClass,n?o:a),t(i,!n),vn(i.traits,o)},Si.prototype.getEffectiveDescriptor=function(e){var t=Nt(e),n=new Jt(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},Si.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},qr.prototype.set=function(e,t,n){if(!Ym(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;n===void 0?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:tf(e,i,n):e.$attrs[t]=n},qr.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&tf(e,n,[]),e[i]},qr.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=er({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},qr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},qr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Zt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Zt.prototype.getType=function(e){var t=this.typeCache,n=Ym(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Zt.prototype.createAny=function(e,t,n){var i=Nt(e),r={$type:e,$instanceOf:function(a){return a===this.$type}},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,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),vn(n,function(a,c){var l;l=a,bu.call(l)==="[object Object]"&&a.value!==void 0?r[a.name]=a.value:r[c]=a}),r},Zt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Zt.prototype.getPackages=function(){return this.registry.getPackages()},Zt.prototype.getElementDescriptor=function(e){return e.$descriptor},Zt.prototype.hasType=function(e,t){return t===void 0&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Zt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Zt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Su=Object.prototype.toString,YE=Object.prototype.hasOwnProperty;function nf(e){return Su.call(e)==="[object Array]"}function gs(e){return Su.call(e)==="[object String]"}function rf(e,t){return YE.call(e,t)}function of(e,t){var n;return t=af(t),xt(e,function(i,r){if(t(i,r))return n=i,!1}),n}function Cu(e,t){var n=[];return xt(e,function(i,r){t(i,r)&&n.push(i)}),n}function xt(e,t){var n;if(e!==void 0){var i=nf(e)?ZE:JE;for(var r in e)if(rf(e,r)&&t(n=e[r],i(r))===!1)return n}}function af(e){return t=e,(n=Su.call(t))==="[object Function]"||n==="[object AsyncFunction]"||n==="[object GeneratorFunction]"||n==="[object AsyncGeneratorFunction]"||n==="[object Proxy]"?e:function(i){return i===e};var t,n}function JE(e){return e}function ZE(e){return Number(e)}function Tu(){return Tu=Object.assign||function(e){for(var t=1;t1?t-1:0),i=1;i",lt:"<",quot:'"'};function nw(e,t,n,i){return i?ew.call($o,i)?$o[i]:"&"+i+";":QE(t||parseInt(n,16))}function tr(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(tw,nw):e}Object.keys($o).forEach(function(e){$o[e.toUpperCase()]=$o[e]});var sf="xsi:type",cf="non-whitespace outside of root node";function Wr(e){return new Error(e)}function lf(e){return"missing namespace for prefix <"+e+">"}function bs(e){return{get:e,enumerable:!0}}function iw(e){var t,n={};for(t in e)n[t]=e[t];return n}function Au(e){return e+"$uri"}function uf(){return{line:0,column:0}}function rw(e){throw e}function pf(e){if(!this)return new pf(e);var t,n,i,r,o,a,c,l,u,p=e&&e.proxy,h=rw,v=uf,f=!1,y=!1,g=null,x=!1;function E(w){w instanceof Error||(w=Wr(w)),g=w,h(w,v)}function _(w){o&&(w instanceof Error||(w=Wr(w)),o(w,v))}this.on=function(w,S){if(typeof S!="function")throw Wr("required args ");switch(w){case"openTag":n=S;break;case"text":t=S;break;case"closeTag":i=S;break;case"error":h=S;break;case"warn":o=S;break;case"cdata":r=S;break;case"attention":l=S;break;case"question":c=S;break;case"comment":a=S;break;default:throw Wr("unsupported event: "+w)}return this},this.ns=function(w){if(w===void 0&&(w={}),typeof w!="object")throw Wr("required args ");var S,D={};for(S in w)D[S]=w[S];return D["http://www.w3.org/2001/XMLSchema-instance"]="xsi",y=!0,u=D,this},this.parse=function(w){if(typeof w!="string")throw Wr("required args ");return g=null,function(S){var D,s,d,m,C,R,I,N,L,T,b,B=y?[]:null,V=y?function(_e){var Ve,ye,Ue={};for(Ve in _e)Ue[ye=_e[Ve]]=ye,Ue[Au(ye)]=Ve;return Ue}(u):null,H=[],q=0,J=!1,Q=!1,oe=0,ie=0,he="",Ne=0;function ee(){if(b!==null)return b;var _e,Ve,ye,Ue,Xe,Ie,pt,ke,He,me,Fe,ci=y&&V.xmlns,Ui=y&&f?[]:null,Je=Ne,vt=he,ln=vt.length,li={},Ua={};e:for(;Je8)){for((me<65||me>122||me>90&&me<97)&&me!==95&&me!==58&&(_("illegal first char attribute name"),He=!0),Fe=Je+1;Fe96&&me<123||me>64&&me<91||me>47&&me<59||me===46||me===45||me===95)){if(me===32||me<14&&me>8){_("missing attribute value"),Je=Fe;continue e}if(me===61)break;_("illegal attribute name char"),He=!0}if((ke=vt.substring(Je,Fe))==="xmlns:xmlns"&&(_("illegal declaration of xmlns"),He=!0),(me=vt.charCodeAt(Fe+1))===34)(Fe=vt.indexOf('"',Je=Fe+2))===-1&&(Fe=vt.indexOf("'",Je))!==-1&&(_("attribute value quote missmatch"),He=!0);else if(me===39)(Fe=vt.indexOf("'",Je=Fe+2))===-1&&(Fe=vt.indexOf('"',Je))!==-1&&(_("attribute value quote missmatch"),He=!0);else for(_("missing attribute value quotes"),He=!0,Fe+=1;Fe8);Fe++);for(Fe===-1&&(_("missing closing quotes"),Fe=ln,He=!0),He||(Ie=vt.substring(Je,Fe)),Je=Fe;Fe+18);Fe++)Je===Fe&&(_("illegal character after attribute end"),He=!0);if(Je=Fe+1,!He)if(ke in Ua)_("attribute <"+ke+"> already defined");else if(Ua[ke]=!0,y)if(f){if((Xe=ke==="xmlns"?"xmlns":ke.charCodeAt(0)===120&&ke.substr(0,6)==="xmlns:"?ke.substr(6):null)!==null){if(_e=tr(Ie),Ve=Au(Xe),!(pt=u[_e])){if(Xe==="xmlns"||Ve in V&&V[Ve]!==_e)do pt="ns"+q++;while(V[pt]!==void 0);else pt=Xe;u[_e]=pt}V[Xe]!==pt&&(Ue||(V=iw(V),Ue=!0),V[Xe]=pt,Xe==="xmlns"&&(V[Au(pt)]=_e,ci=pt),V[Ve]=_e),li[ke]=Ie;continue}Ui.push(ke,Ie)}else(me=ke.indexOf(":"))!==-1?(ye=V[ke.substring(0,me)])?((ke=ci===ye?ke.substr(me+1):ye+ke.substr(me))===sf&&((me=Ie.indexOf(":"))!==-1?(ye=Ie.substring(0,me),Ie=(ye=V[ye]||ye)+Ie.substring(me)):Ie=ci+":"+Ie),li[ke]=Ie):_(lf(ke.substring(0,me))):li[ke]=Ie;else li[ke]=Ie}if(f)for(Je=0,ln=Ui.length;Je=Ie&&(_e=ye.exec(S))&&!((pt=_e[0].length+_e.index)>oe);)Ue+=1,Ie=pt;return oe==-1?(Xe=pt,Ve=S.substring(ie)):ie===0?Ve=S.substring(ie,oe):(Xe=oe-Ie,Ve=ie==-1?S.substring(oe):S.substring(oe,ie+1)),{data:Ve,line:Ue,column:Xe}}for(v=Z,p&&(T=Object.create({},{name:bs(function(){return N}),originalName:bs(function(){return L}),attrs:bs(ee),ns:bs(function(){return V})}));ie!==-1;){if((oe=S.charCodeAt(ie)===60?ie:S.indexOf("<",ie))===-1)return H.length?E("unexpected end of file"):ie===0?E("missing start tag"):void(ie",oe))===-1)return E("unclosed cdata");if(r&&(r(S.substring(oe+9,ie),v),x))return;ie+=3;continue}if(m===45&&S.charCodeAt(oe+3)===45){if((ie=S.indexOf("-->",oe))===-1)return E("unclosed comment");if(a&&(a(S.substring(oe+4,ie),tr,v),x))return;ie+=3;continue}}if(C!==63){for(s=oe+1;;s++){if(R=S.charCodeAt(s),isNaN(R))return ie=-1,E("unclosed tag");if(R===34)s=(m=S.indexOf('"',s+1))!==-1?m:s;else if(R===39)s=(m=S.indexOf("'",s+1))!==-1?m:s;else if(R===62){ie=s;break}}if(C!==33){if(b={},C===47){if(J=!1,Q=!0,!H.length)return E("missing open tag");if(s=N=H.pop(),m=oe+2+s.length,S.substring(oe+2,m)!==s)return E("closing tag mismatch");for(;m8&&C<14))return E("close tag")}else{if(S.charCodeAt(ie-1)===47?(s=N=S.substring(oe+1,ie-1),J=!0,Q=!0):(s=N=S.substring(oe+1,ie),J=!0,Q=!1),!(C>96&&C<123||C>64&&C<91||C===95||C===58))return E("illegal first char nodeName");for(m=1,d=s.length;m96&&C<123||C>64&&C<91||C>47&&C<59||C===45||C===95||C==46)){if(C===32||C<14&&C>8){N=s.substring(0,m),b=null;break}return E("invalid nodeName")}Q||H.push(N)}if(y){if(D=V,J&&(Q||B.push(D),b===null&&(f=s.indexOf("xmlns",m)!==-1)&&(Ne=m,he=s,ee(),f=!1)),L=N,(C=N.indexOf(":"))!==-1){if(!(I=V[N.substring(0,C)]))return E("missing namespace on <"+L+">");N=N.substr(C+1)}else I=V.xmlns;I&&(N=I+":"+N)}if(J&&(Ne=m,he=s,n&&(p?n(T,tr,Q,v):n(N,ee,tr,Q,v),x)))return;if(Q){if(i&&(i(p?T:N,tr,J,v),x))return;y&&(V=J?D:B.pop())}ie+=1}else{if(l&&(l(S.substring(oe,ie+1),tr,v),x))return;ie+=1}}else{if((ie=S.indexOf("?>",oe))===-1)return E("unclosed question");if(c&&(c(S.substring(oe,ie+2),v),x))return;ie+=2}}}(w),v=uf,x=!1,g},this.stop=function(){x=!0}}function df(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var ow={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},xs="xsi:type";function hf(e){return e.xml&&e.xml.serialize}function mf(e){return hf(e)===xs}function ff(e,t){return df(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ci(e){return new Error(e)}function Yn(e){return e.$descriptor}function aw(e){yn(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Ci("expected element");var n,i=this.elementsById,r=Yn(t).idProperty;if(r&&(n=t.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw Ci("duplicate ID <"+n+">");i[n]=t}},this.addWarning=function(t){this.warnings.push(t)}}function zo(){}function ku(){}function Kr(){}function Go(e,t){this.property=e,this.context=t}function Pu(e,t){this.element=t,this.propertyDesc=e}function Es(){}function kt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Mu(e,t,n){kt.call(this,e,t,n)}function Xr(e,t,n){this.model=e,this.context=n}function Ru(e){e instanceof Zt&&(e={model:e}),yn(this,{lax:!1},e)}zo.prototype.handleEnd=function(){},zo.prototype.handleText=function(){},zo.prototype.handleNode=function(){},ku.prototype=Object.create(zo.prototype),ku.prototype.handleNode=function(){return this},Kr.prototype=Object.create(zo.prototype),Kr.prototype.handleText=function(e){this.body=(this.body||"")+e},Go.prototype=Object.create(Kr.prototype),Go.prototype.handleNode=function(e){if(this.element)throw Ci("expected no sub nodes");return this.element=this.createReference(e),this},Go.prototype.handleEnd=function(){this.element.id=this.body},Go.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Pu.prototype=Object.create(Kr.prototype),Pu.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=wu(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Es.prototype=Object.create(Kr.prototype),Es.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},kt.prototype=Object.create(Es.prototype),kt.prototype.addReference=function(e){this.context.addReference(e)},kt.prototype.handleText=function(e){if(!Yn(this.element).bodyProperty)throw Ci("unexpected body text <"+e+">");Kr.prototype.handleText.call(this,e)},kt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Yn(t).bodyProperty;n&&e!==void 0&&(e=wu(n.type,e),t.set(n.name,e))},kt.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Yn(i),o=this.context,a=new i({}),c=this.model;return xt(n,function(l,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?xt(l.split(" "),function(h){o.addReference({element:a,property:p.ns.name,id:h})}):o.addReference({element:a,property:p.ns.name,id:l}):(p?l=wu(p.type,l):u!=="xmlns"&&(t=Nt(u,r.ns.prefix),c.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:l})),a.set(u,l))}),a},kt.prototype.getPropertyForNode=function(e){var t,n,i=Nt(e.name),r=this.type,o=this.model,a=Yn(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return mf(l)&&(t=e.attributes[xs])?(t=function(p,h){var v=Nt(p);return function(f,y){var g=f.name,x=f.localName,E=y.xml&&y.xml.typePrefix;return E&&x.indexOf(E)===0?f.prefix+":"+x.slice(E.length):g}(v,h.getPackage(v.prefix))}(t,o),yn({},l,{effectiveType:Yn(n=o.getType(t)).name})):l;var u=o.getPackage(i.prefix);if(u){if(t=ff(i,u),n=o.getType(t),l=of(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return yn({},l,{effectiveType:Yn(n).name})}else if(l=of(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw Ci("unrecognized element <"+i.name+">")},kt.prototype.toString=function(){return"ElementDescriptor["+Yn(this.type).name+"]"},kt.prototype.valueHandler=function(e,t){return new Pu(e,t)},kt.prototype.referenceHandler=function(e){return new Go(e,this.context)},kt.prototype.handler=function(e){return e==="Element"?new Xr(this.model,e,this.context):new kt(this.model,e,this.context)},kt.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Qm(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(yn(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Mu.prototype=Object.create(kt.prototype),Mu.prototype.createElement=function(e){var t=e.name,n=Nt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&ff(n,o)||t;if(!r.hasType(a))throw Ci("unexpected element <"+e.originalName+">");return kt.prototype.createElement.call(this,e)},Xr.prototype=Object.create(Es.prototype),Xr.prototype.createElement=function(e){var t=e.name,n=Nt(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Xr.prototype.handleChild=function(e){var t=new Xr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Xr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Ru.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof kt?(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 aw(yn({},t,{rootHandler:i})),c=new pf({proxy:!0}),l=function(){var x=[];return Object.defineProperty(x,"peek",{value:function(){return this[this.length-1]}}),x}();function u(x,E,_){var w=E(),S=w.line,D=w.column,s=w.data;s.charAt(0)==="<"&&s.indexOf(" ")!==-1&&(s=s.slice(0,s.indexOf(" "))+">");var d="unparsable content "+(s?s+" ":"")+`detected line: `+S+` column: `+D+` nested error: `+x.message;if(_)return a.addWarning({message:d,error:x}),!0;throw Ci(d)}function p(x,E){return u(x,E,!0)}i.context=a,l.push(i);var h=/^<\?xml /i,v=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function y(x,E){try{l.peek().handleText(x)}catch(_){p(_,E)}}var g=r.getPackages().reduce(function(x,E){return x[E.uri]=E.prefix,x},{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(g).on("openTag",function(x,E,_,w){var S=x.attrs||{},D=Object.keys(S).reduce(function(s,d){var m=E(S[d]);return s[d]=m,s},{});(function(s,d){var m=l.peek();try{l.push(m.handleNode(s))}catch(C){u(C,d,o)&&l.push(new ku)}})({name:x.name,originalName:x.originalName,attributes:D,ns:x.ns},w)}).on("question",function(x){if(h.test(x)){var E=v.exec(x),_=E&&E[1];_&&!f.test(_)&&a.addWarning({message:"unsupported document encoding <"+_+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",y).on("text",function(x,E,_){(function(w,S){w.trim()&&y(w,S)})(E(x),_)}).on("error",u).on("warn",p),new Promise(function(x,E){var _;try{c.parse(e),function(){var d,m,C=a.elementsById,R=a.references;for(d=0;m=R[d];d++){var I=m.element,N=C[m.id],L=Yn(I).propertiesByName[m.property];if(N||a.addWarning({message:"unresolved reference <"+m.id+">",element:m.element,property:m.property,value:m.id}),L.isMany){var T=I.get(L.name),b=T.indexOf(m);b===-1&&(b=T.length),N?T[b]=N:T.splice(b,1)}else I.set(L.name,N)}}()}catch(d){_=d}var w=i.element;_||w||(_=Ci("failed to parse document as <"+i.type.$descriptor.name+">"));var S=a.warnings,D=a.references,s=a.elementsById;return _?(_.warnings=S,E(_)):x({rootElement:w,elementsById:s,references:D,warnings:S})})},Ru.prototype.handler=function(e){return new Mu(this.model,e)};var sw=/<|>|'|"|&|\n\r|\n/g,vf=/<|>|&/g;function cw(e){var t={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||e&&e.byUri(a)},this.add=function(a,c){n[a.uri]=a,c?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return t[a||"xmlns"]},this.mapPrefix=function(a,c){t[a||"xmlns"]=c},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var c=a.uri,l=this.getNSKey(a);i[l]=this.byUri(c),e&&e.logUsed(a)},this.getUsed=function(a){var c=this;return[].concat(r,o).filter(function(l){var u=c.getNSKey(l);return i[u]})}}function lw(e,t){return df(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function yf(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function gf(e){return gs(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var uw={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},pw={"<":"lt",">":"gt","&":"amp"};function bf(e,t,n){return(e=gs(e)?e:""+e).replace(t,function(i){return"&"+n[i]+";"})}function Nu(e){this.tagName=e}function nr(){}function Iu(e){this.tagName=e}function qe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ws(e,t){qe.call(this,e,t)}function dw(){this.value="",this.write=function(e){this.value+=e}}function hw(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 mw(e){return e=yn({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new dw,r=new hw(i,e.format);if(e.preamble&&r.append(` `),new qe().build(t).serializeTo(r),!n)return i.value}}}function _s(e,t){Zt.call(this,e,t)}Nu.prototype.build=function(e){return this.element=e,this},Nu.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},nr.prototype.serializeValue=nr.prototype.serializeTo=function(e){e.append(this.escape?bf(this.value,vf,pw):this.value)},nr.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(vf)!==-1&&(this.escape=!0),this},yf(Iu,nr),Iu.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},qe.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(a){return Cu(a.$descriptor.properties,function(c){var l=c.name;if(c.isVirtual||!rf(a,l))return!1;var u=a[l];return u!==c.default&&u!==null&&(!c.isMany||u.length)})}(e),this.parseAttributes(Cu(n,function(a){return a.isAttr})),this.parseContainments(function(a){return Cu(a,function(c){return!c.isAttr})}(n))),this.parseGenericAttributes(e,t),this},qe.prototype.nsTagName=function(e){return function(t,n){return n.isGeneric?yn({localName:n.ns.localName},t):yn({localName:lw(n.ns.localName,n.$pkg)},t)}(this.logNamespaceUsed(e.ns),e)},qe.prototype.nsPropertyTagName=function(e){return function(t,n){return yn({localName:n.ns.localName},t)}(this.logNamespaceUsed(e.ns),e)},qe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},qe.prototype.nsAttributeName=function(e){var t;if(t=gs(e)?Nt(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:yn({localName:t.localName},n)},qe.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return xt(e,function(r,o){o==="$body"?n.push(new nr().build({type:"String"},r)):o==="$children"?xt(r,function(a){n.push(new qe(t).build(a))}):o.indexOf("$")!==0&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})}),i},qe.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Nt(t);if(o.prefix==="xmlns"&&(i={prefix:o.localName,uri:n}),o.prefix||o.localName!=="xmlns"||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},qe.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return xt(i,function(o,a){var c=n.parseNsAttribute(e,a,o);c&&r.push(c)}),r},qe.prototype.parseGenericAttributes=function(e,t){var n=this;xt(t,function(i){if(i.name!==xs)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){console.warn("missing namespace information for ",i.name,"=",i.value,"on",e,r)}})},qe.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;xt(e,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new nr().build(r,o[0]));else if(Qm(r.type))xt(o,function(u){n.push(new Iu(t.addTagName(t.nsPropertyTagName(r))).build(r,u))});else if(a)xt(o,function(u){n.push(new Nu(t.addTagName(t.nsPropertyTagName(r))).build(u))});else{var c=mf(r),l=function(u){return hf(u)==="property"}(r);xt(o,function(u){var p;p=c?new ws(t,r):l?new qe(t,r):new qe(t),n.push(p.build(u))})}})},qe.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new cw(t):n=t),n},qe.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},qe.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),c=e.prefix,l=e.uri;if(!c&&!l)return{localName:e.localName};if(r=ow[c]||o&&(o.getPackage(c)||{}).uri,!(l=l||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(e=a.byUri(l))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return c&&a.mapPrefix(c,l),e},qe.prototype.parseAttributes=function(e){var t=this,n=this.element;xt(e,function(i){var r=n.get(i.name);if(i.isReference)if(i.isMany){var o=[];xt(r,function(a){o.push(a.id)}),r=o.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(i),r)})},qe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),gf(e)},qe.prototype.addAttribute=function(e,t){var n=this.attrs;gs(t)&&(t=bf(t,sw,uw));var i=function(o,a){a=af(a);var c=nf(o)?-1:void 0;return xt(o,function(l,u){if(a(l,u))return c=u,!1}),c}(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)},qe.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(i){return i.getUsed().filter(function(r){return r.prefix!=="xml"}).map(function(r){return{name:"xmlns"+(r.prefix?":"+r.prefix:""),value:r.uri}})}(n).concat(t)),xt(t,function(i){e.append(" ").append(gf(i.name)).append('="').append(i.value).append('"')})},qe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==nr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),xt(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},yf(ws,qe),ws.prototype.parseNsAttributes=function(e){var t=qe.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(xs),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},ws.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},_s.prototype=Object.create(Zt.prototype),_s.prototype.fromXML=function(e,t,n){var i;i=t,UE.call(i)!=="[object String]"&&(n=t,t="bpmn:Definitions");var r=new Ru(Xm({model:this,lax:!0},n)),o=r.handler(t);return r.fromXML(e,o)},_s.prototype.toXML=function(e,t){var n=new mw(t);return new Promise(function(i,r){try{return i({xml:n.toXML(e)})}catch(o){return r(o)}})};var fw={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function vw(e,t){return new _s(Xm({},fw,e),t)}function Et(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}var yw=new zr({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function Vt(e,t){return e.$instanceOf(t)}function gw(e,t){var n={},i=[];function r(I,N){return function(L){I(L,N)}}function o(I){n[I.id]=I}function a(I,N){try{var L=I.di&&function(T,b){if(T.gfx)throw new Error(t("already rendered {element}",{element:Et(T)}));return e.element(T,b)}(I,N);return o(I),L}catch(T){c(T.message,{element:I,error:T}),console.error(t("failed to import {element}",{element:Et(I)})),console.error(T)}}function c(I,N){e.error(I,N)}function l(I){var N=I.bpmnElement;N?N.di?c(t("multiple DI elements defined for {element}",{element:Et(N)}),{element:N}):(yw.bind(N,"di"),N.di=I):c(t("no bpmnElement referenced in {element}",{element:Et(I)}),{element:I})}function u(I){var N;l(N=I.plane),F(N.planeElement,p)}function p(I){l(I)}function h(){for(;i.length;)i.shift()()}function v(I,N){C(I,N),w(I.ioSpecification,N),_(I.artifacts,N),o(I)}function f(I,N){a(I,N)}function y(I,N){a(I,N)}function g(I,N){a(I,N)}function x(I,N){a(I,N)}function E(I,N){a(I,N)}function _(I,N){F(I,function(L){Vt(L,"bpmn:Association")?i.push(function(){E(L,N)}):E(L,N)})}function w(I,N){I&&(F(I.dataInputs,r(g,N)),F(I.dataOutputs,r(x,N)))}function S(I,N){C(I,N),_(I.artifacts,N)}function D(I,N){var L=a(I,N);Vt(I,"bpmn:SubProcess")&&S(I,L||N),Vt(I,"bpmn:Activity")&&w(I.ioSpecification,N),i.push(function(){F(I.dataInputAssociations,r(y,N)),F(I.dataOutputAssociations,r(y,N))})}function s(I,N){a(I,N)}function d(I,N){i.push(function(){var L=a(I,N);I.childLaneSet&&m(I.childLaneSet,L||N),function(T){F(T.flowNodeRef,function(b){var B=b.get("lanes");B&&B.push(T)})}(I)})}function m(I,N){F(I.lanes,r(d,N))}function C(I,N){(function(L,T){F(L,function(b){Vt(b,"bpmn:SequenceFlow")?i.push(function(){(function(B,V){a(B,V)})(b,T)}):Vt(b,"bpmn:BoundaryEvent")?i.unshift(function(){D(b,T)}):Vt(b,"bpmn:FlowNode")?D(b,T):Vt(b,"bpmn:DataObject")||(Vt(b,"bpmn:DataStoreReference")||Vt(b,"bpmn:DataObjectReference")?s(b,T):c(t("unrecognized flowElement {element} in context {context}",{element:Et(b),context:T?Et(T.businessObject):"null"}),{element:b,context:T}))})})(I.flowElements,N),I.laneSets&&function(L,T){F(L,r(m,T))}(I.laneSets,N)}function R(I,N){var L=a(I,N),T=I.processRef;T&&v(T,L||N)}return{handleDeferred:h,handleDefinitions:function(I,N){var L=I.diagrams;if(N&&L.indexOf(N)===-1)throw new Error(t("diagram not part of bpmn:Definitions"));if(!N&&L&&L.length&&(N=L[0]),!N)throw new Error(t("no diagram to display"));u(N);var T=N.plane;if(!T)throw new Error(t("no plane for {element}",{element:Et(N)}));var b=T.bpmnElement;if(!b){if(b=function(H){return je(H.rootElements,function(q){return Vt(q,"bpmn:Process")||Vt(q,"bpmn:Collaboration")})}(I),!b)throw new Error(t("no process or collaboration to display"));c(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Et(T),rootElement:Et(b)})),T.bpmnElement=b,l(T)}var B,V=function(H,q){return e.root(H,q)}(b,T);if(Vt(b,"bpmn:Process"))v(b,V);else{if(!Vt(b,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Et(T),rootElement:Et(b)}));F((B=b).participants,r(R)),_(B.artifacts),i.push(function(){var H;F(B.messageFlows,r(f,H))}),function(H,q){Ee(H,function(J){return!n[J.id]&&Vt(J,"bpmn:Process")&&J.laneSets}).forEach(r(v,q))}(I.rootElements,V)}h()},handleSubProcess:S,registerDi:l}}function bw(e,t,n){var i,r,o,a=[];return new Promise(function(c,l){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),r.fire("import.render.start",{definitions:t}),function(u,p){new gw({root:function(h){return i.add(h)},element:function(h,v){return i.add(h,v)},error:function(h,v){a.push({message:h,context:v})}},o).handleDefinitions(u,p)}(t,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(u){return u.warnings=a,l(u)}})}function Yr(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&&At(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var 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)})}}var xf='';function Ss(e){return e.join(";")}var Uo,Ef=Ss(["color: #404040"]),xw='
'+xf+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
';function We(e){var t,n;e=z({},Ew,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=ze(''+xf+""),t.appendChild(n),le.bind(n,"click",function(i){Uo||(Uo=ze(xw),Ht.bind(Uo,".backdrop","click",function(r){document.body.removeChild(Uo)})),document.body.appendChild(Uo),i.preventDefault()}),this._init(this._container,this._moddle,e)}function Cs(e,t){return e.warnings=t,e}ae(We,Ur),We.prototype.importXML=Yr(function(e,t){var n=this;return new Promise(function(i,r){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then(function(o){var a=o.rootElement,c=o.references,l=o.warnings,u=o.elementsById;a=n._emit("import.parse.complete",function(p){var h=n.get("eventBus").createEvent(p);return Object.defineProperty(h,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete is deprecated and will be removed in future library versions")),{warnings:p.warnings,references:p.references,elementsById:p.elementsById}}}),h}({error:null,definitions:a,elementsById:u,references:c,warnings:l}))||a,n.importDefinitions(a,t).then(function(p){var h=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:null,warnings:h}),i({warnings:h})}).catch(function(p){var h=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:p,warnings:h}),r(Cs(p,h))})}).catch(function(o){return n._emit("import.parse.complete",{error:o}),o=function(a){var c=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(a.message);return c&&(a.message="unparsable content <"+c[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+c[2]),a}(o),n._emit("import.done",{error:o,warnings:o.warnings}),r(o)})})}),We.prototype.importDefinitions=Yr(function(e,t){var n=this;return new Promise(function(i,r){n._setDefinitions(e),n.open(t).then(function(o){var a=o.warnings;return i({warnings:a})}).catch(function(o){return r(o)})})}),We.prototype.open=Yr(function(e){var t=this._definitions,n=e,i=this;return new Promise(function(r,o){if(!t){var a=new Error("no XML imported");return o(Cs(a,[]))}if(typeof e=="string"&&(n=function(l,u){return u&&je(l.diagrams,function(p){return p.id===u})||null}(t,e),!n)){var c=new Error("BPMNDiagram <"+e+"> not found");return o(Cs(c,[]))}try{i.clear()}catch(l){return o(Cs(l,[]))}bw(i,t,n).then(function(l){var u=l.warnings;return r({warnings:u})}).catch(function(l){return o(l)})})}),We.prototype.saveXML=Yr(function(e){e=e||{};var t=this,n=this._definitions;return new Promise(function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then(function(r){var o=r.xml;return o=t._emit("saveXML.serialized",{xml:o})||o,i({xml:o})})}).catch(function(i){return{error:i}}).then(function(i){t._emit("saveXML.done",i);var r=i.error;return r?Promise.reject(r):i})}),We.prototype.saveSVG=Yr(function(e){var t=this;return new Promise(function(n,i){var r,o;t._emit("saveSVG.start");try{var a=t.get("canvas"),c=a.getDefaultLayer(),l=Ye("defs",a._svg),u=hm(c),p=l?""+hm(l)+"":"",h=c.getBBox();r=` '+p+u+""}catch(v){o=v}return t._emit("saveSVG.done",{error:o,svg:r}),o?i(o):n({svg:r})})}),We.prototype._setDefinitions=function(e){this._definitions=e},We.prototype.getModules=function(){return this._modules},We.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(e){var t=e.businessObject;t&&t.di&&delete t.di}),Ur.prototype.clear.call(this))},We.prototype.destroy=function(){Ur.prototype.destroy.call(this),Nn(this._container)},We.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},We.prototype.off=function(e,t){this.get("eventBus").off(e,t)},We.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=Ye(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},We.prototype.getDefinitions=function(){return this._definitions},We.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},We.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=z(vi(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Ur.call(this,a),n&&n.container&&this.attachTo(n.container)},We.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},We.prototype._createContainer=function(e){var t=ze('
');return z(t.style,{width:wf(e.width),height:wf(e.height),position:e.position}),t},We.prototype._createModdle=function(e){return new vw(z({},this._moddleExtensions,e.moddleExtensions))},We.prototype._modules=[];var Ew={width:"100%",height:"100%",position:"relative"};function wf(e){return e+(fe(e)?"px":"")}function Ho(e){We.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)}function A(e,t){var n=re(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function re(e){return e&&e.businessObject||e}function Oe(e){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?re(e).di&&!!re(e).di.isExpanded:!A(e,"bpmn:Participant")||!!re(e).processRef)}function Ft(e){return e&&!!re(e).triggeredByEvent}function Ts(e,t){var n=re(e),i=!1;return n.eventDefinitions&&F(n.eventDefinitions,function(r){A(r,t)&&(i=!0)}),i}function _f(e){return A(e,"bpmn:FlowElement")||A(e,"bpmn:Participant")||A(e,"bpmn:Lane")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")?"name":A(e,"bpmn:TextAnnotation")?"text":A(e,"bpmn:Group")?"categoryValueRef":void 0}function gn(e){var t=e.businessObject,n=_f(t);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(t):t[n]||""}function Bn(e,t,n){return Yi(e.eventDefinitions,function(i){return i.$type===t&&function(r,o){return Or(o,function(a,c){return r[c]==a})}(e,n)})}function Jr(e){return e.businessObject.di}function Pt(e){return e.businessObject}function Te(e,t){var n=Jr(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function te(e,t){var n=Jr(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||"black"}function qo(e,t,n){var i=Jr(e).get("label");return i&&i.get("color:color")||t||te(e,n)}ae(Ho,We),Ho.prototype._createModdle=function(e){var t=We.prototype._createModdle.call(this,e);return t.ids=new Pn([32,36,1]),t},Ho.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var ww=new Pn,Zr=.95;function ir(e,t,n,i,r,o,a){Wn.call(this,t,a);var c=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor,p=ww.next(),h={},v=n.computeStyle;function f(T,b){var B=z({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},b.attrs),V=b.ref||{x:0,y:0},H=b.scale||1;B.strokeDasharray==="none"&&(B.strokeDasharray=[1e4,1]);var q=se("marker");W(b.element,B),pe(q,b.element),W(q,{id:T,viewBox:"0 0 20 20",refX:V.x,refY:V.y,markerWidth:20*H,markerHeight:20*H,orient:"auto"});var J=Ye("defs",r._svg);J||(J=se("defs"),pe(r._svg,J)),pe(J,q),h[T]=q}function y(T){return T.replace(/[^0-9a-zA-z]+/g,"_")}function g(T,b,B){var V=T+"-"+y(b)+"-"+y(B)+"-"+p;return h[V]||function(H,q,J,Q){if(q==="sequenceflow-end"){var oe=se("path");W(oe,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(H,{element:oe,ref:{x:11,y:10},scale:.5,attrs:{fill:Q,stroke:Q}})}if(q==="messageflow-start"){var ie=se("circle");W(ie,{cx:6,cy:6,r:3.5}),f(H,{element:ie,attrs:{fill:J,stroke:Q},ref:{x:6,y:6}})}if(q==="messageflow-end"){var he=se("path");W(he,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(H,{element:he,attrs:{fill:J,stroke:Q,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if(q==="association-start"){var Ne=se("path");W(Ne,{d:"M 11 5 L 1 10 L 11 15"}),f(H,{element:Ne,attrs:{fill:"none",stroke:Q,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if(q==="association-end"){var ee=se("path");W(ee,{d:"M 1 5 L 11 10 L 1 15"}),f(H,{element:ee,attrs:{fill:"none",stroke:Q,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if(q==="conditional-flow-marker"){var Z=se("path");W(Z,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(H,{element:Z,attrs:{fill:J,stroke:Q},ref:{x:-1,y:10},scale:.5})}if(q==="conditional-default-flow-marker"){var _e=se("path");W(_e,{d:"M 6 4 L 10 16"}),f(H,{element:_e,attrs:{stroke:Q},ref:{x:0,y:10},scale:.5})}}(V,T,b,B),"url(#"+V+")"}function x(T,b,B,V,H){Tt(V)&&(H=V,V=0),V=V||0,(H=v(H,{stroke:"black",strokeWidth:2,fill:"white"})).fill==="none"&&delete H.fillOpacity;var q=b/2,J=B/2,Q=se("circle");return W(Q,{cx:q,cy:J,r:Math.round((b+B)/4-V)}),W(Q,H),pe(T,Q),Q}function E(T,b,B,V,H,q){Tt(H)&&(q=H,H=0),H=H||0,q=v(q,{stroke:"black",strokeWidth:2,fill:"white"});var J=se("rect");return W(J,{x:H,y:H,width:b-2*H,height:B-2*H,rx:V,ry:V}),W(J,q),pe(T,J),J}function _(T,b,B){var V=su(b,B=v(B,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return pe(T,V),V}function w(T,b,B){B=v(B,["no-fill"],{strokeWidth:2,stroke:"black"});var V=se("path");return W(V,{d:b}),W(V,B),pe(T,V),V}function S(T,b,B,V){return w(b,B,z({"data-marker":T},V))}function D(T){return function(b,B){return N[T](b,B)}}function s(T){return N[T]}function d(T,b){var B=Pt(T),V=function(H){return H.$type==="bpmn:IntermediateThrowEvent"||H.$type==="bpmn:EndEvent"}(B);return B.eventDefinitions&&B.eventDefinitions.length>1?B.parallelMultiple?s("bpmn:ParallelMultipleEventDefinition")(b,T,V):s("bpmn:MultipleEventDefinition")(b,T,V):Bn(B,"bpmn:MessageEventDefinition")?s("bpmn:MessageEventDefinition")(b,T,V):Bn(B,"bpmn:TimerEventDefinition")?s("bpmn:TimerEventDefinition")(b,T,V):Bn(B,"bpmn:ConditionalEventDefinition")?s("bpmn:ConditionalEventDefinition")(b,T):Bn(B,"bpmn:SignalEventDefinition")?s("bpmn:SignalEventDefinition")(b,T,V):Bn(B,"bpmn:EscalationEventDefinition")?s("bpmn:EscalationEventDefinition")(b,T,V):Bn(B,"bpmn:LinkEventDefinition")?s("bpmn:LinkEventDefinition")(b,T,V):Bn(B,"bpmn:ErrorEventDefinition")?s("bpmn:ErrorEventDefinition")(b,T,V):Bn(B,"bpmn:CancelEventDefinition")?s("bpmn:CancelEventDefinition")(b,T,V):Bn(B,"bpmn:CompensateEventDefinition")?s("bpmn:CompensateEventDefinition")(b,T,V):Bn(B,"bpmn:TerminateEventDefinition")?s("bpmn:TerminateEventDefinition")(b,T,V):null}function m(T,b,B){B=z({size:{width:100}},B);var V=o.createText(b||"",B);return Ce(V).add("djs-label"),pe(T,V),V}function C(T,b,B){return m(T,Pt(b).name,{box:b,align:B,padding:5,style:{fill:qo(b,u,l)}})}function R(T,b,B){yu(m(T,b,{box:{height:30,width:B.height},align:"center-middle",style:{fill:qo(B,u,l)}}),0,-(-1*B.height),270)}function I(T){for(var b=T.waypoints,B="m "+b[0].x+","+b[0].y,V=1;V1)for(;c=l.shift();){if(!(c.length+px?E.width:x},0),y=o.top;r.vertical==="middle"&&(y+=(n.height-v)/2),y-=(c||u[0].height)/4;var g=se("text");return W(g,i),F(u,function(x){var E;switch(y+=c||x.height,r.horizontal){case"left":E=o.left;break;case"right":E=(a?f:p)-o.right-x.width;break;default:E=Math.max(((a?f:p)-x.width)/2+o.left,0)}var _=se("tspan");W(_,{x:E,y}),_.textContent=x.text,pe(g,_)}),it(h),{dimensions:{width:f,height:v},element:g}};function Cf(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new As({style:t});this.getExternalLabelBounds=function(o,a){var c=r.getDimensions(a,{box:{width:90,height:30,x:o.width/2+o.x,y:o.height/2+o.y},style:i});return{x:Math.round(o.x+o.width/2-c.width/2),y:Math.round(o.y),width:Math.ceil(c.width),height:Math.ceil(c.height)}},this.getTextAnnotationBounds=function(o,a){var c=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(30,Math.round(c.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Cf.$inject=["config.textRenderer"];var Pw=/\{([^{}]+)\}/g,Mw=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const Rw={__init__:["bpmnRenderer"],bpmnRenderer:["type",ir],textRenderer:["type",Cf],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,c=t.containerWidth/r.width*t.xScaleFactor,l=0;l=o.x&&c<=o.x+o.width&&l>=o.y&&l<=o.y+o.height||(t=this._canvas.getRootElement())),this._canvas.addShape(n,t,r)}else{if(!A(u,"bpmndi:BPMNEdge"))throw new Error(p("unknown di {di} for element {semantic}",{di:Et(u),semantic:Et(e)}));var y=this._getSource(e),g=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(Rs(e,{hidden:i,source:y,target:g,waypoints:Iw(e,y,g)})),A(e,"bpmn:DataAssociation")&&(t=null),A(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return Qr(e)&&gn(n)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Jn.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Et(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Af(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),o.indexOf(t)===-1&&o.push(t)},Jn.prototype.addLabel=function(e,t){var n,i,r;return n=function(o,a){var c,l,u,p=o.di.label;return p&&p.bounds?(u=p.bounds,l={width:Math.max(Wo.width,u.width),height:u.height},c={x:u.x+u.width/2,y:u.y+u.height/2}):(c=Ms(a),l=Wo),z({x:c.x-l.width/2,y:c.y-l.height/2},l)}(e,t),(i=gn(t))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(Rs(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!gn(t),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Jn.prototype._getEnd=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],t==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(t==="source"&&r==="bpmn:DataOutputAssociation"||t==="target"&&r==="bpmn:DataInputAssociation")&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Af(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Et(e),side:t}))},Jn.prototype._getSource=function(e){return this._getEnd(e,"source")},Jn.prototype._getTarget=function(e){return this._getEnd(e,"target")},Jn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const Dw={__depends__:[Rw,{__depends__:[ks],bpmnImporter:["type",Jn]}]};function kf(e){e&&typeof e.stopPropagation=="function"&&e.stopPropagation()}function eo(e){return e.originalEvent||e.srcEvent}function Du(e,t){kf(e),kf(eo(e))}function Ti(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Pf(e,t){return(eo(e)||e).button===t}function Ai(e){return Pf(e,0)}function to(e){var t=eo(e)||e;return!!Ai(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Mf(e){var t=eo(e)||e;return Ai(e)&&t.shiftKey}function Bw(e){return!0}function Ns(e){return Ai(e)||function(t){return Pf(t,1)}(e)}function Rf(e,t,n){var i=this;function r(_,w,S){var D,s;(function(d,m){var C=l[d]||Ai;return!C(m)})(_,w)||(S?s=t.getGraphics(S):(D=w.delegateTarget||w.target)&&(s=D,S=t.get(s)),s&&S&&e.fire(_,{element:S,gfx:s,originalEvent:w})===!1&&(w.stopPropagation(),w.preventDefault()))}var o={};function a(_){return o[_]}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"},l={"element.contextmenu":Bw,"element.mousedown":Ns,"element.mouseup":Ns,"element.click":Ns,"element.dblclick":Ns},u="svg, .djs-element";function p(_,w,S,D){var s=o[S]=function(d){r(S,d)};D&&(l[S]=D),s.$delegate=Ht.bind(_,u,w,s)}function h(_,w,S){var D=a(S);D&&Ht.unbind(_,w,D.$delegate)}e.on("canvas.destroy",function(_){(function(w){F(c,function(S,D){h(w,D,S)})})(_.svg)}),e.on("canvas.init",function(_){(function(w){F(c,function(S,D){p(w,D,S)})})(_.svg)}),e.on(["shape.added","connection.added"],function(_){var w=_.element,S=_.gfx;e.fire("interactionEvents.createHit",{element:w,gfx:S})}),e.on(["shape.changed","connection.changed"],500,function(_){var w=_.element,S=_.gfx;e.fire("interactionEvents.updateHit",{element:w,gfx:S})}),e.on("interactionEvents.createHit",500,function(_){var w=_.element,S=_.gfx;i.createDefaultHit(w,S)}),e.on("interactionEvents.updateHit",function(_){var w=_.element,S=_.gfx;i.updateDefaultHit(w,S)});var v=g("djs-hit djs-hit-stroke"),f=g("djs-hit djs-hit-click-stroke"),y={all:g("djs-hit djs-hit-all"),"click-stroke":f,stroke:v};function g(_,w){return w=z({stroke:"white",strokeWidth:15},w||{}),n.cls(_,["no-fill","no-border"],w)}function x(_,w){var S=y[w];if(!S)throw new Error("invalid hit type <"+w+">");return W(_,S),_}function E(_,w){pe(_,w)}this.removeHits=function(_){F(Jl(".djs-hit",_),it)},this.createDefaultHit=function(_,w){var S,D=_.waypoints,s=_.isFrame;return D?this.createWaypointsHit(w,D):(S=s?"stroke":"all",this.createBoxHit(w,S,{width:_.width,height:_.height}))},this.createWaypointsHit=function(_,w){var S=su(w);return x(S,"stroke"),E(_,S),S},this.createBoxHit=function(_,w,S){S=z({x:0,y:0},S);var D=se("rect");return x(D,w),W(D,S),E(_,D),D},this.updateDefaultHit=function(_,w){var S=Ye(".djs-hit",w);if(S)return _.waypoints?function(D,s){W(D,{points:mm(s)})}(S,_.waypoints):W(S,{width:_.width,height:_.height}),S},this.fire=r,this.triggerMouseEvent=function(_,w,S){var D=c[_];if(!D)throw new Error("unmapped DOM event name <"+_+">");return r(D,w,S)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=h}Rf.$inject=["eventBus","elementRegistry","styles"];const Ko={__init__:["interactionEvents"],interactionEvents:["type",Rf]};function Is(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(a,c){var l=se("rect");return W(l,z({x:10,y:10,width:100,height:100},i)),pe(a,l),l}e.on(["shape.added","shape.changed"],500,function(a){var c=a.element,l=a.gfx,u=Ye(".djs-outline",l);u||(u=o(l)),r.updateShapeOutline(u,c)}),e.on(["connection.added","connection.changed"],function(a){var c=a.element,l=a.gfx,u=Ye(".djs-outline",l);u||(u=o(l)),r.updateConnectionOutline(u,c)})}Is.prototype.updateShapeOutline=function(e,t){W(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Is.prototype.updateConnectionOutline=function(e,t){var n=gt(t);W(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Is.$inject=["eventBus","styles","elementRegistry"];const Nf={__init__:["outline"],outline:["type",Is]};function no(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","plane.set"],function(i){n.select(null)})}no.$inject=["eventBus","canvas"],no.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})}},no.prototype.get=function(){return this._selectedElements},no.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},no.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();Se(e)||(e=e?[e]:[]);var r=this._canvas;e=e.filter(function(o){return r.findPlane(o)===r.getActivePlane()}),t?F(e,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var If="hover",Df="selected";function Bf(e,t,n,i){function r(a,c){t.addMarker(a,c)}function o(a,c){t.removeMarker(a,c)}this._multiSelectionBox=null,e.on("element.hover",function(a){r(a.element,If)}),e.on("element.out",function(a){o(a.element,If)}),e.on("selection.changed",function(a){var c=a.oldSelection,l=a.newSelection;F(c,function(u){l.indexOf(u)===-1&&o(u,Df)}),F(l,function(u){c.indexOf(u)===-1&&r(u,Df)})})}function Of(e,t,n,i){e.on("create.end",500,function(r){var o=r.context,a=o.canExecute,c=o.elements,l=(o.hints||{}).autoSelect;if(a){if(l===!1)return;Se(l)?t.select(l):t.select(c.filter(Ow))}}),e.on("connect.end",500,function(r){var o=r.context,a=o.canExecute,c=o.hover;a&&c&&t.select(c)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id);je(o,function(c){return a.id===c.id})||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),c=t.get().length>1,l=to(r)||Mf(r);if(a&&c)return l?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,l)}})}function Ow(e){return!e.hidden}Bf.$inject=["eventBus","canvas","selection","styles"],Of.$inject=["eventBus","selection","canvas","elementRegistry"];const On={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ko,Nf],selection:["type",no],selectionVisuals:["type",Bf],selectionBehavior:["type",Of]};function Bu(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Bu.prototype.next=function(){return this._prefix+ ++this._counter};var jw=new Bu("ov");function mt(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=jw,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=ze('
'),r.insertBefore(o,r.firstChild),o),this._init()}function jf(e,t,n){z(e.style,{left:t+"px",top:n+"px"})}function Xo(e,t){e.style.display=t===!1?"none":""}function Lf(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}mt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],mt.prototype.get=function(e){if(Br(e)&&(e={id:e}),Br(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Ee(t.overlays,fn({type:e.type})):t.overlays.slice():[]}return e.type?Ee(this._overlays,fn({type:e.type})):e.id?this._overlays[e.id]:null},mt.prototype.add=function(e,t,n){if(Tt(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=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},mt.prototype.remove=function(e){var t=this.get(e)||[];Se(t)||(t=[t]);var n=this;F(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(Nn(i.html),Nn(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)}})},mt.prototype.show=function(){Xo(this._overlayRoot)},mt.prototype.hide=function(){Xo(this._overlayRoot,!1)},mt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],rs(this._overlayRoot)},mt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=gt(t);i=o.x,r=o.y}jf(n,i,r),Ut(e.html,"data-container-id",t.id)},mt.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,c=i.top;i.right!==void 0&&(t=o.waypoints?gt(o).width:o.width,a=-1*i.right+t),i.bottom!==void 0&&(n=o.waypoints?gt(o).height:o.height,c=-1*i.bottom+n),jf(r,a||0,c||0)},mt.prototype._createOverlayContainer=function(e){var t=ze('
');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},mt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Lf(this._overlayRoot,n)},mt.prototype._getOverlayContainer=function(e,t){var n=je(this._overlayContainers,function(i){return i.element===e});return n||t?n:this._createOverlayContainer(e)},mt.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),Br(o)&&(o=ze(o)),n=this._getOverlayContainer(r),(t=ze('
')).appendChild(o),e.type&&ct(t).add("djs-overlay-"+e.type);var a=this._canvas.findPlane(r),c=this._canvas.getActivePlane();e.plane=a,a!==c&&Xo(t,!1),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},mt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=e.plane,r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,c=!0;(i!==this._canvas.getActivePlane()||n&&(Mn(r)&&r>t.scale||Mn(o)&&oi&&(r=(1/t.scale||1)*i)),Mn(r)&&(c="scale("+r+","+r+")"),Lf(a,c)},mt.prototype._updateOverlaysVisibilty=function(e){var t=this;F(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},mt.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(n){t.hide()}),e.on("canvas.viewbox.changed",function(n){var i;i=n.viewbox,t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}),e.on(["shape.remove","connection.remove"],function(n){var i=n.element;F(t.get({element:i}),function(a){t.remove(a.id)});var r=t._getOverlayContainer(i);if(r){Nn(r.html);var o=t._overlayContainers.indexOf(r);o!==-1&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(n){var i=n.element,r=t._getOverlayContainer(i,!0);r&&(F(r.overlays,function(o){t._updateOverlay(o)}),t._updateOverlayContainer(r))}),e.on("element.marker.update",function(n){var i=t._getOverlayContainer(n.element,!0);i&&ct(i.html)[n.add?"add":"remove"](n.marker)}),e.on("plane.set",function(n){F(t._overlays,function(i){Xo(i.htmlContainer,i.plane===n.plane)})}),e.on("diagram.clear",this.clear,this)};const Ou={__init__:["overlays"],overlays:["type",mt]};function Zn(e){We.call(this,e)}ae(Zn,We),Zn.prototype._modules=[Dw,ks,On,Ou],Zn.prototype._moddleExtensions={};var Lw=["c","C",67],Vw=["v","V",86],Fw=["y","Y",89],Vf=["z","Z",90];function Kt(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function bn(e,t){return(e=Se(e)?e:[e]).indexOf(t.key)!==-1||e.indexOf(t.keyCode)!==-1}function ju(e){return e.shiftKey}var Ds="keyboard.keydown",Ff="input-handle-modified-keys";function ft(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()})}ft.$inject=["config.keyboard","eventBus"],ft.prototype._keydownHandler=function(e){this._keyHandler(e,Ds)},ft.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},ft.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ds,n)&&e.preventDefault()}},ft.prototype._isEventIgnored=function(e){return(t=e.target)&&(os(t,"input, textarea")||t.contentEditable==="true")&&this._isModifiedKeyIgnored(e);var t},ft.prototype._isModifiedKeyIgnored=function(e){return!Kt(e)||!this._getAllowedModifiers(e.target).includes(e.key)},ft.prototype._getAllowedModifiers=function(e){var t=Ji(e,"["+Ff+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Ff).split(",")},ft.prototype.bind=function(e){this.unbind(),this._node=e,le.bind(e,"keydown",this._keydownHandler,!0),le.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},ft.prototype.getBinding=function(){return this._node},ft.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),le.unbind(e,"keydown",this._keydownHandler,!0),le.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},ft.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},ft.prototype.addListener=function(e,t,n){At(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ds,e,t)},ft.prototype.removeListener=function(e,t){this._eventBus.off(t||Ds,e)},ft.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},ft.prototype.isCmd=Kt,ft.prototype.isShift=ju,ft.prototype.isKey=bn;var $w=500;function io(e,t){var n=this;e.on("editorActions.init",$w,function(i){var r=i.editorActions;n.registerBindings(t,r)})}io.$inject=["eventBus","keyboard"],io.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){if(function(r){return Kt(r)&&!ju(r)&&bn(Vf,r)}(i.keyEvent))return t.trigger("undo"),!0}),n("redo",function(i){if(function(r){return Kt(r)&&(bn(Fw,r)||bn(Vf,r)&&ju(r))}(i.keyEvent))return t.trigger("redo"),!0}),n("copy",function(i){if(function(r){return Kt(r)&&bn(Lw,r)}(i.keyEvent))return t.trigger("copy"),!0}),n("paste",function(i){if(function(r){return Kt(r)&&bn(Vw,r)}(i.keyEvent))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(bn(["+","Add","="],r)&&Kt(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(bn(["-","Subtract"],r)&&Kt(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(bn("0",r)&&Kt(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(bn(["Backspace","Delete","Del"],i.keyEvent))return t.trigger("removeSelection"),!0})};const Lu={__init__:["keyboard","keyboardBindings"],keyboard:["type",ft],keyboardBindings:["type",io]};var zw={moveSpeed:50,moveSpeedAccelerated:200};function $f(e,t,n){var i=this;this._config=z({},zw,e||{}),t.addListener(function(r){var o=r.keyEvent,a=i._config;if(t.isCmd(o)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],o)){var c,l=t.isShift(o)?a.moveSpeedAccelerated:a.moveSpeed;switch(o.key){case"ArrowLeft":case"Left":c="left";break;case"ArrowUp":case"Up":c="up";break;case"ArrowRight":case"Right":c="right";break;case"ArrowDown":case"Down":c="down"}return i.moveCanvas({speed:l,direction:c}),!0}}),this.moveCanvas=function(r){var o=0,a=0,c=r.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(r.direction){case"left":o=c;break;case"up":a=c;break;case"right":o=-c;break;case"down":a=-c}n.scroll({dx:o,dy:a})}}$f.$inject=["config.keyboardMove","keyboard","canvas"];const zf={__depends__:[Lu],__init__:["keyboardMove"],keyboardMove:["type",$f]};var Gw=/^djs-cursor-.*$/;function Bs(e){var t=ct(document.body);t.removeMatching(Gw),e&&t.add("djs-cursor-"+e)}function Gf(){Bs(null)}var Uw=5e3;function Uf(e,t){function n(){return!1}return t=t||"element.click",e.once(t,Uw,n),function(){e.off(t,n)}}function Yo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function jn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hf(e,t){var n;function i(o){var a,c=n.start,l=n.button,u=Ti(o),p=jn(u,c);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,l===0&&Uf(e),Bs("grab")),n.dragging&&(p=jn(u,n.last||n.start),t.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){le.unbind(document,"mousemove",i),le.unbind(document,"mouseup",r),n=null,Gf()}e.on("element.mousedown",500,function(o){return function(a){if(!Ji(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:Ti(a)},le.bind(document,"mousemove",i),le.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}Hf.$inject=["eventBus","canvas"];const qf={__init__:["moveCanvas"],moveCanvas:["type",Hf]};function Vu(e){return Math.log(e)/Math.log(10)}function Wf(e,t){var n=Vu(e.min),i=Vu(e.max);return(Math.abs(n)+Math.abs(i))/t}var Hw=Math.sign||function(e){return e>=0?1:-1},Fu={min:.2,max:4};function Ln(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=qn(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",function(r){i._init(e.enabled!==!1)})}Ln.$inject=["config.zoomScroll","eventBus","canvas"],Ln.prototype.scroll=function(e){this._canvas.scroll(e)},Ln.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Ln.prototype.zoom=function(e,t){var n=Wf(Fu,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Ln.prototype._handleWheel=function(e){if(!Ji(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?e.deltaMode===0?.02:.32:e.deltaMode===0?1:16,i){var a=t.getBoundingClientRect(),c={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Hw(e.deltaY)*o,this.zoom(n,c)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},Ln.prototype.stepZoom=function(e,t){var n=Wf(Fu,10);this._zoom(e,t,n)},Ln.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Vu(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var c,l,u=Math.pow(10,a);i.zoom((c=Fu,l=u,Math.max(c.min,Math.min(c.max,l))),t)},Ln.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return e===void 0&&(e=!i),i!==e&&le[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Ln.prototype._init=function(e){this.toggle(e)};const Kf={__init__:["zoomScroll"],zoomScroll:["type",Ln]};function Jo(e){Zn.call(this,e)}ae(Jo,Zn),Jo.prototype._navigationModules=[zf,qf,Kf],Jo.prototype._modules=[].concat(Zn.prototype._modules,Jo.prototype._navigationModules);var Xf={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */(function(e){(function(t,n,i,r){var o,a=["","webkit","Moz","MS","ms","o"],c=n.createElement("div"),l="function",u=Math.round,p=Math.abs,h=Date.now;function v(k,O,$){return setTimeout(w(k,$),O)}function f(k,O,$){return!!Array.isArray(k)&&(y(k,$[O],$),!0)}function y(k,O,$){var U;if(k)if(k.forEach)k.forEach(O,$);else if(k.length!==r)for(U=0;U\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",$e=t.console&&(t.console.warn||t.console.log);return $e&&$e.call(t.console,U,xe),k.apply(this,arguments)}}o=typeof Object.assign!="function"?function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var O=Object(k),$=1;$-1}function R(k){return k.trim().split(/\s+/g)}function I(k,O,$){if(k.indexOf&&!$)return k.indexOf(O);for(var U=0;UMe[O]})}function T(k,O){for(var $,U,K=O[0].toUpperCase()+O.slice(1),xe=0;xe1&&!Ct.firstMultiple?Ct.firstMultiple=Fe(Me):Ch===1&&(Ct.firstMultiple=!1);var Th=Ct.firstInput,Sr=Ct.firstMultiple,Ah=Sr?Sr.center:Th.center,kh=Me.center=ci(Za);Me.timeStamp=h(),Me.deltaTime=Me.timeStamp-Th.timeStamp,Me.angle=ln(Ah,kh),Me.distance=vt(Ah,kh),function(pn,dt){var pi=dt.center,qi=pn.offsetDelta||{},Wi=pn.prevDelta||{},Ki=pn.prevInput||{};dt.eventType!==ie&&Ki.eventType!==he||(Wi=pn.prevDelta={x:Ki.deltaX||0,y:Ki.deltaY||0},qi=pn.offsetDelta={x:pi.x,y:pi.y}),dt.deltaX=Wi.x+(pi.x-qi.x),dt.deltaY=Wi.y+(pi.y-qi.y)}(Ct,Me),Me.offsetDirection=Je(Me.deltaX,Me.deltaY);var Cr=Ui(Me.deltaTime,Me.deltaX,Me.deltaY);Me.overallVelocityX=Cr.x,Me.overallVelocityY=Cr.y,Me.overallVelocity=p(Cr.x)>p(Cr.y)?Cr.x:Cr.y,Me.scale=Sr?(Dl=Sr.pointers,Bl=Za,vt(Bl[0],Bl[1],ke)/vt(Dl[0],Dl[1],ke)):1,Me.rotation=Sr?function(pn,dt){return ln(dt[1],dt[0],ke)+ln(pn[1],pn[0],ke)}(Sr.pointers,Za):0,Me.maxPointers=Ct.prevInput?Me.pointers.length>Ct.prevInput.maxPointers?Me.pointers.length:Ct.prevInput.maxPointers:Me.pointers.length,function(pn,dt){var pi,qi,Wi,Ki,di=pn.lastInterval||dt,Ph=dt.timeStamp-di.timeStamp;if(dt.eventType!=Ne&&(Ph>oe||di.velocity===r)){var Mh=dt.deltaX-di.deltaX,Rh=dt.deltaY-di.deltaY,Tr=Ui(Ph,Mh,Rh);qi=Tr.x,Wi=Tr.y,pi=p(Tr.x)>p(Tr.y)?Tr.x:Tr.y,Ki=Je(Mh,Rh),pn.lastInterval=dt}else pi=di.velocity,qi=di.velocityX,Wi=di.velocityY,Ki=di.direction;dt.velocity=pi,dt.velocityX=qi,dt.velocityY=Wi,dt.direction=Ki}(Ct,Me);var Dl,Bl,Ol=yt.element;m(Me.srcEvent.target,Ol)&&(Ol=Me.srcEvent.target),Me.target=Ol}(k,$),k.emit("hammer.input",$),k.recognize($),k.session.prevInput=$}function Fe(k){for(var O=[],$=0;$=p(O)?k<0?Z:_e:O<0?Ve:ye}function vt(k,O,$){$||($=pt);var U=O[$[0]]-k[$[0]],K=O[$[1]]-k[$[1]];return Math.sqrt(U*U+K*K)}function ln(k,O,$){$||($=pt);var U=O[$[0]]-k[$[0]],K=O[$[1]]-k[$[1]];return 180*Math.atan2(K,U)/Math.PI}He.prototype={handler:function(){},init:function(){this.evEl&&s(this.element,this.evEl,this.domHandler),this.evTarget&&s(this.target,this.evTarget,this.domHandler),this.evWin&&s(B(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(B(this.element),this.evWin,this.domHandler)}};var li={mousedown:ie,mousemove:2,mouseup:he},Ua="mousedown",nx="mousemove mouseup";function Ha(){this.evEl=Ua,this.evWin=nx,this.pressed=!1,He.apply(this,arguments)}_(Ha,He,{handler:function(k){var O=li[k.type];O&ie&&k.button===0&&(this.pressed=!0),2&O&&k.which!==1&&(O=he),this.pressed&&(O&he&&(this.pressed=!1),this.callback(this.manager,O,{pointers:[k],changedPointers:[k],pointerType:Q,srcEvent:k}))}});var ix={pointerdown:ie,pointermove:2,pointerup:he,pointercancel:Ne,pointerout:Ne},rx={2:J,3:"pen",4:Q,5:"kinect"},mh="pointerdown",fh="pointermove pointerup pointercancel";function Cl(){this.evEl=mh,this.evWin=fh,He.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(mh="MSPointerDown",fh="MSPointerMove MSPointerUp MSPointerCancel"),_(Cl,He,{handler:function(k){var O=this.store,$=!1,U=k.type.toLowerCase().replace("ms",""),K=ix[U],xe=rx[k.pointerType]||k.pointerType,$e=xe==J,yt=I(O,k.pointerId,"pointerId");K&ie&&(k.button===0||$e)?yt<0&&(O.push(k),yt=O.length-1):K&(he|Ne)&&($=!0),yt<0||(O[yt]=k,this.callback(this.manager,K,{pointers:O,changedPointers:[k],pointerType:xe,srcEvent:k}),$&&O.splice(yt,1))}});var ox={touchstart:ie,touchmove:2,touchend:he,touchcancel:Ne};function vh(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,He.apply(this,arguments)}function ax(k,O){var $=N(k.touches),U=N(k.changedTouches);return O&(he|Ne)&&($=L($.concat(U),"identifier")),[$,U]}_(vh,He,{handler:function(k){var O=ox[k.type];if(O===ie&&(this.started=!0),this.started){var $=ax.call(this,k,O);O&(he|Ne)&&$[0].length-$[1].length==0&&(this.started=!1),this.callback(this.manager,O,{pointers:$[0],changedPointers:$[1],pointerType:J,srcEvent:k})}}});var sx={touchstart:ie,touchmove:2,touchend:he,touchcancel:Ne},cx="touchstart touchmove touchend touchcancel";function qa(){this.evTarget=cx,this.targetIds={},He.apply(this,arguments)}function lx(k,O){var $=N(k.touches),U=this.targetIds;if(O&(2|ie)&&$.length===1)return U[$[0].identifier]=!0,[$,$];var K,xe,$e=N(k.changedTouches),yt=[],Me=this.target;if(xe=$.filter(function(Ct){return m(Ct.target,Me)}),O===ie)for(K=0;K-1&&U.splice(K,1)},ux)}}function dx(k){for(var O=k.srcEvent.clientX,$=k.srcEvent.clientY,U=0;U-1&&this.requireFail.splice(O,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(k){return!!this.simultaneous[k.id]},emit:function(k){var O=this,$=this.state;function U(K){O.manager.emit(K,k)}$<8&&U(O.options.event+wh($)),U(O.options.event),k.additionalEvent&&U(k.additionalEvent),$>=8&&U(O.options.event+wh($))},tryEmit:function(k){if(this.canEmit())return this.emit(k);this.state=Gn},canEmit:function(){for(var k=0;kO.threshold&&K&O.direction},attrTest:function(k){return un.prototype.attrTest.call(this,k)&&(2&this.state||!(2&this.state)&&this.directionTest(k))},emit:function(k){this.pX=k.deltaX,this.pY=k.deltaY;var O=_h(k.direction);O&&(k.additionalEvent=this.options.event+O),this._super.emit.call(this,k)}}),_(Pl,un,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Hi]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.scale-1)>this.options.threshold||2&this.state)},emit:function(k){if(k.scale!==1){var O=k.scale<1?"in":"out";k.additionalEvent=this.options.event+O}this._super.emit.call(this,k)}}),_(Ml,Un,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Eh]},process:function(k){var O=this.options,$=k.pointers.length===O.pointers,U=k.distanceO.time;if(this._input=k,!U||!$||k.eventType&(he|Ne)&&!K)this.reset();else if(k.eventType&ie)this.reset(),this._timer=v(function(){this.state=8,this.tryEmit()},O.time,this);else if(k.eventType&he)return 8;return Gn},reset:function(){clearTimeout(this._timer)},emit:function(k){this.state===8&&(k&&k.eventType&he?this.manager.emit(this.options.event+"up",k):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),_(Rl,un,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Hi]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.rotation)>this.options.threshold||2&this.state)}}),_(Nl,un,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ue|Xe,pointers:1},getTouchAction:function(){return Ya.prototype.getTouchAction.call(this)},attrTest:function(k){var O,$=this.options.direction;return $&(Ue|Xe)?O=k.overallVelocity:$&Ue?O=k.overallVelocityX:$&Xe&&(O=k.overallVelocityY),this._super.attrTest.call(this,k)&&$&k.offsetDirection&&k.distance>this.options.threshold&&k.maxPointers==this.options.pointers&&p(O)>this.options.velocity&&k.eventType&he},emit:function(k){var O=_h(k.offsetDirection);O&&this.manager.emit(this.options.event+O,k),this.manager.emit(this.options.event,k)}}),_(Ja,Un,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Al]},process:function(k){var O=this.options,$=k.pointers.length===O.pointers,U=k.distance1&&(p=!0),h.elements.length}),p)return l[e]=Uu(n).center,l;i=t[0],r=Uu(t=mn(t,function(h){return h[a]+h[c]})),l[e]=function(h,v){return Math.round((h[a]+v[a]+v[c])/2)}(i,r)}return l},ro.prototype.trigger=function(e,t){var n=this._modeling,i=Ee(e,function(a){return!(a.waypoints||a.host||a.labelTarget)});if(!(i.length<2)){var r=mn(i,Ww[t]),o=this._alignmentPosition(t,r);n.alignElements(r,o)}};const Kw={__init__:["alignElements"],alignElements:["type",ro]};var Xw=10,ev=50,Yw=250;function Hu(e,t,n,i){for(var r;r=Jw(e,n,t);)n=i(t,n,r);return n}function qu(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 c=o==="x"?"width":"height",l=a.margin,u=a.minDistance;r[o]=l<0?Math.min(i[o]+l-t[c]/2,n[o]-u+l):Math.max(i[o]+i[c]+l+t[c]/2,n[o]+u+l)}}),r}}function Jw(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(o){var a=Wu(o);return o.host&&(a=a.concat(Wu(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(c,l){return c.concat(Wu(l))},[]))),a}(e);return je(r,function(o){return o!==n&&bt(o,i,Xw)==="intersect"})}function Wu(e){return(t=e,t.outgoing.map(function(n){return n.target})).concat(function(n){return n.incoming.map(function(i){return i.source})}(e));var t}function Zw(){return!0}function tv(e,t,n){e.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,c){c||(c={});var l=c.defaultDistance||ev,u=ge(o),p=ce(o);return{x:p.right+l+a.width/2,y:u.y}}(i.source,r)}),e.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){e.fire("autoPlace.start",{source:i,shape:r});var a=e.fire("autoPlace",{source:i,shape:r}),c=t.appendShape(i,r,a,i.parent,o);return e.fire("autoPlace.end",{source:i,shape:c}),c}}function nv(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}tv.$inject=["eventBus","modeling","canvas"],nv.$inject=["eventBus","selection"];const Qw={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",tv],autoPlaceSelectionBehavior:["type",nv]};function Pe(e,t){return Yi(t,function(n){return A(e,n)})}function js(e,t){for(typeof t=="string"&&(t=[t]);e=e.parent;)if(Pe(e,t))return e;return null}function iv(e,t){return A(t,"bpmn:TextAnnotation")?function(n,i){var r=ce(n),o={x:r.right+i.width/2,y:r.top-50-i.height/2};return Hu(n,i,o,qu({y:{margin:-30,minDistance:20}}))}(e,t):Pe(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(n,i){var r=ce(n),o={x:r.right-10+i.width/2,y:r.bottom+40+i.width/2};return Hu(n,i,o,qu({x:{margin:30,minDistance:30}}))}(e,t):A(t,"bpmn:FlowNode")?function(n,i){var r=ce(n),o=ge(n),a=function(h,v){v||(v={});var f=v.defaultDistance||ev,y=v.direction||"e",g=v.filter,x=v.getWeight||function(d){return d.source===h?1:-1},E=v.maxDistance||Yw,_=v.reference||"start";function w(d,m){return y==="n"?_==="start"?ce(d).top-ce(m).bottom:_==="center"?ce(d).top-ge(m).y:ce(d).top-ce(m).top:y==="w"?_==="start"?ce(d).left-ce(m).right:_==="center"?ce(d).left-ge(m).x:ce(d).left-ce(m).left:y==="s"?_==="start"?ce(m).top-ce(d).bottom:_==="center"?ge(m).y-ce(d).bottom:ce(m).bottom-ce(d).bottom:_==="start"?ce(m).left-ce(d).right:_==="center"?ge(m).x-ce(d).right:ce(m).right-ce(d).right}g||(g=Zw);var S=h.incoming.filter(g).map(function(d){var m=x(d),C=m<0?w(d.source,h):w(h,d.source);return{id:d.source.id,distance:C,weight:m}}),D=h.outgoing.filter(g).map(function(d){var m=x(d),C=m>0?w(h,d.target):w(d.target,h);return{id:d.target.id,distance:C,weight:m}}),s=Gt(S.concat(D).reduce(function(d,m){return d[m.id+"__weight_"+m.weight]=m,d},{}),function(d,m){var C=m.distance,R=m.weight;return C<0||C>E||(d[String(C)]||(d[String(C)]=0),d[String(C)]+=1*R,(!d.distance||d[d.distance]a.top&&(c=c.concat("n")),o.righta.left&&(c=c.concat("e")),c}(Rn(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},Qn.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},Qn.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},Qn.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},Ls.$inject=["injector"],ae(Ls,Qn),Ls.prototype.resize=function(e,t,n){A(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},ki.$inject=["eventBus"],ae(ki,ne),ki.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,c){return n(o)},!0)})},ki.prototype.init=function(){},Zo.$inject=["eventBus"],ae(Zo,ki),Zo.prototype.canResize=function(e,t){return!1},ae(Vs,Zo),Vs.$inject=["eventBus","modeling"],Vs.prototype.canResize=function(e,t){if(!A(t,"bpmn:Participant")&&!A(t,"bpmn:Lane")&&!A(t,"bpmn:SubProcess"))return!1;var n=!0;return F(e,function(i){(A(i,"bpmn:Lane")||i.labelTarget)&&(n=!1)}),n};const n_={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Ls],bpmnAutoResizeProvider:["type",Vs]};function ov(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",function(c){t.once("drag.move",1500,function(l){(function(u){if(!u.hover){var p=u.originalEvent,h=o._findTargetGfx(p),v=h&&e.get(h);h&&v&&(u.stopPropagation(),a.hover({element:v,gfx:h}),a.move(p))}})(l)})}),t.on("element.hover",function(c){i=c.gfx,r=c.element}),t.on("element.hover",1500,function(c){r&&t.fire("element.out",{element:r,gfx:i})}),t.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(c){var l;if(c instanceof MouseEvent)return l=Ti(c),function(u){return Ji(u,"svg, .djs-element",!0)}(document.elementFromPoint(l.x,l.y))}}ov.$inject=["elementRegistry","eventBus","injector"];const i_={__init__:["hoverFix"],hoverFix:["type",ov]};var oo=Math.round,av="djs-drag-active";function or(e){e.preventDefault()}function sv(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(E){var _=t.viewbox(),w=t._container.getBoundingClientRect();return{x:_.x+(E.x-w.left)/_.scale,y:_.y+(E.y-w.top)/_.scale}}function c(E,_){_=_||r;var w=e.createEvent(z({},_.payload,_.data,{isTouch:_.isTouch}));return e.fire("drag."+E,w)!==!1&&e.fire(_.prefix+"."+E,w)}function l(E,_){var w,S=r.payload,D=r.displacement,s=r.globalStart,d=Ti(E),m=jn(d,s),C=r.localStart,R=a(d),I=jn(R,C);if(!r.active&&(_||(w=m,Math.sqrt(Math.pow(w.x,2)+Math.pow(w.y,2))>r.threshold))){if(z(S,{x:oo(C.x+D.x),y:oo(C.y+D.y),dx:0,dy:0},{originalEvent:E}),c("start")===!1)return g();r.active=!0,r.keepSelection||(S.previousSelection=n.get(),n.select(null)),r.cursor&&Bs(r.cursor),t.addMarker(t.getRootElement(),av)}Du(E),r.active&&(z(S,{x:oo(R.x+D.x),y:oo(R.y+D.y),dx:oo(I.x),dy:oo(I.y)},{originalEvent:E}),c("move"))}function u(E){var _=!0;r.active&&(E&&(r.payload.originalEvent=E,Du(E)),_=c("end")),_===!1&&c("rejected"),c("ended",x(_!==!0))}function p(E){E.which===27&&(or(E),g())}function h(E){var _;r.active&&(_=Uf(e),setTimeout(_,400),or(E)),u(E)}function v(E){l(E)}function f(E){var _=r.payload;_.hoverGfx=E.gfx,_.hover=E.element,c("hover")}function y(E){c("out");var _=r.payload;_.hoverGfx=null,_.hover=null}function g(E){var _;if(r){var w=r.active;w&&c("cancel"),_=x(E),w&&c("canceled",_)}}function x(E){var _,w;c("cleanup"),Gf(),w=r.trapClick?h:u,le.unbind(document,"mousemove",l),le.unbind(document,"dragstart",or),le.unbind(document,"selectstart",or),le.unbind(document,"mousedown",w,!0),le.unbind(document,"mouseup",w,!0),le.unbind(document,"keyup",p),le.unbind(document,"touchstart",v,!0),le.unbind(document,"touchcancel",g,!0),le.unbind(document,"touchmove",l,!0),le.unbind(document,"touchend",u,!0),e.off("element.hover",f),e.off("element.out",y),t.removeMarker(t.getRootElement(),av);var S=r.payload.previousSelection;return E!==!1&&S&&!n.get().length&&function(D){var s=D.filter(function(d){return i.get(d.id)});s.length&&n.select(s)}(S),_=r,r=null,_}e.on("diagram.destroy",g),this.init=function(E,_,w,S){r&&g(!1),typeof _=="string"&&(S=w,w=_,_=null);var D,s,d,m,C,R=(S=z({},o,S||{})).data||{};m=S.trapClick?h:u,E?(D=eo(E)||E,s=Ti(E),Du(E),D.type==="dragstart"&&or(D)):(D=null,s={x:0,y:0}),d=a(s),_||(_=d),C=function(I){return typeof TouchEvent<"u"&&I instanceof TouchEvent}(D),r=z({prefix:w,data:R,payload:{},globalStart:s,displacement:jn(_,d),localStart:d,isTouch:C},S),S.manual||(C?(le.bind(document,"touchstart",v,!0),le.bind(document,"touchcancel",g,!0),le.bind(document,"touchmove",l,!0),le.bind(document,"touchend",u,!0)):(le.bind(document,"mousemove",l),le.bind(document,"dragstart",or),le.bind(document,"selectstart",or),le.bind(document,"mousedown",m,!0),le.bind(document,"mouseup",m,!0)),le.bind(document,"keyup",p),e.on("element.hover",f),e.on("element.out",y)),c("init"),S.autoActivate&&l(E,!0)},this.move=l,this.hover=f,this.out=y,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(E){z(o,E)}}sv.$inject=["eventBus","canvas","selection","elementRegistry"];const ei={__depends__:[i_,On],dragging:["type",sv]};function ao(e,t,n){this._canvas=n,this._opts=z({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()})}function r_(e,t,n){return t=1&&i<=31||i==127||a==0&&i>=48&&i<=57||a==1&&i>=48&&i<=57&&l==45?"\\"+i.toString(16)+" ":a==0&&o==1&&i==45||!(i>=128||i==45||i==95||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122)?"\\"+r.charAt(a):r.charAt(a):c+="\uFFFD";return c};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(Lh);const Zu=kr(hv.exports);var c_={"&":"&","<":"<",">":">",'"':""","'":"'"};function mv(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(t){return c_[t]})}function fv(e,t,n,i,r){function o(y,g){var x,E=g.waypoints,_=Yu(t,E,y);if(_)return x=function(w,S){var D,s,d=w.waypoints;return S.index<=0||S.bendpoint?null:(s=Kn((D={start:d[S.index-1],end:d[S.index]}).start,D.end))?dv(s==="h"?D.end.x-D.start.x:D.end.y-D.start.y)/2:null}(g,_),function(w,S,D){var s,d,m,C,R,I,N=w.index,L=w.point;return!(N<=0||w.bendpoint)&&(m=uu(s=S[N-1],d=S[N]),C=Kn(s,d),R=Math.abs(L.x-m.x),I=Math.abs(L.y-m.y),C&&R<=D&&I<=D)}(_,E,x)?r.start(y,g,_.index):i.start(y,g,_.index,!_.bendpoint),!0}function a(y,g,x){le.bind(y,g,function(E){n.triggerMouseEvent(g,E,x),E.stopPropagation()})}function c(y,g){var x=t.getLayer("overlays"),E=Ye('.djs-bendpoints[data-element-id="'+Zu(y.id)+'"]',x);return!E&&g&&(W(E=se("g"),{"data-element-id":y.id}),Ce(E).add("djs-bendpoints"),pe(x,E),a(E,"mousedown",y),a(E,"click",y),a(E,"dblclick",y)),E}function l(y,g){return Ye('.djs-segment-dragger[data-segment-idx="'+y+'"]',g)}function u(y,g){g.waypoints.forEach(function(x,E){var _=Ju(y);pe(y,_),Lt(_,x.x,x.y)}),Ju(y,"floating")}function p(y,g){for(var x,E,_,w=g.waypoints,S=1;Sd-3&&(v=bt(y.target,s),x===d-2?v==="intersect"&&(S.pop(),S[S.length-1]=s):v!=="intersect"&&S.push(_)),f.newWaypoints=y.waypoints=c(y,S),u(f,m,p),f.newSegmentStartIndex=g+m,l(p)}),t.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,wv)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var h=p.context.hover;h&&n.removeMarker(h,wv)}),t.on("connectionSegment.move.cleanup",function(p){var h=p.context,v=h.connection;h.draggerGfx&&it(h.draggerGfx),n.removeMarker(v,_v)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var h=p.context;h.connection.waypoints=h.originalWaypoints,l(p)}),t.on("connectionSegment.move.end",function(p){var h=p.context,v=h.connection,f=h.newWaypoints,y=h.newSegmentStartIndex,g=function(w,S){var D=0;return{waypoints:w.filter(function(s,d){return!lu(w[d-1],w[d+1],s)||(D=d<=S?D-1:D,!1)}),segmentOffset:D}}(f=f.map(function(w){return{original:w.original,x:Math.round(w.x),y:Math.round(w.y)}}),y),x=c(v,g.waypoints),E=g.segmentOffset,_={segmentMove:{segmentStartIndex:h.segmentStartIndex,newSegmentStartIndex:y+E}};o.updateWaypoints(v,x,_)})}Av.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var l_=Math.abs,kv=Math.round;function Pv(e){return{x:e.x,y:e.y}}function Mv(e){return{x:e.x+e.width,y:e.y+e.height}}function Qt(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:kv(e.x+e.width/2),y:kv(e.y+e.height/2)}}function so(e,t){var n=e.snapped;return!!n&&(typeof t=="string"?n[t]:n.x&&n.y)}function ut(e,t,n){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Rv(e){return e.children||[]}var u_=Math.abs,Nv=Math.round;function Iv(e){function t(i,r){if(Se(i)){for(var o=i.length;o--;)if(u_(i[o]-r)<=10)return i[o]}else{var a=r%(i=+i);if(a<10)return r-a;if(a>i-10)return r-a+i}return r}function n(i){if(i.width)return{x:Nv(i.width/2+i.x),y:Nv(i.height/2+i.y)}}e.on("connectionSegment.move.move",1500,function(i){var r,o,a=function(h){var v=h.snapPoints,f=h.connection,y=f.waypoints,g=h.segmentStart,x=h.segmentStartIndex,E=h.segmentEnd,_=h.segmentEndIndex,w=h.axis;if(v)return v;var S=[y[x-1],g,E,y[_+1]];return x<2&&S.unshift(n(f.source)),_>y.length-3&&S.unshift(n(f.target)),h.snapPoints=v={horizontal:[],vertical:[]},F(S,function(D){D&&(D=D.original||D,w==="y"&&v.horizontal.push(D.y),w==="x"&&v.vertical.push(D.x))}),v}(i.context),c=i.x,l=i.y;if(a){var u=c-(r=t(a.vertical,c)),p=l-(o=t(a.horizontal,l));z(i,{dx:i.dx-u,dy:i.dy-p,x:r,y:o}),(u||a.vertical.indexOf(c)!==-1)&&ut(i,"x",r),(p||a.horizontal.indexOf(l)!==-1)&&ut(i,"y",o)}}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var r,o,a=i.context,c=function(y){var g=y.snapPoints,x=y.connection.waypoints,E=y.bendpointIndex;if(g)return g;var _=[x[E-1],x[E+1]];return y.snapPoints=g={horizontal:[],vertical:[]},F(_,function(w){w&&(w=w.original||w,g.horizontal.push(w.y),g.vertical.push(w.x))}),g}(a),l=a.hover,u=l&&n(l),p=i.x,h=i.y;if(c){var v=p-(r=t(u?c.vertical.concat([u.x]):c.vertical,p)),f=h-(o=t(u?c.horizontal.concat([u.y]):c.horizontal,h));z(i,{dx:i.dx-v,dy:i.dy-f,x:i.x-v,y:i.y-f}),(v||c.vertical.indexOf(p)!==-1)&&ut(i,"x",r),(f||c.horizontal.indexOf(h)!==-1)&&ut(i,"y",o)}})}Iv.$inject=["eventBus"];const p_={__depends__:[ei,Vn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",fv],bendpointMove:["type",Qu],bendpointMovePreview:["type",Ev],connectionSegmentMove:["type",Av],bendpointSnapping:["type",Iv]};function Dv(e,t,n,i){function r(o,a){return i.allowed("connection.create",{source:o,target:a})}e.on("connect.hover",function(o){var a,c=o.context,l=c.start,u=o.hover;if(c.hover=u,!Yh(a=c.canExecute=r(l,u))){if(a!==!1)return c.source=l,void(c.target=u);Yh(a=c.canExecute=r(u,l))||a!==!1&&(c.source=u,c.target=l)}}),e.on(["connect.out","connect.cleanup"],function(o){var a=o.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),e.on("connect.end",function(o){var a=o.context,c=a.canExecute,l=a.connectionStart,u={x:o.x,y:o.y},p=a.source,h=a.target;if(!c)return!1;var v=null,f={connectionStart:tp(a)?u:l,connectionEnd:tp(a)?l:u};Tt(c)&&(v=c),n.connect(p,h,v,f)}),this.start=function(o,a,c,l){Tt(c)||(l=c,c=ge(a)),t.init(o,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}function tp(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}Dv.$inject=["eventBus","dragging","modeling","rules"];var Bv="connect-ok",Ov="connect-not-ok";function jv(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(r){var o=r.context,a=o.canExecute,c=o.hover,l=o.source,u=o.start,p=o.startPosition,h=o.target,v=o.connectionStart||p,f=o.connectionEnd||{x:r.x,y:r.y},y=v,g=f;tp(o)&&(y=f,g=v),i.drawPreview(o,a,{source:l||u,target:h||c,connectionStart:y,connectionEnd:g})}),t.on("connect.hover",900,function(r){var o=r.context,a=r.hover,c=o.canExecute;c!==null&&n.addMarker(a,c?Bv:Ov)}),t.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,Bv),n.removeMarker(o,Ov))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}jv.$inject=["injector","eventBus","canvas"];const np={__depends__:[On,Vn,ei],__init__:["connectPreview"],connect:["type",Dv],connectPreview:["type",jv]};function ti(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)}ti.$inject=["injector","canvas","graphicsFactory","elementFactory"],ti.prototype.drawPreview=function(e,t,n){n=n||{};var i,r=e.connectionPreviewGfx,o=e.getConnection,a=n.source,c=n.target,l=n.waypoints,u=n.connectionStart,p=n.connectionEnd,h=n.noLayout,v=n.noCropping,f=n.noNoop,y=this;r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),am(r),o||(o=e.getConnection=function(g){var x={};return function(E){var _=JSON.stringify(E),w=x[_];return w||(w=x[_]=g.apply(null,arguments)),w}}(function(g,x,E){return y.getConnection(g,x,E)})),t&&(i=o(t,a,c)),i?(i.waypoints=l||[],this._layouter&&!h&&(i.waypoints=this._layouter.layoutConnection(i,{source:a,target:c,connectionStart:u,connectionEnd:p,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[a?ge(a):u,c?ge(c):p]),this._connectionDocking&&(a||c)&&!v&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,c)),this._graphicsFactory.drawConnection(r,i)):!f&&this.drawNoopPreview(r,n)},ti.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||ge(n),o=t.connectionEnd||ge(i),a=this.cropWaypoints(r,o,n,i);pe(e,this.createNoopConnection(a[0],a[1]))},ti.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),c=r.getConnectionPath({waypoints:[e,t]});return[e=n&&mu(o,c,!0)||e,t=i&&mu(a,c,!1)||t]},ti.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&it(e.connectionPreviewGfx)},ti.prototype.getConnection=function(e){var t=function(n){return Tt(n)?n:{}}(e);return this._elementFactory.createConnection(t)},ti.prototype.createConnectionPreviewGfx=function(){var e=se("g");return W(e,{pointerEvents:"none"}),Ce(e).add("djs-connection-preview"),pe(this._canvas.getActiveLayer(),e),e},ti.prototype.createNoopConnection=function(e,t){var n=se("polyline");return W(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),W(n,{points:[e.x,e.y,t.x,t.y]}),n};const d_={__init__:["connectionPreview"],connectionPreview:["type",ti]};var Lv=Math.min,Vv=Math.max;function ip(e){e.preventDefault()}function ta(e){e.stopPropagation()}function xn(e){this.container=e.container,this.parent=ze('
'),this.content=Ye("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=qn(this.autoResize,this),this.handlePaste=qn(this.handlePaste,this)}function en(e,t){this._eventBus=e,this._providers=[],this._textbox=new xn({container:t.getContainer(),keyHandler:qn(this._handleKey,this),resizeHandler:qn(this._handleResize,this)})}xn.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var c=Rn(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(r.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 l=Rn(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return z(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&z(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),o.innerText=n,le.bind(o,"keydown",this.keyHandler),le.bind(o,"mousedown",ta),le.bind(o,"paste",this.handlePaste),i.autoResize&&le.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},xn.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},xn.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,` `),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},xn.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,c=r.startOffset,l=r.endOffset,u=r.commonAncestorContainer,p=(t=u.childNodes,[].slice.call(t));if(function(g){return g.nodeType===Node.TEXT_NODE}(u)){var h=o.textContent;o.textContent=h.substring(0,c)+e+h.substring(l),n=o,i=c+e.length}else if(o===this.content&&a===this.content){var v=document.createTextNode(e);this.content.insertBefore(v,p[c]),n=v,i=v.textContent.length}else{var f=p.indexOf(o),y=p.indexOf(a);p.forEach(function(g,x){x===f?g.textContent=o.textContent.substring(0,c)+e+a.textContent.substring(l):x>f&&x<=y&&Nn(g)}),n=o,i=c+e.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},xn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
');var h=function(f){ip(f),ta(f);var y=Lv(Vv(u+f.clientX-c,i),o),g=Lv(Vv(p+f.clientY-l,r),a);t.style.width=y+"px",t.style.height=g+"px",e.resizeHandler({width:u,height:p,dx:f.clientX-c,dy:f.clientY-l})},v=function(f){ip(f),ta(f),le.unbind(document,"mousemove",h,!1),le.unbind(document,"mouseup",v,!1)};le.bind(n,"mousedown",function(f){ip(f),ta(f),c=f.clientX,l=f.clientY;var y=t.getBoundingClientRect();u=y.width,p=y.height,le.bind(document,"mousemove",h),le.bind(document,"mouseup",v)})}z(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)},xn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),le.unbind(t,"keydown",this.keyHandler),le.unbind(t,"mousedown",ta),le.unbind(t,"input",this.autoResize),le.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Nn(n)),Nn(e)},xn.prototype.getValue=function(){return this.content.innerText.trim()},xn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},xn.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)},en.$inject=["eventBus","canvas"],en.prototype.registerProvider=function(e){this._providers.push(e)},en.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},en.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},en.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},en.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},en.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&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()}},en.prototype.getValue=function(){return this._textbox.getValue()},en.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return t===27?(e.preventDefault(),this.cancel()):t!==13||e.shiftKey?void 0:(e.preventDefault(),this.complete())},en.prototype._handleResize=function(e){this._fire("resize",e)},en.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=je(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 Fv={__depends__:[Ko],__init__:["directEditing"],directEditing:["type",en]};var $v=".entry";function tn(e,t,n){this._eventBus=t,this._overlays=n;var i=Mn(e&&e.scale)?e.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:i},this._current=null,this._init()}tn.$inject=["config.contextPad","eventBus","overlays"],tn.prototype._init=function(){var e=this._eventBus,t=this;e.on("selection.changed",function(n){var i=n.newSelection;i.length===1?t.open(i[0]):t.close()}),e.on("elements.delete",function(n){F(n.elements,function(i){t.isOpen(i)&&t.close()})}),e.on("element.changed",function(n){var i=n.element,r=t._current;r&&r.element===i&&t.open(i,!0)})},tn.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},tn.prototype.getEntries=function(e){var t=this._getProviders(),n={};return F(t,function(i){var r=i.getContextPadEntries(e);At(r)?n=r(n):F(r,function(o,a){n[a]=o})}),n},tn.prototype.trigger=function(e,t,n){var i,r,o=this._current.element,a=this._current.entries,c=t.delegateTarget||t.target;if(!c)return t.preventDefault();if(i=a[Ut(c,"data-action")].action,r=t.originalEvent||t,At(i)){if(e==="click")return i(r,o,n)}else if(i[e])return i[e](r,o,n);t.preventDefault()},tn.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},tn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},tn.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),i=n.html;F(t,function(r,o){var a,c=r.group||"default",l=ze(r.html||'
');Ut(l,"data-action",o),(a=Ye("[data-group="+c+"]",i))||(a=ze('
'),i.appendChild(a)),a.appendChild(l),r.className&&function(u,p){var h=ct(u);(Se(p)?p:p.split(/\s+/g)).forEach(function(v){h.add(v)})}(l,r.className),r.title&&Ut(l,"title",r.title),r.imageUrl&&l.appendChild(ze(''))}),ct(i).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},tn.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=ze('
'),r=z({html:i},this._overlaysConfig);Ht.bind(i,$v,"click",function(a){t.trigger("click",a)}),Ht.bind(i,$v,"dragstart",function(a){t.trigger("dragstart",a)}),le.bind(i,"mousedown",function(a){a.stopPropagation()}),this._overlayId=n.add(e,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:e,pad:o}),o},tn.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},tn.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};const h_={__depends__:[Ko,Ou],contextPad:["type",tn]};var m_=["marker-start","marker-mid","marker-end"],f_=["circle","ellipse","line","path","polygon","polyline","rect"];function cr(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",function(){F(r._clonedMarkers,function(o){it(o)}),r._clonedMarkers={}})}cr.$inject=["elementRegistry","eventBus","canvas","styles"],cr.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},cr.prototype.addDragger=function(e,t,n){var i=sm(n=n||this.getGfx(e)),r=n.getBoundingClientRect();return this._cloneMarkers(ys(i)),W(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),pe(t,i),i},cr.prototype.addFrame=function(e,t){var n=se("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return pe(t,n),n},cr.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n0,a=r&&Io(r)>0;return!o&&!a},rt.prototype.open=function(e,t,n){var i=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:t,element:e,position:n},o=this._getEntries(e,i),a=this._getHeaderEntries(e,i);r.entries=z({},o,a),r.container=this._createContainer(),Io(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),Io(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var c=this._canvas.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},rt.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),Nn(this._current.container),this._current.container=null)},rt.prototype.isOpen=function(){return!!this._current.container},rt.prototype.trigger=function(e){e.preventDefault();var t=Ut(e.delegateTarget||e.target,Yv),n=this._getEntry(t);if(n.action)return n.action.call(null,e,n)},rt.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},rt.prototype._getEntries=function(e,t){var n={};return F(t,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(e);At(r)?n=r(n):F(r,function(o,a){n[a]=o})}else F(i.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=vi(o,["id"])})}),n},rt.prototype._getHeaderEntries=function(e,t){var n={};return F(t,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(e);At(r)?n=r(n):F(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;F(i.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=vi(o,["id"])})}}),n},rt.prototype._getEntry=function(e){var t=this._current.entries[e];if(!t)throw new Error("entry not found");return t},rt.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},rt.prototype._createContainer=function(){var e=ze('
'),t=this._current.position,n=this._current.className;return z(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),ct(e).add(n),e},rt.prototype._attachContainer=function(e,t,n){var i=this;Ht.bind(e,".entry","click",function(r){i.trigger(r)}),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n)},rt.prototype._updateScale=function(e){var t,n,i=this._canvas.zoom(),r=this._config.scale,o=i;r!==!0&&(r===!1?(t=1,n=1):(t=r.min,n=r.max),Mn(t)&&in&&(o=n)),function(a,c){a.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(l){a.style[l+"transform"]=c})}(e,"scale("+o+")")},rt.prototype._assureIsInbounds=function(e,t){var n,i,r=this._canvas._container.getBoundingClientRect(),o=e.offsetLeft,a=e.offsetTop,c=e.scrollWidth,l=e.scrollHeight,u={},p=t.x-r.left,h=t.y-r.top;o+c>r.width&&(u.x=!0),a+l>r.height&&(u.y=!0),u.x&&u.y?(n=p-c+"px",i=h-l+"px"):u.x?(n=p-c+"px",i=h+"px"):u.y&&h"),i=this;return ct(n).add(t),F(e,function(r,o){var a=i._createEntry(r,o);n.appendChild(a)}),n},rt.prototype._createEntry=function(e,t){var n=ze("
"),i=ct(n);if(i.add("entry"),e.className&&e.className.split(" ").forEach(function(o){i.add(o)}),Ut(n,Yv,t),e.label){var r=ze("");r.textContent=e.label,n.appendChild(r)}return e.imageUrl&&n.appendChild(ze('')),e.active===!0&&i.add("active"),e.disabled===!0&&i.add("disabled"),e.title&&(n.title=e.title),n},rt.prototype._bindAutoClose=function(){this._eventBus.once(Jv,this.close,this)},rt.prototype._unbindAutoClose=function(){this._eventBus.off(Jv,this.close,this)};const y_={__init__:["popupMenu"],popupMenu:["type",rt]};function ra(){}ra.prototype.get=function(){return this._data},ra.prototype.set=function(e){this._data=e},ra.prototype.clear=function(){var e=this._data;return delete this._data,e},ra.prototype.isEmpty=function(){return!this._data};const g_={clipboard:["type",ra]};function rp(e){var t=this;function n(i){t._lastMoveEvent=i}this._lastMoveEvent=null,e.on("canvas.init",function(i){(t._svg=i.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}rp.$inject=["eventBus"],rp.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}(0,0)};const oa={__init__:["mouse"],mouse:["type",rp]};function En(e,t,n,i,r,o,a,c){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=c,r.on("copyPaste.copyElement",function(l){var u=l.descriptor,p=l.element,h=l.elements;u.priority=1,u.id=p.id,je(h,function(v){return v===p.parent})&&(u.parent=p.parent.id),function(v){return!!v.host}(p)&&(u.priority=2,u.host=p.host.id),Us(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(v){return ht(v.waypoints,function(f){return(f=Zv(f)).original&&(f.original=Zv(f.original)),f})}(p)),Hs(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),F(["x","y","width","height"],function(v){fe(p[v])&&(u[v]=p[v])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),r.on("copyPaste.pasteElements",function(l){z(l.hints,{createElementsBehavior:!1})})}function Us(e){return!!e.waypoints}function Hs(e){return!!e.labelTarget}function Zv(e){return z({},e)}function Qv(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}En.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],En.prototype.copy=function(e){var t,n;return Se(e)||(e=e?[e]:[]),n=(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))===!1?{}:this.createTree(Se(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},En.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},En.prototype._paste=function(e,t,n,i){F(e,function(o){fe(o.x)||(o.x=0),fe(o.y)||(o.y=0)});var r=gt(e);return F(e,function(o){Us(o)&&(o.waypoints=ht(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),z(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,z({},i))},En.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return F(e,function(o,a){F(o=mn(o,"priority"),function(c){var l,u=z({},vi(c,["priority"]));return i[c.parent]?u.parent=i[c.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),Us(u)?(u.source=i[c.source],u.target=i[c.target],l=i[c.id]=t.createConnection(u),void r.push(l)):Hs(u)?(u.labelTarget=i[u.labelTarget],l=i[c.id]=t.createLabel(u),void r.push(l)):(u.host&&(u.host=i[u.host]),l=i[c.id]=t.createShape(u),void r.push(l))})}),r},En.prototype.createConnection=function(e){return this._elementFactory.createConnection(vi(e,["id"]))},En.prototype.createLabel=function(e){return this._elementFactory.createLabel(vi(e,["id"]))},En.prototype.createShape=function(e){return this._elementFactory.createShape(vi(e,["id"]))},En.prototype.hasRelations=function(e,t){var n,i;return!(Us(e)&&(n=je(t,fn({id:e.source.id})),i=je(t,fn({id:e.target.id})),!n||!i))&&!(Hs(e)&&!je(t,fn({id:e.labelTarget.id})))},En.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(a,c){var l=je(r,function(u){return a===u.element});l?l.depth=120&&z(h,{"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&&z(h,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three Lanes"),action:{click:g(3)}}})),z(h,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add Lane below"),action:{click:function(_,w){n.addLane(w,"bottom")}}}})}A(v,"bpmn:FlowNode")&&(A(v,"bpmn:EventBasedGateway")?z(h,{"append.receive-task":y("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append ReceiveTask")),"append.message-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):py(v,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(h,{"append.compensation-activity":y("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):A(v,"bpmn:EndEvent")||v.isForCompensation||py(v,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Ft(v)||z(h,{"append.end-event":y("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append EndEvent")),"append.gateway":y("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append Gateway")),"append.append-task":y("bpmn:Task","bpmn-icon-task",p("Append Task")),"append.intermediate-event":y("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append Intermediate/Boundary Event"))})),a.isEmpty(e,"bpmn-replace")||z(h,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(_,w){var S=z(function(D){var s=c.getContainer(),d=t.getPad(D).html,m=s.getBoundingClientRect(),C=d.getBoundingClientRect(),R=C.top-m.top;return{x:C.left-m.left,y:R+C.height+5}}(w),{cursor:{x:_.x,y:_.y}});a.open(w,"bpmn-replace",S)}}}}),Pe(v,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(h,{"append.text-annotation":y("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(v.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),A(v,"bpmn:TextAnnotation")&&z(h,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:f,dragstart:f}}}),Pe(v,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(h,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),A(v,"bpmn:Group")&&z(h,{"append.text-annotation":y("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var E=l.allowed("elements.delete",{elements:[e]});return Se(E)&&(E=E[0]===e),E&&z(h,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:function(_){n.removeElements([e])}}}}),h};const z_={__depends__:[Fv,h_,On,np,Gs,j_],__init__:["contextPadProvider"],contextPadProvider:["type",sp]};var G_={horizontal:["x","width"],vertical:["y","height"]};function ni(e){this._modeling=e,this._filters=[],this.registerFilter(function(t,n,i){var r,o=0,a=0;return F(t,function(c){c.waypoints||c.labelTarget||(o+=c[i],a+=1)}),r=Math.round(o/a),Ee(t,function(c){return c[i]=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},ni.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};const U_={__init__:["distributeElements"],distributeElements:["type",ni]};function dy(e){e.registerFilter(function(t){return Ee(t,function(n){var i=Pe(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)})})}dy.$inject=["distributeElements"];const H_={__depends__:[U_],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",dy]};var hy="is not a registered action";function rn(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function cp(e,t){return new Error(e+" "+t)}rn.$inject=["eventBus","injector"],rn.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),c=e.get("rules",!1),l=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var p=i.get();o.copy(p)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(p){r.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&i&&c&&this.register("removeSelection",function(){var p=i.get();if(p.length){var h,v=c.allowed("elements.delete",{elements:p});v!==!1&&(h=Se(v)?v:p).length&&n.removeElements(h.slice())}}),l&&this.register("moveCanvas",function(p){l.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})},rn.prototype.trigger=function(e,t){if(!this._actions[e])throw cp(e,hy);return this._actions[e](t)},rn.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);F(e,function(i,r){n._registerAction(r,i)})},rn.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw cp(e,"is already registered");this._actions[e]=t},rn.prototype.unregister=function(e){if(!this.isRegistered(e))throw cp(e,hy);this._actions[e]=void 0},rn.prototype.getActions=function(){return Object.keys(this._actions)},rn.prototype.isRegistered=function(e){return!!this._actions[e]};const q_={__init__:["editorActions"],editorActions:["type",rn]};function Qs(e){e.invoke(rn,this)}ae(Qs,rn),Qs.$inject=["injector"],Qs.prototype._registerDefaultActions=function(e){rn.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),c=e.get("globalConnect",!1),l=e.get("distributeElements",!1),u=e.get("alignElements",!1),p=e.get("directEditing",!1),h=e.get("searchPad",!1),v=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",function(){var f=t.getRootElement(),y=n.filter(function(g){return g!==f});return i.select(y),y}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),c&&this._registerAction("globalConnectTool",function(){c.toggle()}),i&&l&&this._registerAction("distributeElements",function(f){var y=i.get(),g=f.type;y.length&&l.trigger(y,g)}),i&&u&&this._registerAction("alignElements",function(f){var y=i.get(),g=[],x=f.type;y.length&&(g=Ee(y,function(E){return!A(E,"bpmn:Lane")}),u.trigger(g,x))}),i&&v&&this._registerAction("setColor",function(f){var y=i.get();y.length&&v.setColor(y,f)}),i&&p&&this._registerAction("directEditing",function(){var f=i.get();f.length&&p.activate(f[0])}),h&&this._registerAction("find",function(){h.toggle()}),t&&v&&this._registerAction("moveToOrigin",function(){var f,y,g=t.getRootElement();f=gt(y=A(g,"bpmn:Collaboration")?n.filter(function(x){return A(x.parent,"bpmn:Collaboration")}):n.filter(function(x){return x!==g&&!A(x.parent,"bpmn:SubProcess")})),v.moveElements(y,{x:-f.x,y:-f.y},g)})};const W_={__depends__:[q_],editorActions:["type",Qs]};function my(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context;Pe(t.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}my.$inject=["eventBus"];function lp(e,t,n){return n||(n="round"),Math[n](e/t)*t}function Mi(e,t,n){var i=!n||n.active!==!1;this._eventBus=t;var r=this;t.on("diagram.init",800,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"],1200,function(o){var a=o.originalEvent;if(!(!r.active||a&&Kt(a))){var c=o.context,l=c.gridSnappingContext;l||(l=c.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},h=function(f,y,g){var x=f.context,E=f.shape,_=x.gridSnappingContext,w=_.snapLocation,S=_.snapOffset;return S&&fe(S[y])||(S||(S=_.snapOffset={}),fe(S[y])||(S[y]=0),!E)||(g.get(E.id)||(ec(y)?S[y]+=E[y]+E.width/2:S[y]+=E[y]+E.height/2),!w)||(y==="x"?/left/.test(w)?S[y]-=E.width/2:/right/.test(w)&&(S[y]+=E.width/2):/top/.test(w)?S[y]-=E.height/2:/bottom/.test(w)&&(S[y]+=E.height/2)),S[y]}(o,u,e);h&&(p.offset=h);var v=function(f,y){var g=f.context,x=g.createConstraints,E=g.resizeConstraints||{},_=g.gridSnappingContext,w=_.snapConstraints;if(w&&w[y])return w[y];w||(w=_.snapConstraints={}),w[y]||(w[y]={});var S=g.direction;x&&(ec(y)?(w.x.min=x.left,w.x.max=x.right):(w.y.min=x.top,w.y.max=x.bottom));var D=E.min,s=E.max;return D&&(ec(y)?vy(S)?w.x.max=D.left:w.x.min=D.right:fy(S)?w.y.max=D.top:w.y.min=D.bottom),s&&(ec(y)?vy(S)?w.x.min=s.left:w.x.max=s.right:fy(S)?w.y.min=s.top:w.y.max=s.bottom),w[y]}(o,u);v&&z(p,v),so(o,u)||r.snapEvent(o,u,p)})}})}function ec(e){return e==="x"}function fy(e){return e.indexOf("n")!==-1}function vy(e){return e.indexOf("w")!==-1}function lr(e,t){ne.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=(r.hints||{}).autoResize;if(o){var a=r.shape,c=r.newBounds;Br(o)?r.newBounds=n.snapComplex(c,o):r.newBounds=n.snapSimple(a,c)}})}Mi.prototype.snapEvent=function(e,t,n){ut(e,t,this.snapValue(e[t],n))},Mi.prototype.getGridSpacing=function(){return 10},Mi.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=lp(e+=r,10),t&&t.min&&fe(n=t.min)&&(n=lp(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&fe(i=t.max)&&(i=lp(i+r,10,"floor"),e=Math.min(e,i)),e-=r},Mi.prototype.isActive=function(){return this.active},Mi.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Mi.prototype.toggleActive=function(){this.setActive(!this.active)},Mi.$inject=["elementRegistry","eventBus","config.gridSnapping"],lr.$inject=["eventBus","gridSnapping","modeling"],ae(lr,ne),lr.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},lr.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},lr.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),z(e,o),e},lr.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),z(e,o),e};function yy(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,function(n){var i,r=n.context;r.initialized&&(r.axis==="x"?(i=t.snapValue(n.dx),n.x=n.x+i-n.dx,n.dx=i):(i=t.snapValue(n.dy),n.y=n.y+i-n.dy,n.dy=i))})}yy.$inject=["eventBus","gridSnapping"];const K_={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",lr],gridSnappingSpaceToolBehavior:["type",yy]}],__init__:["gridSnapping"],gridSnapping:["type",Mi]};function gy(e,t){e.on("autoPlace",2e3,function(n){var i=n.source,r=ge(i),o=n.shape,a=iv(i,o);return["x","y"].forEach(function(c){var l={};a[c]!==r[c]&&(a[c]>r[c]?l.min=a[c]:l.max=a[c],A(o,"bpmn:TextAnnotation")&&(function(u){return u==="x"}(c)?l.offset=-o.width/2:l.offset=-o.height/2),a[c]=t.snapValue(a[c],l))}),a})}gy.$inject=["eventBus","gridSnapping"];function by(e,t,n){t.on(["create.start","shape.move.start"],1750,function(i){var r=i.context,o=r.shape,a=e.getRootElement();A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&a.children.length&&r.createConstraints&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))})}by.$inject=["canvas","eventBus","gridSnapping"];function tc(e,t,n){ne.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(r){var o=r.context,a=o.connection,c=o.hints||{},l=a.waypoints;c.connectionStart||c.connectionEnd||c.createElementsBehavior===!1||function(u){return u.length>3}(l)&&n.updateWaypoints(a,i.snapMiddleSegments(l))})}function X_(e,t,n){var i=Kn(t,n),r={};return function(o){return o==="h"}(i)&&(r.y=e.snapValue(t.y)),function(o){return o==="v"}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=z({},t,r),n=z({},n,r)),[t,n]}tc.$inject=["eventBus","gridSnapping","modeling"],ae(tc,ne),tc.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i5&&W(c,{x:a.x,width:a.width}),a.height>5&&W(c,{y:a.y,height:a.height}),r.canExecute?Ce(c).remove(ky):Ce(c).add(ky)}),e.on("resize.cleanup",function(i){var r,o;r=i.context,o=r.shape,r.frame&&it(r.frame),t.removeMarker(o,Ay)})}Py.$inject=["eventBus","canvas","previewSupport"];var My=-6,ua="djs-resizer",r1=["n","w","s","e","nw","ne","se","sw"];function Ri(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&&F(a,qn(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}Ri.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){Ai(o)&&i.activate(o,e,n)}le.bind(t,"mousedown",r),le.bind(t,"touchstart",r)},Ri.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(u){var p={x:0,y:0};return u.indexOf("e")!==-1?p.x=6:u.indexOf("w")!==-1&&(p.x=My),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=My),p}(i),a=se("g");Ce(a).add(ua),Ce(a).add(ua+"-"+e.id),Ce(a).add(ua+"-"+i),pe(r,a);var c=se("rect");W(c,{x:-2+o.x,y:-2+o.y,width:4,height:4}),Ce(c).add(ua+"-visual"),pe(a,c);var l=se("rect");return W(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),Ce(l).add(ua+"-hit"),pe(a,l),yu(a,t,n),a},Ri.prototype.createResizer=function(e,t){var n=Ty(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},Ri.prototype.addResizer=function(e){var t=this;this._resize.canResize({shape:e})&&F(r1,function(n){t.createResizer(e,n)})},Ri.prototype.removeResizers=function(){am(this._getResizersParent())},Ri.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Ri.$inject=["eventBus","canvas","selection","resize"];const Ry={__depends__:[Vn,ei,na],__init__:["resize","resizePreview","resizeHandles"],resize:["type",la],resizePreview:["type",Py],resizeHandles:["type",Ri]};function up(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return et(e.get("rootElements"),i),re(i).$parent=e,re(n).$parent=i,n}function pa(e,t,n,i,r,o,a){function c(l,u){(u||Pe(l,["bpmn:Task","bpmn:TextAnnotation"])||pp(l))&&i.activate(l)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(l){c(l.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],function(l){i.isActive()&&i.complete()}),e.on(["commandStack.changed"],function(l){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(l){o.removeResizers()}),e.on("create.end",500,function(l){var u=l.context,p=u.shape,h=l.context.canExecute;l.isTouch||h&&(u.hints&&u.hints.createElementsBehavior===!1||c(p))}),e.on("autoPlace.end",500,function(l){c(l.shape)})}function pp(e){return A(e,"bpmn:SubProcess")&&!Oe(e)}pa.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],pa.prototype.activate=function(e){var t=gn(e);if(t!==void 0){var n={text:t};z(n,this.getEditingBBox(e));var i={};return(Pe(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||pp(e))&&z(i,{centerVertically:!0}),Qr(e)&&z(i,{autoResize:!0}),A(e,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},pa.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},c=t.zoom(),l=this._textRenderer.getDefaultStyle(),u=this._textRenderer.getExternalStyle(),p=u.fontSize*c,h=u.lineHeight,v=l.fontSize*c,f=l.lineHeight,y={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(A(e,"bpmn:Lane")||function(D){return A(D,"bpmn:Participant")&&Oe(D)}(e))&&(z(a,{width:i.height,height:30*c,x:i.x-i.height/2+15*c,y:o-30*c/2}),z(y,{fontSize:v+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:"rotate(-90deg)"})),(Pe(e,["bpmn:Task","bpmn:CallActivity"])||function(D){return A(D,"bpmn:Participant")&&!Oe(D)}(e)||pp(e))&&(z(a,{width:i.width,height:i.height}),z(y,{fontSize:v+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"})),function(D){return A(D,"bpmn:SubProcess")&&Oe(D)}(e)&&(z(a,{width:i.width,x:i.x}),z(y,{fontSize:v+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"}));var g=90*c,x=7*c,E=4*c;if(n.labelTarget&&(z(a,{width:g,height:i.height+x+E,x:r-g/2,y:i.y-x}),z(y,{fontSize:p+"px",lineHeight:h,paddingTop:x+"px",paddingBottom:E+"px"})),Qr(n)&&!Ps(n)&&!wt(n)){var _=Ms(e),w=t.getAbsoluteBBox({x:_.x,y:_.y,width:0,height:0}),S=p+x+E;z(a,{width:g,height:S,x:w.x-g/2,y:w.y-S/2}),z(y,{fontSize:p+"px",lineHeight:h,paddingTop:x+"px",paddingBottom:E+"px"})}return A(e,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*c,minHeight:10*c}),z(y,{textAlign:"left",paddingTop:5*c+"px",paddingBottom:7*c+"px",paddingLeft:7*c+"px",paddingRight:5*c+"px",fontSize:v+"px",lineHeight:f})),{bounds:a,style:y}},pa.prototype.update=function(e,t,n,i){var r,o,a;if(A(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}),A(e,"bpmn:Group")&&!re(e).categoryValueRef){var c=up(re(this._canvas.getRootElement()).$parent,this._bpmnFactory);re(e).categoryValueRef=c}(a=t)&&a.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var Ny="djs-element-hidden",Iy="djs-label-hidden";function Dy(e,t,n,i){var r,o,a,c=this,l=t.getDefaultLayer();e.on("directEditing.activate",function(u){var p=u.active;if(A(r=p.element.label||p.element,"bpmn:TextAnnotation")){o=t.getAbsoluteBBox(r),a=se("g");var h=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),v=c.path=se("path");W(v,{d:h,strokeWidth:2,stroke:o1(r)}),pe(a,v),pe(l,a),Lt(a,r.x,r.y)}A(r,"bpmn:TextAnnotation")||r.labelTarget?t.addMarker(r,Ny):(A(r,"bpmn:Task")||A(r,"bpmn:CallActivity")||A(r,"bpmn:SubProcess")||A(r,"bpmn:Participant"))&&t.addMarker(r,Iy)}),e.on("directEditing.resize",function(u){if(A(r,"bpmn:TextAnnotation")){var p=u.height,h=u.dy,v=Math.max(r.height/o.height*(p+h),0),f=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:v,position:{mx:0,my:0}});W(c.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(u){var p=u.active;p&&(t.removeMarker(p.element.label||p.element,Ny),t.removeMarker(r,Iy)),r=void 0,o=void 0,a&&(it(a),a=void 0)})}function o1(e,t){return re(e).di.get("stroke")||t||"black"}Dy.$inject=["eventBus","canvas","elementRegistry","pathMap"];const a1={__depends__:[Cy,Ry,Fv],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",pa],labelEditingPreview:["type",Dy]};var dp=["top","bottom","left","right"],ic=10;function hp(e,t){function n(i){if(Ps(i)){var r=function(o){var a=ge(o.label),c=ge(o),l=By(c,a);if(u=l,dp.indexOf(u)!==-1){var u,p=function(f){var y=ge(f),g=[].concat(f.incoming.map(function(x){return x.waypoints[x.waypoints.length-2]}),f.outgoing.map(function(x){return x.waypoints[1]})).map(function(x){return By(y,x)});return g}(o);if(o.host){var h=function(f){var y,g=f.host,x=ge(f),E=bt(x,g);y=E.indexOf("-")>=0?E.split("-"):[E];var _=dp.filter(function(w){return y.indexOf(w)===-1});return _}(o);p=p.concat(h)}var v=dp.filter(function(f){return p.indexOf(f)===-1});if(v.indexOf(l)===-1)return v[0]}}(i);r&&function(o,a){var c=ge(o),l=o.label,u=ge(l);if(l.parent){var p,h=ce(o);switch(a){case"top":p={x:c.x,y:h.top-ic-l.height/2};break;case"left":p={x:h.left-ic-l.width/2,y:c.y};break;case"bottom":p={x:c.x,y:h.bottom+ic+l.height/2};break;case"right":p={x:h.right+ic+l.width/2,y:c.y}}var v=jn(p,u);t.moveShape(l,v)}}(i,r)}}ne.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.source,c=o.target;(r.hints||{}).createElementsBehavior!==!1&&(n(a),n(c))}),this.postExecuted(["label.create"],function(i){var r=i.context,o=r.shape;(r.hints||{}).createElementsBehavior!==!1&&n(o.labelTarget)}),this.postExecuted(["elements.create"],function(i){var r=i.context,o=r.elements;(r.hints||{}).createElementsBehavior!==!1&&o.forEach(function(a){n(a)})})}function By(e,t){return bt(t,e,5)}function mp(e,t,n){ne.call(this,e),this.preExecute("shape.append",function(i){var r=i.source,o=i.shape;i.position||(A(o,"bpmn:TextAnnotation")?i.position={x:r.x+r.width/2+75,y:r.y-50-o.height/2}:i.position={x:r.x+r.width+80+o.width/2,y:r.y+r.height/2})},!0)}function fp(e,t){e.invoke(ne,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;F(Ee(r.incoming.concat(r.outgoing),function(o){return A(o,"bpmn:Association")}),function(o){t.moveConnection(o,{x:0,y:0},i)})},!0)}ae(hp,ne),hp.$inject=["eventBus","modeling"],ae(mp,ne),mp.$inject=["eventBus","elementFactory","bpmnRules"],ae(fp,ne),fp.$inject=["injector","modeling"];function rc(e,t){t.invoke(ne,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return Oy(o,o.host)})).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",500,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];Oy(a,o)&&(i.shapes=[n.replaceShape(a,o)])}},!0)}function Oy(e,t){return!wt(e)&&Pe(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}rc.$inject=["bpmnReplace","injector"],ae(rc,ne),rc.prototype.replaceShape=function(e,t){var n,i=(n=re(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function vp(e,t,n){function i(r){return Ee(r.attachers,function(o){return A(o,"bpmn:BoundaryEvent")})}ne.call(this,e),this.postExecute("connection.create",function(r){var o=r.context.source,a=r.context.target,c=i(a);A(o,"bpmn:EventBasedGateway")&&A(a,"bpmn:ReceiveTask")&&c.length>0&&n.removeElements(c)}),this.postExecute("connection.reconnect",function(r){var o=r.context.oldSource,a=r.context.newSource;A(o,"bpmn:Gateway")&&A(a,"bpmn:EventBasedGateway")&&F(a.outgoing,function(c){var l=c.target,u=i(l);A(l,"bpmn:ReceiveTask")&&u.length>0&&n.removeElements(u)})}),e.on("moddleCopy.canCopyProperty",2e3,function(r){var o=r.parent,a=r.property,c=r.propertyName,l=t.getPropertyDescriptor(o,c);l&&l.isReference&&A(a,"bpmn:RootElement")&&o.set(c,a)})}vp.$inject=["eventBus","moddle","modeling"],ae(vp,ne);function yp(e,t,n,i,r){function o(u){return Pe(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,h){return Se(h)||(h=[h]),Yi(h,function(v){return Ts(p,v)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!je(e.getDefinitions().get("rootElements"),fn({id:u.id}))}function c(u){return A(u,"bpmn:ErrorEventDefinition")?"errorRef":A(u,"bpmn:EscalationEventDefinition")?"escalationRef":A(u,"bpmn:MessageEventDefinition")?"messageRef":A(u,"bpmn:SignalEventDefinition")?"signalRef":void 0}function l(u){if(Pe(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions")[0];return p.get(c(p))}n.invoke(ne,this),this.executed("shape.create",function(u){var p=u.shape;if(o(p)){var h=l(re(p));h&&!a(h)&&(et(e.getDefinitions().get("rootElements"),h),u.addedRootElement=h)}},!0),this.reverted("shape.create",function(u){var p=u.addedRootElement;p&&Qe(e.getDefinitions().get("rootElements"),p)},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,h=u.element;if(o(h)){var v=l(re(h));v&&(p.referencedRootElement=v)}}),t.on("copyPaste.pasteElement",500,function(u){var p=u.descriptor,h=p.businessObject;if(o(h)){var v=p.referencedRootElement;v&&(a(v)||(v=i.copyElement(v,r.create(v.$type))),function(f,y){if(Pe(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",y);var g=f.get("eventDefinitions")[0];g.set(c(g),y)}(h,v))}})}function gp(e){e.invoke(ne,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;A(i,"bpmn:Lane")&&!A(r,"bpmn:Lane")&&(n.parent=js(i,"bpmn:Participant"))})}yp.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],ae(yp,ne),gp.$inject=["injector"],ae(gp,ne);var oc=1500;function jy(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"],oc,function(i){var r=i.context.shape||i.shape,o=i.hover;A(o,"bpmn:Lane")&&!Pe(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=wn(o),i.hoverGfx=e.getGraphics(i.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||A(r,"bpmn:Group"))&&(i.hover=a,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"],oc,function(i){var r=i.hover;A(r,"bpmn:Lane")&&(i.hover=wn(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],oc,function(i){var r=i.context,o=i.hover,a=r.type;A(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=wn(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],oc,function(i){var r=i.context,o=r.start;A(o,"bpmn:Lane")&&(r.start=wn(o)||o)}),t.on("shape.move.start",2e3,function(i){var r=i.shape;A(r,"bpmn:Lane")&&(i.shape=wn(r)||r)})}function bp(e,t,n){ne.call(this,e),this.preExecute("shape.create",function(i){var r=i.context.shape;if(A(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=t.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}jy.$inject=["elementRegistry","eventBus","canvas"],bp.$inject=["eventBus","bpmnFactory","moddle"],ae(bp,ne);var xp=20,Ep=20,Ly=30,ac=2e3;function wp(e,t,n){function i(r){var o,a=r.parent,c=e.getRootElement();A(c,"bpmn:Collaboration")?o=c:(o=n.makeCollaboration(),r.process=a),r.parent=o}ne.call(this,t),t.on(["create.start","shape.move.start"],ac,function(r){var o=r.context,a=o.shape,c=e.getRootElement();if(A(a,"bpmn:Participant")&&A(c,"bpmn:Process")&&c.children.length){var l=c.children.filter(function(h){return!A(h,"bpmn:Group")&&!wt(h)&&!function(v){return!!v.waypoints}(h)});if(l.length){var u=gt(l),p=function(h,v){v={width:v.width+2*xp+Ly,height:v.height+2*Ep};var f=Math.max(h.width,v.width),y=Math.max(h.height,v.height);return{x:-f/2,y:-y/2,width:f,height:y}}(a,u);z(a,p),o.createConstraints=function(h,v){return v=ce(v),{bottom:v.top+h.height/2-Ep,left:v.right-h.width/2+xp,top:v.bottom-h.height/2+Ep,right:v.left+h.width/2-xp-Ly}}(a,u)}}}),t.on("create.start",ac,function(r){var o=r.context.shape,a=e.getRootElement(),c=e.getGraphics(a);function l(u){u.element=a,u.gfx=c}A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&(t.on("element.hover",ac,l),t.once("create.cleanup",function(){t.off("element.hover",l)}))}),this.preExecute("shape.create",function(r){var o=r.parent;A(r.shape,"bpmn:Participant")&&A(o,"bpmn:Process")&&i(r)},!0),this.execute("shape.create",function(r){var o=r.process,a=r.shape;o&&(r.oldProcessRef=a.businessObject.processRef,a.businessObject.processRef=o.businessObject)},!0),this.revert("shape.create",function(r){var o=r.process,a=r.shape;o&&(a.businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("shape.create",function(r){var o=r.process,a=r.shape;if(o){var c=o.children.slice();n.moveElements(c,{x:0,y:0},a)}},!0),this.preExecute("elements.create",ac,function(r){var o,a=r.elements,c=r.parent;sc(a)&&A(c,"bpmn:Process")&&(i(r),o=sc(a),r.oldProcessRef=o.businessObject.processRef,o.businessObject.processRef=c.businessObject)},!0),this.revert("elements.create",function(r){var o=r.elements;r.process&&(sc(o).businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("elements.create",function(r){var o,a=r.elements,c=r.process;if(c){o=sc(a);var l=c.children.slice();n.moveElements(l,{x:0,y:0},o)}},!0)}function sc(e){return je(e,function(t){return A(t,"bpmn:Participant")})}wp.$inject=["canvas","eventBus","modeling"],ae(wp,ne);var Vy="__targetRef_placeholder";function _p(e,t){function n(o,a){var c=o.get("properties"),l=je(c,function(u){return u.name===Vy});return!l&&a&&et(c,l=t.create("bpmn:Property",{name:Vy})),l}function i(o,a){var c=n(o);c&&(function(l,u,p){return je(l.get("dataInputAssociations"),function(h){return h!==p&&h.targetRef===u})}(o,c,a)||Qe(o.get("properties"),c))}function r(o){var a,c=o.context,l=c.connection,u=l.businessObject,p=l.target,h=p&&p.businessObject,v=c.newTarget,f=v&&v.businessObject,y=c.oldTarget||c.target,g=y&&y.businessObject,x=l.businessObject;g&&g!==h&&i(g,u),f&&f!==h&&i(f,u),h?(a=n(h,!0),x.targetRef=a):x.targetRef=null}ne.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Fy(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Fy(r))}function Fy(e){return function(t){if(A(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function cc(e){this._bpmnUpdater=e}function Sp(e,t,n,i){function r(a){return a.children.filter(function(c){return A(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function o(a,c){var l=a.businessObject||a;if(c=c||n.filter(function(p){return A(p,"bpmn:Participant")&&re(p).processRef})[0]){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,newSemanticParent:u.processRef||u,newDiParent:u.di})}}ne.call(this,i),t.registerHandler("dataStore.updateContainment",cc),this.preExecute("shape.create",function(a){var c=a.context,l=c.shape;A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var c=a.context,l=c.shapes;l.filter(function(u){return A(u,"bpmn:DataStoreReference")}).length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(u){return!A(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var c=a.context.shape,l=c.parent;A(c,"bpmn:DataStoreReference")&&c.type!=="label"&&A(l,"bpmn:Collaboration")&&o(c)}),this.postExecute("shape.move",function(a){var c=a.context,l=c.shape,u=c.oldParent,p=l.parent;A(u,"bpmn:Collaboration")||A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&A(p,"bpmn:Collaboration")&&o(l,A(u,"bpmn:Participant")?u:function(h,v){for(;h.parent;){if(A(h.parent,v))return h.parent;h=h.parent}}(u,"bpmn:Participant"))}),this.postExecute("shape.delete",function(a){var c=a.context.shape,l=e.getRootElement();Pe(c,["bpmn:Participant","bpmn:SubProcess"])&&A(l,"bpmn:Collaboration")&&r(l).filter(function(u){return function(p,h){for(var v=p.businessObject||p,f=h.businessObject||h;v.$parent;){if(v.$parent===f.processRef||f)return!0;v=v.$parent}return!1}(u,c)}).forEach(function(u){o(u)})}),this.postExecute("canvas.updateRoot",function(a){var c=a.context,l=c.oldRoot,u=c.newRoot;r(l).forEach(function(p){A(u,"bpmn:Process")&&o(p,u)})})}_p.$inject=["eventBus","bpmnFactory"],ae(_p,ne),cc.$inject=["bpmnUpdater"],cc.prototype.execute=function(e){var t=e.dataStoreBo,n=e.newSemanticParent,i=e.newDiParent;e.oldSemanticParent=t.$parent,e.oldDiParent=t.di.$parent,this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},cc.prototype.revert=function(e){var t=e.dataStoreBo,n=e.oldSemanticParent,i=e.oldDiParent;this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Sp.$inject=["canvas","commandStack","elementRegistry","eventBus"],ae(Sp,ne);function Cp(e,t,n){ne.call(this,e),this.postExecuted("shape.delete",500,function(i){var r=i.context,o=r.hints,a=r.shape,c=r.oldParent;A(a,"bpmn:Lane")&&(o&&o.nested||function(l,u){var p,h,v,f=Pi(u),y=[],g=[];Zi(f,function(x){return x.y>l.y?g.push(x):y.push(x),x.children}),f.length&&(p=g.length&&y.length?l.height/2:l.height,y.length&&(h=n.calculateAdjustments(y,"y",p,l.y-10),n.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:p},"s")),g.length&&(v=n.calculateAdjustments(g,"y",-p,l.y+l.height+10),n.makeSpace(v.movingShapes,v.resizingShapes,{x:0,y:-p},"n")))}(a,c))})}Cp.$inject=["eventBus","modeling","spaceTool"],ae(Cp,ne);function lc(e,t){t.invoke(ne,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return $y(o,o.host)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n.replaceShape(r[o])})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,c){var l,u=a.host;$y(a,(l=u,r.indexOf(l)!==-1?u:o))&&(r[c]=n.replaceShape(a))})},!0)}function $y(e,t){return!wt(e)&&A(e,"bpmn:BoundaryEvent")&&!t}function Tp(e,t,n){function i(r,o,a){var c,l,u,p,h,v,f,y,g=o.waypoints,x=r.outgoing.slice(),E=r.incoming.slice(),_=Xu(g,y=fe(a.width)?ge(a):a);if(_){if(c=g.slice(0,_.index),l=g.slice(_.index+(_.bendpoint?1:0)),!c.length||!l.length)return;u=_.bendpoint?g[_.index]:y,c.length!==1&&zy(r,c[c.length-1])||c.push(Gy(u)),l.length!==1&&zy(r,l[0])||l.unshift(Gy(u))}p=o.source,h=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||y),v=o),t.canConnect(r,h,o)&&(v?f=n.connect(r,h,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||y),f=o));var w=[].concat(v&&Ee(E,function(S){return S.source===v.source})||[],f&&Ee(x,function(S){return S.target===f.target})||[]);w.length&&n.removeElements(w)}ne.call(this,e),this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,c=r.delta,l=a[0];if(l&&o){o&&o.waypoints&&(r.newParent=o=o.parent);var u=ge(l),p={x:u.x+c.x,y:u.y+c.y},h=je(o.children,function(v){return t.canInsert(a,v)&&Xu(v.waypoints,p)});h&&(r.targetFlow=h,r.position=p)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,c=r.position;a&&i(o[0],a,c)},!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,c=r.position;a&&i(o,a,c)},!0)}function zy(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 Gy(e){return z({},e)}function Ap(e,t){ne.call(this,e),this.preExecuted("connection.create",function(n){var i=n.context,r=i.source,o=i.target,a=o.incoming.slice();i.hints&&i.hints.createElementsBehavior===!1||A(r,"bpmn:EventBasedGateway")&&o.incoming.length&&a.filter(kp).forEach(function(c){t.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;A(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(kp).map(function(r){return r.target}).reduce(function(r,o){var a=o.incoming.filter(kp);return r.concat(a)},[]).forEach(function(r){r.source!==i&&t.removeConnection(r)})})}function kp(e){return A(e,"bpmn:SequenceFlow")}lc.$inject=["bpmnReplace","injector"],ae(lc,ne),lc.prototype.replaceShape=function(e){var t,n,i=(n=re(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},ae(Tp,ne),Tp.$inject=["eventBus","bpmnRules","modeling"],Ap.$inject=["eventBus","modeling"],ae(Ap,ne);function Pp(e,t,n,i,r,o){function a(){return re(t.getRootElement()).$parent}function c(l){var u=re(l).categoryValueRef;if(u){var p=u.$parent;u&&(Qe(p.categoryValue,u),p&&!p.categoryValue.length&&function(h){Qe(a().get("rootElements"),h)}(p))}}r.invoke(ne,this),this.executed("shape.delete",function(l){var u,p=l.context.shape;if(A(p,"bpmn:Group")){var h=re(p).categoryValueRef,v=n.filter(function(f){return A(f,"bpmn:Group")});u=h,v.some(function(f){var y=re(f);return y.categoryValueRef&&y.categoryValueRef===u})||c(p)}}),this.reverted("shape.delete",function(l){var u=l.context.shape;if(A(u,"bpmn:Group")){var p=re(u).categoryValueRef,h=a(),v=p?p.$parent:null;et(v.get("categoryValue"),p),et(h.get("rootElements"),v)}}),this.execute("shape.create",function(l){var u=re(l.context.shape);if(A(u,"bpmn:Group")&&!u.categoryValueRef){var p=up(a(),e);u.categoryValueRef=p}}),this.revert("shape.create",function(l){var u=l.context.shape;A(u,"bpmn:Group")&&(c(u),delete re(u).categoryValueRef)}),i.on("moddleCopy.canCopyProperty",2e3,function(l){var u,p=l.property;if(A(p,"bpmn:CategoryValue"))return u=up(a(),e),o.copyElement(p,u)})}function Mp(e,t,n,i){var r,o,a,c;return(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))==0?null:(o=e.y-n.y,a=e.x-n.x,c=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+c*(t.x-e.x)),y:Math.round(e.y+c*(t.y-e.y))})}function Uy(e){function t(n,i,r){var o,a={x:r.x,y:r.y-50},c={x:r.x-50,y:r.y},l=Mp(n,i,r,a),u=Mp(n,i,r,c);o=l&&u?Hy(l,r)>Hy(u,r)?u:l:l||u,n.original=o}e.on("bpmnElement.added",function(n){var i,r,o=n.element;o.waypoints&&(t((r=(i=o).waypoints)[0],r[1],ge(i.source)),t(r[r.length-1],r[r.length-2],ge(i.target)))})}function Hy(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Rp(e){ne.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=re(n.context.shape);Pe(i,t)&&!i.di.get("isHorizontal")&&i.di.set("isHorizontal",!0)})}function qy(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Wy(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Ky(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=function(a,c,l){var u=[{n:a[0]-l[0],lambda:c[0]},{n:a[1]-l[1],lambda:c[1]}];return-(u[0].n*c[0]+u[1].n*c[1])/(u[0].lambda*c[0]+u[1].lambda*c[1])}([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function s1(e,t){var n=Ky(e,t);return qy({x:n.x-e.x,y:n.y-e.y})}function uc(e,t){return qy({x:e.x-t.x,y:e.y-t.y})}Pp.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],ae(Pp,ne),Uy.$inject=["eventBus"],Rp.$inject=["eventBus"],ae(Rp,ne);var Xy=Math.sqrt,Yy=Math.min,c1=Math.max,Jy=Math.abs;function Zy(e){return Math.pow(e,2)}function da(e,t){return Xy(Zy(e.x-t.x)+Zy(e.y-t.y))}function l1(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,c=n.y-e.y,l=r*r+o*o,u=(r*a+o*c)/l,p=u*u-(a*a+c*c-i*i)/l;if(p<0&&p>-1e-6&&(p=0),p<0)return[];var h=Xy(p),v=-u+h,f=-u-h,y={x:e.x-r*v,y:e.y-o*v};return p===0?[y]:[y,{x:e.x-r*f,y:e.y-o*f}].filter(function(g){return function(x,E,_){return Qy(x.x,E.x,_.x)&&Qy(x.y,E.y,_.y)}(g,e,t)})}function Qy(e,t,n){return e>=Yy(t,n)-pc&&e<=c1(t,n)+pc}var pc=.1;function eg(e,t){return Jy(e.x-t.x)<=pc&&Jy(e.y-t.y)<=pc}function u1(e,t,n,i){var r=0,o=0,a=function(R){return{x:R.x+R.width/2,y:R.y+R.height/2}}(e),c=function(R,I){var N,L,T,b,B,V,H,q,J,Q,oe,ie,he=0;for(he=0;he line intersections");V.length===1&&(H={type:"bendpoint",position:V[0],segmentIndex:he,bendpointIndex:eg(N,V[0])?he:he+1}),V.length===2&&(oe=V[0],ie=V[1],H={type:"segment",position:B={x:(oe.x+ie.x)/2,y:(oe.y+ie.y)/2},segmentIndex:he,relativeLocation:da(N,B)/da(N,L)}),q=da(H.position,R),(!Q||J>q)&&(Q=H,J=q)}return Q}(a,n),l=c.segmentIndex,u=function(R,I,N,L){var T=N.segmentIndex,b=I.length-R.length;if(L.segmentMove){var B=L.segmentMove.segmentStartIndex,V=L.segmentMove.newSegmentStartIndex;return T===B?V:T>=V?T+b=J&&(H=q?T+1:T-1),Tt.length-2)return{x:r,y:o};var p,h,v=ng(n,l),f=ng(t,u),y=c.position,g=function(R,I){var N=uc(R[0],R[1]),L=uc(R[0],I);return N===0?0:L/N}(v,y),x=(p=f,h=Wy(v),Wy(p)-h);if(c.type==="bendpoint"){var E=t.length-n.length,_=c.bendpointIndex,w=n[_];if(t.indexOf(w)!==-1)return{x:r,y:o};if(E===0){var S=t[_];return{x:S.x-c.position.x,y:S.y-c.position.y}}E<0&&_!==0&&_"+o+"
"}))})}function Op(e,t,n,i){ne.call(this,e);var r=i.get("dragging",!1);function o(a){var c,l,u=a.source,p=a.target;a.parent&&(A(a,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(l=!0),n.canConnectMessageFlow(u,p)&&(c="bpmn:MessageFlow")),A(a,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(l=!0),n.canConnectSequenceFlow(u,p)&&(c="bpmn:SequenceFlow")),A(a,"bpmn:Association")&&!n.canConnectAssociation(u,p)&&(l=!0),l&&t.removeConnection(a),c&&t.connect(u,p,{type:c,waypoints:a.waypoints.slice()}))}this.postExecuted("elements.move",function(a){F(a.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(a){var c,l,u=a.context,p=u.connection,h=u.newSource||p.source,v=u.newTarget||p.target;(c=n.canConnect(h,v))&&c.type!==p.type&&(l=t.connect(h,v,{type:c.type,waypoints:p.waypoints.slice()}),t.removeConnection(p),u.connection=l,r&&function(f,y){var g,x=r.context(),E=x&&x.payload.previousSelection;!E||!E.length||(g=E.indexOf(f),g!==-1&&E.splice(g,1,y))}(p,l))}),this.postExecuted("element.updateProperties",function(a){var c,l=a.context,u=l.properties,p=l.element,h=p.businessObject;u.default&&(c=je(p.outgoing,fn({id:p.businessObject.default.id})))&&t.updateProperties(c,{conditionExpression:void 0}),u.conditionExpression&&h.sourceRef.default===h&&t.updateProperties(p.source,{default:void 0})})}function jp(e,t){ne.call(this,e),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;A(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)}function fc(e,t,n,i,r,o){i.invoke(ne,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var c=a.context,l=c.parent,u=c.elements,p=t.canReplace(u,l);p&&this.replaceElements(u,p.replacements)},this),this.postExecuted(["elements.move"],500,function(a){var c=a.context,l=c.newParent,u=c.newHost,p=[];F(c.closure.topLevel,function(v){p=Ft(v)?p.concat(v.children):p.concat(v)}),p.length===1&&u&&(l=u);var h=t.canReplace(p,l);h&&this.replaceElements(p,h.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var c,l=a.context,u=l.oldShape,p=l.newShape,h=u.attachers;h&&h.length&&(c=t.canReplace(h,p),this.replaceElements(h,c.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var c=a.context,l=c.oldShape,u=c.newShape;r.unclaimId(l.businessObject.id,l.businessObject),r.updateProperties(u,{id:l.id})})}cg.$inject=["eventBus","tooltips","translate"],ae(Op,ne),Op.$inject=["eventBus","modeling","bpmnRules","injector"],jp.$inject=["eventBus","modeling"],ae(jp,ne),ae(fc,ne),fc.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;F(t,function(o){var a={type:o.newElementType},c=n.get(o.oldElementId),l=e.indexOf(c);e[l]=i.replaceElement(c,a,{select:!1})}),t&&r.select(e)},fc.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var ur={width:300,height:60},ma={width:300,height:150},lg={width:140,height:120},ug={width:50,height:30};function pg(e){e.on("resize.start",1500,function(t){var n=t.context,i=n.shape,r=n.direction,o=n.balanced;(A(i,"bpmn:Lane")||A(i,"bpmn:Participant"))&&(n.resizeConstraints=function(a,c,l){var u=wn(a),p=!0,h=!0,v=Zs(u,[u]),f=ce(a),y={},g={};return/e/.test(c)?g.right=f.left+ur.width:/w/.test(c)&&(g.left=f.right-ur.width),v.forEach(function(x){var E=ce(x);/n/.test(c)&&(E.topf.bottom+10&&(h=!1),l&&vc(f.bottom-E.top)<10&&yc(y,"bottom",E.bottom-ur.height),vc(f.bottom-E.bottom)<5&&gc(g,"bottom",E.top+ur.height))}),u.children.filter(function(x){return!x.hidden&&!x.waypoints&&(A(x,"bpmn:FlowElement")||A(x,"bpmn:Artifact"))}).forEach(function(x){var E=ce(x);p&&/n/.test(c)&&yc(g,"top",E.top-g1),/e/.test(c)&&gc(g,"right",E.right+v1),h&&/s/.test(c)&&gc(g,"bottom",E.bottom+b1),/w/.test(c)&&yc(g,"left",E.left-y1)}),{min:g,max:y}}(i,r,o)),A(i,"bpmn:Participant")&&(n.minDimensions=ma),A(i,"bpmn:SubProcess")&&Oe(i)&&(n.minDimensions=lg),A(i,"bpmn:TextAnnotation")&&(n.minDimensions=ug)})}pg.$inject=["eventBus"];var vc=Math.abs,m1=Math.min,f1=Math.max;function dg(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function yc(e,t,n){return dg(e,t,n,m1)}function gc(e,t,n){return dg(e,t,n,f1)}var v1=20,y1=50,g1=20,b1=20;function hg(e,t){e.on("resize.start",1501,function(n){var i=n.context,r=i.shape;(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))&&(i.balanced=!to(n))}),e.on("resize.end",1001,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))return o&&(a=Dm(a),t.resizeLane(r,a,i.balanced)),!1})}function Lp(e,t,n){ne.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(A(o,"bpmn:SequenceFlow")&&A(a,"bpmn:SequenceFlow")&&t.canConnect(o.source,a.target,o)){var c=function(l,u){var p=Mp(lo(l[l.length-2]),lo(l[l.length-1]),lo(u[1]),lo(u[0]));return p?[].concat(l.slice(0,l.length-1),[p],u.slice(1)):[lo(l[0]),lo(u[u.length-1])]}(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,c)}}})}function lo(e){return e.original||e}hg.$inject=["eventBus","modeling"],ae(Lp,ne),Lp.$inject=["eventBus","bpmnRules","modeling"];var x1=Math.max;function mg(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return F(n,function(a){var c=a.id;A(a,"bpmn:Participant")&&(function(l){return l==="x"}(i)?o[c]=ma:o[c]={width:ma.width,height:E1(a,r)}),A(a,"bpmn:SubProcess")&&Oe(a)&&(o[c]=lg),A(a,"bpmn:TextAnnotation")&&(o[c]=ug)}),o})}function E1(e,t){var n;return Pi(e).length?(n=function(i,r){var o,a=Pi(i);return o=fg(a,r),i.height-o.height+ur.height}(e,t),x1(ma.height,n)):ma.height}function fg(e,t){var n,i,r;for(n=0;n=(i=e[n]).y&&t<=i.y+i.height)return(r=Pi(i)).length?fg(r,t):i}function Vp(e,t){e.invoke(ne,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(A(r,"bpmn:SubProcess")&&A(i,"bpmn:Task")&&Oe(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};t.createShape({type:"bpmn:StartEvent"},a,r)}})}mg.$inject=["eventBus"],Vp.$inject=["injector","modeling"],ae(Vp,ne);function Fp(e,t,n,i){ne.call(this,e),this.executed(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape;A(a,"bpmn:SubProcess")&&(a.collapsed?re(a).di.isExpanded=!1:((o=a.children).length&&o.forEach(function(c){c.type!=="label"||c.businessObject.name||(c.hidden=!0)}),re(a).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(r){var o=r.context.shape;o.collapsed?re(o).di.isExpanded=!1:re(o).di.isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape,c=t._getDefaultSize(a);o=a.collapsed?function(l,u){return{x:l.x+(l.width-u.width)/2,y:l.y+(l.height-u.height)/2,width:u.width,height:u.height}}(a,c):function(l,u){var p,h,v=l.children,f=u;return(p=uy((h=v,h.filter(function(y){return!y.hidden})).concat([l])))?(f.width=Math.max(p.width,f.width),f.height=Math.max(p.height,f.height),f.x=p.x+(p.width-f.width)/2,f.y=p.y+(p.height-f.height)/2):(f.x=l.x+(l.width-f.width)/2,f.y=l.y+(l.height-f.height)/2),f}(a,c),n.resizeShape(a,o,null,{autoResize:!a.collapsed&&"nwse"})})}function $p(e,t,n,i){t.invoke(ne,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;wt(o)||(A(o,"bpmn:Participant")&&Oe(o)&&n.ids.unclaim(a.processRef.id),i.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(r){var o=r.context.connection.businessObject;i.unclaimId(o.id,o)}),this.preExecute("canvas.updateRoot",function(){var r=e.getRootElement().businessObject;n.ids.unclaim(r.id)})}ae(Fp,ne),Fp.$inject=["eventBus","elementFactory","modeling"],ae($p,ne),$p.$inject=["canvas","injector","moddle","modeling"];function zp(e,t,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}ne.call(this,e);var o=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,5e3,function(a){(i=i||new w1).enter()}),this.postExecuted(o,500,function(a){(function(){if(!i)throw new Error(n("out of bounds release"));var c=i.leave();c&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null)})()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(a){var c=a.context.shape,l=r();c.labelTarget||(A(c,"bpmn:Lane")&&l.addLane(c),A(c,"bpmn:FlowNode")&&l.addFlowNode(c))})}function w1(){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}}function Gp(e,t){ne.call(this,e),this.preExecute("connection.delete",function(n){var i=n.context.connection,r=i.source;(function(o,a){if(!A(o,"bpmn:SequenceFlow"))return!1;var c=re(a),l=re(o);return c.get("default")===l})(i,r)&&t.updateProperties(r,{default:null})})}zp.$inject=["eventBus","modeling","translate"],ae(zp,ne),ae(Gp,ne),Gp.$inject=["eventBus","modeling"];const _1={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","rootElementReferenceBehavior","createBehavior","fixHoverBehavior","createDataObjectBehavior","createParticipantBehavior","dataStoreBehavior","dataInputAssociationBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","toggleElementCollapseBehaviour","spaceToolBehavior","subProcessStartEventBehavior","unclaimIdBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior"],adaptiveLabelPositioningBehavior:["type",hp],appendBehavior:["type",mp],associationBehavior:["type",fp],attachEventBehavior:["type",rc],boundaryEventBehavior:["type",vp],rootElementReferenceBehavior:["type",yp],createBehavior:["type",gp],fixHoverBehavior:["type",jy],createDataObjectBehavior:["type",bp],createParticipantBehavior:["type",wp],dataInputAssociationBehavior:["type",_p],dataStoreBehavior:["type",Sp],deleteLaneBehavior:["type",Cp],detachEventBehavior:["type",lc],dropOnFlowBehavior:["type",Tp],eventBasedGatewayBehavior:["type",Ap],groupBehavior:["type",Pp],importDockingFix:["type",Uy],isHorizontalFix:["type",Rp],labelBehavior:["type",Np],messageFlowBehavior:["type",Bp],modelingFeedback:["type",cg],replaceConnectionBehavior:["type",Op],removeParticipantBehavior:["type",jp],replaceElementBehaviour:["type",fc],resizeBehavior:["type",pg],resizeLaneBehavior:["type",hg],removeElementBehavior:["type",Lp],toggleElementCollapseBehaviour:["type",Fp],spaceToolBehavior:["type",mg],subProcessStartEventBehavior:["type",Vp],unclaimIdBehavior:["type",$p],updateFlowNodeRefsBehavior:["type",zp],unsetDefaultFlowBehavior:["type",Gp]};function vg(e,t){var n=bt(e,t,-15);return n!=="intersect"?n:null}function _t(e){ki.call(this,e)}function Up(e){return!e||wt(e)}function yg(e){do{if(A(e,"bpmn:Process"))return re(e);if(A(e,"bpmn:Participant"))return re(e).processRef||re(e)}while(e=e.parent)}function Hp(e){return A(e,"bpmn:TextAnnotation")}function qp(e){return A(e,"bpmn:Group")&&!e.labelTarget}function Wp(e){return A(e,"bpmn:BoundaryEvent")&&Fn(e,"bpmn:CompensateEventDefinition")}function uo(e){return re(e).isForCompensation}function gg(e){for(var t=e;t=t.parent;){if(A(t,"bpmn:FlowElementsContainer"))return re(t);if(A(t,"bpmn:Participant"))return re(t).processRef}return null}function Fn(e,t){return!!je(re(e).eventDefinitions||[],function(n){return A(n,t)})}function bg(e,t){return(re(e).eventDefinitions||[]).every(function(n){return A(n,t)})}function xg(e){return A(e,"bpmn:ReceiveTask")||A(e,"bpmn:IntermediateCatchEvent")&&(Fn(e,"bpmn:MessageEventDefinition")||Fn(e,"bpmn:TimerEventDefinition")||Fn(e,"bpmn:ConditionalEventDefinition")||Fn(e,"bpmn:SignalEventDefinition"))}function bc(e){return e.waypoints}function Kp(e,t){var n=function(i){for(var r=[];i;)(i=i.parent)&&r.push(i);return r}(t);return n.indexOf(e)!==-1}function xc(e,t,n){if(Up(e)||Up(t))return null;if(!A(n,"bpmn:DataAssociation")){if(kg(e,t))return{type:"bpmn:MessageFlow"};if(Pg(e,t))return{type:"bpmn:SequenceFlow"}}var i=Yp(e,t);return i||(Wp(e)&&uo(t)?{type:"bpmn:Association",associationDirection:"One"}:!!Ag(e,t)&&{type:"bpmn:Association"})}function po(e,t,n){return!(!wt(e)&&!qp(e))||!(A(t,"bpmn:Participant")&&!Oe(t))&&(A(e,"bpmn:Participant")?A(t,"bpmn:Process")||A(t,"bpmn:Collaboration"):Pe(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:A(e,"bpmn:Lane")?A(t,"bpmn:Participant")||A(t,"bpmn:Lane"):!(A(e,"bpmn:BoundaryEvent")&&!function(i){return re(i).cancelActivity&&(Eg(i)||wg(i))}(e))&&(A(e,"bpmn:FlowElement")&&!A(e,"bpmn:DataStoreReference")?A(t,"bpmn:FlowElementsContainer")?Oe(t):Pe(t,["bpmn:Participant","bpmn:Lane"]):A(e,"bpmn:DataStoreReference")&&A(t,"bpmn:Collaboration")?Yi(re(t).get("participants"),function(i){return!!i.get("processRef")}):Pe(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Pe(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!A(e,"bpmn:MessageFlow")&&(A(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function S1(e){return A(e,"bpmn:Lane")}function C1(e){return!!function(t){return!wt(t)&&A(t,"bpmn:BoundaryEvent")}(e)||!(!A(e,"bpmn:IntermediateThrowEvent")||!Eg(e))||A(e,"bpmn:IntermediateCatchEvent")&&wg(e)}function Eg(e){var t=re(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function wg(e){return _g(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function _g(e,t){return t.some(function(n){return Fn(e,n)})}function fa(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return!wt(r)&&!!C1(r)&&!Ft(t)&&!(!A(t,"bpmn:Activity")||uo(t))&&!(i&&!vg(i,t))&&!function(o){return A(o,"bpmn:ReceiveTask")&&je(o.incoming,function(a){return A(a.source,"bpmn:EventBasedGateway")})}(t)&&"attach"}function Sg(e,t,n){if(!t)return!1;var i={replacements:[]};return F(e,function(r){Ft(t)||A(r,"bpmn:StartEvent")&&r.type!=="label"&&po(r,t)&&(function(o){return o&&re(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return Ts(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return Ts(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return Ts(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),_g(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&A(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),A(t,"bpmn:Transaction")||Fn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(A(r,"bpmn:EndEvent")&&po(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),A(r,"bpmn:BoundaryEvent")&&fa(r,t,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function Cg(e,t){return!Yi(e,S1)&&(!t||e.every(function(n){return po(n,t)}))}function Xp(e,t,n,i){return!!t&&(!(!wt(e)&&!qp(e))||n!==t&&(!n||!Kp(n,t))&&(po(e,t)||Ec(e,t)))}function Tg(e,t){return A(e,"bpmn:SubProcess")?Oe(e)&&(!t||t.width>=100&&t.height>=80):A(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:A(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!Hp(e)||!!qp(e)}function Ag(e,t){return!bc(e)&&!bc(t)&&(!(!Wp(e)||!uo(t))||!Kp(t,e)&&!Kp(e,t)&&(!!function(n,i){var r=Hp(n),o=Hp(i);return(r||o)&&r!==o}(e,t)||!!Yp(e,t)))}function kg(e,t){return!(Rg(e)&&!Rg(t))&&A(i=e,"bpmn:InteractionNode")&&!A(i,"bpmn:BoundaryEvent")&&(!A(i,"bpmn:Event")||A(i,"bpmn:ThrowEvent")&&bg(i,"bpmn:MessageEventDefinition"))&&function(r){return A(r,"bpmn:InteractionNode")&&!uo(r)&&(!A(r,"bpmn:Event")||A(r,"bpmn:CatchEvent")&&bg(r,"bpmn:MessageEventDefinition"))&&!(A(r,"bpmn:BoundaryEvent")&&!Fn(r,"bpmn:MessageEventDefinition"))}(t)&&(n=t,yg(e)!==yg(n));var n,i}function Pg(e,t){return!(xg(t)&&t.incoming.length>0&&(n=t.incoming,(n=n||[]).some(T1))&&!A(e,"bpmn:EventBasedGateway"))&&A(r=e,"bpmn:FlowNode")&&!A(r,"bpmn:EndEvent")&&!Ft(r)&&!(A(r,"bpmn:IntermediateThrowEvent")&&Fn(r,"bpmn:LinkEventDefinition"))&&!Wp(r)&&!uo(r)&&function(o){return A(o,"bpmn:FlowNode")&&!A(o,"bpmn:StartEvent")&&!A(o,"bpmn:BoundaryEvent")&&!Ft(o)&&!(A(o,"bpmn:IntermediateCatchEvent")&&Fn(o,"bpmn:LinkEventDefinition"))&&!uo(o)}(t)&&(i=t,gg(e)===gg(i))&&!(A(e,"bpmn:EventBasedGateway")&&!xg(t));var n,i,r}function Yp(e,t){return Pe(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Pe(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!Pe(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!Pe(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Ec(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&&Pe(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!wt(t)&&A(e,"bpmn:FlowNode")&&!A(e,"bpmn:BoundaryEvent")&&po(e,t.parent)}function Mg(e,t){return!!wt(t)||!(A(t,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(e,t.parent))}function T1(e){if(e&&e.source)return A(e.source,"bpmn:EventBasedGateway")}function Rg(e){return js(e,"bpmn:Process")||js(e,"bpmn:Collaboration")}ae(_t,ki),_t.$inject=["eventBus"],_t.prototype.init=function(){this.addRule("connection.start",function(e){return function(t){return Up(t)?null:Pe(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(e.source)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return xc(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection;return xc(e.source,e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){return Tg(e.shape,e.newBounds)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return!(bc(i)&&!Ec(t,i))&&Or(t,function(r){return bc(r)?xc(r.source,r.target,r):r.host?fa(r,r.host,null,n):Xp(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return fa(n,t,null,i)||Sg(n,t,i)||Cg(n,t)||Ec(n,t)}),this.addRule("shape.create",function(e){return Xp(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return fa(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element;return Mg(e.elements,t)})},_t.prototype.canConnectMessageFlow=kg,_t.prototype.canConnectSequenceFlow=Pg,_t.prototype.canConnectDataAssociation=Yp,_t.prototype.canConnectAssociation=Ag,_t.prototype.canMove=Cg,_t.prototype.canAttach=fa,_t.prototype.canReplace=Sg,_t.prototype.canDrop=po,_t.prototype.canInsert=Ec,_t.prototype.canCreate=Xp,_t.prototype.canConnect=xc,_t.prototype.canResize=Tg,_t.prototype.canCopy=Mg;const A1={__depends__:[Vn],__init__:["bpmnRules"],bpmnRules:["type",_t]};function Ng(e,t){e.on("saveXML.start",2e3,function(){var n,i,r=t.getRootElement(),o=re(r).di;n=Ee(n=ss([r],!1),function(a){return a!==r&&!a.labelTarget}),i=ht(n,Jr),o.set("planeElement",i)})}Ng.$inject=["eventBus","canvas"];const k1={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Ng]};function wc(e){ne.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)})}function Jp(e,t,n){wc.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{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:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(o){var a=o.order;if(a||(o.order=a=function(c){if(c.labelTarget)return{level:10};var l=je(i,function(u){return Pe(c,[u.type])});return l&&l.order||{level:1}}(o)),!a)throw new Error("no order for <"+o.id+">");return a}this.getOrdering=function(o,a){if(o.labelTarget)return{parent:t.getRootElement(),index:-1};var c=r(o);c.containers&&(a=function(p,h,v){for(var f=h;f&&!Pe(f,v);)f=f.parent;if(!f)throw new Error("no parent for <"+p.id+"> in <"+(h&&h.id)+">");return f}(o,a,c.containers));var l=a.children.indexOf(o),u=function(p,h){h=Wl(h);var v=Se(p)?-1:void 0;return F(p,function(f,y){if(h(f,y))return v=y,!1}),v}(a.children,function(p){return!(!o.labelTarget&&p.labelTarget)&&c.level");this._pushAction(e),t||(this._fire(i,"preExecute",e),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",e)),this._atomicDo(function(){n._fire(i,"execute",e),o.execute&&n._markDirty(o.execute(r)),n._executedAction(e,t),n._fire(i,"executed",e)}),t||(this._fire(i,"postExecute",e),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",e)),this._popAction(e)},Ke.prototype._pushAction=function(e){var 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)},Ke.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:Jh("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Ke.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=Se(e)?e:[e],t.dirty=t.dirty.concat(e))},Ke.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Ke.prototype._revertedAction=function(e){this._stackIdx--},Ke.prototype._getHandler=function(e){return this._handlerMap[e]},Ke.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 M1={commandStack:["type",Ke]};var R1=new Bu("tt");function Zp(e,t){e.style.display=t===!1?"none":""}var Ig="djs-tooltip",Qp="."+Ig;function It(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=R1,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),i=ze('
'),n.insertBefore(i,n.firstChild),i);var r=this;Ht.bind(this._tooltipRoot,Qp,"mousedown",function(o){o.stopPropagation()}),Ht.bind(this._tooltipRoot,Qp,"mouseover",function(o){r.trigger("mouseover",o)}),Ht.bind(this._tooltipRoot,Qp,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}It.$inject=["eventBus","canvas"],It.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=z({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},It.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(Ut(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},It.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},It.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},It.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},It.prototype.remove=function(e){var t=this.get(e);t&&(Nn(t.html),Nn(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},It.prototype.show=function(){Zp(this._tooltipRoot)},It.prototype.hide=function(){Zp(this._tooltipRoot,!1)},It.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},It.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Br(i)&&(i=ze(i)),(t=ze('
')).appendChild(i),e.type&&ct(t).add("djs-tooltip-"+e.type),e.className&&ct(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},It.prototype._updateTooltip=function(e){var t,n,i,r=e.position,o=e.htmlContainer;t=o,n=r.x,i=r.y,z(t.style,{left:n+"px",top:i+"px"})},It.prototype._updateTooltipVisibilty=function(e){F(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoomid(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(id(i)<5)return!1;i<0&&(i*=-1),to(e)&&(i*=-1);var o=function(u,p){if(u==="x"){if(p>0)return"e";if(p<0)return"w"}if(u==="y"){if(p>0)return"s";if(p<0)return"n"}return null}(n,i),a=ss(this._canvas.getRootElement(),!0),c=this.calculateAdjustments(a,n,i,r),l=function(u,p,h,v,f){var y=u.movingShapes,g=u.resizingShapes;if(g.length){var x,E,_={};return F(g,function(w){var S,D,s,d=ce(w),m=Ee(w.children,function(I){return!(od(I)||Fg(I)||rd(y,I)||rd(g,I))}),C=Ee(w.children,function(I){return!od(I)&&!Fg(I)&&rd(y,I)});m.length&&(D=Lg(ce(gt(m))),S=v-d[Sc[h]]+D[Sc[h]],h==="n"?_.bottom=E=fe(E)?Math.min(E,S):S:h==="w"?_.right=E=fe(E)?Math.min(E,S):S:h==="s"?_.top=x=fe(x)?Math.max(x,S):S:h==="e"&&(_.left=x=fe(x)?Math.max(x,S):S)),C.length&&(s=Lg(ce(gt(C))),S=v-s[Sc[jg[h]]]+d[Sc[jg[h]]],h==="n"?_.bottom=E=fe(E)?Math.min(E,S):S:h==="w"?_.right=E=fe(E)?Math.min(E,S):S:h==="s"?_.top=x=fe(x)?Math.max(x,S):S:h==="e"&&(_.left=x=fe(x)?Math.max(x,S):S));var R=f&&f[w.id];R&&(h==="n"?(S=v+w[ii[p]]-R[ii[p]],_.bottom=E=fe(E)?Math.min(E,S):S):h==="w"?(S=v+w[ii[p]]-R[ii[p]],_.right=E=fe(E)?Math.min(E,S):S):h==="s"?(S=v-w[ii[p]]+R[ii[p]],_.top=x=fe(x)?Math.max(x,S):S):h==="e"&&(S=v-w[ii[p]]+R[ii[p]],_.left=x=fe(x)?Math.max(x,S):S))}),_}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(t,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),Bs("resize-"+(n==="x"?"ew":"ns")),!0},ri.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[];return F(e,function(c){if(c.parent&&!od(c)){var l=c[t],u=l+c[ii[t]];return n>0&&l>i||n<0&&ui&&r.allowed("shape.resize",{shape:c})?a.push(c):void 0}}),{movingShapes:o,resizingShapes:a}},ri.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},ri.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var ad="djs-dragging",$g="djs-resizing",Tc=Math.max;function zg(e,t,n,i,r){function o(a,c){F(a,function(l){r.addDragger(l,c),n.addMarker(l,ad)})}e.on("spaceTool.selection.start",function(a){var c=n.getLayer("space"),l=a.context,u="M 0,-10000 L 0,10000",p="M -10000,0 L 10000,0",h=se("g");W(h,i.cls("djs-crosshair-group",["no-events"])),pe(c,h);var v=se("path");W(v,"d",u),Ce(v).add("djs-crosshair"),pe(h,v);var f=se("path");W(f,"d",p),Ce(f).add("djs-crosshair"),pe(h,f),l.crosshairGroup=h}),e.on("spaceTool.selection.move",function(a){Lt(a.context.crosshairGroup,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var c=a.context.crosshairGroup;c&&it(c)}),e.on("spaceTool.move",250,function(a){var c=a.context,l=c.line,u=c.axis,p=c.movingShapes,h=c.resizingShapes;if(c.initialized){if(!c.dragGroup){var v=n.getLayer("space");W(l=se("path"),"d","M0,0 L0,0"),Ce(l).add("djs-crosshair"),pe(v,l),c.line=l;var f=se("g");W(f,i.cls("djs-drag-group",["no-events"])),pe(n.getActiveLayer(),f),o(p,f),o(c.movingConnections=t.filter(function(E){var _=!1;F(p,function(s){F(s.outgoing,function(d){E===d&&(_=!0)})});var w=!1;F(p,function(s){F(s.incoming,function(d){E===d&&(w=!0)})});var S=!1;F(h,function(s){F(s.outgoing,function(d){E===d&&(S=!0)})});var D=!1;return F(h,function(s){F(s.incoming,function(d){E===d&&(D=!0)})}),function(s){return s.waypoints}(E)&&(_||S)&&(w||D)}),f),c.dragGroup=f}if(!c.frameGroup){var y=se("g");W(y,i.cls("djs-frame-group",["no-events"])),pe(n.getActiveLayer(),y);var g=[];F(h,function(E){var _=r.addFrame(E,y),w=_.getBBox();g.push({element:_,initialBounds:w}),n.addMarker(E,$g)}),c.frameGroup=y,c.frames=g}W(l,{d:{x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y}[u]});var x={x:a.dx,y:a.dy};x[{x:"y",y:"x"}[c.axis]]=0,Lt(c.dragGroup,x.x,x.y),F(c.frames,function(E){var _,w,S=E.element,D=E.initialBounds;c.direction==="e"?W(S,{width:Tc(D.width+x.x,5)}):W(S,{width:_=Tc(D.width-x.x,5),x:D.x+D.width-_}),c.direction==="s"?W(S,{height:Tc(D.height+x.y,5)}):W(S,{height:w=Tc(D.height-x.y,5),y:D.y+D.height-w})})}}),e.on("spaceTool.cleanup",function(a){var c=a.context,l=c.movingShapes,u=c.movingConnections,p=c.resizingShapes,h=c.line,v=c.dragGroup,f=c.frameGroup;F(l,function(y){n.removeMarker(y,ad)}),F(u,function(y){n.removeMarker(y,ad)}),v&&(it(h),it(v)),F(p,function(y){n.removeMarker(y,$g)}),f&&it(f)})}zg.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const Gg={__init__:["spaceToolPreview"],__depends__:[ei,Vn,_c,na,oa],spaceTool:["type",ri],spaceToolPreview:["type",zg]};function on(e){this._model=e}function $t(e,t,n,i){ne.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(p){F(p.context.oldRoot.children,function(h){A(h,"bpmn:BaseElement")&&r.updateParent(h)})}function a(p){var h=p.context.shape;A(h,"bpmn:BaseElement")&&r.updateBounds(h)}function c(p){r.updateConnection(p.context)}function l(p){r.updateConnectionWaypoints(p.context.connection)}function u(p){r.updateAttachment(p.context)}this.executed(["connection.layout","connection.create"],function(p){var h,v=p.context,f=v.hints||{};v.cropped||f.createElementsBehavior===!1||((h=v.connection).waypoints=n.getCroppedWaypoints(h),v.cropped=!0)}),this.reverted(["connection.layout"],function(p){delete p.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],an(function(p){var h=p.context;r.updateParent(h.shape||h.connection,h.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],an(function(p){var h=p.context,v=h.shape||h.connection,f=h.parent||h.newParent;r.updateParent(v,f)})),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],an(function(p){p.context.shape.type!=="label"&&a(p)})),this.reverted(["shape.move","shape.create","shape.resize"],an(function(p){p.context.shape.type!=="label"&&a(p)})),e.on("shape.changed",function(p){p.element.type==="label"&&a({context:{shape:p.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],an(c)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],an(c)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],an(l)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],an(l)),this.executed("connection.reconnect",an(function(p){var h=p.context,v=h.connection,f=h.oldSource,y=h.newSource,g=re(v),x=re(f),E=re(y);g.conditionExpression&&!Pe(E,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(h.oldConditionExpression=g.conditionExpression,delete g.conditionExpression),f!==y&&x.default===g&&(h.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",an(function(p){var h=p.context,v=h.connection,f=h.oldSource,y=h.newSource,g=re(v),x=re(f),E=re(y);h.oldConditionExpression&&(g.conditionExpression=h.oldConditionExpression),h.oldDefault&&(x.default=h.oldDefault,delete E.default)})),this.executed(["element.updateAttachment"],an(u)),this.reverted(["element.updateAttachment"],an(u))}function an(e){return function(t){var n=t.context;A(n.shape||n.connection,"bpmn:BaseElement")&&e(t)}}function Ni(e,t,n){Xn.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Ug(e,t,n){e[n]=t[n],delete t[n]}function Ac(e,t){this._modeling=e,this._canvas=t}function kc(e){this._modeling=e}function Pc(e,t){this._canvas=e,this._layouter=t}on.$inject=["moddle"],on.prototype._needsId=function(e){return Pe(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},on.prototype._ensureId=function(e){var t;t=A(e,"bpmn:Activity")?"Activity":A(e,"bpmn:Event")?"Event":A(e,"bpmn:Gateway")?"Gateway":Pe(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},on.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},on.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},on.prototype.createDiShape=function(e,t,n){return this.create("bpmndi:BPMNShape",z({bpmnElement:e,bounds:this.createDiBounds(t)},n))},on.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},on.prototype.createDiWaypoints=function(e){var t=this;return ht(e,function(n){return t.createDiWaypoint(n)})},on.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Rn(e,["x","y"]))},on.prototype.createDiEdge=function(e,t,n){return this.create("bpmndi:BPMNEdge",z({bpmnElement:e,waypoint:this.createDiWaypoints(t)},n))},on.prototype.createDiPlane=function(e){return this.create("bpmndi:BPMNPlane",{bpmnElement:e})},ae($t,ne),$t.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],$t.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},$t.prototype.updateParent=function(e,t){if(!(e instanceof fs||A(e,"bpmn:DataStoreReference")&&e.parent&&A(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=n&&n.businessObject,o=r&&r.di;A(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,t&&t.businessObject),A(e,"bpmn:DataOutputAssociation")&&(r=e.source?e.source.businessObject:null),A(e,"bpmn:DataInputAssociation")&&(r=e.target?e.target.businessObject:null),this.updateSemanticParent(i,r),A(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},$t.prototype.updateBounds=function(e){var t=e.businessObject.di,n=e instanceof fs?this._getLabel(t):t,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),z(i,{x:e.x,y:e.y,width:e.width,height:e.height})},$t.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(A(n,"bpmn:Lane")&&Qe(n.get("flowNodeRef"),e),A(t,"bpmn:Lane")&&et(t.get("flowNodeRef"),e))},$t.prototype.updateDiConnection=function(e,t,n){e.sourceElement&&e.sourceElement.bpmnElement!==t&&(e.sourceElement=t&&t.di),e.targetElement&&e.targetElement.bpmnElement!==n&&(e.targetElement=n&&n.di)},$t.prototype.updateDiParent=function(e,t){if(t&&!A(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Qe(n,e),e.$parent=null)}},$t.prototype.getLaneSet=function(e){var t,n;return A(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(A(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},$t.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!A(e,"bpmn:DataInput")&&!A(e,"bpmn:DataOutput")||(A(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(A(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(A(e,"bpmn:FlowElement")){if(t){if(A(t,"bpmn:Participant"))t=t.processRef;else if(A(t,"bpmn:Lane"))do t=t.$parent.$parent;while(A(t,"bpmn:Lane"))}i="flowElements"}else if(A(e,"bpmn:Artifact")){for(;t&&!A(t,"bpmn:Process")&&!A(t,"bpmn:SubProcess")&&!A(t,"bpmn:Collaboration");){if(A(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(A(e,"bpmn:MessageFlow"))i="messageFlows";else if(A(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(u){for(;u&&!A(u,"bpmn:Definitions");)u=u.$parent;return u}(e.$parent||t),e.$parent&&(Qe(o.get("rootElements"),a),a.$parent=null),t&&(et(o.get("rootElements"),a),a.$parent=o))}else A(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":A(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var c;if(e.$parent&&Qe(c=e.$parent.get(i),e),t?((c=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var l=n.get(i);Qe(c,e),t&&(l||(l=[],t.set(i,l)),l.push(e))}}},$t.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},$t.prototype.updateConnection=function(e){var t,n=e.connection,i=re(n),r=re(n.source),o=re(n.target);if(A(i,"bpmn:DataAssociation"))A(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t)):A(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||r,this.updateSemanticParent(i,r,t),i.targetRef=o);else{var a=A(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Qe(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Qe(i.targetRef&&i.targetRef.get("incoming"),i),o&&o.get("incoming")&&o.get("incoming").push(i)),i.targetRef=o)}this.updateConnectionWaypoints(n),this.updateDiConnection(i.di,r,o)},$t.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},ae(Ni,Xn),Ni.$inject=["bpmnFactory","moddle","translate"],Ni.prototype.baseCreate=Xn.prototype.create,Ni.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,z({type:"label"},Wo,t)):this.createBpmnElement(e,t)},Ni.prototype.createBpmnElement=function(e,t){var n,i,r,o=this._translate,a=(t=t||{}).businessObject;if(!a){if(!t.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(t.type)}return a.di||(a.di=e==="root"?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):e==="connection"?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),A(a,"bpmn:Group")&&(t=z({isFrame:!0},t)),t.di&&(z(a.di,t.di),delete t.di),function(c,l,u){F(u,function(p){l[p]!==void 0&&Ug(c,l,p)})}(a,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&Ug(a.di,t,"isExpanded"),A(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),t.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete t.eventDefinitionType),n=this._getDefaultSize(a),t=z({businessObject:a,id:a.id},n,t),this.baseCreate(e,t)},Ni.prototype._getDefaultSize=function(e){return A(e,"bpmn:SubProcess")?Oe(e)?{width:350,height:200}:{width:100,height:80}:A(e,"bpmn:Task")?{width:100,height:80}:A(e,"bpmn:Gateway")?{width:50,height:50}:A(e,"bpmn:Event")?{width:36,height:36}:A(e,"bpmn:Participant")?Oe(e)?{width:600,height:250}:{width:400,height:60}:A(e,"bpmn:Lane")?{width:400,height:100}:A(e,"bpmn:DataObjectReference")?{width:36,height:50}:A(e,"bpmn:DataStoreReference")?{width:50,height:50}:A(e,"bpmn:TextAnnotation")?{width:100,height:30}:A(e,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Ni.prototype.createParticipantShape=function(e){return Tt(e)||(e={isExpanded:e}),(e=z({type:"bpmn:Participant"},e||{})).isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},Ac.$inject=["modeling","canvas"],Ac.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;F(n,function(r){var o={x:0,y:0};i.left?o.x=i.left-r.x:i.right?o.x=i.right-r.width-r.x:i.center?o.x=i.center-Math.round(r.width/2)-r.x:i.top?o.y=i.top-r.y:i.bottom?o.y=i.bottom-r.height-r.y:i.middle&&(o.y=i.middle-Math.round(r.height/2)-r.y),t.moveElements([r],o,r.parent)})},Ac.prototype.postExecute=function(e){},kc.$inject=["modeling"],kc.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},kc.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,Yi(t.outgoing,function(r){return r.target===n})||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},Pc.$inject=["canvas","layouter"],Pc.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},Pc.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Mc=Math.round;function sd(e){this._modeling=e}function Hg(e){return!!e.waypoints}sd.$inject=["modeling"],sd.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;F(t,function(p){fe(p.x)||(p.x=0),fe(p.y)||(p.y=0)});var c=gt(t);F(t,function(p){Hg(p)&&(p.waypoints=ht(p.waypoints,function(h){return{x:Mc(h.x-c.x-c.width/2+r.x),y:Mc(h.y-c.y-c.height/2+r.y)}})),z(p,{x:Mc(p.x-c.x-c.width/2+r.x),y:Mc(p.y-c.y-c.height/2+r.y)})});var l=fm(t),u={};F(t,function(p){if(Hg(p))u[p.id]=fe(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);else{var h=z({},o);l.indexOf(p)===-1&&(h.autoResize=!1),u[p.id]=fe(i)?a.createShape(p,Rn(p,["x","y","width","height"]),p.parent||n,i,h):a.createShape(p,Rn(p,["x","y","width","height"]),p.parent||n,h)}}),e.elements=Hl(u)};var qg=Math.round;function Ii(e){this._canvas=e}function ya(e){Ii.call(this,e)}Ii.$inject=["canvas"],Ii.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?z(t,n):z(t,{x:n.x-qg(t.width/2),y:n.y-qg(t.height/2)}),this._canvas.addShape(t,i,r),t},Ii.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},ae(ya,Ii),ya.$inject=["canvas"];var O1=Ii.prototype.execute;ya.prototype.execute=function(e){var t=e.shape;return function(n){["width","height"].forEach(function(i){n[i]===void 0&&(n[i]=0)})}(t),t.labelTarget=e.labelTarget,O1.call(this,e)};var j1=Ii.prototype.revert;function Rc(e,t){this._canvas=e,this._modeling=t}function cd(e,t){this._modeling=e,this._elementRegistry=t}function ga(e,t){this._canvas=e,this._modeling=t}function Nc(e){this._modeling=e}ya.prototype.revert=function(e){return e.shape.labelTarget=null,j1.call(this,e)},Rc.$inject=["canvas","modeling"],Rc.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=cu(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},Rc.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,et(n.children,t,i),this._canvas.addConnection(t,n),t},cd.$inject=["modeling","elementRegistry"],cd.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;F(e.elements,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})},ga.$inject=["canvas","modeling"],ga.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;ho(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ho(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),ho(n.children,function(i){i.waypoints?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},ga.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=cu(i.children,n),t.removeShape(n),n},ga.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return et(i.children,n,r),t.addShape(n,i),n},Nc.$inject=["modeling"];var Wg={x:"y",y:"x"};function Ic(e,t){this._layouter=e,this._canvas=t}function ld(){}function ud(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function ba(e){this._modeling=e}function Dc(e){this._helper=new ba(e)}function dr(e){this._modeling=e,this._helper=new ba(e)}function xa(e){this._modeling=e}function Kg(e){return e.original||e}function oi(e,t){this._modeling=e,this._rules=t}function Ea(e){this._modeling=e}function Di(e){this._modeling=e}function Xg(e){return z({},e)}function Yg(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Jg(e,t,n){var i=Yg(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i] required");var r=e.changed||this.getVisualReferences(n).concat(t),o=e.oldProperties||function(a,c){return Gt(c,function(l,u){return l[u]=a.get(u),l},{})}(n,is(i));return ib(n,i),e.oldProperties=o,e.changed=r,r},wa.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return ib(n,t),i},wa.prototype.getVisualReferences=function(e){var t=this._elementRegistry;return A(e,"bpmn:DataObject")?function(n,i){return i.filter(function(r){return A(r,"bpmn:DataObjectReference")&&re(r).dataObjectRef===n})}(e,t):[]};var _a="default",ai="id",rb="di",L1={width:0,height:0};function Sa(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function ob(e,t){return ai in e&&e[ai]!==t[ai]}function ab(e,t){F(t,function(n,i){i!==rb?e.set(i,n):e.di&&function(r,o){F(o,function(a,c){r.set(c,a)})}(e.di,n)})}Sa.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],Sa.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,c=function(u){var p=z({},u);return V1.forEach(function(h){h in u&&(p[h]=re(p[h]))}),p}(e.properties),l=e.oldProperties||function(u,p){var h=is(p);return Gt(h,function(v,f){return v[f]=f!==rb?u.get(f):function(y,g){return Gt(g,function(x,E){return x[E]=y.get(E),x},{})}(u.di,is(p.di)),v},{})}(a,c);return ob(c,a)&&(o.unclaim(a[ai]),r.updateId(t,c[ai]),o.claim(c[ai],a)),_a in c&&(c[_a]&&n.push(r.get(c[_a].id)),a[_a]&&n.push(r.get(a[_a].id))),ab(a,c),e.oldProperties=l,e.changed=n,n},Sa.prototype.postExecute=function(e){var t=e.element.label,n=t&&re(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,L1)}},Sa.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 ab(r,i),ob(n,r)&&(a.unclaim(n[ai]),o.updateId(t,i[ai]),a.claim(i[ai],r)),e.changed};var V1=["default"];function jc(e,t){this._canvas=e,this._modeling=t}function dd(e,t){this._modeling=e,this._spaceTool=t}function hd(e,t){this._modeling=e,this._translate=t}function Ca(e,t){this._modeling=e,this._spaceTool=t}jc.$inject=["canvas","modeling"],jc.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,c=o.di;t.setRootElement(n,!0),et(a.rootElements,i),i.$parent=a,Qe(a.rootElements,o),o.$parent=null,o.di=null,c.bpmnElement=i,i.di=c,e.oldRoot=r},jc.prototype.revert=function(e){var t=this._canvas,n=e.newRoot.businessObject,i=e.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;t.setRootElement(i,!0),Qe(o.rootElements,n),n.$parent=null,et(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},dd.$inject=["modeling","spaceTool"],dd.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=wn(i),a=o===i,c=a?i:i.parent;Pi(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+co,y:i.y,width:i.width-co,height:i.height},c);var l=[];Zi(o,function(y){return l.push(y),y.label&&l.push(y.label),y===i?[]:Ee(y.children,function(g){return g!==i})});var u=r==="top"?-120:120,p=r==="top"?i.y:i.y+i.height,h=p+(r==="top"?10:-10),v=r==="top"?"n":"s",f=t.calculateAdjustments(l,"y",u,h);t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:u},v,h),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?co:0),y:p-(r==="top"?120:0),width:i.width-(a?co:0),height:120},c)},hd.$inject=["modeling","translate"],hd.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=Pi(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var c,l,u,p,h,v=Math.round(i.height/r);for(h=0;h0||u.bottom<0?-n:n,a=c.calculateAdjustments(h,"y",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(u.left||u.right)&&(n=u.right||u.left,i=e.x+(u.right?e.width:0)+(u.right?-10:100),r=u.right?"e":"w",o=u.left>0||u.right<0?-n:n,a=c.calculateAdjustments(v,"x",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var Ta="flowNodeRef",md="lanes";function Aa(e){this._elementRegistry=e}function Lc(e){this._moddle=e}Aa.$inject=["elementRegistry"],Aa.prototype.computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(l){n.indexOf(l)===-1&&(o.push(l),n.push(l))}function c(l){if(!l.parent)return[];var u=function(p){var h=wn(p);return r[h.id]||(r[h.id]=Zs(h)),r[h.id]}(l);return u.filter(function(p){return h=l,v=ce(p),f=h.x+h.width/2,y=h.y+h.height/2,f>v.left&&fv.top&&y: must be specified as : with start/end in { h,v,t,r,b,l }");if(mb(n)){var i=function(a,c,l){return pb(a,c,l)}(e,t,n),r=function(a,c,l){var u=pb(c,a,db(l));return{waypoints:u.waypoints.slice().reverse(),directions:db(u.directions),turnNextDirections:u.turnNextDirections}}(e,t,n),o=function(a,c){var l=a.directions.split(":")[1],u=c.directions.split(":")[0];a.turnNextDirections&&(l=l=="h"?"v":"h"),c.turnNextDirections&&(u=u=="h"?"v":"h");var p=l+":"+u;return{waypoints:vd(a.waypoints[a.waypoints.length-1],c.waypoints[0],p),directions:p}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(a,c,l){var u=Fc((c.x-a.x)/2+a.x),p=Fc((c.y-a.y)/2+a.y);if(l==="h:v")return[{x:c.x,y:a.y}];if(l==="v:h")return[{x:a.x,y:c.y}];if(l==="h:h")return[{x:u,y:a.y},{x:u,y:c.y}];if(l==="v:v")return[{x:a.x,y:p},{x:c.x,y:p}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function U1(e,t,n,i,r){var o=lE(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=bt(e,t,G1[o]||0),c=function(p,h){if(mb(h))return h;switch(p){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return h}}(a,o);n=n||ge(e),i=i||ge(t);var l=c.split(":"),u=fb(n,e,l[0],function(p){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"}[p]}(a));return function(p,h,v){var f=vd(p,h,v);return f.unshift(p),f.push(h),vb(f)}(u,fb(i,t,l[1],a),c)}function H1(e,t,n,i,r,o){var a;return Se(n)&&(r=n,o=i,n=ge(e),i=ge(t)),r=r||[],a=(o=z({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")!==-1&&function(c,l,u,p,h){var v,f,y={};return f=bt(c,l),/^(top|bottom|left|right)$/.test(f)?(/top|bottom/.test(f)&&(v="x"),/left|right/.test(f)&&(v="y"),h.preserveDocking==="target"?hb(v,p,c)?(y[v]=p[v],[{x:y.x!==void 0?y.x:u.x,y:y.y!==void 0?y.y:u.y,original:{x:y.x!==void 0?y.x:u.x,y:y.y!==void 0?y.y:u.y}},{x:p.x,y:p.y}]):null:hb(v,u,l)?(y[v]=u[v],[{x:u.x,y:u.y},{x:y.x!==void 0?y.x:p.x,y:y.y!==void 0?y.y:p.y,original:{x:y.x!==void 0?y.x:p.x,y:y.y!==void 0?y.y:p.y}}]):null):null}(e,t,n,i,o),a||(a=o.connectionEnd&&function(c,l,u,p){var h=p.slice().reverse();return h=yd(c,l,u,h),h?h.reverse():null}(t,e,i,r),a||(a=o.connectionStart&&yd(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:U1(e,t,n,i,o)))}function hb(e,t,n){return function(i,r,o){return i>=r&&i<=o}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function yd(e,t,n,i){if(function(c){return c.length<3||!(c.length>4)&&!!je(c,function(l,u){var p=c[u-1];return p&&jo(l,p)<3})}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(c,l,u){switch(Kn(l,c)){case"v":return{x:u.x,y:c.y};case"h":return{x:c.x,y:u.y}}return{x:c.x,y:c.y}}(a[1],o,n),r=function(c,l,u){var p;for(p=c.length-2;p!==0;p--)if(Em(c[p],l,ub)||Em(c[p],u,ub))return c.slice(p);return c}(a,e,t),r!==a&&(a=yd(e,t,n,r)),a&&Kn(a)?null:a}function mb(e){return e&&/t|r|b|l/.test(e)}function fb(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 vb(e){return e.reduce(function(t,n,i){return lu(t[t.length-1],e[i+1],n,0)||t.push(n),t},[])}var q1=-10,W1=40,gd={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},$c={top:"t",right:"r",bottom:"b",left:"l"};function bd(){}function K1(e,t){return A(t,"bpmn:Participant")?"source":A(e,"bpmn:Participant")?"target":ka(t)?"source":ka(e)||A(t,"bpmn:Event")?"target":A(e,"bpmn:Event")?"source":null}function X1(e){return ka(e)?"target":"source"}function yb(e,t){return e?e.original||e:ge(t)}function gb(e,t){return A(t,"bpmn:Activity")&&A(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function ka(e){return A(e,"bpmn:SubProcess")&&Oe(e)}function Pa(e,t){return e===t}function Ma(e){var t=/right|left/.exec(e);return t&&t[0]}function hr(e){var t=/top|bottom/.exec(e);return t&&t[0]}function xd(e){return e==="right"||e==="left"}function Y1(e,t){var n=t.waypoints,i=n&&n.length&&bt(n[0],e);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function J1(e,t,n){var i,r,o,a,c=ge(e),l=ge(t),u=(a=(o=e).host,bt(ge(o),a,q1)),p=Pa(e.host,t),h=["top","right","bottom","left"].indexOf(u)!==-1,v=bt(l,c,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return p?function(f,y,g,x,E){var _,w=y?f:hr(f),S=$c[w];return _=y?xd(f)?bb("y",g,x,E)?"h":"b":bb("x",g,x,E)?"v":"l":"v",[S+":"+_]}(u,h,e,t,n):(i=function(f,y,g){if(g)return $c[f];if(Pa(hr(f),hr(y))||(x=Ma(f),E=Ma(y),gd[x]===E))return $c[hr(f)];var x,E;return $c[Ma(f)]}(u,v,h),r=function(f,y,g){if(g)return xd(f)?(x=y,E=Ma(f),_=gd[E],x.indexOf(_)!==-1||Pa(f,y)?"h":"v"):function(w,S){var D=hr(w),s=gd[D];return S.indexOf(s)!==-1}(f,y)||Pa(f,y)?"v":"h";var x,E,_;return xd(y)||Pa(hr(f),hr(y))&&Ma(y)?"h":"v"}(u,v,h),[i+":"+r])}function bb(e,t,n,i){var r=W1;return!(Ed(e,i,n,r)||Ed(e,i,{x:n.x+n.width,y:n.y+n.height},r)||Ed(e,i,ge(t),r))}function Ed(e,t,n,i){return Math.abs(t[e]-n[e])
'),e.appendChild(o));var a=n.html||(n.separator?'
':'
'),c=ze(a);o.appendChild(c),n.separator||(Ut(c,"data-action",i),n.title&&Ut(c,"title",n.title),n.className&&function(l,u){var p=ct(l);(Se(u)?u:u.split(/\s+/g)).forEach(function(h){p.add(h)})}(c,n.className),n.imageUrl&&c.appendChild(ze('')))}),this.open()},ot.prototype.trigger=function(e,t,n){var i,r,o,a=this._entries,c=t.delegateTarget||t.target;if(!c)return t.preventDefault();(i=a[Ut(c,"data-action")])&&(r=i.action,o=t.originalEvent||t,At(r)?e==="click"&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},ot.prototype._layoutChanged=function(){this._toggleState({})},ot.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},ot.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},ot.prototype.open=function(){this._toggleState({open:!0})},ot.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},ot.prototype.isActiveTool=function(e){return e&&this._activeTool===e},ot.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=Ye(".djs-palette-entries",this._container),this._toolsContainer=Ye("[data-group=tools]",t)),F(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=ct(n);i=i.replace("-tool",""),r.contains("entry")&&i===e?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},ot.prototype.isOpen=function(){return ct(this._container).has(Sd)},ot.prototype._getParentContainer=function(){return this._canvas.getContainer()},ot.HTML_MARKUP='
';const nS={__init__:["palette"],palette:["type",ot]};var Mb="crosshair";function mr(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var c=this,l=function(h){var v,f=t.getActiveLayer();W(v=h.frame=se("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),pe(f,v)},u=function(h){var v=h.frame,f=h.bbox;W(v,{x:f.x,y:f.y,width:f.width,height:f.height})},p=function(h){h.frame&&it(h.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(h){var v=h.originalEvent.target;(h.hover||v instanceof SVGElement)&&e.once("lasso.selection.ended",function(){c.activateLasso(h.originalEvent,!0)})}),e.on("lasso.end",function(h){var v=Cd(h),f=i.filter(function(y){return y});c.select(f,v)}),e.on("lasso.start",function(h){var v=h.context;v.bbox=Cd(h),l(v)}),e.on("lasso.move",function(h){var v=h.context;v.bbox=Cd(h),u(v)}),e.on("lasso.cleanup",function(h){var v=h.context;p(v)}),e.on("element.mousedown",1500,function(h){if(Mf(h))return c.activateLasso(h.originalEvent),!0})}function Cd(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y=n.x&&t.yn.x&&t.y<=n.y?{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?{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?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}mr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],mr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Mb,data:{context:{}}})},mr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:Mb,data:{context:{}}})},mr.prototype.select=function(e,t){var n=function(i,r){var o={};return F(i,function(a){var c=a;c.waypoints&&(c=gt(c)),!fe(r.y)&&c.x>r.x&&(o[a.id]=a),!fe(r.x)&&c.y>r.y&&(o[a.id]=a),c.x>r.x&&c.y>r.y&&(fe(r.width)&&fe(r.height)&&c.width+c.xu[h]+v-p&&ut(l,h,u[h]+v-p)})}(t,o,function(l){return A(l,"bpmn:Task")?lS:cS}(o)),o&&function(l,u){return Yi(u,function(p){return Vb(l,p)})}(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Qt(r),Pe(o,["bpmn:Event","bpmn:Gateway"])&&Lb(t,Qt(o)),Pe(o,["bpmn:Task","bpmn:SubProcess"])&&function(l,u){var p=Qt(u);Ob.forEach(function(h){(function(v,f,y){return v[y]>f[y]+Bb&&v[y]v[g]?v[g]+kd:v[g]-kd,ut(l,g,x))})}}(t)):Vb(i,"bpmn:MessageFlow")?(A(r,"bpmn:Event")&&(n.connectionStart=Qt(r)),A(o,"bpmn:Event")&&Lb(t,Qt(o))):n.connectionStart=n.initialConnectionStart)})}function Lb(e,t){ut(e,"x",t.x),ut(e,"y",t.y)}function Vb(e,t){return e&&e.type===t}function Fb(e,t){return e==="x"?t.width:t.height}function ji(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Uc(e){this._snapValues={}}jb.$inject=["eventBus"],ji.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},ji.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},ji.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},ji.prototype.getSnapLocations=function(){return this._snapLocations},ji.prototype.setSnapLocations=function(e){this._snapLocations=e},ji.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Uc).initDefaults(this._defaultSnaps),n},Uc.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},Uc.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(o,a,c){var l,u;for(c=c===void 0?10:c,l=0;l=e.x||i&&i<=e.x)&&ut(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&ut(e,"y",e.y)}}function $b(e,t){return e.indexOf(t)!==-1}function zb(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}ae(vo,$n),vo.$inject=["eventBus","injector"],vo.prototype.initSnap=function(e){var t=$n.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return F(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",zb(o,i,e))}),F(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",zb(o,i,e))}),A(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},vo.prototype.addSnapTargetPoints=function(e,t,n){$n.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);F(i,function(o){var a;(function(c){return A(c,"bpmn:SubProcess")&&Oe(c)?!0:A(c,"bpmn:Participant")}(o)||(a="bpmn:TextAnnotation",[t,o].every(function(c){return A(c,a)})))&&(e.add("top-left",Pv(o)),e.add("bottom-right",Mv(o)))});var r=this._elementRegistry;return F(t.incoming,function(o){if(r.get(t.id)){$b(i,o.source)||e.add("mid",ge(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),F(t.outgoing,function(o){if(r.get(t.id)){$b(i,o.target)||e.add("mid",ge(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),A(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},vo.prototype.getSnapTargets=function(e,t){return $n.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!A(n,"bpmn:Lane")})};function Ra(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.on(["resize.move","resize.end"],1250,function(i){var r=i.context,o=r.shape,a=o.parent,c=r.direction,l=r.snapContext;if(!(i.originalEvent&&Kt(i.originalEvent)||so(i))){var u=l.pointsForTarget(a);u.initialized||((u=n.addSnapTargetPoints(u,o,a,c)).initialized=!0),function(p){return p==="n"||p==="s"}(c)&&ut(i,"x",i.x),function(p){return p==="e"||p==="w"}(c)&&ut(i,"y",i.y),t.snap(i,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}function Gb(e,t){var n=ge(e),i=ce(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}Ra.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new ji);var o=Gb(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Ra.prototype.addSnapTargetPoints=function(e,t,n,i){return F(this.getSnapTargets(t,n),function(r){e.add("corner",Mv(r)),e.add("corner",Pv(r))}),e.add("corner",Gb(t,i)),e},Ra.$inject=["eventBus","snapping"],Ra.prototype.getSnapTargets=function(e,t){return Rv(t).filter(function(n){return i=n,r=e,!(i.host===r||function(o){return!!o.waypoints}(n)||function(o){return!!o.hidden}(n)||function(o){return!!o.labelTarget}(n));var i,r})};function Li(e){this._canvas=e,this._asyncHide=Zh(qn(this.hide,this),1e3)}Li.$inject=["canvas"],Li.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:so(e,"x"),y:so(e,"y")};F(i,function(o){var a=n.getSnapOrigin(o),c={x:e.x+a.x,y:e.y+a.y};if(F(["x","y"],function(l){var u;r[l]||(u=t.snap(c,o,l,7))!==void 0&&(r[l]={value:u,originValue:u-a[l]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),F(["x","y"],function(o){var a=r[o];Tt(a)&&ut(e,o,a.originValue)})},Li.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=se("path");return W(n,{d:"M0,0 L0,0"}),Ce(n).add("djs-snap-line"),pe(t,n),{update:function(i){fe(i)?W(n,e==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):W(n,{display:"none"})}}},Li.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Li.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Li.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Li.prototype.hide=function(){F(this._snapLines,function(e){e.update()})};const hS={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",$n],resizeSnapping:["type",Ra],snapping:["type",Li]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",jb],createMoveSnapping:["type",vo]};function de(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=ze(de.BOX_HTML),this._searchInput=Ye(de.INPUT_SELECTOR,this._container),this._resultsContainer=Ye(de.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Ub(e,t,n){var i=function(o){var a="";return o.forEach(function(c){c.matched?a+=''+mv(c.matched)+"":a+=mv(c.normal)}),a!==""?a:null}(t),r=ze(n);r.innerHTML=i,e.appendChild(r)}de.$inject=["canvas","eventBus","overlays","selection"],de.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Ht.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close()}),t(this._container,de.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,de.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,de.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,de.INPUT_SELECTOR,"keydown",function(n){n.keyCode===38&&n.preventDefault(),n.keyCode===40&&n.preventDefault()}),t(this._container,de.INPUT_SELECTOR,"keyup",function(n){if(n.keyCode===27)return e.close();if(n.keyCode===13){var i=e._getCurrentResult();return i?e._select(i):e.close()}return n.keyCode===38?e._scrollToDirection(!0):n.keyCode===40?e._scrollToDirection():void(n.keyCode!==37&&n.keyCode!==39&&e._search(n.delegateTarget.value))})},de.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Ht.unbind(e.el,e.type,e.listener)})},de.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=Ye(de.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},de.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},de.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&&Ub(n,e.primaryTokens,de.RESULT_PRIMARY_HTML),Ub(n,e.secondaryTokens,de.RESULT_SECONDARY_HTML),Ut(n,de.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},de.prototype.registerProvider=function(e){this._searchProvider=e},de.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,ct(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},de.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,ct(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},de.prototype.toggle=function(){this.isOpen()?this.close():this.open()},de.prototype.isOpen=function(){return this._open},de.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&ct(t).remove(de.RESULT_SELECTED_CLASS);var n=Ut(e,de.RESULT_ID_ATTRIBUTE),i=this._results[n].element;ct(e).add(de.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},de.prototype._select=function(e){var t=Ut(e,de.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)},de.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=function(n){var i=6,r=n.width+2*i,o=n.height+2*i,a=["width: "+r+"px","height: "+o+"px"].join("; ");return{position:{bottom:o-i,right:r-i},show:!0,html:'
'}}(gt(e));this._overlayId=this._overlays.add(e,t)}},de.CONTAINER_SELECTOR=".djs-search-container",de.INPUT_SELECTOR=".djs-search-input input",de.RESULTS_CONTAINER_SELECTOR=".djs-search-results",de.RESULT_SELECTOR=".djs-search-result",de.RESULT_SELECTED_CLASS="djs-search-result-selected",de.RESULT_SELECTED_SELECTOR="."+de.RESULT_SELECTED_CLASS,de.RESULT_ID_ATTRIBUTE="data-result-id",de.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",de.OVERLAY_CLASS="djs-search-overlay",de.BOX_HTML='
',de.RESULT_HTML='
',de.RESULT_PRIMARY_HTML='
',de.RESULT_SECONDARY_HTML='

';const mS={__depends__:[Ou,On],searchPad:["type",de]};function Md(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function Hb(e){return Ee(e,function(t){return!!t.matched}).length>0}function qb(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+r')}),zn.prototype._interactionModules=[zf,qf,qw,Kf],zn.prototype._modelingModules=[Kw,t_,o_,n_,p_,np,d_,z_,ny,Gs,H_,W_,Y_,J_,Z_,n1,a1,Z1,Q1,aS,sS,Ry,hS,fS],zn.prototype._modules=[].concat(Zn.prototype._modules,zn.prototype._interactionModules,zn.prototype._modelingModules);const Wb=(e,t,n)=>(n||(n="camunda"),` `),vS={"Append EndEvent":"\u8FFD\u52A0\u7ED3\u675F\u4E8B\u4EF6","Append Gateway":"\u8FFD\u52A0\u7F51\u5173","Append Task":"\u8FFD\u52A0\u4EFB\u52A1","Append Intermediate/Boundary Event":"\u8FFD\u52A0\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Activate the global connect tool":"\u6FC0\u6D3B\u5168\u5C40\u8FDE\u63A5\u5DE5\u5177","Append {type}":"\u6DFB\u52A0 {type}","Add Lane above":"\u5728\u4E0A\u9762\u6DFB\u52A0\u9053","Divide into two Lanes":"\u5206\u5272\u6210\u4E24\u4E2A\u9053","Divide into three Lanes":"\u5206\u5272\u6210\u4E09\u4E2A\u9053","Add Lane below":"\u5728\u4E0B\u9762\u6DFB\u52A0\u9053","Append compensation activity":"\u8FFD\u52A0\u8865\u507F\u6D3B\u52A8","Change type":"\u4FEE\u6539\u7C7B\u578B","Connect using Association":"\u4F7F\u7528\u5173\u8054\u8FDE\u63A5","Connect using Sequence/MessageFlow or Association":"\u4F7F\u7528\u987A\u5E8F/\u6D88\u606F\u6D41\u6216\u8005\u5173\u8054\u8FDE\u63A5","Connect using DataInputAssociation":"\u4F7F\u7528\u6570\u636E\u8F93\u5165\u5173\u8054\u8FDE\u63A5",Remove:"\u79FB\u9664","Activate the hand tool":"\u6FC0\u6D3B\u6293\u624B\u5DE5\u5177","Activate the lasso tool":"\u6FC0\u6D3B\u5957\u7D22\u5DE5\u5177","Activate the create/remove space tool":"\u6FC0\u6D3B\u521B\u5EFA/\u5220\u9664\u7A7A\u95F4\u5DE5\u5177","Create expanded SubProcess":"\u521B\u5EFA\u6269\u5C55\u5B50\u8FC7\u7A0B","Create IntermediateThrowEvent/BoundaryEvent":"\u521B\u5EFA\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Create Pool/Participant":"\u521B\u5EFA\u6C60/\u53C2\u4E0E\u8005","Parallel Multi Instance":"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6","Sequential Multi Instance":"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",DataObjectReference:"\u6570\u636E\u5BF9\u8C61\u53C2\u8003",DataStoreReference:"\u6570\u636E\u5B58\u50A8\u53C2\u8003",Loop:"\u5FAA\u73AF","Ad-hoc":"\u5373\u5E2D","Create {type}":"\u521B\u5EFA {type}",Task:"\u4EFB\u52A1","Send Task":"\u53D1\u9001\u4EFB\u52A1","Receive Task":"\u63A5\u6536\u4EFB\u52A1","User Task":"\u7528\u6237\u4EFB\u52A1","Manual Task":"\u624B\u5DE5\u4EFB\u52A1","Business Rule Task":"\u4E1A\u52A1\u89C4\u5219\u4EFB\u52A1","Service Task":"\u670D\u52A1\u4EFB\u52A1","Script Task":"\u811A\u672C\u4EFB\u52A1","Call Activity":"\u8C03\u7528\u6D3B\u52A8","Sub Process (collapsed)":"\u5B50\u6D41\u7A0B\uFF08\u6298\u53E0\u7684\uFF09","Sub Process (expanded)":"\u5B50\u6D41\u7A0B\uFF08\u5C55\u5F00\u7684\uFF09","Start Event":"\u5F00\u59CB\u4E8B\u4EF6",StartEvent:"\u5F00\u59CB\u4E8B\u4EF6","Intermediate Throw Event":"\u4E2D\u95F4\u4E8B\u4EF6","End Event":"\u7ED3\u675F\u4E8B\u4EF6",EndEvent:"\u7ED3\u675F\u4E8B\u4EF6","Create StartEvent":"\u521B\u5EFA\u5F00\u59CB\u4E8B\u4EF6","Create EndEvent":"\u521B\u5EFA\u7ED3\u675F\u4E8B\u4EF6","Create Task":"\u521B\u5EFA\u4EFB\u52A1","Create User Task":"\u521B\u5EFA\u7528\u6237\u4EFB\u52A1","Create Gateway":"\u521B\u5EFA\u7F51\u5173","Create DataObjectReference":"\u521B\u5EFA\u6570\u636E\u5BF9\u8C61","Create DataStoreReference":"\u521B\u5EFA\u6570\u636E\u5B58\u50A8","Create Group":"\u521B\u5EFA\u5206\u7EC4","Create Intermediate/Boundary Event":"\u521B\u5EFA\u4E2D\u95F4/\u8FB9\u754C\u4E8B\u4EF6","Message Start Event":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6","Timer Start Event":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6","Conditional Start Event":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6","Signal Start Event":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6","Error Start Event":"\u9519\u8BEF\u5F00\u59CB\u4E8B\u4EF6","Escalation Start Event":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6","Compensation Start Event":"\u8865\u507F\u5F00\u59CB\u4E8B\u4EF6","Message Start Event (non-interrupting)":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Start Event (non-interrupting)":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Start Event (non-interrupting)":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Signal Start Event (non-interrupting)":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Start Event (non-interrupting)":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Message Intermediate Catch Event":"\u6D88\u606F\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Message Intermediate Throw Event":"\u6D88\u606F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Timer Intermediate Catch Event":"\u5B9A\u65F6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Escalation Intermediate Throw Event":"\u5347\u7EA7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Conditional Intermediate Catch Event":"\u6761\u4EF6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Catch Event":"\u94FE\u63A5\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Throw Event":"\u94FE\u63A5\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Compensation Intermediate Throw Event":"\u8865\u507F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Signal Intermediate Catch Event":"\u4FE1\u53F7\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Signal Intermediate Throw Event":"\u4FE1\u53F7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Message End Event":"\u6D88\u606F\u7ED3\u675F\u4E8B\u4EF6","Escalation End Event":"\u5B9A\u65F6\u7ED3\u675F\u4E8B\u4EF6","Error End Event":"\u9519\u8BEF\u7ED3\u675F\u4E8B\u4EF6","Cancel End Event":"\u53D6\u6D88\u7ED3\u675F\u4E8B\u4EF6","Compensation End Event":"\u8865\u507F\u7ED3\u675F\u4E8B\u4EF6","Signal End Event":"\u4FE1\u53F7\u7ED3\u675F\u4E8B\u4EF6","Terminate End Event":"\u7EC8\u6B62\u7ED3\u675F\u4E8B\u4EF6","Message Boundary Event":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6","Message Boundary Event (non-interrupting)":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Boundary Event":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6","Timer Boundary Event (non-interrupting)":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Boundary Event":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6","Escalation Boundary Event (non-interrupting)":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Boundary Event":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6","Conditional Boundary Event (non-interrupting)":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Error Boundary Event":"\u9519\u8BEF\u8FB9\u754C\u4E8B\u4EF6","Cancel Boundary Event":"\u53D6\u6D88\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event (non-interrupting)":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Compensation Boundary Event":"\u8865\u507F\u8FB9\u754C\u4E8B\u4EF6","Exclusive Gateway":"\u4E92\u65A5\u7F51\u5173","Parallel Gateway":"\u5E76\u884C\u7F51\u5173","Inclusive Gateway":"\u76F8\u5BB9\u7F51\u5173","Complex Gateway":"\u590D\u6742\u7F51\u5173","Event based Gateway":"\u4E8B\u4EF6\u7F51\u5173",Transaction:"\u8F6C\u8FD0","Sub Process":"\u5B50\u6D41\u7A0B","Event Sub Process":"\u4E8B\u4EF6\u5B50\u6D41\u7A0B","Collapsed Pool":"\u6298\u53E0\u6C60","Expanded Pool":"\u5C55\u5F00\u6C60","no parent for {element} in {parent}":"\u5728{parent}\u91CC\uFF0C{element}\u6CA1\u6709\u7236\u7C7B","no shape type specified":"\u6CA1\u6709\u6307\u5B9A\u7684\u5F62\u72B6\u7C7B\u578B","flow elements must be children of pools/participants":"\u6D41\u5143\u7D20\u5FC5\u987B\u662F\u6C60/\u53C2\u4E0E\u8005\u7684\u5B50\u7C7B","out of bounds release":"out of bounds release","more than {count} child lanes":"\u5B50\u9053\u5927\u4E8E{count} ","element required":"\u5143\u7D20\u4E0D\u80FD\u4E3A\u7A7A","diagram not part of bpmn:Definitions":"\u6D41\u7A0B\u56FE\u4E0D\u7B26\u5408bpmn\u89C4\u8303","no diagram to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B\u56FE","no process or collaboration to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B/\u534F\u4F5C","element {element} referenced by {referenced}#{property} not yet drawn":"\u7531{referenced}#{property}\u5F15\u7528\u7684{element}\u5143\u7D20\u4ECD\u672A\u7ED8\u5236","already rendered {element}":"{element} \u5DF2\u88AB\u6E32\u67D3","failed to import {element}":"\u5BFC\u5165{element}\u5931\u8D25",Id:"\u7F16\u53F7",Name:"\u540D\u79F0",General:"\u5E38\u89C4",Details:"\u8BE6\u60C5","Message Name":"\u6D88\u606F\u540D\u79F0",Message:"\u6D88\u606F",Initiator:"\u521B\u5EFA\u8005","Asynchronous Continuations":"\u6301\u7EED\u5F02\u6B65","Asynchronous Before":"\u5F02\u6B65\u524D","Asynchronous After":"\u5F02\u6B65\u540E","Job Configuration":"\u5DE5\u4F5C\u914D\u7F6E",Exclusive:"\u6392\u9664","Job Priority":"\u5DE5\u4F5C\u4F18\u5148\u7EA7","Retry Time Cycle":"\u91CD\u8BD5\u65F6\u95F4\u5468\u671F",Documentation:"\u6587\u6863","Element Documentation":"\u5143\u7D20\u6587\u6863","History Configuration":"\u5386\u53F2\u914D\u7F6E","History Time To Live":"\u5386\u53F2\u7684\u751F\u5B58\u65F6\u95F4",Forms:"\u8868\u5355","Form Key":"\u8868\u5355key","Form Fields":"\u8868\u5355\u5B57\u6BB5","Business Key":"\u4E1A\u52A1key","Form Field":"\u8868\u5355\u5B57\u6BB5",ID:"\u7F16\u53F7",Type:"\u7C7B\u578B",Label:"\u540D\u79F0","Default Value":"\u9ED8\u8BA4\u503C","Default Flow":"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84","Conditional Flow":"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84","Sequence Flow":"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",Validation:"\u6821\u9A8C","Add Constraint":"\u6DFB\u52A0\u7EA6\u675F",Config:"\u914D\u7F6E",Properties:"\u5C5E\u6027","Add Property":"\u6DFB\u52A0\u5C5E\u6027",Value:"\u503C",Listeners:"\u76D1\u542C\u5668","Execution Listener":"\u6267\u884C\u76D1\u542C","Event Type":"\u4E8B\u4EF6\u7C7B\u578B","Listener Type":"\u76D1\u542C\u5668\u7C7B\u578B","Java Class":"Java\u7C7B",Expression:"\u8868\u8FBE\u5F0F","Must provide a value":"\u5FC5\u987B\u63D0\u4F9B\u4E00\u4E2A\u503C","Delegate Expression":"\u4EE3\u7406\u8868\u8FBE\u5F0F",Script:"\u811A\u672C","Script Format":"\u811A\u672C\u683C\u5F0F","Script Type":"\u811A\u672C\u7C7B\u578B","Inline Script":"\u5185\u8054\u811A\u672C","External Script":"\u5916\u90E8\u811A\u672C",Resource:"\u8D44\u6E90","Field Injection":"\u5B57\u6BB5\u6CE8\u5165",Extensions:"\u6269\u5C55","Input/Output":"\u8F93\u5165/\u8F93\u51FA","Input Parameters":"\u8F93\u5165\u53C2\u6570","Output Parameters":"\u8F93\u51FA\u53C2\u6570",Parameters:"\u53C2\u6570","Output Parameter":"\u8F93\u51FA\u53C2\u6570","Timer Definition Type":"\u5B9A\u65F6\u5668\u5B9A\u4E49\u7C7B\u578B","Timer Definition":"\u5B9A\u65F6\u5668\u5B9A\u4E49",Date:"\u65E5\u671F",Duration:"\u6301\u7EED",Cycle:"\u5FAA\u73AF",Signal:"\u4FE1\u53F7","Signal Name":"\u4FE1\u53F7\u540D\u79F0",Escalation:"\u5347\u7EA7",Error:"\u9519\u8BEF","Link Name":"\u94FE\u63A5\u540D\u79F0",Condition:"\u6761\u4EF6\u540D\u79F0","Variable Name":"\u53D8\u91CF\u540D\u79F0","Variable Event":"\u53D8\u91CF\u4E8B\u4EF6","Specify more than one variable change event as a comma separated list.":"\u591A\u4E2A\u53D8\u91CF\u4E8B\u4EF6\u4EE5\u9017\u53F7\u9694\u5F00","Wait for Completion":"\u7B49\u5F85\u5B8C\u6210","Activity Ref":"\u6D3B\u52A8\u53C2\u8003","Version Tag":"\u7248\u672C\u6807\u7B7E",Executable:"\u53EF\u6267\u884C\u6587\u4EF6","External Task Configuration":"\u6269\u5C55\u4EFB\u52A1\u914D\u7F6E","Task Priority":"\u4EFB\u52A1\u4F18\u5148\u7EA7",External:"\u5916\u90E8",Connector:"\u8FDE\u63A5\u5668","Must configure Connector":"\u5FC5\u987B\u914D\u7F6E\u8FDE\u63A5\u5668","Connector Id":"\u8FDE\u63A5\u5668\u7F16\u53F7",Implementation:"\u5B9E\u73B0\u65B9\u5F0F","Field Injections":"\u5B57\u6BB5\u6CE8\u5165",Fields:"\u5B57\u6BB5","Result Variable":"\u7ED3\u679C\u53D8\u91CF",Topic:"\u4E3B\u9898","Configure Connector":"\u914D\u7F6E\u8FDE\u63A5\u5668","Input Parameter":"\u8F93\u5165\u53C2\u6570",Assignee:"\u4EE3\u7406\u4EBA","Candidate Users":"\u5019\u9009\u7528\u6237","Candidate Groups":"\u5019\u9009\u7EC4","Due Date":"\u5230\u671F\u65F6\u95F4","Follow Up Date":"\u8DDF\u8E2A\u65E5\u671F",Priority:"\u4F18\u5148\u7EA7","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00",Variables:"\u53D8\u91CF","Candidate Starter Configuration":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u914D\u7F6E","Candidate Starter Groups":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7EC4","This maps to the process definition key.":"\u8FD9\u6620\u5C04\u5230\u6D41\u7A0B\u5B9A\u4E49\u952E\u3002","Candidate Starter Users":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7684\u7528\u6237","Specify more than one user as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7528\u6237\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002","Tasklist Configuration":"Tasklist\u914D\u7F6E",Startable:"\u542F\u52A8","Specify more than one group as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7EC4\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002"};var Hc,Rd,yS={exports:{}};/*! * svg.js - A lightweight library for manipulating and animating SVG. * @version 2.7.1 * https://svgdotjs.github.io/ * * @copyright Wout Fierens * @license MIT * * BUILT: Fri Nov 30 2018 10:01:55 GMT+0100 (GMT+01:00) */Hc=typeof window<"u"?window:Lh,Rd=function(e,t){var n=(this!==void 0?this:e).SVG=function(s){if(n.supported)return s=new n.Doc(s),n.parser.draw||n.prepare(),s};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!t.createElementNS&&!!t.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(s){return"Svgjs"+h(s)+n.did++},n.create=function(s){var d=t.createElementNS(this.ns,s);return d.setAttribute("id",this.eid(s)),d},n.extend=function(){var s,d,m,C;for(d=(s=[].slice.call(arguments)).pop(),C=s.length-1;C>=0;C--)if(s[C])for(m in d)s[C].prototype[m]=d[m];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(s){var d=typeof s.create=="function"?s.create:function(){this.constructor.call(this,n.create(s.create))};return s.inherit&&(d.prototype=new s.inherit),s.extend&&n.extend(d,s.extend),s.construct&&n.extend(s.parent||n.Container,s.construct),d},n.adopt=function(s){return s?s.instance?s.instance:((d=s.nodeName=="svg"?s.parentNode instanceof e.SVGElement?new n.Nested:new n.Doc:s.nodeName=="linearGradient"?new n.Gradient("linear"):s.nodeName=="radialGradient"?new n.Gradient("radial"):n[h(s.nodeName)]?new n[h(s.nodeName)]:new n.Element(s)).type=s.nodeName,d.node=s,s.instance=d,d instanceof n.Doc&&d.namespace().defs(),d.setData(JSON.parse(s.getAttribute("svgjs:data"))||{}),d):null;var d},n.prepare=function(){var s=t.getElementsByTagName("body")[0],d=(s?new n.Doc(s):n.adopt(t.documentElement).nested()).size(2,0);n.parser={body:s||t.documentElement,draw:d.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:d.polyline().node,path:d.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},t.addEventListener("DOMContentLoaded",function(){n.parser.draw||n.prepare()},!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(s,d){var m,C=s.length,R=[];for(m=0;m1?1:s,new n.Color({r:~~(this.r+(this.destination.r-this.r)*s),g:~~(this.g+(this.destination.g-this.g)*s),b:~~(this.b+(this.destination.b-this.b)*s)})):this}}),n.Color.test=function(s){return s+="",n.regex.isHex.test(s)||n.regex.isRgb.test(s)},n.Color.isRgb=function(s){return s&&typeof s.r=="number"&&typeof s.g=="number"&&typeof s.b=="number"},n.Color.isColor=function(s){return n.Color.isRgb(s)||n.Color.test(s)},n.Array=function(s,d){(s=(s||[]).valueOf()).length==0&&d&&(s=d.valueOf()),this.value=this.parse(s)},n.extend(n.Array,{morph:function(s){if(this.destination=this.parse(s),this.value.length!=this.destination.length){for(var d=this.value[this.value.length-1],m=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(m);for(;this.value.length=0;C--)this.value[C]=[this.value[C][0]+s,this.value[C][1]+d];return this},size:function(s,d){var m,C=this.bbox();for(m=this.value.length-1;m>=0;m--)C.width&&(this.value[m][0]=(this.value[m][0]-C.x)*s/C.width+C.x),C.height&&(this.value[m][1]=(this.value[m][1]-C.y)*d/C.height+C.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(s,d,m){return d.x=m.x=s[0],d.y=m.y=s[1],["M",d.x,d.y]},L:function(s,d){return d.x=s[0],d.y=s[1],["L",s[0],s[1]]},H:function(s,d){return d.x=s[0],["H",s[0]]},V:function(s,d){return d.y=s[0],["V",s[0]]},C:function(s,d){return d.x=s[4],d.y=s[5],["C",s[0],s[1],s[2],s[3],s[4],s[5]]},S:function(s,d){return d.x=s[2],d.y=s[3],["S",s[0],s[1],s[2],s[3]]},Q:function(s,d){return d.x=s[2],d.y=s[3],["Q",s[0],s[1],s[2],s[3]]},T:function(s,d){return d.x=s[0],d.y=s[1],["T",s[0],s[1]]},Z:function(s,d,m){return d.x=m.x,d.y=m.y,["Z"]},A:function(s,d){return d.x=s[5],d.y=s[6],["A",s[0],s[1],s[2],s[3],s[4],s[5],s[6]]}},r="mlhvqtcsaz".split(""),o=0,a=r.length;o=0;R--)(C=this.value[R][0])=="M"||C=="L"||C=="T"?(this.value[R][1]+=s,this.value[R][2]+=d):C=="H"?this.value[R][1]+=s:C=="V"?this.value[R][1]+=d:C=="C"||C=="S"||C=="Q"?(this.value[R][1]+=s,this.value[R][2]+=d,this.value[R][3]+=s,this.value[R][4]+=d,C=="C"&&(this.value[R][5]+=s,this.value[R][6]+=d)):C=="A"&&(this.value[R][6]+=s,this.value[R][7]+=d);return this},size:function(s,d){var m,C,R=this.bbox();for(m=this.value.length-1;m>=0;m--)(C=this.value[m][0])=="M"||C=="L"||C=="T"?(this.value[m][1]=(this.value[m][1]-R.x)*s/R.width+R.x,this.value[m][2]=(this.value[m][2]-R.y)*d/R.height+R.y):C=="H"?this.value[m][1]=(this.value[m][1]-R.x)*s/R.width+R.x:C=="V"?this.value[m][1]=(this.value[m][1]-R.y)*d/R.height+R.y:C=="C"||C=="S"||C=="Q"?(this.value[m][1]=(this.value[m][1]-R.x)*s/R.width+R.x,this.value[m][2]=(this.value[m][2]-R.y)*d/R.height+R.y,this.value[m][3]=(this.value[m][3]-R.x)*s/R.width+R.x,this.value[m][4]=(this.value[m][4]-R.y)*d/R.height+R.y,C=="C"&&(this.value[m][5]=(this.value[m][5]-R.x)*s/R.width+R.x,this.value[m][6]=(this.value[m][6]-R.y)*d/R.height+R.y)):C=="A"&&(this.value[m][1]=this.value[m][1]*s/R.width,this.value[m][2]=this.value[m][2]*d/R.height,this.value[m][6]=(this.value[m][6]-R.x)*s/R.width+R.x,this.value[m][7]=(this.value[m][7]-R.y)*d/R.height+R.y);return this},equalCommands:function(s){var d,m,C;for(s=new n.PathArray(s),C=this.value.length===s.value.length,d=0,m=this.value.length;C&&dN);return C},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(s,d){this.value=0,this.unit=d||"",typeof s=="number"?this.value=isNaN(s)?0:isFinite(s)?s:s<0?-34e37:34e37:typeof s=="string"?(d=s.match(n.regex.numberAndUnit))&&(this.value=parseFloat(d[1]),d[5]=="%"?this.value/=100:d[5]=="s"&&(this.value*=1e3),this.unit=d[5]):s instanceof n.Number&&(this.value=s.valueOf(),this.unit=s.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(s){return s=new n.Number(s),new n.Number(this+s,this.unit||s.unit)},minus:function(s){return s=new n.Number(s),new n.Number(this-s,this.unit||s.unit)},times:function(s){return s=new n.Number(s),new n.Number(this*s,this.unit||s.unit)},divide:function(s){return s=new n.Number(s),new n.Number(this/s,this.unit||s.unit)},to:function(s){var d=new n.Number(this);return typeof s=="string"&&(d.unit=s),d},morph:function(s){return this.destination=new n.Number(s),s.relative&&(this.destination.value+=this.value),this},at:function(s){return this.destination?new n.Number(this.destination).minus(this).times(s).plus(this):this}}}),n.Element=n.invent({create:function(s){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=s)&&(this.type=s.nodeName,this.node.instance=this,this._events=s._events||{},this._stroke=s.getAttribute("stroke")||this._stroke)},extend:{x:function(s){return this.attr("x",s)},y:function(s){return this.attr("y",s)},cx:function(s){return s==null?this.x()+this.width()/2:this.x(s-this.width()/2)},cy:function(s){return s==null?this.y()+this.height()/2:this.y(s-this.height()/2)},move:function(s,d){return this.x(s).y(d)},center:function(s,d){return this.cx(s).cy(d)},width:function(s){return this.attr("width",s)},height:function(s){return this.attr("height",s)},size:function(s,d){var m=f(this,s,d);return this.width(new n.Number(m.width)).height(new n.Number(m.height))},clone:function(s){this.writeDataToDom();var d=E(this.node.cloneNode(!0));return s?s.add(d):this.after(d),d},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(s){return this.after(s).remove(),s},addTo:function(s){return s.put(this)},putIn:function(s){return s.add(this)},id:function(s){return this.attr("id",s)},inside:function(s,d){var m=this.bbox();return s>m.x&&d>m.y&&s/,"").replace(/<\/svg>$/,"");d.innerHTML=""+s.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2>")+"";for(var m=0,C=d.firstChild.childNodes.length;m":function(s){return-Math.cos(s*Math.PI)/2+.5},">":function(s){return Math.sin(s*Math.PI/2)},"<":function(s){return 1-Math.cos(s*Math.PI/2)}},n.morph=function(s){return function(d,m){return new n.MorphObj(d,m).at(s)}},n.Situation=n.invent({create:function(s){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(s.duration).valueOf(),this.delay=new n.Number(s.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=s.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(s){this._target=s,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(s,d,m){typeof s=="object"&&(d=s.ease,m=s.delay,s=s.duration);var C=new n.Situation({duration:s||1e3,delay:m||0,ease:n.easing[d||"-"]||d});return this.queue(C),this},delay:function(s){var d=new n.Situation({duration:s,delay:0,ease:n.easing["-"]});return this.queue(d)},target:function(s){return s&&s instanceof n.Element?(this._target=s,this):this._target},timeToAbsPos:function(s){return(s-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(s){return this.situation.duration/this._speed*s+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=e.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){e.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(s){return(typeof s=="function"||s instanceof n.Situation)&&this.situations.push(s),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var s,d,m,C=this.situation;if(C.init)return this;for(s in C.animations)for(m=this.target()[s](),Array.isArray(m)||(m=[m]),Array.isArray(C.animations[s])||(C.animations[s]=[C.animations[s]]),d=m.length;d--;)C.animations[s][d]instanceof n.Number&&(m[d]=new n.Number(m[d])),C.animations[s][d]=m[d].morph(C.animations[s][d]);for(s in C.attrs)C.attrs[s]=new n.MorphObj(this.target().attr(s),C.attrs[s]);for(s in C.styles)C.styles[s]=new n.MorphObj(this.target().style(s),C.styles[s]);return C.initialTransformation=this.target().matrixify(),C.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(s,d){var m=this.active;return this.active=!1,d&&this.clearQueue(),s&&this.situation&&(!m&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var s=this.situation;this.stop(),this.situation=s,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(s,d){var m=this.situation.duration/this._speed;return this.absPos=s,d||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*m,this.situation.finish=this.situation.start+m,this.step(!0)},speed:function(s){return s===0?this.pause():s?(this._speed=s,this.at(this.absPos,!0)):this._speed},loop:function(s,d){var m=this.last();return m.loops=s==null||s,m.loop=0,d&&(m.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(s){var d=this.last();return d.reversed=s===void 0?!d.reversed:s,this},progress:function(s){return s?this.situation.ease(this.pos):this.pos},after:function(s){var d=this.last();return this.target().on("finished.fx",function m(C){C.detail.situation==d&&(s.call(this,d),this.off("finished.fx",m))}),this._callStart()},during:function(s){var d=this.last(),m=function(C){C.detail.situation==d&&s.call(this,C.detail.pos,n.morph(C.detail.pos),C.detail.eased,d)};return this.target().off("during.fx",m).on("during.fx",m),this.after(function(){this.off("during.fx",m)}),this._callStart()},afterAll:function(s){var d=function m(C){s.call(this),this.off("allfinished.fx",m)};return this.target().off("allfinished.fx",d).on("allfinished.fx",d),this._callStart()},duringAll:function(s){var d=function(m){s.call(this,m.detail.pos,n.morph(m.detail.pos),m.detail.eased,m.detail.situation)};return this.target().off("during.fx",d).on("during.fx",d),this.afterAll(function(){this.off("during.fx",d)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(s,d,m){return this.last()[m||"animations"][s]=d,this._callStart()},step:function(s){var d,m,C;s||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(d=Math.max(this.absPos,0),m=Math.floor(d),this.situation.loops===!0||mthis.lastPos&&I<=R&&(this.situation.once[I].call(this.target(),this.pos,R),delete this.situation.once[I]);return this.active&&this.target().fire("during",{pos:this.pos,eased:R,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=R,this):this},eachAt:function(){var s,d,m,C=this,R=this.target(),I=this.situation;for(s in I.animations)m=[].concat(I.animations[s]).map(function(L){return typeof L!="string"&&L.at?L.at(I.ease(C.pos),C.pos):L}),R[s].apply(R,m);for(s in I.attrs)m=[s].concat(I.attrs[s]).map(function(L){return typeof L!="string"&&L.at?L.at(I.ease(C.pos),C.pos):L}),R.attr.apply(R,m);for(s in I.styles)m=[s].concat(I.styles[s]).map(function(L){return typeof L!="string"&&L.at?L.at(I.ease(C.pos),C.pos):L}),R.style.apply(R,m);if(I.transforms.length){for(m=I.initialTransformation,s=0,d=I.transforms.length;s=0;--d)this[S[d]]=s[S[d]]!=null?s[S[d]]:m[S[d]]},extend:{extract:function(){var s=y(this,0,1),d=y(this,1,0),m=180/Math.PI*Math.atan2(s.y,s.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(m*Math.PI/180)+this.f*Math.sin(m*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(m*Math.PI/180)+this.e*Math.sin(-m*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-m,skewY:180/Math.PI*Math.atan2(d.y,d.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:m,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new n.Matrix(this)}},clone:function(){return new n.Matrix(this)},morph:function(s){return this.destination=new n.Matrix(s),this},at:function(s){return this.destination?new n.Matrix({a:this.a+(this.destination.a-this.a)*s,b:this.b+(this.destination.b-this.b)*s,c:this.c+(this.destination.c-this.c)*s,d:this.d+(this.destination.d-this.d)*s,e:this.e+(this.destination.e-this.e)*s,f:this.f+(this.destination.f-this.f)*s}):this},multiply:function(s){return new n.Matrix(this.native().multiply(function(d){return d instanceof n.Matrix||(d=new n.Matrix(d)),d}(s).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(s,d){return new n.Matrix(this.native().translate(s||0,d||0))},scale:function(s,d,m,C){return arguments.length==1?d=s:arguments.length==3&&(C=m,m=d,d=s),this.around(m,C,new n.Matrix(s,0,0,d,0,0))},rotate:function(s,d,m){return s=n.utils.radians(s),this.around(d,m,new n.Matrix(Math.cos(s),Math.sin(s),-Math.sin(s),Math.cos(s),0,0))},flip:function(s,d){return s=="x"?this.scale(-1,1,d,0):s=="y"?this.scale(1,-1,0,d):this.scale(-1,-1,s,d??s)},skew:function(s,d,m,C){return arguments.length==1?d=s:arguments.length==3&&(C=m,m=d,d=s),s=n.utils.radians(s),d=n.utils.radians(d),this.around(m,C,new n.Matrix(1,Math.tan(d),Math.tan(s),1,0,0))},skewX:function(s,d,m){return this.skew(s,0,d,m)},skewY:function(s,d,m){return this.skew(0,s,d,m)},around:function(s,d,m){return this.multiply(new n.Matrix(1,0,0,1,s||0,d||0)).multiply(m).multiply(new n.Matrix(1,0,0,1,-s||0,-d||0))},native:function(){for(var s=n.parser.native.createSVGMatrix(),d=S.length-1;d>=0;d--)s[S[d]]=this[S[d]];return s},toString:function(){return"matrix("+w(this.a)+","+w(this.b)+","+w(this.c)+","+w(this.d)+","+w(this.e)+","+w(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var s=this.rect(1,1),d=s.node.getScreenCTM();return s.remove(),new n.Matrix(d)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(s,d){var m;m=Array.isArray(s)?{x:s[0],y:s[1]}:typeof s=="object"?{x:s.x,y:s.y}:s!=null?{x:s,y:d??s}:{x:0,y:0},this.x=m.x,this.y=m.y},extend:{clone:function(){return new n.Point(this)},morph:function(s,d){return this.destination=new n.Point(s,d),this},at:function(s){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*s,y:this.y+(this.destination.y-this.y)*s}):this},native:function(){var s=n.parser.native.createSVGPoint();return s.x=this.x,s.y=this.y,s},transform:function(s){return new n.Point(this.native().matrixTransform(s.native()))}}}),n.extend(n.Element,{point:function(s,d){return new n.Point(s,d).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(s,d,m){if(s==null){for(s={},m=(d=this.node.attributes).length-1;m>=0;m--)s[d[m].nodeName]=n.regex.isNumber.test(d[m].nodeValue)?parseFloat(d[m].nodeValue):d[m].nodeValue;return s}if(typeof s=="object")for(d in s)this.attr(d,s[d]);else if(d===null)this.node.removeAttribute(s);else{if(d==null)return(d=this.node.getAttribute(s))==null?n.defaults.attrs[s]:n.regex.isNumber.test(d)?parseFloat(d):d;s=="stroke-width"?this.attr("stroke",parseFloat(d)>0?this._stroke:null):s=="stroke"&&(this._stroke=d),s!="fill"&&s!="stroke"||(n.regex.isImage.test(d)&&(d=this.doc().defs().image(d,0,0)),d instanceof n.Image&&(d=this.doc().defs().pattern(0,0,function(){this.add(d)}))),typeof d=="number"?d=new n.Number(d):n.Color.isColor(d)?d=new n.Color(d):Array.isArray(d)&&(d=new n.Array(d)),s=="leading"?this.leading&&this.leading(d):typeof m=="string"?this.node.setAttributeNS(m,s,d.toString()):this.node.setAttribute(s,d.toString()),!this.rebuild||s!="font-size"&&s!="x"||this.rebuild(s,d)}return this}}),n.extend(n.Element,{transform:function(s,d){var m,C,R=this;if(typeof s!="object")return m=new n.Matrix(R).extract(),typeof s=="string"?m[s]:m;if(m=new n.Matrix(R),d=!!d||!!s.relative,s.a!=null)m=d?m.multiply(new n.Matrix(s)):new n.Matrix(s);else if(s.rotation!=null)x(s,R),m=d?m.rotate(s.rotation,s.cx,s.cy):m.rotate(s.rotation-m.extract().rotation,s.cx,s.cy);else if(s.scale!=null||s.scaleX!=null||s.scaleY!=null){if(x(s,R),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,!d){var I=m.extract();s.scaleX=1*s.scaleX/I.scaleX,s.scaleY=1*s.scaleY/I.scaleY}m=m.scale(s.scaleX,s.scaleY,s.cx,s.cy)}else s.skew!=null||s.skewX!=null||s.skewY!=null?(x(s,R),s.skewX=s.skew!=null?s.skew:s.skewX!=null?s.skewX:0,s.skewY=s.skew!=null?s.skew:s.skewY!=null?s.skewY:0,d||(I=m.extract(),m=m.multiply(new n.Matrix().skew(I.skewX,I.skewY,s.cx,s.cy).inverse())),m=m.skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?R.bbox()["c"+s.flip]:s.offset:s.offset==null?(C=R.bbox(),s.flip=C.cx,s.offset=C.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(d?m=m.translate(s.x,s.y):(s.x!=null&&(m.e=s.x),s.y!=null&&(m.f=s.y)));return this.attr("transform",m)}}),n.extend(n.FX,{transform:function(s,d){var m,C,R=this.target();return typeof s!="object"?(m=new n.Matrix(R).extract(),typeof s=="string"?m[s]:m):(d=!!d||!!s.relative,s.a!=null?m=new n.Matrix(s):s.rotation!=null?(x(s,R),m=new n.Rotate(s.rotation,s.cx,s.cy)):s.scale!=null||s.scaleX!=null||s.scaleY!=null?(x(s,R),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,m=new n.Scale(s.scaleX,s.scaleY,s.cx,s.cy)):s.skewX!=null||s.skewY!=null?(x(s,R),s.skewX=s.skewX!=null?s.skewX:0,s.skewY=s.skewY!=null?s.skewY:0,m=new n.Skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?R.bbox()["c"+s.flip]:s.offset:s.offset==null?(C=R.bbox(),s.flip=C.cx,s.offset=C.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(m=new n.Translate(s.x,s.y)),m?(m.relative=d,this.last().transforms.push(m),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var s=(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map(function(d){var m=d.trim().split("(");return[m[0],m[1].split(n.regex.delimiter).map(function(C){return parseFloat(C)})]}).reduce(function(d,m){return m[0]=="matrix"?d.multiply(g(m[1])):d[m[0]].apply(d,m[1])},new n.Matrix);return s},toParent:function(s){if(this==s)return this;var d=this.screenCTM(),m=s.screenCTM().inverse();return this.addTo(s).untransform().transform(m.multiply(d)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(s,d){if(arguments.length>1&&typeof d!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(s))for(var m=0,C=this.arguments.length;m=0},index:function(s){return[].slice.call(this.node.childNodes).indexOf(s.node)},get:function(s){return n.adopt(this.node.childNodes[s])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(s,d){var m,C,R=this.children();for(m=0,C=R.length;mC/R?this.height/R:this.width/C,this.x=d,this.y=m,this.width=C,this.height=R)}else s=typeof s=="string"?s.match(B).map(function(V){return parseFloat(V)}):Array.isArray(s)?s:typeof s=="object"?[s.x,s.y,s.width,s.height]:arguments.length==4?[].slice.call(arguments):[0,0,0,0],this.x=s[0],this.y=s[1],this.width=s[2],this.height=s[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(s,d,m,C){return this.destination=new n.ViewBox(s,d,m,C),this},at:function(s){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*s,this.y+(this.destination.y-this.y)*s,this.width+(this.destination.width-this.width)*s,this.height+(this.destination.height-this.height)*s]):this}},parent:n.Container,construct:{viewbox:function(s,d,m,C){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(s,d,m,C))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(s){n.Element.prototype[s]=function(d){return d==null?n.off(this,s):n.on(this,s,d),this}}),n.listenerId=0,n.on=function(s,d,m,C,R){var I=m.bind(C||s),N=s instanceof n.Element?s.node:s;N.instance=N.instance||{_events:{}};var L=N.instance._events;m._svgjsListenerId||(m._svgjsListenerId=++n.listenerId),d.split(n.regex.delimiter).forEach(function(T){var b=T.split(".")[0],B=T.split(".")[1]||"*";L[b]=L[b]||{},L[b][B]=L[b][B]||{},L[b][B][m._svgjsListenerId]=I,N.addEventListener(b,I,R||!1)})},n.off=function(s,d,m,C){var R=s instanceof n.Element?s.node:s;if(R.instance&&(typeof m!="function"||(m=m._svgjsListenerId))){var I=R.instance._events;(d||"").split(n.regex.delimiter).forEach(function(N){var L,T,b=N&&N.split(".")[0],B=N&&N.split(".")[1];if(m)I[b]&&I[b][B||"*"]&&(R.removeEventListener(b,I[b][B||"*"][m],C||!1),delete I[b][B||"*"][m]);else if(b&&B){if(I[b]&&I[b][B]){for(T in I[b][B])n.off(R,[b,B].join("."),T);delete I[b][B]}}else if(B)for(N in I)for(L in I[N])B===L&&n.off(R,[N,B].join("."));else if(b){if(I[b]){for(L in I[b])n.off(R,[b,L].join("."));delete I[b]}}else{for(N in I)n.off(R,N);R.instance._events={}}})}},n.extend(n.Element,{on:function(s,d,m,C){return n.on(this,s,d,m,C),this},off:function(s,d){return n.off(this.node,s,d),this},fire:function(s,d){return s instanceof e.Event?this.node.dispatchEvent(s):this.node.dispatchEvent(s=new n.CustomEvent(s,{detail:d,cancelable:!0})),this._event=s,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(s){return s==null?this.transform("x"):this.transform({x:s-this.x()},!0)},y:function(s){return s==null?this.transform("y"):this.transform({y:s-this.y()},!0)},cx:function(s){return s==null?this.gbox().cx:this.x(s-this.gbox().width/2)},cy:function(s){return s==null?this.gbox().cy:this.y(s-this.gbox().height/2)},gbox:function(){var s=this.bbox(),d=this.transform();return s.x+=d.x,s.x2+=d.x,s.cx+=d.x,s.y+=d.y,s.y2+=d.y,s.cy+=d.y,s}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(s){s&&((s=typeof s=="string"?t.getElementById(s):s).nodeName=="svg"?this.constructor.call(this,s):(this.constructor.call(this,n.create("svg")),s.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var s;return this._defs||((s=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(s):this._defs=new n.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"&&this.node.parentNode.nodeName!="#document-fragment"?this.node.parentNode:null},spof:function(){var s=this.node.getScreenCTM();return s&&this.style("left",-s.e%1+"px").style("top",-s.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(s){this.writeDataToDom();var d=this.node,m=E(d.cloneNode(!0));return s?(s.node||s).appendChild(m.node):d.parentNode.insertBefore(m.node,d.nextSibling),m}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var s=this.position()+1,d=this.parent();return d.removeElement(this).add(this,s),d instanceof n.Doc&&d.node.appendChild(d.defs().node),this},backward:function(){var s=this.position();return s>0&&this.parent().removeElement(this).add(this,s-1),this},front:function(){var s=this.parent();return s.node.appendChild(this.node),s instanceof n.Doc&&s.node.appendChild(s.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(s){s.remove();var d=this.position();return this.parent().add(s,d),this},after:function(s){s.remove();var d=this.position();return this.parent().add(s,d+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(s){return this.masker=s instanceof n.Mask?s:this.parent().mask().add(s),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(s){return this.clipper=s instanceof n.ClipPath?s:this.parent().clip().add(s),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(s){this.constructor.call(this,n.create(s+"Gradient")),this.type=s},inherit:n.Container,extend:{at:function(s,d,m){return this.put(new n.Stop).update(s,d,m)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(s,d,m){return s=="transform"&&(s="gradientTransform"),n.Container.prototype.attr.call(this,s,d,m)}},construct:{gradient:function(s,d){return this.defs().gradient(s,d)}}}),n.extend(n.Gradient,n.FX,{from:function(s,d){return(this._target||this).type=="radial"?this.attr({fx:new n.Number(s),fy:new n.Number(d)}):this.attr({x1:new n.Number(s),y1:new n.Number(d)})},to:function(s,d){return(this._target||this).type=="radial"?this.attr({cx:new n.Number(s),cy:new n.Number(d)}):this.attr({x2:new n.Number(s),y2:new n.Number(d)})}}),n.extend(n.Defs,{gradient:function(s,d){return this.put(new n.Gradient(s)).update(d)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(s){return(typeof s=="number"||s instanceof n.Number)&&(s={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),s.opacity!=null&&this.attr("stop-opacity",s.opacity),s.color!=null&&this.attr("stop-color",s.color),s.offset!=null&&this.attr("offset",new n.Number(s.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return this.fill()},attr:function(s,d,m){return s=="transform"&&(s="patternTransform"),n.Container.prototype.attr.call(this,s,d,m)}},construct:{pattern:function(s,d,m){return this.defs().pattern(s,d,m)}}}),n.extend(n.Defs,{pattern:function(s,d,m){return this.put(new n.Pattern).update(m).attr({x:0,y:0,width:s,height:d,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element}),n.Bare=n.invent({create:function(s,d){if(this.constructor.call(this,n.create(s)),d)for(var m in d.prototype)typeof d.prototype[m]=="function"&&(this[m]=d.prototype[m])},inherit:n.Element,extend:{words:function(s){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(t.createTextNode(s)),this}}}),n.extend(n.Parent,{element:function(s,d){return this.put(new n.Bare(s,d))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(s,d){return this.attr("href",(d||"")+"#"+s,n.xlink)}},construct:{use:function(s,d){return this.put(new n.Use).element(s,d)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(s,d){return this.put(new n.Rect).size(s,d)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(s){return this.put(new n.Circle).rx(new n.Number(s).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(s){return this.attr("r",s)},ry:function(s){return this.rx(s)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(s,d){return this.put(new n.Ellipse).size(s,d).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(s){return this.attr("rx",s)},ry:function(s){return this.attr("ry",s)}}),n.extend(n.Circle,n.Ellipse,{x:function(s){return s==null?this.cx()-this.rx():this.cx(s+this.rx())},y:function(s){return s==null?this.cy()-this.ry():this.cy(s+this.ry())},cx:function(s){return s==null?this.attr("cx"):this.attr("cx",s)},cy:function(s){return s==null?this.attr("cy"):this.attr("cy",s)},width:function(s){return s==null?2*this.rx():this.rx(new n.Number(s).divide(2))},height:function(s){return s==null?2*this.ry():this.ry(new n.Number(s).divide(2))},size:function(s,d){var m=f(this,s,d);return this.rx(new n.Number(m.width).divide(2)).ry(new n.Number(m.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(s,d,m,C){return s==null?this.array():(s=d!==void 0?{x1:s,y1:d,x2:m,y2:C}:new n.PointArray(s).toLine(),this.attr(s))},move:function(s,d){return this.attr(this.array().move(s,d).toLine())},size:function(s,d){var m=f(this,s,d);return this.attr(this.array().size(m.width,m.height).toLine())}},construct:{line:function(s,d,m,C){return n.Line.prototype.plot.apply(this.put(new n.Line),s!=null?[s,d,m,C]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(s){return this.put(new n.Polyline).plot(s||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(s){return this.put(new n.Polygon).plot(s||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(s){return s==null?this.array():this.clear().attr("points",typeof s=="string"?s:this._array=new n.PointArray(s))},clear:function(){return delete this._array,this},move:function(s,d){return this.attr("points",this.array().move(s,d))},size:function(s,d){var m=f(this,s,d);return this.attr("points",this.array().size(m.width,m.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},width:function(s){var d=this.bbox();return s==null?d.width:this.size(s,d.height)},height:function(s){var d=this.bbox();return s==null?d.height:this.size(d.width,s)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(s){return s==null?this.array():this.clear().attr("d",typeof s=="string"?s:this._array=new n.PathArray(s))},clear:function(){return delete this._array,this},move:function(s,d){return this.attr("d",this.array().move(s,d))},x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},size:function(s,d){var m=f(this,s,d);return this.attr("d",this.array().size(m.width,m.height))},width:function(s){return s==null?this.bbox().width:this.size(s,this.bbox().height)},height:function(s){return s==null?this.bbox().height:this.size(this.bbox().width,s)}},construct:{path:function(s){return this.put(new n.Path).plot(s||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(s){if(!s)return this;var d=this,m=new e.Image;return n.on(m,"load",function(){n.off(m);var C=d.parent(n.Pattern);C!==null&&(d.width()==0&&d.height()==0&&d.size(m.width,m.height),C&&C.width()==0&&C.height()==0&&C.size(d.width(),d.height()),typeof d._loaded=="function"&&d._loaded.call(d,{width:m.width,height:m.height,ratio:m.width/m.height,url:s}))}),n.on(m,"error",function(C){n.off(m),typeof d._error=="function"&&d._error.call(d,C)}),this.attr("href",m.src=this.src=s,n.xlink)},loaded:function(s){return this._loaded=s,this},error:function(s){return this._error=s,this}},construct:{image:function(s,d,m){return this.put(new n.Image).load(s).size(d||0,m||d||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(s){return s==null?this.attr("x"):this.attr("x",s)},y:function(s){var d=this.attr("y"),m=typeof d=="number"?d-this.bbox().y:0;return s==null?typeof d=="number"?d-m:d:this.attr("y",typeof s.valueOf()=="number"?s+m:s)},cx:function(s){return s==null?this.bbox().cx:this.x(s-this.bbox().width/2)},cy:function(s){return s==null?this.bbox().cy:this.y(s-this.bbox().height/2)},text:function(s){if(s===void 0){s="";for(var d=this.node.childNodes,m=0,C=d.length;m=0;d--)s.childNodes[d]instanceof e.SVGElement&&E(s.childNodes[d]);return n.adopt(s).id(n.eid(s.nodeName))}function _(s){return s.x==null&&(s.x=0,s.y=0,s.width=0,s.height=0),s.w=s.width,s.h=s.height,s.x2=s.x+s.width,s.y2=s.y+s.height,s.cx=s.x+s.width/2,s.cy=s.y+s.height/2,s}function w(s){return Math.abs(s)>1e-37?s:0}["fill","stroke"].forEach(function(s){var d,m={};m[s]=function(C){if(C===void 0)return this;if(typeof C=="string"||n.Color.isRgb(C)||C&&typeof C.fill=="function")this.attr(s,C);else for(d=c[s].length-1;d>=0;d--)C[c[s][d]]!=null&&this.attr(c.prefix(s,c[s][d]),C[c[s][d]]);return this},n.extend(n.Element,n.FX,m)}),n.extend(n.Element,n.FX,{rotate:function(s,d,m){return this.transform({rotation:s,cx:d,cy:m})},skew:function(s,d,m,C){return arguments.length==1||arguments.length==3?this.transform({skew:s,cx:d,cy:m}):this.transform({skewX:s,skewY:d,cx:m,cy:C})},scale:function(s,d,m,C){return arguments.length==1||arguments.length==3?this.transform({scale:s,cx:d,cy:m}):this.transform({scaleX:s,scaleY:d,cx:m,cy:C})},translate:function(s,d){return this.transform({x:s,y:d})},flip:function(s,d){return d=typeof s=="number"?s:d,this.transform({flip:s||"both",offset:d})},matrix:function(s){return this.attr("transform",new n.Matrix(arguments.length==6?[].slice.call(arguments):s))},opacity:function(s){return this.attr("opacity",s)},dx:function(s){return this.x(new n.Number(s).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(s){return this.y(new n.Number(s).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(s,d){return this.dx(s).dy(d)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(s,d){var m=(this._target||this).type;return m=="radial"||m=="circle"?this.attr("r",new n.Number(s)):this.rx(s).ry(d??s)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(s){return this.node.getPointAtLength(s)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(s,d){if(typeof s=="object")for(d in s)this.font(d,s[d]);return s=="leading"?this.leading(d):s=="anchor"?this.attr("text-anchor",d):s=="size"||s=="family"||s=="weight"||s=="stretch"||s=="variant"||s=="style"?this.attr("font-"+s,d):this.attr(s,d)}}),n.Set=n.invent({create:function(s){s instanceof n.Set?this.members=s.members.slice():Array.isArray(s)?this.members=s:this.clear()},extend:{add:function(){var s,d,m=[].slice.call(arguments);for(s=0,d=m.length;s-1&&this.members.splice(d,1),this},each:function(s){for(var d=0,m=this.members.length;d=0},index:function(s){return this.members.indexOf(s)},get:function(s){return this.members[s]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(this.members.length==0)return new n.RBox;var s=this.members[0].rbox(this.members[0].doc());return this.each(function(){s=s.merge(this.rbox(this.doc()))}),s}},construct:{set:function(s){return new n.Set(s)}}}),n.FX.Set=n.invent({create:function(s){this.set=s}}),n.Set.inherit=function(){var s=[];for(var d in n.Shape.prototype)typeof n.Shape.prototype[d]=="function"&&typeof n.Set.prototype[d]!="function"&&s.push(d);for(var d in s.forEach(function(C){n.Set.prototype[C]=function(){for(var R=0,I=this.members.length;R=0;s--)delete this.memory()[arguments[s]];return this},memory:function(){return this._memory||(this._memory={})}}),n.get=function(s){var d=t.getElementById(function(m){var C=(m||"").toString().match(n.regex.reference);if(C)return C[1]}(s)||s);return n.adopt(d)},n.select=function(s,d){return new n.Set(n.utils.map((d||t).querySelectorAll(s),function(m){return n.adopt(m)}))},n.extend(n.Parent,{select:function(s){return n.select(s,this.node)}});var S="abcdef".split("");if(typeof e.CustomEvent!="function"){var D=function(s,d){d=d||{bubbles:!1,cancelable:!1,detail:void 0};var m=t.createEvent("CustomEvent");return m.initCustomEvent(s,d.bubbles,d.cancelable,d.detail),m};D.prototype=e.Event.prototype,n.CustomEvent=D}else n.CustomEvent=e.CustomEvent;return function(s){for(var d=0,m=["moz","webkit"],C=0;C2&&arguments[2]!==void 0?arguments[2]:{};return t=Bd(t),Dt(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function n0(e){e=Bd(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1?t-1:0),i=1;i0)return c(v);e.apply(r,i),l()}function c(p){n=setTimeout(a,p)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){o=Date.now();for(var p=arguments.length,h=new Array(p),v=0;v1?n-1:0),r=1;r0){var a=r.x-10,c=r.y-10,l=function(p){return p===1}(o)?"<":"-";(function(p){return p.length==2})(t)&&(l="<>");var u=20*DS(t[o-1],r);i=i.animate(u,l,0).move(a,c)}}),i.after(function(){e.remove(),n()})},Da.prototype.play=function(){this.gfx.play()},Da.prototype.pause=function(){this.gfx.pause()},Da.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var Vd,jS=function(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")return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(at,i)?at[i]:at._default,a=o[0],c=o[1],l=o[2];for((r=t.createElement("div")).innerHTML=c+e+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=t.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},c0=!1;typeof document<"u"&&((Vd=document.createElement("div")).innerHTML='
a',c0=!Vd.getElementsByTagName("link").length,Vd=void 0);var at={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:c0?[1,"X
","
"]:[0,"",""]};at.td=at.th=[3,"","
"],at.option=at.optgroup=[1,'"],at.thead=at.tbody=at.colgroup=at.caption=at.tfoot=[1,"","
"],at.polyline=at.ellipse=at.polygon=at.circle=at.text=at.line=at.path=at.rect=at.g=[1,'',""];var Bt=jS,Fd={},l0=window.addEventListener?"addEventListener":"attachEvent",LS=window.removeEventListener?"removeEventListener":"detachEvent",u0=l0!=="addEventListener"?"on":"";Fd.bind=function(e,t,n,i){return e[l0](u0+t,n,i||!1),n},Fd.unbind=function(e,t,n,i){return e[LS](u0+t,n,i||!1),n};var _n=Fd,VS=Bt,FS=_n,p0=Ge.is,$S=Y.GENERATE_TOKEN_EVENT,zS=Y.UPDATE_ELEMENT_EVENT;function $d(e,t,n){this._eventBus=e,this._processInstances=t,this._processInstanceSettings=n}$d.prototype.createContextPads=function(e){if(e.attachers.length&&this._processInstances.getProcessInstances(e).length){var t=e.incoming.filter(function(r){return p0(r,"bpmn:SequenceFlow")}),n=this,i=[];return e.attachers.forEach(function(r){var o=r.outgoing.filter(function(c){return p0(c,"bpmn:SequenceFlow")});if(t.length&&o.length){var a=VS('
');i.push({element:r,html:a}),FS.bind(a,"click",function(){n._processInstances.getProcessInstances(e).forEach(function(c){var l=c.parentProcessInstanceId;r.businessObject.cancelActivity&&(e.children.forEach(function(u){u.tokenCount&&u.tokenCount[c.processInstanceId]&&u.tokenCount[c.processInstanceId]--}),n._processInstances.finish(c.processInstanceId),n._eventBus.fire(zS,{element:e})),n._eventBus.fire($S,{element:r,processInstanceId:l})})})}}),i}},$d.$inject=["eventBus","processInstances","processInstanceSettings"];var GS=$d,US=Ge.is,HS=Bt,qS=_n;function zd(e){this._exclusiveGatewaySettings=e}zd.prototype.createContextPads=function(e){var t=this;if(!(e.outgoing.filter(function(i){return US(i,"bpmn:SequenceFlow")}).length<2)){var n=HS('
');return qS.bind(n,"click",function(){t._exclusiveGatewaySettings.setSequenceFlow(e)}),[{element:e,html:n}]}},zd.$inject=["exclusiveGatewaySettings"];var WS=zd,d0=Bt,h0=_n,Gd=Ge.is,m0=Y.GENERATE_TOKEN_EVENT;function Ud(e){this._eventBus=e}Ud.prototype.createContextPads=function(e){var t=e.parent.shownProcessInstance,n=e.incoming.filter(function(c){return Gd(c,"bpmn:SequenceFlow")}),i=[];n.forEach(function(c){var l=c.source;Gd(l,"bpmn:EventBasedGateway")&&l.tokenCount&&l.tokenCount[t]&&i.push(l)});var r=e.outgoing.filter(function(c){return Gd(c,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(e.tokenCount&&e.tokenCount[t])o=d0('
'),h0.bind(o,"click",function(){e.tokenCount[t]--,a._eventBus.fire(m0,{element:e,processInstanceId:t})});else{if(!i.length)return;o=d0('
'),h0.bind(o,"click",function(){i.forEach(function(c){c.tokenCount[t]--}),a._eventBus.fire(m0,{element:e,processInstanceId:t})})}return[{element:e,html:o}]}},Ud.$inject=["eventBus"];var KS=Ud,XS=Bt,YS=_n;function Hd(e,t){this._processInstances=e,this._processInstanceSettings=t}Hd.prototype.createContextPads=function(e){var t=this;if(!(this._processInstances.getProcessInstances(e).filter(function(i){return!i.isFinished}).length<2)){var n=XS('
');return YS.bind(n,"click",function(){t._processInstanceSettings.showNext(e)}),[{element:e,html:n}]}},Hd.$inject=["processInstances","processInstanceSettings"];var JS=Hd,ZS=Bt,QS=_n,eC=Ge.is,tC=Y.GENERATE_TOKEN_EVENT;function qd(e,t,n){this._eventBus=e,this._elementRegistry=t,this._animation=n}qd.prototype.createContextPads=function(e){var t=!1;if(this._elementRegistry.forEach(function(r){r.tokenCount&&Object.values(r.tokenCount).forEach(function(o){o&&(t=!0)})}),!(eC(e.parent,"bpmn:SubProcess")||t||this._animation.animations.length)){var n=this,i=ZS('
');return QS.bind(i,"click",function(){n._eventBus.fire(tC,{element:e})}),[{element:e,html:i}]}},qd.$inject=["eventBus","elementRegistry","animation"];var nC=qd,f0=Ge.isAncestor,iC=Y.TOGGLE_MODE_EVENT,rC=Y.RESET_SIMULATION_EVENT,oC=Y.TERMINATE_EVENT,aC=Y.UPDATE_ELEMENTS_EVENT,sC=Y.UPDATE_ELEMENT_EVENT,cC=Y.PROCESS_INSTANCE_SHOWN_EVENT,lC=GS,uC=WS,pC=KS,dC=JS,hC=nC,Ba=500;function vr(e,t,n,i,r,o){var a=this;this._elementRegistry=t,this._overlays=n,this._injector=i,this._canvas=r,this._processInstances=o,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",uC),this.registerHandler("bpmn:IntermediateCatchEvent",pC),this.registerHandler("bpmn:SubProcess",dC),this.registerHandler("bpmn:SubProcess",lC),this.registerHandler("bpmn:StartEvent",hC),e.on(iC,Ba,function(c){c.simulationModeActive?a.openContextPads():a.closeContextPads()}),e.on(rC,Ba,function(){a.closeContextPads(),a.openContextPads()}),e.on(oC,Ba,function(c){var l=c.element.parent;a.closeContextPads(l)}),e.on(aC,Ba,function(c){c.elements.forEach(function(l){a.closeElementContextPads(l),a.openElementContextPads(l)})}),e.on(sC,Ba,function(c){var l=c.element;a.closeElementContextPads(l),a.openElementContextPads(l)}),e.on(cC,function(c){var l=c.processInstanceId,u=o.getProcessInstance(l).parent;a.closeContextPads(u),a.openContextPads(u)})}vr.prototype.registerHandler=function(e,t){var n=this._injector.instantiate(t);this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)},vr.prototype.openContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){t.handlers[n.type]&&f0(e,n)&&t.openElementContextPads(n)})},vr.prototype.openElementContextPads=function(e){if(this.handlers[e.type]){var t=[];this.handlers[e.type].forEach(function(i){var r=i.createContextPads(e);r&&r.forEach(function(o){o&&t.push(o)})});var n=this;t.forEach(function(i){var r={top:-15,left:-15},o=n._overlays.add(i.element,"context-menu",{position:r,html:i.html,show:{minZoom:.5}});n.overlayIds[i.element.id]=o})}},vr.prototype.closeContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){f0(e,n)&&t.closeElementContextPads(n)})},vr.prototype.closeElementContextPads=function(e){var t=this;e.attachers&&e.attachers.length>0&&e.attachers.forEach(function(i){t.closeElementContextPads(i)}),e.children&&e.children.length>0&&e.children.forEach(function(i){t.closeElementContextPads(i)});var n=this.overlayIds[e.id];n&&(this._overlays.remove(n),delete this.overlayIds[e.id])},vr.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var mC=vr,fC=Y.TOGGLE_MODE_EVENT;function v0(e,t,n,i,r,o,a,c){var l=this;function u(v,f,y){var g=v[f];v[f]=function(){return y.call(this,g,arguments)}}function p(v,f){u(v,f,function(y,g){if(!l.modelingDisabled)return y.apply(this,g)})}function h(v,f){u(v,f,function(y,g){if(l.modelingDisabled)throw new Error("model is read-only");return y.apply(this,g)})}this._eventBus=e,this.modelingDisabled=!1,e.on(fC,10001,function(v){var f=v.simulationModeActive;l.modelingDisabled=f,l.modelingDisabled&&(i.cancel(),t.close(),n.cancel()),a._update()}),p(t,"open"),p(n,"init"),p(i,"activate"),p(n,"init"),p(i,"activate"),h(o,"moveShape"),h(o,"updateAttachment"),h(o,"moveElements"),h(o,"moveConnection"),h(o,"layoutConnection"),h(o,"createConnection"),h(o,"createShape"),h(o,"createLabel"),h(o,"appendShape"),h(o,"removeElements"),h(o,"distributeElements"),h(o,"removeShape"),h(o,"removeConnection"),h(o,"replaceShape"),h(o,"pasteElements"),h(o,"alignElements"),h(o,"resizeShape"),h(o,"createSpace"),h(o,"updateWaypoints"),h(o,"reconnectStart"),h(o,"reconnectEnd"),u(r,"trigger",function(v,f){var y=f[0];if(!l.modelingDisabled||!function(g,x){return g.indexOf(x)>-1}(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],y))return v.apply(this,f)})}v0.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var vC=v0,yC=Bt,gC=Y.TOGGLE_MODE_EVENT,bC=Y.RESET_SIMULATION_EVENT,xC=Y.GENERATE_TOKEN_EVENT;function go(e,t){var n=this;this._overlays=e,t.on(gC,function(i){i.simulationModeActive||n.removeElementNotifications()}),t.on([bC,xC],function(){n.removeElementNotifications()})}go.prototype.addElementNotifications=function(e,t){var n=this;e.forEach(function(i){n.addElementNotification(i,t)})},go.prototype.addElementNotification=function(e,t){var n={top:-15,right:15},i='
'+(t.icon?'':"")+(''+t.text+""||"")+"
",r=yC(i);this._overlays.add(e,"element-notification",{position:n,html:r,show:{minZoom:.5}})},go.prototype.removeElementNotifications=function(e){var t=this;e?e.forEach(function(n){t.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},go.prototype.removeElementNotification=function(e){this._overlays.remove({element:e})},go.$inject=["overlays","eventBus"];var y0,g0,EC=go;function b0(){return g0?y0:(g0=1,y0=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n
'),hT.bind(this.paletteEntry,"click",function(){e.resetSimulation(),e._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},Qc.prototype.resetSimulation=function(){A0(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(e){e.tokenCount!==void 0&&delete e.tokenCount}),this._eventBus.fire(yT)},Qc.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var gT=Qc,bT=Bt,el=Fi,Yd=_n,tl=Na,xT=Y.TOGGLE_MODE_EVENT;function nl(e,t,n){var i=this;this._canvas=e,this._animation=t,this._eventBus=n,this._init(),n.on(xT,function(r){r.simulationModeActive?el(i.container).remove("hidden"):el(i.container).add("hidden")})}nl.prototype._init=function(){var e=this;this.container=bT('');var t=tl("#animation-speed-1",this.container),n=tl("#animation-speed-2",this.container),i=tl("#animation-speed-3",this.container);Yd.bind(t,"click",function(){e.setActive(t),e._animation.setAnimationSpeed(.5)}),Yd.bind(n,"click",function(){e.setActive(n),e._animation.setAnimationSpeed(1)}),Yd.bind(i,"click",function(){e.setActive(i),e._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},nl.prototype.setActive=function(e){tl.all(".animation-speed-button",this.container).forEach(function(t){el(t).remove("active")}),el(e).add("active")},nl.$inject=["canvas","animation","eventBus"];var ET=nl,k0=Bt,xo=Fi,Jd=_n,Zd=Na,wT=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},_T=Y.TOGGLE_MODE_EVENT,ST=Y.PROCESS_INSTANCE_CREATED_EVENT,CT=Y.PROCESS_INSTANCE_FINISHED_EVENT,TT=Y.PROCESS_INSTANCE_SHOWN_EVENT,AT=Y.PROCESS_INSTANCE_HIDDEN_EVENT,kT=Y.RESET_SIMULATION_EVENT,PT=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),MT=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function P0(e){return e===null}function Sn(e,t,n,i,r,o){var a=this;this._eventBus=e,this._canvas=t,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=o,this.highlightedElement=null,this._init(),e.on(_T,function(c){c.simulationModeActive?xo(a.container).remove("hidden"):(xo(a.container).add("hidden"),wT(a.container),P0(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),e.on(ST,function(c){a.addInstance(c)}),e.on(CT,function(c){a.removeInstance(c)}),e.on(TT,function(c){a.setInstanceShown(c.processInstanceId)}),e.on(AT,function(c){a.setInstanceHidden(c.processInstanceId)}),e.on(kT,function(){a.removeAllInstances()})}Sn.prototype._init=function(){this.container=k0(''),this._canvas.getContainer().appendChild(this.container)},Sn.prototype.addInstance=function(e){var t=this,n=e.processInstanceId,i=e.parent,r=k0('
'+n+"
");Jd.bind(r,"click",function(){t._processInstances.getProcessInstances(i).forEach(function(o){t._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),t._processInstanceSettings.showProcessInstance(n,i)}),Jd.bind(r,"mouseenter",function(){t.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},t.addHighlightToProcess(i)}),Jd.bind(r,"mouseleave",function(){t.removeHighlightFromProcess(i),t.highlightedElement=null}),this.container.appendChild(r)},Sn.prototype.removeInstance=function(e){var t=e.processInstanceId,n=Zd("#instance-"+t,this.container);n&&n.remove()},Sn.prototype.removeAllInstances=function(){this.container.innerHTML=""},Sn.prototype.setInstanceShown=function(e){var t=Zd("#instance-"+e,this.container);t&&xo(t).add("active")},Sn.prototype.setInstanceHidden=function(e){var t=Zd("#instance-"+e,this.container);t&&xo(t).remove("active")},Sn.prototype.addHighlightToProcess=function(e){this.setColor(e,MT,PT),e.parent||xo(this._canvas.getContainer()).add("highlight")},Sn.prototype.removeHighlightFromProcess=function(e){P0(this.highlightedElement)||(this.setColor(e,this.highlightedElement.stroke,this.highlightedElement.fill),e.parent||xo(this._canvas.getContainer()).remove("highlight"))},Sn.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,r)},Sn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var RT=Sn,il=Ge,NT=il.getBusinessObject,rl=il.is,IT=il.isAncestor,DT=il.isTypedEvent,BT=Y.CONSUME_TOKEN_EVENT;function ol(e,t,n,i,r,o,a){this._animation=t,this._elementRegistry=n,this._log=i,this._elementNotifications=r,this._canvas=o,this._processInstances=a,e.on(BT,250,function(){})}ol.prototype.isDeadlock=function(){var e=this,t=[];this._elementRegistry.forEach(function(r){r.tokenCount&&t.push(r)});var n=[],i=[];t.forEach(function(r){r.outgoing.filter(function(a){return rl(a,"bpmn:SequenceFlow")}).length||n.push(r),rl(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return rl(a,"bpmn:SequenceFlow")}).length>r.tokenCount&&n.push(r);var o=[];(function a(c){c.outgoing.forEach(function(l){o.indexOf(l.target)===-1&&(o.push(l.target),DT(NT(l.target),"bpmn:TerminateEventDefinition")&&i.push(c),a(l.target))})})(r)}),t.length&&!i.length&&n.length&&!this._animation.animations.length&&(e._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach(function(r){e._elementNotifications.addElementNotification(r,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})}))},ol.prototype.isFinished=function(e,t){var n=this._processInstances.getProcessInstance(t).parent,i=!1;n||(n=this._canvas.getRootElement()),n.children.forEach(function(o){o.tokenCount&&o.tokenCount[t]&&o.tokenCount[t].length&&(i=!0)});var r=!1;if(this._animation.animations.forEach(function(o){IT(n,o.element)&&o.processInstanceId===t&&(r=!0)}),!i&&!r)return rl(n,"bpmn:SubProcess")?this._log.log("Subprocess "+t+" finished","info","fa-check-circle"):(this._log.log("Process "+t+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(e,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},ol.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var OT=ol,jT=Bt,al=Fi,LT=_n,VT=Na,M0=Y.TOGGLE_MODE_EVENT;function sl(e,t,n,i){var r=this;this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,e.on("import.done",function(){r.canvasParent=r._canvas.getContainer().parentNode,r.palette=VT(".djs-palette",r._canvas.getContainer()),r._init()})}sl.prototype._init=function(){this.container=jT(`
Token Simulation
`),LT.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},sl.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation ',al(this.canvasParent).remove("simulation"),al(this.palette).remove("hidden"),this._eventBus.fire(M0,{simulationModeActive:!1});var e=this._selection.get();e.length===1&&this._contextPad.open(e[0])}else this.container.innerHTML='Token Simulation ',al(this.canvasParent).add("simulation"),al(this.palette).add("hidden"),this._eventBus.fire(M0,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},sl.$inject=["eventBus","canvas","selection","contextPad"];var FT=sl,$T=Bt,R0=Ge.isAncestor,zT=Y.TOGGLE_MODE_EVENT,GT=Y.GENERATE_TOKEN_EVENT,UT=Y.CONSUME_TOKEN_EVENT,HT=Y.RESET_SIMULATION_EVENT,qT=Y.TERMINATE_EVENT,WT=Y.PROCESS_INSTANCE_SHOWN_EVENT;function xr(e,t,n,i,r){var o=this;this._overlays=t,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},e.on(zT,function(a){a.simulationModeActive||o.removeTokenCounts()}),e.on(HT,function(){o.removeTokenCounts()}),e.on(qT,function(a){var c=a.element.parent;o.removeTokenCounts(c)}),e.on([GT,UT],500,function(a){var c=a.element.parent;o.removeTokenCounts(c),o.addTokenCounts(c)}),e.on(WT,function(a){var c=a.processInstanceId,l=r.getProcessInstance(c).parent;o.removeTokenCounts(l),o.addTokenCounts(l)})}xr.prototype.addTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement());var n=e.shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(e);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach(function(r){R0(e,r)&&t.addTokenCount(r,n)})},xr.prototype.addTokenCount=function(e,t){var n=e.tokenCount&&e.tokenCount[t];if(n){var i=this.createTokenCount(n),r={bottom:10,left:-15},o=this._overlays.add(e,"token-count",{position:r,html:i,show:{minZoom:.5}});this.overlayIds[e.id]=o}},xr.prototype.createTokenCount=function(e){return $T('
'+e+"
")},xr.prototype.removeTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){R0(e,n)&&t.removeTokenCount(n)})},xr.prototype.removeTokenCount=function(e){var t=this.overlayIds[e.id];t&&(this._overlays.remove(t),delete this.overlayIds[e.id])},xr.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var KT=xr,Ga=Ge,XT=Ga.getBusinessObject,YT=Ga.is,JT=Ga.isAncestor,ZT=Ga.getDescendants,QT=Ga.isTypedEvent,eA=Y.GENERATE_TOKEN_EVENT,tA=Y.TERMINATE_EVENT,nA=Y.UPDATE_ELEMENTS_EVENT;function cl(e,t,n,i,r,o){this._animation=e,this._eventBus=t,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}cl.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=QT(XT(t),"bpmn:TerminateEventDefinition"),r=YT(t.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(tA,e),this._elementRegistry.forEach(function(c){JT(t.parent,c)&&c.tokenCount&&c.tokenCount[n]&&delete c.tokenCount[n]}),this._processInstances.finish(n));var o=this._simulationState.isFinished(t,n);if(o&&this._processInstances.finish(n),(o||i)&&r){var a=this._processInstances.getProcessInstance(n);this._eventBus.fire(eA,{element:t.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(nA,{elements:ZT(this._elementRegistry.getAll(),t.parent)})},cl.prototype.generate=function(e){},cl.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var iA=cl,rA=Ge.is,oA=Y.UPDATE_ELEMENTS_EVENT;function ll(e,t){this._eventBus=e,this._animation=t}ll.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++;var i=t.outgoing,r=[];i.forEach(function(o){var a=o.target;rA(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(oA,{elements:r})},ll.prototype.generate=function(){},ll.$inject=["eventBus","animation"];var aA=ll,sA=Y.CONSUME_TOKEN_EVENT,cA=Y.GENERATE_TOKEN_EVENT;function ul(e,t,n){this._eventBus=e,this._animation=t,this._elementRegistry=n}ul.prototype.consume=function(e){var t=e.element;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);this._eventBus.fire(cA,e)},ul.prototype.generate=function(e){var t=e.element,n=e.processInstanceId;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);var i=this,r=this._elementRegistry.get(t.sequenceFlow.id);this._animation.createAnimation(r,n,function(){i._eventBus.fire(sA,{element:r.target,processInstanceId:n})})},ul.$inject=["eventBus","animation","elementRegistry"];var lA=ul,N0=Ge.is,uA=Y.CONSUME_TOKEN_EVENT,pA=Y.UPDATE_ELEMENT_EVENT,dA=Y.UPDATE_ELEMENTS_EVENT;function pl(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}pl.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(pA,{element:t})},pl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(a){return N0(a,"bpmn:SequenceFlow")}).forEach(function(a){t._animation.createAnimation(a,i,function(){t._eventBus.fire(uA,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return N0(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(dA,{elements:o})},pl.$inject=["animation","eventBus","elementRegistry"];var hA=pl,mA=Ge.is,fA=Y.CONSUME_TOKEN_EVENT,vA=Y.GENERATE_TOKEN_EVENT;function dl(e,t){this._animation=e,this._eventBus=t}dl.prototype.consume=function(e){this._eventBus.fire(vA,{element:e})},dl.prototype.generate=function(e){var t=this;e.outgoing.filter(function(n){return mA(n,"bpmn:SequenceFlow")}).forEach(function(n){t._animation.createAnimation(n,function(){t._eventBus.fire(fA,{element:n.target})})})},dl.$inject=["animation","eventBus"];var yA=dl,gA=Ge.is,bA=Y.CONSUME_TOKEN_EVENT,xA=Y.GENERATE_TOKEN_EVENT;function hl(e,t){this._animation=e,this._eventBus=t}hl.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,t.incoming.length===t.tokenCount[n]&&(this._eventBus.fire(xA,e),t.tokenCount[n]=0)},hl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return gA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(bA,{element:r.target,processInstanceId:i})})})},hl.$inject=["animation","eventBus"];var EA=hl,Qd=Ge.is,wA=Y.CONSUME_TOKEN_EVENT,_A=Y.UPDATE_ELEMENTS_EVENT;function ml(e,t,n,i){this._animation=e,this._eventBus=t,this._elementRegistry=n,this._processInstances=i}ml.prototype.consume=function(){},ml.prototype.generate=function(e){var t=this,n=e.element,i=e.parentProcessInstanceId,r=n.outgoing.filter(function(l){return Qd(l,"bpmn:SequenceFlow")}),o=n.parent,a=this._processInstances.create(o,i);if(r.forEach(function(l){t._animation.createAnimation(l,a,function(){t._eventBus.fire(wA,{element:l.target,processInstanceId:a})})}),!Qd(n.parent,"bpmn:SubProcess")){var c=this._elementRegistry.filter(function(l){return Qd(l,"bpmn:StartEvent")});this._eventBus.fire(_A,{elements:c})}},ml.$inject=["animation","eventBus","elementRegistry","processInstances"];var SA=ml,I0=Ge.is,CA=Y.CONSUME_TOKEN_EVENT,D0=Y.GENERATE_TOKEN_EVENT,B0=Y.UPDATE_ELEMENT_EVENT;function fl(e,t,n){this._animation=e,this._eventBus=t,this._log=n}fl.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=t.children.filter(function(r){return I0(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(D0,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(D0,e)),this._eventBus.fire(B0,{element:t})},fl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return I0(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(CA,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(B0,{element:n})},fl.$inject=["animation","eventBus","log"];var TA=fl,AA=Ge.is,kA=Y.CONSUME_TOKEN_EVENT,PA=Y.UPDATE_ELEMENT_EVENT;function vl(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}vl.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(PA,{element:t})},vl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return AA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(kA,{element:r.target,processInstanceId:i})})})},vl.$inject=["animation","eventBus","elementRegistry"];var MA=vl,RA=Ge.is,NA=Y.CONSUME_TOKEN_EVENT,IA=Y.GENERATE_TOKEN_EVENT;function yl(e,t){this._animation=e,this._eventBus=t}yl.prototype.consume=function(e){this._eventBus.fire(IA,e)},yl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return RA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(NA,{element:r.target,processInstanceId:i})})})},yl.$inject=["animation","eventBus"];var DA=iA,BA=aA,OA=lA,jA=hA,LA=yA,VA=EA,FA=SA,$A=TA,zA=MA,GA=yl,UA=Y.GENERATE_TOKEN_EVENT,HA=Y.CONSUME_TOKEN_EVENT;function eh(e,t,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",DA),this.registerHandler("bpmn:EventBasedGateway",BA),this.registerHandler("bpmn:ExclusiveGateway",OA),this.registerHandler("bpmn:IntermediateCatchEvent",jA),this.registerHandler("bpmn:IntermediateThrowEvent",LA),this.registerHandler("bpmn:ParallelGateway",VA),this.registerHandler("bpmn:StartEvent",FA),this.registerHandler("bpmn:SubProcess",$A),this.registerHandler("bpmn:BoundaryEvent",zA),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],GA),e.on(UA,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].generate(r)}),e.on(HA,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].consume(r)})}eh.prototype.registerHandler=function(e,t){var n=this,i=this._injector.instantiate(t);Array.isArray(e)||(e=[e]),e.forEach(function(r){n.handlers[r]=i})},eh.$inject=["eventBus","animation","injector"];var qA=eh;function O0(e,t,n,i,r,o){o.register({toggleTokenSimulation:function(){t.toggleMode()}}),o.register({togglePauseTokenSimulation:function(){n.toggle()}}),o.register({resetTokenSimulation:function(){r.resetSimulation()}}),o.register({toggleTokenSimulationLog:function(){i.toggle()}})}O0.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var WA=O0,KA=Y.TOGGLE_MODE_EVENT;function j0(e,t){var n=t.get("editorActions",!1),i=t.get("keyboard",!1);if(i&&n){var r=!1;e.on("keyboard.init",function(){i.addListener(1e4,function(o){(function(a){gl(["t","T"],a)?n.trigger("toggleTokenSimulation"):r&&(gl(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):gl([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):gl(["r","R"],a)&&n.trigger("resetTokenSimulation"))})(o.keyEvent)})}),e.on(KA,function(o){var a=o.simulationModeActive;r=!!a})}}function gl(e,t){return e.indexOf(t.key)>-1}j0.$inject=["eventBus","injector"];var XA=j0,YA=Bt,L0=Fi,JA=Y.TOGGLE_MODE_EVENT;function bl(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(JA,function(i){i.simulationModeActive?L0(n.container).remove("hidden"):L0(n.container).add("hidden")})}bl.prototype._init=function(){this.container=YA(''),this._canvas.getContainer().appendChild(this.container)},bl.prototype.addEntry=function(e,t){var n=0;this.entries.forEach(function(i){t>=i.index&&n++}),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},bl.$inject=["eventBus","canvas"];const ZA=kr({__init__:["animation","contextPads","disableModeling","elementNotifications","elementSupport","exclusiveGatewaySettings","log","notifications","pauseSimulation","preserveElementColors","processInstanceIds","processInstanceSettings","processInstances","resetSimulation","setAnimationSpeed","showProcessInstance","simulationState","toggleMode","tokenCount","tokenSimulationBehavior","tokenSimulationEditorActions","tokenSimulationKeyboardBindings","tokenSimulationPalette"],animation:["type",OS],contextPads:["type",mC],disableModeling:["type",vC],elementNotifications:["type",EC],elementSupport:["type",TC],exclusiveGatewaySettings:["type",MC],log:["type",LC],notifications:["type",FC],pauseSimulation:["type",XC],preserveElementColors:["type",JC],processInstanceIds:["type",eT],processInstanceSettings:["type",aT],processInstances:["type",pT],resetSimulation:["type",gT],setAnimationSpeed:["type",ET],showProcessInstance:["type",RT],simulationState:["type",OT],toggleMode:["type",FT],tokenCount:["type",KT],tokenSimulationBehavior:["type",qA],tokenSimulationEditorActions:["type",WA],tokenSimulationKeyboardBindings:["type",XA],tokenSimulationPalette:["type",bl]}),QA={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},ek={name:"Activiti",uri:"http://activiti.org/bpmn",prefix:"activiti",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","activiti:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"activiti:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"},{name:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["activiti:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","activiti:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","activiti:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike","activiti:ExecutionListener","activiti:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["activiti:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["activiti:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProperty",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]}],emumerations:[]},tk={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"Boolean",default:!1},{name:"formInit",isAttr:!0,type:"Boolean",default:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",isAttr:!0,type:"String"}]},{name:"Assignee",supperClass:"Element",meta:{allowedIn:["*"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"viewId",type:"Number",isAttr:!0}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"code",type:"String",isAttr:!0},{name:"isHide",type:"String",isAttr:!0},{name:"next",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"condition",type:"String",isAttr:!0},{name:"operationType",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"ChildField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0},{name:"children",type:"ChildField",isMany:!0},{name:"extensionElements",type:"bpmn:ExtensionElements",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Condition",superClass:["Element"],meta:{allowedIn:["bpmn:SequenceFlow"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"field",type:"String",isAttr:!0},{name:"compare",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"logic",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]}],emumerations:[]},th=Object.prototype.toString,nk=Object.prototype.hasOwnProperty;function V0(e){return th.call(e)==="[object Array]"}function F0(e){const t=th.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function ik(e,t){return nk.call(e,t)}function rk(e,t){const n=function(r){return F0(r)?r:o=>o===r}(t);let i;return $0(e,function(r,o){if(n(r,o))return i=r,!1}),i}function $0(e,t){let n,i;if(e===void 0)return;const r=V0(e)?ak:ok;for(let o in e)if(ik(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function Eo(e,t){return!!rk(e,t)}function ok(e){return e}function ak(e){return Number(e)}function sk(e,...t){return Object.assign(e,...t)}const ck="*";function wo(e){const t=this;e.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return t.canCopyProperty(i,r)})}function _o(e,t){return e&&F0(e.$instanceOf)&&e.$instanceOf(t)}function z0(e,t){return Eo(t,function(n){return _o(e,n)})}function Cn(e,t){return t?_o(e,t)?e:e.$parent?Cn(e.$parent,t):void 0:e.$parent}wo.$inject=["eventBus"],wo.prototype.canCopyProperty=function(e,t){return n=e,!(th.call(n)==="[object Object]"&&!function(i,r){const o=i.$type&&i.$model.getTypeDescriptor(i.$type),a=o&&o.meta&&o.meta.allowedIn;return!a||function(c){return c.indexOf(ck)!==-1}(a)?!0:Eo(a,function(c){return Cn(r,c)})}(e,t))&&!(_o(e,"camunda:InputOutput")&&!this.canHostInputOutput(t))&&!(z0(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t))&&!(_o(e,"camunda:In")&&!this.canHostIn(t))&&void 0;var n},wo.prototype.canHostInputOutput=function(e){if(Cn(e,"camunda:Connector"))return!0;const t=Cn(e,"bpmn:FlowNode");return!!t&&!z0(t,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&!(_o(t,"bpmn:SubProcess")&&t.get("triggeredByEvent"))},wo.prototype.canHostConnector=function(e){return!_o(Cn(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||Cn(e,"bpmn:IntermediateThrowEvent")||Cn(e,"bpmn:EndEvent")},wo.prototype.canHostIn=function(e){return Cn(e,"bpmn:CallActivity")?!0:!Cn(e,"bpmn:SignalEventDefinition")||Cn(e,"bpmn:IntermediateThrowEvent")||Cn(e,"bpmn:EndEvent")};const lk={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",wo]},uk={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function nh(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function ih(e,t){return(n=e)&&n.length&&Eo(e,function(i){return nh(i,t)});var n}function rh(e,t,n){const i=t.name,r=uk[i.replace(/activiti:/,"")];return i===e&&function(o,a){return Eo(a,function(c){return nh(o,c)})}(n,r)}function oh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}oh.$inject=["eventBus"],oh.prototype.canCloneProperty=function(e,t){return rh("activiti:FailedJobRetryTimeCycle",t,e)?ih(e.eventDefinitions,"bpmn:TimerEventDefinition")||ih(e.eventDefinitions,"bpmn:SignalEventDefinition")||nh(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):rh("activiti:Connector",t,e)||rh("activiti:Field",t,e)?ih(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const pk={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",oh]},dk={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function ah(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function sh(e,t){return(n=e)&&n.length&&Eo(e,function(i){return ah(i,t)});var n}function ch(e,t,n){const i=t.name,r=dk[i.replace(/flowable:/,"")];return i===e&&function(o,a){return Eo(a,function(c){return ah(o,c)})}(n,r)}function lh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}lh.$inject=["eventBus"],lh.prototype.canCloneProperty=function(e,t){return ch("flowable:FailedJobRetryTimeCycle",t,e)?sh(e.eventDefinitions,"bpmn:TimerEventDefinition")||sh(e.eventDefinitions,"bpmn:SignalEventDefinition")||ah(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):ch("flowable:Connector",t,e)||ch("flowable:Field",t,e)?sh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const hk={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",lh]};var Re,zi,mk=Object.defineProperty,xl=Object.getOwnPropertySymbols,G0=Object.prototype.hasOwnProperty,U0=Object.prototype.propertyIsEnumerable,uh=(e,t,n)=>t in e?mk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H0=(e,t)=>{for(var n in t||(t={}))G0.call(t,n)&&uh(e,n,t[n]);if(xl)for(var n of xl(t))U0.call(t,n)&&uh(e,n,t[n]);return e},Gi=(e,t,n)=>(uh(e,typeof t!="symbol"?t+"":t,n),n);function Tn(e){return e==null}function ph(e){return typeof e=="string"}(zi=Re||(Re={})).Root="Root",zi.Declaration="Declaration",zi.Comment="Comment",zi.DocumentType="DocumentType",zi.Element="Element",zi.Text="Text",zi.Instruction="Instruction",zi.CDATA="CDATA";var cn=class{constructor(e,t=null,n=null){Gi(this,"name"),Gi(this,"type"),Gi(this,"parent"),Gi(this,"children"),Gi(this,"attributes"),Gi(this,"value"),Gi(this,"selfClosing"),Gi(this,"prefix"),this.name="",this.type=e,this.parent=t,this.value=n,this.children=null,this.attributes={},this.selfClosing=!1,this.prefix=""}setName(e){return this.name=e,this}setType(e){return this.type=e,this}setParent(e){return this.parent=e,this}setChildren(e){return this.children=e&&Array.from(e),this}setAttributes(e){return this.attributes=H0({},e),this}setValue(e){return this.value=e,this}setSelfClosing(e){return this.selfClosing=e,this}setPrefix(e){return this.prefix=e,this}addAttribute(e,t){return this.attributes[e]=t,this}removeAttribute(e){return delete this.attributes[e],this}addChild(e){return e===this||(this.children||(this.children=[]),this.children.push(e),e.parent!==this&&(e.parent=this)),this}removeChild(e){if(this.children&&this.children.length){const t=this.children.findIndex(n=>n===e);~t&&(this.children.splice(t,1),e.parent=null)}return this}toJsObject(){return{name:this.name||void 0,prefix:this.prefix||void 0,type:this.type,attributes:Object.keys(this.attributes).length?this.attributes:void 0,value:Tn(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===Re.Element||this.type===Re.Root)&&this.children&&this.children.length?this.children.map(e=>e.toJSON()):void 0}}toXmlString(e=" ",t=` `,n=0){const i=e.repeat(n);let r="";switch(this.type){case Re.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(e,t,n)).join(t):"";break;case Re.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=q0(this.attributes||{});a&&(r+=` ${a}`),this.children&&this.children.length?r+=`>${t}${this.children.map(c=>c.toXmlString(e,t,n+1)).join(t)}${t}${i}`:r+=this.selfClosing?" />":`>`;break}case Re.CDATA:r+=`${i}`;break;case Re.Text:r+=Tn(this.value)?"":`${i}${this.value}`;break;case Re.DocumentType:r+=Tn(this.value)?"":`${i}`;break;case Re.Comment:r+=`${i}`;break;case Re.Declaration:if(r+=`${i}{var l={};for(var u in a)G0.call(a,u)&&c.indexOf(u)<0&&(l[u]=a[u]);if(a!=null&&xl)for(var u of xl(a))c.indexOf(u)<0&&U0.call(a,u)&&(l[u]=a[u]);return l})(this.attributes,["version"]);o&&(r+=q0(o))}r+="?>";break;case Re.Instruction:r+=Tn(this.value)?"":`${i}`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function q0(e){return Object.keys(e).map(t=>{const n=e[t];return Tn(n)?null:function(i){return typeof i=="boolean"}(n)?n?t:null:`${t}="${n}"`}).filter(Boolean).join(" ")}var W0=e=>e,K0={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:W0,attributeProcessor:W0},fk=Object.keys(K0),Er="Tag is not closed.";function vk(e,t={}){const n=e.replace(/\r\n?/g,` `),i=function(l={}){const u=H0({},l);return fk.forEach(p=>{Tn(u[p])&&(u[p]=K0[p])}),u}(t),r=n.length,o=new cn(Re.Root);let a=o,c="";for(let l=0;l",l,`Element End ${Er}`);let h=n.substring(l+2,p),v="";if(!i.prefixInName){const f=h.indexOf(":");~f&&(v=h.substring(0,f),h=h.substring(f+1))}if(a.prefix!==v||a.name!==h)throw new Error("End Tag is incorrect.");if(c){const f=dh(wr("",Re.Text,c,i));f&&a.addChild(new cn(Re.Text,a,f))}a=a.parent,c="",l=p}else if(n[l+1]==="?"){const p=So(n,"?>",l,`Processing Instruction ${Er}`),h=n.substring(l+2,p-1);if(a)if(h.startsWith("xml ")&&h.includes("version=")&&a.type===Re.Root){const v=new cn(Re.Declaration,a);v.attributes=hh(h.substr(4),Re.Declaration,i),a.addChild(v)}else a.addChild(new cn(Re.Instruction,a,wr("",Re.Instruction,h,i)));l=p}else if(n.substr(l+1,3)==="!--"){const p=So(n,"-->",l,`Comment ${Er}`),h=n.substring(l+4,p-2);a&&a.addChild(new cn(Re.Comment,a,wr("",Re.Comment,h,i))),l=p}else if(n.substr(l+1,8)==="!DOCTYPE"){let p=So(n,">",l,`Document Type ${Er}`),h=n.substring(l+9,p);h.includes("[")&&(p=So(n,"]>",l,`Document Type ${Er}`),h=n.substring(l+9,p)),a&&a.addChild(new cn(Re.DocumentType,a,wr("",Re.DocumentType,h,i))),l=p}else if(n.substr(l+1,8)==="![CDATA["){const p=So(n,"]]>",l,`CDATA Section ${Er}`),h=n.substring(l+9,p-2);if(a&&c){const v=dh(wr("",Re.Text,c,i));v&&a.addChild(new cn(Re.Text,a,v))}a.addChild(new cn(Re.CDATA,a,wr("",Re.CDATA,h,i))),c="",l=p}else{let p="",h="",v=l+1;for(;v<=r;){let x=n[v];if(p)x===p&&(p="");else if(x==='"'||x==="'")p=x;else if(x===" ")x=" ";else if(x===">")break;h+=x,v++}if(v>r)throw new Error(`Element ${Er}`);h=h.trim();const f=h.indexOf(" ");let y=h,g="";if(~f?(y=h.substr(0,f),h=h.substr(f+1)):h="",!i.prefixInName){const x=y.indexOf(":");~x&&(g=y.substring(0,x),y=y.substring(x+1))}if(a&&c){const x=dh(wr("",Re.Text,c,i));x&&a.addChild(new cn(Re.Text,a,x))}if(h.length&&h.lastIndexOf("/")===h.length-1){y[y.length-1]==="/"?(y=y.substr(0,y.length-1),h=""):h=h.substr(0,h.length-1);const x=new cn(Re.Element,a);x.name=y,x.selfClosing=!0,x.prefix=g,h&&!i.ignoreAttributes&&(x.attributes=hh(h,Re.Element,i)),a.addChild(x)}else{const x=new cn(Re.Element,a);h&&!i.ignoreAttributes&&(x.attributes=hh(h,Re.Element,i)),x.name=y,x.prefix=g,a.addChild(x),a=x}c="",l=v}}return o}function So(e,t,n,i){const r=e.indexOf(t,n);if(!~r)throw new Error(i);return r+t.length-1}function wr(e,t,n,i){return n?(i.trimValues&&(n=n.trim()),X0(i.valueProcessor(n,t,e),i.parseNodeValue)):null}function X0(e,t){return t&&ph(e)?(e=e.trim())==="true"||e!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(e):Tn(e)?null:e}function dh(e){return Tn(e)?"":ph(e)?e:String(e)}var yk=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function hh(e,t,n){const i=(e=e.replace(/\r?\n/g," ")).match(yk)||[],r={};for(let o=0;o{}},additionalModel:[Object,Array],moddleExtension:{type:Object,default:()=>{}},onlyCustomizeAddi:{type:Boolean,default:!1},onlyCustomizeModdle:{type:Boolean,default:!1},simulation:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},prefix:{type:String,default:"camunda"},events:{type:Array,default:()=>["element.click"]},headerButtonSize:{type:String,default:"small",validator:e=>["default","medium","small","mini"].indexOf(e)!==-1},headerButtonType:{type:String,default:"primary",validator:e=>["default","primary","success","warning","danger","info"].indexOf(e)!==-1}},emits:["destroy","init-finished","save","commandStack-changed","input","change","canvas-viewbox-changed","element-click"],setup(e,{emit:t}){const n=G(),i=G(),r=t,o=e;ko("configGlobal",o);let a=null;const c=G(1),l=G(!1),u=G(!1),p=G(""),h=G("xml"),v=G(!1),f=G(!1),y=Ot(()=>{console.log(o.additionalModel,"additionalModel");const R=[];if(o.onlyCustomizeAddi)return Object.prototype.toString.call(o.additionalModel)=="[object Array]"?o.additionalModel||[]:[o.additionalModel];Object.prototype.toString.call(o.additionalModel)=="[object Array]"?R.push(...o.additionalModel):o.additionalModel&&R.push(o.additionalModel);const I={translate:["value",(N=o.translations||vS,function(L,T){return T=T||{},(L=N[L]||L).replace(/{([^}]+)}/g,function(b,B){let V=T[B];return N[T[B]]!==null&&N[T[B]]!==void 0&&(V=N[T[B]]),V||"{"+B+"}"})})]};var N;return R.push(I),o.simulation&&R.push(ZA),console.log(o.prefix,"props.prefix "),o.prefix==="camunda"&&R.push(lk),o.prefix==="flowable"&&R.push(hk),o.prefix==="activiti"&&R.push(pk),R}),g=Ot(()=>{console.log(o.onlyCustomizeModdle,"props.onlyCustomizeModdle"),console.log(o.moddleExtension,"props.moddleExtension"),console.log(o.prefix,"props.prefix");const R={};if(o.onlyCustomizeModdle)return o.moddleExtension||null;if(o.moddleExtension)for(let I in o.moddleExtension)R[I]=o.moddleExtension[I];return o.prefix==="activiti"&&(R.activiti=ek),o.prefix==="flowable"&&(R.flowable=tk),o.prefix==="camunda"&&(R.camunda=QA),R});console.log(y,"additionalModules()"),console.log(g,"moddleExtensions()");const x=()=>{const R=a.get("eventBus");console.log(R,"EventBus"),o.events.forEach(I=>{R.on(I,function(N){let L=I.replace(/\./g,"-"),T=N?N.element:null;console.log(L,"eventName"),console.log(T,"element"),r("element-click",T,N)})}),R.on("commandStack.changed",async I=>{try{v.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:N}=await a.saveXML({format:!0});r("commandStack-changed",I),r("input",N),r("change",N)}catch(N){console.error(`[Process Designer Warn]: ${N.message||N}`)}}),a.on("canvas.viewbox.changed",({viewbox:I})=>{r("canvas-viewbox-changed",{viewbox:I});const{scale:N}=I;c.value=Math.floor(100*N)/100})},E=async R=>{console.log(R,"xml");let I=o.processId||`Process_${new Date().getTime()}`,N=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,L=R||Wb(I,N,o.prefix);try{let{warnings:T}=await a.importXML(L);console.log(T,"warnings"),T&&T.length&&T.forEach(b=>console.warn(b))}catch(T){console.error(`[Process Designer Warn]: ${T.message||T}`)}},_=async R=>{try{if(R==="xml"||R==="bpmn"){const{err:N,xml:L}=await a.saveXML();N&&console.error(`[Process Designer Warn ]: ${N.message||N}`);let{href:T,filename:b}=w(R.toUpperCase(),L);I(T,b)}else{const{err:N,svg:L}=await a.saveSVG();if(N)return console.error(N);let{href:T,filename:b}=w("SVG",L);I(T,b)}}catch(N){console.error(`[Process Designer Warn ]: ${N.message||N}`)}function I(N,L){if(N&&L){let T=document.createElement("a");T.download=L,T.href=N,T.click(),URL.revokeObjectURL(T.href)}}},w=(R,I)=>({filename:`diagram.${R}`,href:`data:application/${R==="svg"?"text/xml":"bpmn20-xml"};charset=UTF-8,${encodeURIComponent(I)}`,data:I}),S=()=>{const R=i.value.files[0],I=new FileReader;I.readAsText(R),I.onload=function(){let N=this.result;E(N)}},D=()=>{u.value=!u.value,console.log(a.get("toggleMode","strict"),"bpmnModeler.get('toggleMode')"),o.simulation&&a.get("toggleMode","strict").toggleMode()},s=R=>{const I=a.get("alignElements"),N=a.get("selection").get();!N||N.length<=1?kx.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):Mr.confirm("\u81EA\u52A8\u5BF9\u9F50\u53EF\u80FD\u9020\u6210\u56FE\u5F62\u53D8\u5F62\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F","\u8B66\u544A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{I.trigger(N,R)})},d=()=>{console.log(a.saveXML,"bpmnModeler"),a.saveXML({format:!0}).then(({xml:R})=>{p.value=R,h.value="xml",l.value=!0})},m=()=>{a.saveXML({format:!0}).then(({xml:R})=>{var N;const I=new cn(Re.Root,vk(R));p.value=(N=I.parent)==null?void 0:N.toJSON(),h.value="json",l.value=!0})},C=async()=>{const{err:R,xml:I}=await a.saveXML();R?alert("\u4FDD\u5B58\u6A21\u578B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"):r("save",I)};return Tx(()=>{console.log(o,"propspropspropsprops")}),Pr(()=>{(()=>{if(a)return;let R=document.getElementById("bpmnCanvas");console.log(R,"data"),console.log(o.keyboard,"props.keyboard"),console.log(y,"additionalModules()"),console.log(g,"moddleExtensions()"),a=new zn({container:R,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:y.value,moddleExtensions:g.value}),r("init-finished",a),x()})(),E(o.value)}),An(()=>{a&&a.destroy(),r("destroy",a),a=null}),(R,I)=>{const N=Ir,L=Ox,T=Px,b=Mx,B=kn,V=jl,H=Ax("highlight");return X(),Ae("div",gk,[De("div",bk,[Qa(R.$slots,"control-header"),R.$slots["control-header"]?we("",!0):(X(),Ae(st,{key:0},[M(b,{key:"file-control"},{default:j(()=>[M(N,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:I[0]||(I[0]=q=>P(i).click())}),M(T,{effect:"light",placement:"bottom"},{content:j(()=>[De("div",xk,[M(L,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:I[1]||(I[1]=q=>{_("xml")})}),Ek,M(L,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:I[2]||(I[2]=q=>{_("svg")})}),wk,M(L,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:I[3]||(I[3]=q=>{_("bpmn")})})])]),default:j(()=>[M(N,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),M(T,{effect:"light"},{content:j(()=>[M(L,{title:"\u9884\u89C8XML",onClick:d}),_k,M(L,{title:"\u9884\u89C8JSON",onClick:m})]),default:j(()=>[M(N,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(X(),ue(T,{key:0,effect:"light",content:P(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:j(()=>[M(N,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:D})]),_:1},8,["content"])):we("",!0)]),_:1}),M(b,{key:"align-control"},{default:j(()=>[M(T,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-bottom",onClick:I[4]||(I[4]=q=>s("left"))})]),_:1}),M(T,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-top",onClick:I[5]||(I[5]=q=>s("right"))})]),_:1}),M(T,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-left",onClick:I[6]||(I[6]=q=>s("top"))})]),_:1}),M(T,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-right",onClick:I[7]||(I[7]=q=>s("bottom"))})]),_:1}),M(T,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-center",onClick:I[8]||(I[8]=q=>s("center"))})]),_:1}),M(T,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-middle",onClick:I[9]||(I[9]=q=>s("middle"))})]),_:1})]),_:1}),M(b,{key:"scale-control"},{default:j(()=>[M(T,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:j(()=>[M(N,{preIcon:"ep:zoom-out",onClick:I[10]||(I[10]=q=>((J=.1)=>{let Q=Math.floor(100*c.value-100*J)/100;if(Q<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");c.value=Q,a.get("canvas").zoom(c.value)})()),disabled:P(c)<.2},null,8,["disabled"])]),_:1}),M(B,null,{default:j(()=>[ve(Vl(Math.floor(10*P(c)*10)+"%"),1)]),_:1}),M(T,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:j(()=>[M(N,{preIcon:"ep:zoom-in",onClick:I[11]||(I[11]=q=>((J=.1)=>{let Q=Math.floor(100*c.value+100*J)/100;if(Q>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");c.value=Q,a.get("canvas").zoom(c.value)})()),disabled:P(c)>4},null,8,["disabled"])]),_:1}),M(T,{effect:"light",content:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D"},{default:j(()=>[M(N,{preIcon:"ep:scale-to-original",onClick:I[12]||(I[12]=q=>(c.value=1,void a.get("canvas").zoom("fit-viewport","auto")))})]),_:1})]),_:1}),M(b,{key:"stack-control"},{default:j(()=>[M(T,{effect:"light",content:"\u64A4\u9500"},{default:j(()=>[M(N,{preIcon:"ep:refresh-left",onClick:I[13]||(I[13]=q=>{a.get("commandStack").undo()}),disabled:!P(f)},null,8,["disabled"])]),_:1}),M(T,{effect:"light",content:"\u6062\u590D"},{default:j(()=>[M(N,{preIcon:"ep:refresh-right",onClick:I[14]||(I[14]=q=>{a.get("commandStack").redo()}),disabled:!P(v)},null,8,["disabled"])]),_:1}),M(T,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:j(()=>[M(N,{preIcon:"ep:refresh",onClick:I[15]||(I[15]=q=>(v.value=!1,f.value=!1,void E(null)))})]),_:1})]),_:1}),M(N,{preIcon:"ep:plus",title:"\u4FDD\u5B58\u6A21\u578B",onClick:C,type:o.headerButtonType,disabled:P(u)},null,8,["type","disabled"])],64)),De("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:S},null,544)]),De("div",Sk,[De("div",{class:"my-process-designer__canvas",ref_key:"bpmnCanvas",ref:n,id:"bpmnCanvas",style:{width:"1680px",height:"800px"}},null,512)]),M(V,{title:"\u9884\u89C8",modelValue:P(l),"onUpdate:modelValue":I[16]||(I[16]=q=>Mt(l)?l.value=q:null),width:"80%",scroll:!0,"max-height":"600px"},{default:j(()=>[Xi((X(),Ae("div",null,[De("code",Ck,Vl(P(p)),1)])),[[H]])]),_:1},8,["modelValue"])])}}});El.install=function(e){e.component(El.name,El)};const Tk={class:"panel-tab__content"},Ak=Ze({name:"ElementForm",__name:"ElementForm",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix");Hn("width");const i=G(""),r=G("");G("");const o=G([]);G({}),G({long:"\u957F\u6574\u578B",string:"\u5B57\u7B26\u4E32",boolean:"\u5E03\u5C14\u7C7B",date:"\u65E5\u671F\u7C7B",enum:"\u679A\u4E3E\u7C7B",custom:"\u81EA\u5B9A\u4E49\u7C7B\u578B"}),G(-1),G(-1),G(!1),G(!1),G({}),G(""),G([]),G([]),G([]);const a=G(),c=G(),l=G(),u=G(),p=()=>window==null?void 0:window.bpmnInstances,h=()=>{p().modeling.updateProperties(Be(a.value),{formKey:i.value})},v=()=>{const y=p().moddle.create("bpmn:ExtensionElements",{values:u.value.concat(l.value)});p().modeling.updateProperties(Be(a.value),{extensionElements:y})},f=G([]);return Pr(async()=>{f.value=await jx()}),nt(()=>t.id,y=>{y&&y.length&&Rt(()=>{var g,x;a.value=p().bpmnElement,i.value=a.value.businessObject.formKey,((g=i.value)==null?void 0:g.length)>0&&(i.value=parseInt(i.value)),c.value=a.value.businessObject.get("extensionElements")||p().moddle.create("bpmn:ExtensionElements",{values:[]}),l.value=((x=c.value.values.filter(E=>E.$type===`${n}:FormData`))==null?void 0:x[0])||p().moddle.create(`${n}:FormData`,{fields:[]}),r.value=l.value.businessKey,u.value=c.value.values.filter(E=>E.$type!==`${n}:FormData`),o.value=JSON.parse(JSON.stringify(l.value.fields||[])),v()})},{immediate:!0}),(y,g)=>{const x=hi,E=mi,_=Yt,w=dn;return X(),Ae("div",Tk,[M(w,{"label-width":"80px"},{default:j(()=>[M(_,{label:"\u6D41\u7A0B\u8868\u5355"},{default:j(()=>[M(E,{modelValue:P(i),"onUpdate:modelValue":g[0]||(g[0]=S=>Mt(i)?i.value=S:null),clearable:"",onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(f),S=>(X(),ue(x,{key:S.id,label:S.name,value:S.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})])}}}),kk={class:"panel-tab__content"},Pk={key:0},Mk={key:1},Rk=Ze({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(e){const t=e,n=G({}),i=G(),r=G({}),o=Fl({id:[{required:!0,message:"\u6D41\u7A0B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u6D41\u7A0B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),a=()=>window==null?void 0:window.bpmnInstances,c=p=>{p&&(p.match(/[a-zA-Z_][\-_.0-9a-zA-Z$]*/)?(console.log("key \u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u8FDB\u884C\u8D4B\u503C"),r.value.id=p,setTimeout(()=>{u("id")},100)):console.log("key \u4E0D\u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u4E0D\u8FDB\u884C\u8D4B\u503C"))},l=p=>{console.log(r,"elementBaseInfo"),p&&(r.value.name=p,setTimeout(()=>{u("name")},100))},u=p=>{console.log(p,"key");const h=Object.create(null);h[p]=r.value[p],n.value={...r.value,...n.value},p==="id"?(console.log(window,"window"),console.log(i.value,"bpmnElement"),console.log(Be(i.value),"bpmnElement"),a().modeling.updateProperties(Be(i.value),{id:r.value[p],di:{id:`${r.value[p]}_di`}})):(console.log(h,"attrObj"),a().modeling.updateProperties(Be(i.value),h))};return nt(()=>t.businessObject,p=>{var h;p&&(console.log(window,"window"),console.log(i.value,"bpmnElement"),i.value=(h=a())==null?void 0:h.bpmnElement,r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type)}),nt(()=>{var p;return(p=t.model)==null?void 0:p.key},p=>{p&&(c(t.model.key),l(t.model.name))}),An(()=>{i.value=null}),(p,h)=>{const v=hn,f=Yt,y=dn;return X(),Ae("div",kk,[M(y,{"label-width":"90px",model:P(n),rules:P(o)},{default:j(()=>[P(n).type=="bpmn:Process"?(X(),Ae("div",Pk,[M(f,{label:"\u6D41\u7A0B\u6807\u8BC6",prop:"id"},{default:j(()=>[M(v,{modelValue:P(n).id,"onUpdate:modelValue":h[0]||(h[0]=g=>P(n).id=g),placeholder:"\u8BF7\u8F93\u5165\u6D41\u6807\u6807\u8BC6",disabled:P(n).id!==void 0&&P(n).id.length>0,onChange:c},null,8,["modelValue","disabled"])]),_:1}),M(f,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:j(()=>[M(v,{modelValue:P(n).name,"onUpdate:modelValue":h[1]||(h[1]=g=>P(n).name=g),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onChange:l},null,8,["modelValue"])]),_:1})])):(X(),Ae("div",Mk,[M(f,{label:"ID"},{default:j(()=>[M(v,{modelValue:P(r).id,"onUpdate:modelValue":h[2]||(h[2]=g=>P(r).id=g),clearable:"",onChange:h[3]||(h[3]=g=>u("id"))},null,8,["modelValue"])]),_:1}),M(f,{label:"\u540D\u79F0"},{default:j(()=>[M(v,{modelValue:P(r).name,"onUpdate:modelValue":h[4]||(h[4]=g=>P(r).name=g),clearable:"",onChange:h[5]||(h[5]=g=>u("name"))},null,8,["modelValue"])]),_:1})]))]),_:1},8,["model","rules"])])}}}),Nk={class:"panel-tab__content"},Ik={class:"element-property input-property"},Dk=De("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1),Bk={class:"element-property__value"},Ok=Ze({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(e){const t=e,n=G(""),i=G(),r=()=>window.bpmnInstances,o=()=>{i.value&&i.value.id===t.id||(i.value=r().elementRegistry.get(t.id));const a=r().bpmnFactory.create("bpmn:Documentation",{text:n.value});r().modeling.updateProperties(Be(i.value),{documentation:[a]})};return An(()=>{i.value=null}),nt(()=>t.id,a=>{a&&a.length?Rt(()=>{var l;const c=(l=r().bpmnElement.businessObject)==null?void 0:l.documentation;n.value=c&&c.length?c[0].text:""}):n.value=""},{immediate:!0}),(a,c)=>{const l=hn;return X(),Ae("div",Nk,[De("div",Ik,[Dk,De("div",Bk,[M(l,{type:"textarea",modelValue:P(n),"onUpdate:modelValue":c[0]||(c[0]=u=>Mt(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),jk=Ze({name:"ProcessExpressionDialog",__name:"ProcessExpressionDialog",emits:["success"],setup(e,{expose:t,emit:n}){const i=G(!1),r=G(!0),o=G([]),a=G(0),c=Fl({pageNo:1,pageSize:10,type:"",status:Uh.ENABLE});t({open:p=>{c.pageNo=1,c.type=p,l(),i.value=!0}});const l=async()=>{r.value=!0;try{const p=await qx.getProcessExpressionPage(c);o.value=p.list,a.value=p.total}finally{r.value=!1}},u=n;return(p,h)=>{const v=Rr,f=kn,y=Nr,g=Gh,x=zh,E=jl,_=Vh;return X(),ue(E,{title:"\u8BF7\u9009\u62E9\u8868\u8FBE\u5F0F",modelValue:P(i),"onUpdate:modelValue":h[2]||(h[2]=w=>Mt(i)?i.value=w:null),width:"1024px"},{default:j(()=>[M(x,null,{default:j(()=>[Xi((X(),ue(y,{data:P(o),stripe:!0,"show-overflow-tooltip":!0},{default:j(()=>[M(v,{label:"\u540D\u5B57",align:"center",prop:"name"}),M(v,{label:"\u8868\u8FBE\u5F0F",align:"center",prop:"expression"}),M(v,{label:"\u64CD\u4F5C",align:"center"},{default:j(w=>[M(f,{link:"",type:"primary",onClick:S=>(async D=>{i.value=!1,u("select",D)})(w.row)},{default:j(()=>[ve(" \u9009\u62E9 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[_,P(r)]]),M(g,{total:P(a),page:P(c).pageNo,"onUpdate:page":h[0]||(h[0]=w=>P(c).pageNo=w),limit:P(c).pageSize,"onUpdate:limit":h[1]||(h[1]=w=>P(c).pageSize=w),onPagination:l},null,8,["total","page","limit"])]),_:1})]),_:1},8,["modelValue"])}}}),Lk=Ze({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(e){const t=e,n=G({candidateStrategy:void 0,candidateParam:[]}),i=G(),r=()=>window==null?void 0:window.bpmnInstances,o=G([]),a=G(),c=G([]),l=G([]),u=G([]),p=()=>{n.value.candidateParam=[],h()},h=()=>{r().modeling.updateProperties(Be(i.value),{candidateStrategy:n.value.candidateStrategy,candidateParam:n.value.candidateParam.join(",")})},v=G(),f=async()=>{v.value.open()},y=g=>{n.value.candidateParam=[g.expression],h()};return nt(()=>t.id,()=>{i.value=r().bpmnElement,Rt(()=>{(()=>{const g=i.value.businessObject;g&&(g.candidateStrategy!=null?n.value.candidateStrategy=parseInt(g.candidateStrategy):n.value.candidateStrategy=void 0,g.candidateParam&&g.candidateParam.length>0?n.value.candidateStrategy===60?n.value.candidateParam=[g.candidateParam]:n.value.candidateParam=g.candidateParam.split(",").map(x=>+x):n.value.candidateParam=[])})()})},{immediate:!0}),Pr(async()=>{o.value=await $x();const g=await zx();a.value=Vx(g,"id"),c.value=await Gx(),l.value=await Ux(),u.value=await Hx()}),An(()=>{i.value=null}),(g,x)=>{const E=hi,_=mi,w=Yt,S=Lx,D=hn,s=kn,d=dn;return X(),ue(d,{"label-width":"100px"},{default:j(()=>[M(w,{label:"\u89C4\u5219\u7C7B\u578B",prop:"candidateStrategy"},{default:j(()=>[M(_,{modelValue:P(n).candidateStrategy,"onUpdate:modelValue":x[0]||(x[0]=m=>P(n).candidateStrategy=m),clearable:"",style:{width:"100%"},onChange:p},{default:j(()=>[(X(!0),Ae(st,null,Xt(P($l)(P(Po).BPM_TASK_CANDIDATE_STRATEGY),m=>(X(),ue(E,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(n).candidateStrategy==10?(X(),ue(w,{key:0,label:"\u6307\u5B9A\u89D2\u8272",prop:"candidateParam"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[1]||(x[1]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(o),m=>(X(),ue(E,{key:m.id,label:m.name,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy==20||P(n).candidateStrategy==21?(X(),ue(w,{key:1,label:"\u6307\u5B9A\u90E8\u95E8",prop:"candidateParam",span:"24"},{default:j(()=>[M(S,{ref:"treeRef",modelValue:P(n).candidateParam,"onUpdate:modelValue":x[2]||(x[2]=m=>P(n).candidateParam=m),data:P(a),props:P(Fx),"empty-text":"\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E",multiple:"","node-key":"id","show-checkbox":"",onChange:h},null,8,["modelValue","data","props"])]),_:1})):we("",!0),P(n).candidateStrategy==22?(X(),ue(w,{key:2,label:"\u6307\u5B9A\u5C97\u4F4D",prop:"candidateParam",span:"24"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[3]||(x[3]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(c),m=>(X(),ue(E,{key:m.id,label:m.name,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy==30?(X(),ue(w,{key:3,label:"\u6307\u5B9A\u7528\u6237",prop:"candidateParam",span:"24"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[4]||(x[4]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(l),m=>(X(),ue(E,{key:m.id,label:m.nickname,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy===40?(X(),ue(w,{key:4,label:"\u6307\u5B9A\u7528\u6237\u7EC4",prop:"candidateParam"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[5]||(x[5]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(u),m=>(X(),ue(E,{key:m.id,label:m.name,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy===60?(X(),ue(w,{key:5,label:"\u6D41\u7A0B\u8868\u8FBE\u5F0F",prop:"candidateParam"},{default:j(()=>[M(D,{type:"textarea",modelValue:P(n).candidateParam[0],"onUpdate:modelValue":x[6]||(x[6]=m=>P(n).candidateParam[0]=m),clearable:"",style:{width:"72%"},onChange:h},null,8,["modelValue"]),M(s,{class:"ml-5px",size:"small",type:"success",onClick:f},{default:j(()=>[ve("\u9009\u62E9\u8868\u8FBE\u5F0F")]),_:1}),M(jk,{ref_key:"processExpressionDialogRef",ref:v,onSelect:y},null,512)]),_:1})):we("",!0)]),_:1})}}}),Vk={style:{"margin-top":"16px"}},Fk=Ze({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(e){const t=e,n=G({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=G({}),r=G(),o=()=>window==null?void 0:window.bpmnInstances,a=()=>{let c=Object.create(null);c.scriptFormat=i.value.scriptFormat||null,c.resultVariable=i.value.resultVariable||null,i.value.scriptType==="inline"?(c.script=i.value.script||null,c.resource=null):(c.resource=i.value.resource||null,c.script=null),o().modeling.updateProperties(Be(r.value),c)};return An(()=>{r.value=null}),nt(()=>t.id,()=>{r.value=o().bpmnElement,Rt(()=>{(()=>{var c;for(let l in n.value){let u=((c=r.value)==null?void 0:c.businessObject[l])||n.value[l];i.value[l]=u}i.value.scriptType=i.value.script?"inline":"external"})()})},{immediate:!0}),(c,l)=>{const u=hn,p=Yt,h=hi,v=mi;return X(),Ae("div",Vk,[M(p,{label:"\u811A\u672C\u683C\u5F0F"},{default:j(()=>[M(u,{modelValue:P(i).scriptFormat,"onUpdate:modelValue":l[0]||(l[0]=f=>P(i).scriptFormat=f),clearable:"",onInput:l[1]||(l[1]=f=>a()),onChange:l[2]||(l[2]=f=>a())},null,8,["modelValue"])]),_:1}),M(p,{label:"\u811A\u672C\u7C7B\u578B"},{default:j(()=>[M(v,{modelValue:P(i).scriptType,"onUpdate:modelValue":l[3]||(l[3]=f=>P(i).scriptType=f)},{default:j(()=>[M(h,{label:"\u5185\u8054\u811A\u672C",value:"inline"}),M(h,{label:"\u5916\u90E8\u8D44\u6E90",value:"external"})]),_:1},8,["modelValue"])]),_:1}),Xi(M(p,{label:"\u811A\u672C"},{default:j(()=>[M(u,{modelValue:P(i).script,"onUpdate:modelValue":l[4]||(l[4]=f=>P(i).script=f),type:"textarea",resize:"vertical",autosize:{minRows:2,maxRows:4},clearable:"",onInput:l[5]||(l[5]=f=>a()),onChange:l[6]||(l[6]=f=>a())},null,8,["modelValue"])]),_:1},512),[[es,P(i).scriptType==="inline"]]),Xi(M(p,{label:"\u8D44\u6E90\u5730\u5740"},{default:j(()=>[M(u,{modelValue:P(i).resource,"onUpdate:modelValue":l[7]||(l[7]=f=>P(i).resource=f),clearable:"",onInput:l[8]||(l[8]=f=>a()),onChange:l[9]||(l[9]=f=>a())},null,8,["modelValue"])]),_:1},512),[[es,P(i).scriptType==="external"]]),M(p,{label:"\u7ED3\u679C\u53D8\u91CF"},{default:j(()=>[M(u,{modelValue:P(i).resultVariable,"onUpdate:modelValue":l[10]||(l[10]=f=>P(i).resultVariable=f),clearable:"",onInput:l[11]||(l[11]=f=>a()),onChange:l[12]||(l[12]=f=>a())},null,8,["modelValue"])]),_:1})])}}}),$k={style:{"margin-top":"16px"}},zk={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},Gk=Ze({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(e){const t=e,n=Fh(),i=G(""),r=G({}),o=G({}),a=G(!1),c=G(),l=G(),u=G(),p=()=>window.bpmnInstances,h=()=>{a.value=!0,r.value={}},v=()=>{if(o.value[r.value.id])return void n.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const y=p().moddle.create("bpmn:Message",r.value);u.value.push(y),o.value[r.value.id]=r.value.name,l.value[r.value.id]=y,a.value=!1},f=y=>{y==="-1"?p().modeling.updateProperties(Be(c.value),{messageRef:null}):p().modeling.updateProperties(Be(c.value),{messageRef:l.value[y]})};return Pr(()=>{l.value=Object.create(null),u.value=p().modeler.getDefinitions().rootElements,u.value.filter(y=>y.$type==="bpmn:Message").forEach(y=>{l.value[y.id]=y,o.value[y.id]=y.name}),o.value[-1]="\u65E0"}),An(()=>{c.value=null}),nt(()=>t.id,()=>{Rt(()=>{var y,g;c.value=p().bpmnElement,i.value=((g=(y=c.value.businessObject)==null?void 0:y.messageRef)==null?void 0:g.id)||"-1"})},{immediate:!0}),(y,g)=>{const x=hi,E=mi,_=Ir,w=Yt,S=hn,D=dn,s=kn,d=Mo;return X(),Ae("div",$k,[M(w,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:j(()=>[De("div",zk,[M(E,{modelValue:P(i),"onUpdate:modelValue":g[0]||(g[0]=m=>Mt(i)?i.value=m:null),onChange:f},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(o)),m=>(X(),ue(x,{value:m,label:P(o)[m],key:m},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),M(_,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:h})])]),_:1}),M(d,{modelValue:P(a),"onUpdate:modelValue":g[3]||(g[3]=m=>Mt(a)?a.value=m:null),"close-on-click-modal":!1,title:"\u521B\u5EFA\u65B0\u6D88\u606F",width:"400px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(s,{size:"small",type:"primary",onClick:v},{default:j(()=>[ve("\u786E \u8BA4")]),_:1})]),default:j(()=>[M(D,{model:P(r),size:"small","label-width":"90px"},{default:j(()=>[M(w,{label:"\u6D88\u606FID"},{default:j(()=>[M(S,{modelValue:P(r).id,"onUpdate:modelValue":g[1]||(g[1]=m=>P(r).id=m),clearable:""},null,8,["modelValue"])]),_:1}),M(w,{label:"\u6D88\u606F\u540D\u79F0"},{default:j(()=>[M(S,{modelValue:P(r).name,"onUpdate:modelValue":g[2]||(g[2]=m=>P(r).name=m),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),Uk={class:"panel-tab__content"},Hk=Ze({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(e){const t=e,n=G({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=G(),r=G({UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}),o=G(),a=()=>window.bpmnInstances,c=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),a().modeling.updateProperties(a().bpmnElement,{...n.value})};return nt(()=>t.id,()=>{var l,u,p,h,v,f;o.value=a().bpmnElement,n.value.asyncBefore=(u=(l=o.value)==null?void 0:l.businessObject)==null?void 0:u.asyncBefore,n.value.asyncAfter=(h=(p=o.value)==null?void 0:p.businessObject)==null?void 0:h.asyncAfter,n.value.exclusive=(f=(v=o.value)==null?void 0:v.businessObject)==null?void 0:f.exclusive},{immediate:!0}),nt(()=>t.type,()=>{t.type==r.value.UserTask&&(i.value=Lk),t.type==r.value.ScriptTask&&(i.value=Fk),t.type==r.value.ReceiveTask&&(i.value=Gk)},{immediate:!0}),(l,u)=>{const p=$h,h=Yt,v=dn;return X(),Ae("div",Uk,[M(v,{size:"small","label-width":"90px"},{default:j(()=>[M(h,{label:"\u5F02\u6B65\u5EF6\u7EED",style:{display:"none"}},{default:j(()=>[M(p,{modelValue:P(n).asyncBefore,"onUpdate:modelValue":u[0]||(u[0]=f=>P(n).asyncBefore=f),label:"\u5F02\u6B65\u524D",onChange:c},null,8,["modelValue"]),M(p,{modelValue:P(n).asyncAfter,"onUpdate:modelValue":u[1]||(u[1]=f=>P(n).asyncAfter=f),label:"\u5F02\u6B65\u540E",onChange:c},null,8,["modelValue"]),P(n).asyncAfter||P(n).asyncBefore?(X(),ue(p,{key:0,modelValue:P(n).exclusive,"onUpdate:modelValue":u[2]||(u[2]=f=>P(n).exclusive=f),label:"\u6392\u9664",onChange:c},null,8,["modelValue"])):we("",!0)]),_:1}),(X(),ue(Ix(P(i)),Rx(Nx(l.$props)),null,16))]),_:1})])}}}),qk={class:"panel-tab__content"},Wk=Ze({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String},setup(e){const t=e,n=Hn("prefix"),i=G(""),r=G({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1}),o=G({}),a=G(null),c=G(null),l=()=>window==null?void 0:window.bpmnInstances,u=x=>{if(x!=="Null"){if(x==="StandardLoop"){const E=l().moddle.create("bpmn:StandardLoopCharacteristics");return l().modeling.updateProperties(Be(a.value),{loopCharacteristics:E}),void(c.value=null)}c.value=x==="SequentialMultiInstance"?l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!0}):l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{collection:"${coll_userList}"}),l().modeling.updateProperties(Be(a.value),{loopCharacteristics:Be(c.value)})}else l().modeling.updateProperties(Be(a.value),{loopCharacteristics:null})},p=x=>{let E=null;x&&x.length&&(E=l().moddle.create("bpmn:FormalExpression",{body:x})),l().modeling.updateModdleProperties(Be(a.value),c.value,{loopCardinality:E})},h=x=>{let E=null;x&&x.length&&(E=l().moddle.create("bpmn:FormalExpression",{body:x})),l().modeling.updateModdleProperties(Be(a.value),c.value,{completionCondition:E})},v=x=>{const E=l().moddle.create("bpmn:ExtensionElements",{values:[l().moddle.create(`${n}:FailedJobRetryTimeCycle`,{body:x})]});l().modeling.updateModdleProperties(Be(a.value),c.value,{extensionElements:E})},f=()=>{l().modeling.updateModdleProperties(Be(a.value),c.value,{collection:o.value.collection||null,elementVariable:o.value.elementVariable||null})},y=x=>{const{asyncBefore:E,asyncAfter:_}=o.value;let w=Object.create(null);E||_?w[x]=o.value[x]:(o.value.exclusive=!1,w={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),l().modeling.updateModdleProperties(Be(a.value),c.value,w)},g=x=>{x==="\u4F9D\u6B21\u5BA1\u6279"?(u("SequentialMultiInstance"),p("1"),h("${ nrOfCompletedInstances >= nrOfInstances }")):x==="\u4F1A\u7B7E"?(u("ParallelMultiInstance"),h("${ nrOfCompletedInstances >= nrOfInstances }")):x==="\u6216\u7B7E"&&(u("ParallelMultiInstance"),h("${ nrOfCompletedInstances > 0 }"))};return An(()=>{c.value=null,a.value=null}),nt(()=>t.businessObject,x=>{var _,w,S,D;var E;a.value=l().bpmnElement,(E=x).loopCharacteristics?E.loopCharacteristics.$type==="bpmn:StandardLoopCharacteristics"?(i.value="StandardLoop",o.value={}):(E.loopCharacteristics.isSequential?i.value="SequentialMultiInstance":i.value="ParallelMultiInstance",o.value={...r.value,...E.loopCharacteristics,completionCondition:((w=(_=E.loopCharacteristics)==null?void 0:_.completionCondition)==null?void 0:w.body)??"",loopCardinality:((D=(S=E.loopCharacteristics)==null?void 0:S.loopCardinality)==null?void 0:D.body)??""},c.value=l().bpmnElement.businessObject.loopCharacteristics,E.loopCharacteristics.extensionElements&&E.loopCharacteristics.extensionElements.values&&E.loopCharacteristics.extensionElements.values.length&&(o.value.timeCycle=E.loopCharacteristics.extensionElements.values[0].body)):(i.value="Null",o.value={})},{immediate:!0}),(x,E)=>{const _=kn,w=Yt,S=hi,D=mi,s=hn,d=$h,m=dn;return X(),Ae("div",qk,[M(m,{"label-width":"90px"},{default:j(()=>[M(w,{label:"\u5FEB\u6377\u914D\u7F6E"},{default:j(()=>[M(_,{size:"small",onClick:E[0]||(E[0]=C=>g("\u4F9D\u6B21\u5BA1\u6279"))},{default:j(()=>[ve("\u4F9D\u6B21\u5BA1\u6279")]),_:1}),M(_,{size:"small",onClick:E[1]||(E[1]=C=>g("\u4F1A\u7B7E"))},{default:j(()=>[ve("\u4F1A\u7B7E")]),_:1}),M(_,{size:"small",onClick:E[2]||(E[2]=C=>g("\u6216\u7B7E"))},{default:j(()=>[ve("\u6216\u7B7E")]),_:1})]),_:1}),M(w,{label:"\u4F1A\u7B7E\u7C7B\u578B"},{default:j(()=>[M(D,{modelValue:P(i),"onUpdate:modelValue":E[3]||(E[3]=C=>Mt(i)?i.value=C:null),onChange:u},{default:j(()=>[M(S,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),M(S,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),M(S,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),P(i)==="ParallelMultiInstance"||P(i)==="SequentialMultiInstance"?(X(),Ae(st,{key:0},[M(w,{label:"\u5FAA\u73AF\u6570\u91CF",key:"loopCardinality"},{default:j(()=>[M(s,{modelValue:P(o).loopCardinality,"onUpdate:modelValue":E[4]||(E[4]=C=>P(o).loopCardinality=C),clearable:"",onChange:p},null,8,["modelValue"])]),_:1}),Xi(M(w,{label:"\u96C6\u5408",key:"collection"},{default:j(()=>[M(s,{modelValue:P(o).collection,"onUpdate:modelValue":E[5]||(E[5]=C=>P(o).collection=C),clearable:"",onChange:f},null,8,["modelValue"])]),_:1},512),[[es,!1]]),M(w,{label:"\u5143\u7D20\u53D8\u91CF",key:"elementVariable",style:{display:"none"}},{default:j(()=>[M(s,{modelValue:P(o).elementVariable,"onUpdate:modelValue":E[6]||(E[6]=C=>P(o).elementVariable=C),clearable:"",onChange:f},null,8,["modelValue"])]),_:1}),M(w,{label:"\u5B8C\u6210\u6761\u4EF6",key:"completionCondition"},{default:j(()=>[M(s,{modelValue:P(o).completionCondition,"onUpdate:modelValue":E[7]||(E[7]=C=>P(o).completionCondition=C),clearable:"",onChange:h},null,8,["modelValue"])]),_:1}),M(w,{label:"\u5F02\u6B65\u72B6\u6001",key:"async",style:{display:"none"}},{default:j(()=>[M(d,{modelValue:P(o).asyncBefore,"onUpdate:modelValue":E[8]||(E[8]=C=>P(o).asyncBefore=C),label:"\u5F02\u6B65\u524D",onChange:E[9]||(E[9]=C=>y("asyncBefore"))},null,8,["modelValue"]),M(d,{modelValue:P(o).asyncAfter,"onUpdate:modelValue":E[10]||(E[10]=C=>P(o).asyncAfter=C),label:"\u5F02\u6B65\u540E",onChange:E[11]||(E[11]=C=>y("asyncAfter"))},null,8,["modelValue"]),P(o).asyncAfter||P(o).asyncBefore?(X(),ue(d,{key:0,modelValue:P(o).exclusive,"onUpdate:modelValue":E[12]||(E[12]=C=>P(o).exclusive=C),label:"\u6392\u9664",onChange:E[13]||(E[13]=C=>y("exclusive"))},null,8,["modelValue"])):we("",!0)]),_:1}),P(o).asyncAfter||P(o).asyncBefore?(X(),ue(w,{label:"\u91CD\u8BD5\u5468\u671F",prop:"timeCycle",key:"timeCycle"},{default:j(()=>[M(s,{modelValue:P(o).timeCycle,"onUpdate:modelValue":E[14]||(E[14]=C=>P(o).timeCycle=C),clearable:"",onChange:v},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1})])}}}),Kk={class:"panel-tab__content"},Xk=Ze({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(e){const t=e,n=G({}),i=G(),r=G(),o=G(),a=G(),c=()=>window==null?void 0:window.bpmnInstances,l=p=>p==="condition"?(a.value=c().moddle.create("bpmn:FormalExpression"),void c().modeling.updateProperties(Be(i.value),{conditionExpression:a.value})):p==="default"?(c().modeling.updateProperties(Be(i.value),{conditionExpression:null}),void c().modeling.updateProperties(Be(r.value),{default:Be(i.value)})):(o.value.default&&o.value.default.id===i.value.id&&c().modeling.updateProperties(Be(r.value),{default:null}),void c().modeling.updateProperties(Be(i.value),{conditionExpression:null})),u=()=>{let p,{conditionType:h,scriptType:v,body:f,resource:y,language:g}=n.value;h==="expression"?p=c().moddle.create("bpmn:FormalExpression",{body:f}):v==="inlineScript"?(p=c().moddle.create("bpmn:FormalExpression",{body:f,language:g}),n.value.resource=""):(n.value.body="",p=c().moddle.create("bpmn:FormalExpression",{resource:y,language:g})),c().modeling.updateProperties(Be(i.value),{conditionExpression:p})};return An(()=>{i.value=null,r.value=null,o.value=null}),nt(()=>t.businessObject,p=>{console.log(p,"val"),Rt(()=>{(()=>{if(i.value=c().bpmnElement,r.value=i.value.source,o.value=i.value.businessObject.sourceRef,n.value={type:"default"},o.value&&o.value.default&&o.value.default.id===i.value.id)n.value={type:"default"};else if(i.value.businessObject.conditionExpression){const h=i.value.businessObject.conditionExpression;if(n.value={...h,type:"condition"},n.value.resource)return n.value.conditionType="script",void(n.value.scriptType="externalScript");if(h.language)return n.value.conditionType="script",void(n.value.scriptType="inlineScript");n.value.conditionType="expression"}else n.value={type:"normal"}})()})},{immediate:!0}),(p,h)=>{const v=hi,f=mi,y=Yt,g=hn,x=dn;return X(),Ae("div",Kk,[M(x,{model:P(n),"label-width":"90px",size:"small"},{default:j(()=>[M(y,{label:"\u6D41\u8F6C\u7C7B\u578B"},{default:j(()=>[M(f,{modelValue:P(n).type,"onUpdate:modelValue":h[0]||(h[0]=E=>P(n).type=E),onChange:l},{default:j(()=>[M(v,{label:"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",value:"normal"}),M(v,{label:"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84",value:"default"}),M(v,{label:"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84",value:"condition"})]),_:1},8,["modelValue"])]),_:1}),P(n).type==="condition"?(X(),ue(y,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:j(()=>[M(f,{modelValue:P(n).conditionType,"onUpdate:modelValue":h[1]||(h[1]=E=>P(n).conditionType=E)},{default:j(()=>[M(v,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),M(v,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).conditionType&&P(n).conditionType==="expression"?(X(),ue(y,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:j(()=>[M(g,{modelValue:P(n).body,"onUpdate:modelValue":h[2]||(h[2]=E=>P(n).body=E),style:{width:"192px"},clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):we("",!0),P(n).conditionType&&P(n).conditionType==="script"?(X(),Ae(st,{key:2},[M(y,{label:"\u811A\u672C\u8BED\u8A00",key:"language"},{default:j(()=>[M(g,{modelValue:P(n).language,"onUpdate:modelValue":h[3]||(h[3]=E=>P(n).language=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),M(y,{label:"\u811A\u672C\u7C7B\u578B",key:"scriptType"},{default:j(()=>[M(f,{modelValue:P(n).scriptType,"onUpdate:modelValue":h[4]||(h[4]=E=>P(n).scriptType=E)},{default:j(()=>[M(v,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),M(v,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),P(n).scriptType==="inlineScript"?(X(),ue(y,{label:"\u811A\u672C",key:"body"},{default:j(()=>[M(g,{modelValue:P(n).body,"onUpdate:modelValue":h[5]||(h[5]=E=>P(n).body=E),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):we("",!0),P(n).scriptType==="externalScript"?(X(),ue(y,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:j(()=>[M(g,{modelValue:P(n).resource,"onUpdate:modelValue":h[6]||(h[6]=E=>P(n).resource=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1},8,["model"])])}}}),Yk={class:"panel-tab__content"},Jk={class:"panel-tab__content--title"},Zk={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},Qk=Ze({name:"SignalAndMassage",__name:"SignalAndMessage",setup(e){const t=Fh(),n=G([]),i=G([]),r=G(!1),o=G(""),a=G({}),c=G(),l=G(),u=G(),p=Ot(()=>o.value==="message"?{title:"\u521B\u5EFA\u6D88\u606F",idLabel:"\u6D88\u606FID",nameLabel:"\u6D88\u606F\u540D\u79F0"}:{title:"\u521B\u5EFA\u4FE1\u53F7",idLabel:"\u4FE1\u53F7ID",nameLabel:"\u4FE1\u53F7\u540D\u79F0"}),h=()=>window==null?void 0:window.bpmnInstances,v=()=>{console.log(window,"window"),c.value=h().modeler.getDefinitions().rootElements,l.value={},u.value={},i.value=[],n.value=[],c.value.forEach(g=>{g.$type==="bpmn:Message"&&(l.value[g.id]=!0,i.value.push({...g})),g.$type==="bpmn:Signal"&&(u.value[g.id]=!0,n.value.push({...g}))})},f=g=>{o.value=g,a.value={},r.value=!0},y=()=>{if(o.value==="message"){l.value[a.value.id]&&t.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=h().moddle.create("bpmn:Message",a.value);c.value.push(g)}else{u.value[a.value.id]&&t.error("\u8BE5\u4FE1\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=h().moddle.create("bpmn:Signal",a.value);c.value.push(g)}r.value=!1,v()};return Pr(()=>{v()}),(g,x)=>{const E=ts,_=Ir,w=Rr,S=Nr,D=hn,s=Yt,d=dn,m=kn,C=Mo;return X(),Ae("div",Yk,[De("div",Jk,[De("span",null,[M(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),ve("\u6D88\u606F\u5217\u8868")]),M(_,{type:"primary",title:"\u521B\u5EFA\u65B0\u6D88\u606F",preIcon:"ep:plus",onClick:x[0]||(x[0]=R=>f("message"))})]),M(S,{data:P(i),border:""},{default:j(()=>[M(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),M(w,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),M(w,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),De("div",Zk,[De("span",null,[M(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),ve("\u4FE1\u53F7\u5217\u8868")]),M(_,{type:"primary",title:"\u521B\u5EFA\u65B0\u4FE1\u53F7",preIcon:"ep:plus",onClick:x[1]||(x[1]=R=>f("signal"))})]),M(S,{data:P(n),border:""},{default:j(()=>[M(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),M(w,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),M(w,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),M(C,{modelValue:P(r),"onUpdate:modelValue":x[5]||(x[5]=R=>Mt(r)?r.value=R:null),title:P(p).title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(m,{onClick:x[4]||(x[4]=R=>r.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(m,{type:"primary",onClick:y},{default:j(()=>[ve("\u4FDD \u5B58")]),_:1})]),default:j(()=>[M(d,{model:P(a),"label-width":"90px"},{default:j(()=>[M(s,{label:P(p).idLabel},{default:j(()=>[M(D,{modelValue:P(a).id,"onUpdate:modelValue":x[2]||(x[2]=R=>P(a).id=R),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),M(s,{label:P(p).nameLabel},{default:j(()=>[M(D,{modelValue:P(a).name,"onUpdate:modelValue":x[3]||(x[3]=R=>P(a).name=R),clearable:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}}),_r=()=>window==null?void 0:window.bpmnInstances;function wl(e,t,n){const i=Object.create(null);switch(i.event=e.event,t&&(i.id=e.id),e.listenerType){case"scriptListener":i.script=function(r,o){const{scriptType:a,scriptFormat:c,value:l,resource:u}=r,p=a==="inlineScript"?{scriptFormat:c,value:l}:{scriptFormat:c,resource:u};return _r().moddle.create(`${o}:Script`,p)}(e,n);break;case"expressionListener":i.expression=e.expression;break;case"delegateExpressionListener":i.delegateExpression=e.delegateExpression;break;default:i.class=e.class}if(e.fields&&(i.fields=e.fields.map(r=>function(o,a){const{name:c,fieldType:l,string:u,expression:p}=o,h=l==="string"?{name:c,string:u}:{name:c,expression:p};return _r().moddle.create(`${a}:Field`,h)}(r,n))),t&&e.event==="timeout"&&e.eventDefinitionType){const r=_r().moddle.create("bpmn:FormalExpression",{body:e.eventTimeDefinitions}),o=_r().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${eP(8)}`,[`time${e.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return _r().moddle.create(`${n}:${t?"TaskListener":"ExecutionListener"}`,i)}function Co(e,t){const n=_r().moddle.create("bpmn:ExtensionElements",{values:t});_r().modeling.updateProperties(Be(e),{extensionElements:n})}function eP(e=8,t){let n="";const i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=e;r>0;--r)n+=i[Math.floor(62*Math.random())];return n}function Y0(e){let t={...e};if(e.script&&(t={...e,...e.script,scriptType:e.script.resource?"externalScript":"inlineScript"}),e.event==="timeout"&&e.eventDefinitions&&e.eventDefinitions.length){let n="";for(const i in e.eventDefinitions[0])console.log(e.eventDefinitions,i),i.indexOf("time")!==-1&&(n=i,t.eventDefinitionType=i.replace("time","").toLowerCase());console.log(n),t.eventTimeDefinitions=e.eventDefinitions[0][n].body}return t}function J0(e){let t;return e.class&&(t="classListener"),e.expression&&(t="expressionListener"),e.delegateExpression&&(t="delegateExpressionListener"),e.script&&(t="scriptListener"),{...JSON.parse(JSON.stringify(e)),...e.script??{},listenerType:t}}function Z0(e){if(e.valueType==="class")return{listenerType:"classListener",class:e.value,event:e.event,fields:[]};if(e.valueType==="expression")return{listenerType:"expressionListener",expression:e.value,event:e.event,fields:[]};if(e.valueType==="delegateExpression")return{listenerType:"delegateExpressionListener",delegateExpression:e.value,event:e.event,fields:[]};throw new Error("\u672A\u77E5\u7684\u76D1\u542C\u5668\u7C7B\u578B")}const Q0={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},tP={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},ex={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},tx=Ze({name:"ProcessListenerDialog",__name:"ProcessListenerDialog",emits:["success"],setup(e,{expose:t,emit:n}){const i=G(!1),r=G(!0),o=G([]),a=G(0),c=Fl({pageNo:1,pageSize:10,type:"",status:Uh.ENABLE});t({open:async p=>{c.pageNo=1,c.type=p,l(),i.value=!0}});const l=async()=>{r.value=!0;try{const p=await Kx.getProcessListenerPage(c);o.value=p.list,a.value=p.total}finally{r.value=!1}},u=n;return(p,h)=>{const v=Rr,f=Wx,y=kn,g=Nr,x=Gh,E=zh,_=jl,w=Vh;return X(),ue(_,{title:"\u8BF7\u9009\u62E9\u76D1\u542C\u5668",modelValue:P(i),"onUpdate:modelValue":h[2]||(h[2]=S=>Mt(i)?i.value=S:null),width:"1024px"},{default:j(()=>[M(E,null,{default:j(()=>[Xi((X(),ue(g,{data:P(o),stripe:!0,"show-overflow-tooltip":!0},{default:j(()=>[M(v,{label:"\u540D\u5B57",align:"center",prop:"name"}),M(v,{label:"\u7C7B\u578B",align:"center",prop:"type"},{default:j(S=>[M(f,{type:P(Po).BPM_PROCESS_LISTENER_TYPE,value:S.row.type},null,8,["type","value"])]),_:1}),M(v,{label:"\u4E8B\u4EF6",align:"center",prop:"event"}),M(v,{label:"\u503C\u7C7B\u578B",align:"center",prop:"valueType"},{default:j(S=>[M(f,{type:P(Po).BPM_PROCESS_LISTENER_VALUE_TYPE,value:S.row.valueType},null,8,["type","value"])]),_:1}),M(v,{label:"\u503C",align:"center",prop:"value"}),M(v,{label:"\u64CD\u4F5C",align:"center"},{default:j(S=>[M(y,{link:"",type:"primary",onClick:D=>(async s=>{i.value=!1,u("select",s)})(S.row)},{default:j(()=>[ve(" \u9009\u62E9 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[w,P(r)]]),M(x,{total:P(a),page:P(c).pageNo,"onUpdate:page":h[0]||(h[0]=S=>P(c).pageNo=S),limit:P(c).pageSize,"onUpdate:limit":h[1]||(h[1]=S=>P(c).pageSize=S),onPagination:l},null,8,["total","page","limit"])]),_:1})]),_:1},8,["modelValue"])}}}),nP={class:"panel-tab__content"},iP={class:"element-drawer__button"},rP={class:"listener-filed__title"},oP={class:"element-drawer__button"},aP=Ze({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix"),i=Hn("width"),r=G([]),o=G({}),a=G(!1),c=G([]),l=G({}),u=G(!1),p=G(-1),h=G(-1),v=G(Q0),f=G(ex),y=G(),g=G(),x=G(),E=G(),_=G(),w=()=>{var I,N,L;y.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],x.value=((L=(N=(I=y.value.businessObject)==null?void 0:I.extensionElements)==null?void 0:N.values)==null?void 0:L.filter(T=>T.$type===`${n}:ExecutionListener`))??[],r.value=x.value.map(T=>J0(T))},S=(I,N)=>{I?(o.value=Y0(I),p.value=N):(o.value={},p.value=-1),I&&I.fields?c.value=I.fields.map(L=>({...L,fieldType:L.string?"string":"expression"})):(c.value=[],o.value.fields=[]),a.value=!0,Rt(()=>{E.value&&E.value.clearValidate()})},D=(I,N)=>{l.value=I?JSON.parse(JSON.stringify(I)):{},h.value=I?N:-1,u.value=!0,Rt(()=>{_.value&&_.value.clearValidate()})},s=async()=>{await _.value.validate()&&(h.value===-1?(c.value.push(l.value),o.value.fields.push(l.value)):(c.value.splice(h.value,1,l.value),o.value.fields.splice(h.value,1,l.value)),u.value=!1,Rt(()=>{l.value={}}))},d=async()=>{var N,L,T;if(!await E.value.validate())return;const I=wl(o.value,!1,n);p.value===-1?(x.value.push(I),r.value.push(o.value)):(x.value.splice(p.value,1,I),r.value.splice(p.value,1,o.value)),g.value=((T=(L=(N=y.value.businessObject)==null?void 0:N.extensionElements)==null?void 0:L.values)==null?void 0:T.filter(b=>b.$type!==`${n}:ExecutionListener`))??[],Co(y.value,g.value.concat(x.value)),a.value=!1,o.value={}},m=G(),C=async()=>{m.value.open("execution")},R=I=>{var T,b,B;const N=Z0(I),L=wl(N,!1,n);x.value.push(L),r.value.push(N),g.value=((B=(b=(T=y.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:b.values)==null?void 0:B.filter(V=>V.$type!==`${n}:ExecutionListener`))??[],Co(y.value,g.value.concat(x.value))};return nt(()=>t.id,I=>{I&&I.length&&Rt(()=>{w()})},{immediate:!0}),(I,N)=>{const L=Rr,T=kn,b=zl,B=Nr,V=Ir,H=hi,q=mi,J=Yt,Q=hn,oe=dn,ie=ts,he=Hh,Ne=Mo;return X(),Ae(st,null,[De("div",nP,[M(B,{data:P(r),size:"small",border:""},{default:j(()=>[M(L,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(L,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"100px",prop:"event"}),M(L,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"100px","show-overflow-tooltip":"",formatter:ee=>P(v)[ee.listenerType]},null,8,["formatter"]),M(L,{label:"\u64CD\u4F5C",width:"100px"},{default:j(ee=>[M(T,{size:"small",link:"",onClick:Z=>S(ee.row,ee.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(b,{direction:"vertical"}),M(T,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:Z=>(_e=>{Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{x.value.splice(_e,1),r.value.splice(_e,1),Co(y.value,g.value.concat(x.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(ee.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",iP,[M(V,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",size:"small",onClick:N[0]||(N[0]=ee=>S(null))}),M(V,{type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u76D1\u542C\u5668",size:"small",onClick:C})]),M(he,{modelValue:P(a),"onUpdate:modelValue":N[12]||(N[12]=ee=>Mt(a)?a.value=ee:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${P(i)}px`,"append-to-body":"","destroy-on-close":""},{default:j(()=>[M(oe,{model:P(o),"label-width":"96px",ref_key:"listenerFormRef",ref:E},{default:j(()=>[M(J,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(q,{modelValue:P(o).event,"onUpdate:modelValue":N[1]||(N[1]=ee=>P(o).event=ee)},{default:j(()=>[M(H,{label:"start",value:"start"}),M(H,{label:"end",value:"end"})]),_:1},8,["modelValue"])]),_:1}),M(J,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(q,{modelValue:P(o).listenerType,"onUpdate:modelValue":N[2]||(N[2]=ee=>P(o).listenerType=ee)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(v)),ee=>(X(),ue(H,{key:ee,label:P(v)[ee],value:ee},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(o).listenerType==="classListener"?(X(),ue(J,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(o).class,"onUpdate:modelValue":N[3]||(N[3]=ee=>P(o).class=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).listenerType==="expressionListener"?(X(),ue(J,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(o).expression,"onUpdate:modelValue":N[4]||(N[4]=ee=>P(o).expression=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).listenerType==="delegateExpressionListener"?(X(),ue(J,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(o).delegateExpression,"onUpdate:modelValue":N[5]||(N[5]=ee=>P(o).delegateExpression=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).listenerType==="scriptListener"?(X(),Ae(st,{key:3},[M(J,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:j(()=>[M(Q,{modelValue:P(o).scriptFormat,"onUpdate:modelValue":N[6]||(N[6]=ee=>P(o).scriptFormat=ee),clearable:""},null,8,["modelValue"])]),_:1}),M(J,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:j(()=>[M(q,{modelValue:P(o).scriptType,"onUpdate:modelValue":N[7]||(N[7]=ee=>P(o).scriptType=ee)},{default:j(()=>[M(H,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),M(H,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),P(o).scriptType==="inlineScript"?(X(),ue(J,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:j(()=>[M(Q,{modelValue:P(o).value,"onUpdate:modelValue":N[8]||(N[8]=ee=>P(o).value=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).scriptType==="externalScript"?(X(),ue(J,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:j(()=>[M(Q,{modelValue:P(o).resource,"onUpdate:modelValue":N[9]||(N[9]=ee=>P(o).resource=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1},8,["model"]),M(b),De("p",rP,[De("span",null,[M(ie,{icon:"ep:menu"}),ve("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),M(V,{type:"primary",onClick:N[10]||(N[10]=ee=>D(null)),title:"\u6DFB\u52A0\u5B57\u6BB5"})]),M(B,{data:P(c),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:j(()=>[M(L,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(L,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),M(L,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:ee=>P(f)[ee.fieldType]},null,8,["formatter"]),M(L,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:ee=>ee.string||ee.expression},null,8,["formatter"]),M(L,{label:"\u64CD\u4F5C",width:"130px"},{default:j(ee=>[M(T,{size:"small",link:"",onClick:Z=>D(ee.row,ee.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(b,{direction:"vertical"}),M(T,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:Z=>(_e=>{Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{c.value.splice(_e,1),o.value.fields.splice(_e,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(ee.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",oP,[M(T,{onClick:N[11]||(N[11]=ee=>a.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(T,{type:"primary",onClick:d},{default:j(()=>[ve("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),M(Ne,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:P(u),"onUpdate:modelValue":N[18]||(N[18]=ee=>Mt(u)?u.value=ee:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(T,{size:"small",onClick:N[17]||(N[17]=ee=>u.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(T,{size:"small",type:"primary",onClick:s},{default:j(()=>[ve("\u786E \u5B9A")]),_:1})]),default:j(()=>[M(oe,{model:P(l),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:_,style:{height:"136px"}},{default:j(()=>[M(J,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(l).name,"onUpdate:modelValue":N[13]||(N[13]=ee=>P(l).name=ee),clearable:""},null,8,["modelValue"])]),_:1}),M(J,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(q,{modelValue:P(l).fieldType,"onUpdate:modelValue":N[14]||(N[14]=ee=>P(l).fieldType=ee)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(f)),ee=>(X(),ue(H,{key:ee,label:P(f)[ee],value:ee},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(l).fieldType==="string"?(X(),ue(J,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(l).string,"onUpdate:modelValue":N[15]||(N[15]=ee=>P(l).string=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).fieldType==="expression"?(X(),ue(J,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(l).expression,"onUpdate:modelValue":N[16]||(N[16]=ee=>P(l).expression=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])]),M(tx,{ref_key:"processListenerDialogRef",ref:m,onSelect:R},null,512)],64)}}}),sP={class:"panel-tab__content"},cP={class:"element-drawer__button"},lP=Ze({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix"),i=G([]),r=G({}),o=G(-1),a=G(!1),c=G(),l=G(),u=G(),p=G(),h=G(),v=()=>window==null?void 0:window.bpmnInstances,f=()=>{var E,_;console.log(window,"windowwindowwindowwindowwindowwindowwindow"),c.value=v().bpmnElement,l.value=[],u.value=((_=(E=c.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:_.values.filter(w=>(w.$type!==`${n}:Properties`&&l.value.push(w),w.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((w,S)=>w.concat(S.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},y=(E,_)=>{o.value=_,r.value=_===-1?{}:JSON.parse(JSON.stringify(E)),a.value=!0,Rt(()=>{h.value&&h.value.clearValidate()})},g=()=>{console.log(r.value,"propertyForm.value");const{name:E,value:_}=r.value;if(o.value!==-1)v().modeling.updateModdleProperties(Be(c.value),Be(p.value)[Be(o.value)],{name:E,value:_});else{const w=v().moddle.create(`${n}:Property`,{name:E,value:_}),S=v().moddle.create(`${n}:Properties`,{values:p.value.concat([w])});x(S)}a.value=!1,f()},x=E=>{const _=v().moddle.create("bpmn:ExtensionElements",{values:l.value.concat([E])});v().modeling.updateProperties(Be(c.value),{extensionElements:_})};return nt(()=>t.id,E=>{E&&E&&E.length&&f()},{immediate:!0}),(E,_)=>{const w=Rr,S=kn,D=zl,s=Nr,d=Ir,m=hn,C=Yt,R=dn,I=Mo;return X(),Ae("div",sP,[M(s,{data:P(i),"max-height":"240",fit:"",border:""},{default:j(()=>[M(w,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(w,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),M(w,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),M(w,{label:"\u64CD\u4F5C",width:"110px"},{default:j(N=>[M(S,{link:"",onClick:L=>y(N.row,N.$index),size:"small"},{default:j(()=>[ve(" \u7F16\u8F91 ")]),_:2},1032,["onClick"]),M(D,{direction:"vertical"}),M(S,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:L=>((T,b)=>{console.log(T,"attr"),Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5C5E\u6027\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{i.value.splice(b,1),p.value.splice(b,1);const B=v().moddle.create(`${n}:Properties`,{values:p.value});x(B),f()}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(N.row,N.$index)},{default:j(()=>[ve(" \u79FB\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",cP,[M(d,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:_[0]||(_[0]=N=>y(null,-1))})]),M(I,{modelValue:P(a),"onUpdate:modelValue":_[4]||(_[4]=N=>Mt(a)?a.value=N:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(S,{onClick:_[3]||(_[3]=N=>a.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(S,{type:"primary",onClick:g},{default:j(()=>[ve("\u786E \u5B9A")]),_:1})]),default:j(()=>[M(R,{model:P(r),"label-width":"80px",ref_key:"attributeFormRef",ref:h},{default:j(()=>[M(C,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:j(()=>[M(m,{modelValue:P(r).name,"onUpdate:modelValue":_[1]||(_[1]=N=>P(r).name=N),clearable:""},null,8,["modelValue"])]),_:1}),M(C,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:j(()=>[M(m,{modelValue:P(r).value,"onUpdate:modelValue":_[2]||(_[2]=N=>P(r).value=N),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),uP={class:"panel-tab__content"},pP={class:"element-drawer__button"},dP={class:"listener-filed__title"},hP={class:"element-drawer__button"},mP=Ze({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix"),i=Hn("width"),r=G([]),o=G(tP),a=G(Q0),c=G(!1),l=G({}),u=G(ex),p=G([]),h=G(!1),v=G(-1),f=G(-1),y=G({}),g=G(),x=G(),E=G(),_=G(),w=G(),S=()=>window==null?void 0:window.bpmnInstances,D=(N,L)=>{N?(l.value=Y0(N),v.value=L):(l.value={},v.value=-1),N&&N.fields?p.value=N.fields.map(T=>({...T,fieldType:T.string?"string":"expression"})):(p.value=[],l.value.fields=[]),c.value=!0,Rt(()=>{_.value&&_.value.clearValidate()})},s=async()=>{var L,T,b;if(!await _.value.validate())return;const N=wl(l.value,!0,n);v.value===-1?(x.value.push(N),r.value.push(l.value)):(x.value.splice(v.value,1,N),r.value.splice(v.value,1,l.value)),E.value=((b=(T=(L=g.value.businessObject)==null?void 0:L.extensionElements)==null?void 0:T.values)==null?void 0:b.filter(B=>B.$type!==`${n}:TaskListener`))??[],Co(g.value,E.value.concat(x.value)),c.value=!1,l.value={}},d=(N,L)=>{y.value=N?JSON.parse(JSON.stringify(N)):{},f.value=N?L:-1,h.value=!0,Rt(()=>{w.value&&w.value.clearValidate()})},m=async()=>{await w.value.validate()&&(f.value===-1?(p.value.push(y.value),l.value.fields.push(y.value)):(p.value.splice(f.value,1,y.value),l.value.fields.splice(f.value,1,y.value)),h.value=!1,Rt(()=>{y.value={}}))},C=G(),R=async()=>{C.value.open("task")},I=N=>{var b,B,V;const L=Z0(N),T=wl(L,!0,n);x.value.push(T),r.value.push(L),E.value=((V=(B=(b=g.value.businessObject)==null?void 0:b.extensionElements)==null?void 0:B.values)==null?void 0:V.filter(H=>H.$type!==`${n}:TaskListener`))??[],Co(g.value,E.value.concat(x.value))};return nt(()=>t.id,N=>{N&&N.length&&Rt(()=>{var L,T;console.log(S().bpmnElement,"window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement"),g.value=S().bpmnElement,E.value=[],x.value=((T=(L=g.value.businessObject)==null?void 0:L.extensionElements)==null?void 0:T.values.filter(b=>b.$type===`${n}:TaskListener`))??[],r.value=x.value.map(b=>J0(b))})},{immediate:!0}),(N,L)=>{const T=Rr,b=kn,B=zl,V=Nr,H=Ir,q=hi,J=mi,Q=Yt,oe=hn,ie=dn,he=ts,Ne=Hh,ee=Mo;return X(),Ae(st,null,[De("div",uP,[M(V,{data:P(r),size:"small",border:""},{default:j(()=>[M(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(T,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:Z=>P(o)[Z.event]},null,8,["formatter"]),M(T,{label:"\u4E8B\u4EF6id","min-width":"80px",prop:"id","show-overflow-tooltip":""}),M(T,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:Z=>P(a)[Z.listenerType]},null,8,["formatter"]),M(T,{label:"\u64CD\u4F5C",width:"90px"},{default:j(Z=>[M(b,{size:"small",link:"",onClick:_e=>D(Z.row,Z.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(B,{direction:"vertical"}),M(b,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:_e=>((Ve,ye)=>{console.log(Ve,"listener"),Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{x.value.splice(ye,1),r.value.splice(ye,1),Co(g.value,E.value.concat(x.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(Z.row,Z.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",pP,[M(H,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:L[0]||(L[0]=Z=>D(null))}),M(H,{type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u76D1\u542C\u5668",size:"small",onClick:R})]),M(Ne,{modelValue:P(c),"onUpdate:modelValue":L[15]||(L[15]=Z=>Mt(c)?c.value=Z:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${P(i)}px`,"append-to-body":"","destroy-on-close":""},{default:j(()=>[M(ie,{size:"small",model:P(l),"label-width":"96px",ref_key:"listenerFormRef",ref:_},{default:j(()=>[M(Q,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(J,{modelValue:P(l).event,"onUpdate:modelValue":L[1]||(L[1]=Z=>P(l).event=Z)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(o)),Z=>(X(),ue(q,{key:Z,label:P(o)[Z],value:Z},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),M(Q,{label:"\u76D1\u542C\u5668ID",prop:"id",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).id,"onUpdate:modelValue":L[2]||(L[2]=Z=>P(l).id=Z),clearable:""},null,8,["modelValue"])]),_:1}),M(Q,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(J,{modelValue:P(l).listenerType,"onUpdate:modelValue":L[3]||(L[3]=Z=>P(l).listenerType=Z)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(a)),Z=>(X(),ue(q,{key:Z,label:P(a)[Z],value:Z},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(l).listenerType==="classListener"?(X(),ue(Q,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).class,"onUpdate:modelValue":L[4]||(L[4]=Z=>P(l).class=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).listenerType==="expressionListener"?(X(),ue(Q,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).expression,"onUpdate:modelValue":L[5]||(L[5]=Z=>P(l).expression=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).listenerType==="delegateExpressionListener"?(X(),ue(Q,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).delegateExpression,"onUpdate:modelValue":L[6]||(L[6]=Z=>P(l).delegateExpression=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).listenerType==="scriptListener"?(X(),Ae(st,{key:3},[M(Q,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:j(()=>[M(oe,{modelValue:P(l).scriptFormat,"onUpdate:modelValue":L[7]||(L[7]=Z=>P(l).scriptFormat=Z),clearable:""},null,8,["modelValue"])]),_:1}),M(Q,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:j(()=>[M(J,{modelValue:P(l).scriptType,"onUpdate:modelValue":L[8]||(L[8]=Z=>P(l).scriptType=Z)},{default:j(()=>[M(q,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),M(q,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),P(l).scriptType==="inlineScript"?(X(),ue(Q,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:j(()=>[M(oe,{modelValue:P(l).value,"onUpdate:modelValue":L[9]||(L[9]=Z=>P(l).value=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).scriptType==="externalScript"?(X(),ue(Q,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:j(()=>[M(oe,{modelValue:P(l).resource,"onUpdate:modelValue":L[10]||(L[10]=Z=>P(l).resource=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0),P(l).event==="timeout"?(X(),Ae(st,{key:4},[M(Q,{label:"\u5B9A\u65F6\u5668\u7C7B\u578B",prop:"eventDefinitionType",key:"eventDefinitionType"},{default:j(()=>[M(J,{modelValue:P(l).eventDefinitionType,"onUpdate:modelValue":L[11]||(L[11]=Z=>P(l).eventDefinitionType=Z)},{default:j(()=>[M(q,{label:"\u65E5\u671F",value:"date"}),M(q,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),M(q,{label:"\u5FAA\u73AF",value:"cycle"}),M(q,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),P(l).eventDefinitionType&&P(l).eventDefinitionType!=="null"?(X(),ue(Q,{label:"\u5B9A\u65F6\u5668",prop:"eventTimeDefinitions",key:"eventTimeDefinitions",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u5B9A\u65F6\u5668\u914D\u7F6E"}},{default:j(()=>[M(oe,{modelValue:P(l).eventTimeDefinitions,"onUpdate:modelValue":L[12]||(L[12]=Z=>P(l).eventTimeDefinitions=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1},8,["model"]),M(B),De("p",dP,[De("span",null,[M(he,{icon:"ep:menu"}),ve("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),M(b,{size:"small",type:"primary",onClick:L[13]||(L[13]=Z=>d(null))},{default:j(()=>[ve("\u6DFB\u52A0\u5B57\u6BB5")]),_:1})]),M(V,{data:P(p),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:j(()=>[M(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(T,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),M(T,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:Z=>P(u)[Z.fieldType]},null,8,["formatter"]),M(T,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:Z=>Z.string||Z.expression},null,8,["formatter"]),M(T,{label:"\u64CD\u4F5C",width:"100px"},{default:j(Z=>[M(b,{size:"small",link:"",onClick:_e=>d(Z.row,Z.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(B,{direction:"vertical"}),M(b,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:_e=>((Ve,ye)=>{console.log(Ve,"field"),Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(ye,1),l.value.fields.splice(ye,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(Z.row,Z.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",hP,[M(b,{size:"small",onClick:L[14]||(L[14]=Z=>c.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(b,{size:"small",type:"primary",onClick:s},{default:j(()=>[ve("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),M(ee,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:P(h),"onUpdate:modelValue":L[21]||(L[21]=Z=>Mt(h)?h.value=Z:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(b,{size:"small",onClick:L[20]||(L[20]=Z=>h.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(b,{size:"small",type:"primary",onClick:m},{default:j(()=>[ve("\u786E \u5B9A")]),_:1})]),default:j(()=>[M(ie,{model:P(y),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:w,style:{height:"136px"}},{default:j(()=>[M(Q,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(y).name,"onUpdate:modelValue":L[16]||(L[16]=Z=>P(y).name=Z),clearable:""},null,8,["modelValue"])]),_:1}),M(Q,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(J,{modelValue:P(y).fieldType,"onUpdate:modelValue":L[17]||(L[17]=Z=>P(y).fieldType=Z)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(u)),Z=>(X(),ue(q,{key:Z,label:P(u)[Z],value:Z},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(y).fieldType==="string"?(X(),ue(Q,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(y).string,"onUpdate:modelValue":L[18]||(L[18]=Z=>P(y).string=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(y).fieldType==="expression"?(X(),ue(Q,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(y).expression,"onUpdate:modelValue":L[19]||(L[19]=Z=>P(y).expression=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])]),M(tx,{ref_key:"processListenerDialogRef",ref:C,onSelect:I},null,512)],64)}}}),_l=Ze({name:"MyPropertiesPanel",__name:"PropertiesPanel",props:{bpmnModeler:{type:Object,default:()=>{}},prefix:{type:String,default:"camunda"},width:{type:Number,default:480},idEditDisabled:{type:Boolean,default:!1},model:Object},setup(e){const t=e,n=G("base"),i=G(""),r=G(""),o=G({}),a=G(!1),c=G(!1),l=G();ko("prefix",t.prefix),ko("width",t.width);const u=()=>window==null?void 0:window.bpmnInstances,p=nt(()=>t.bpmnModeler,()=>{if(!t.bpmnModeler)return void console.log("\u7F3A\u5C11props.bpmnModeler");console.log("props.bpmnModeler \u6709\u503C\u4E86\uFF01\uFF01\uFF01"),window.bpmnInstances={modeler:t.bpmnModeler,modeling:t.bpmnModeler.get("modeling"),moddle:t.bpmnModeler.get("moddle"),eventBus:t.bpmnModeler.get("eventBus"),bpmnFactory:t.bpmnModeler.get("bpmnFactory"),elementFactory:t.bpmnModeler.get("elementFactory"),elementRegistry:t.bpmnModeler.get("elementRegistry"),replace:t.bpmnModeler.get("replace"),selection:t.bpmnModeler.get("selection")},console.log(u(),"window.bpmnInstances"),h(),p()},{immediate:!0}),h=()=>{v(null),t.bpmnModeler.on("import.done",f=>{console.log(f,"eeeee"),v(null)}),t.bpmnModeler.on("selection.changed",({newSelection:f})=>{v(f[0]||null)}),t.bpmnModeler.on("element.changed",({element:f})=>{f&&f.id===i.value&&v(f)})},v=f=>{let y=f;y||(y=u().elementRegistry.find(g=>g.type==="bpmn:Process")??u().elementRegistry.find(g=>g.type==="bpmn:Collaboration")),y&&(console.log(` ---------- select element changed: id: ${y.id} type: ${y.businessObject.$type} ---------- `),console.log("businessObject: ",y.businessObject),u().bpmnElement=y,l.value=y,i.value=y.id,r.value=y.type.split(":")[1]||"",o.value=JSON.parse(JSON.stringify(y.businessObject)),a.value=!(r.value!=="SequenceFlow"||!y.source||y.source.type.indexOf("StartEvent")!==-1),c.value=r.value==="UserTask"||r.value==="StartEvent")};return An(()=>{window.bpmnInstances=null,console.log(t,"props1"),console.log(t.bpmnModeler,"props.bpmnModeler1")}),nt(()=>i.value,()=>{n.value="base"}),(f,y)=>{const g=ts,x=aE,E=Ak,_=oE;return X(),Ae("div",{class:"process-panel__container",style:Dx({width:`${e.width}px`})},[M(_,{modelValue:P(n),"onUpdate:modelValue":y[0]||(y[0]=w=>Mt(n)?n.value=w:null)},{default:j(()=>[M(x,{name:"base"},{title:j(()=>[M(g,{icon:"ep:info-filled"}),ve(" \u5E38\u89C4")]),default:j(()=>[M(Rk,{"id-edit-disabled":e.idEditDisabled,"business-object":P(o),type:P(r),model:e.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),P(r)==="Process"?(X(),ue(x,{name:"condition",key:"message"},{title:j(()=>[M(g,{icon:"ep:comment"}),ve("\u6D88\u606F\u4E0E\u4FE1\u53F7")]),default:j(()=>[M(Qk)]),_:1})):we("",!0),P(a)?(X(),ue(x,{name:"condition",key:"condition"},{title:j(()=>[M(g,{icon:"ep:promotion"}),ve("\u6D41\u8F6C\u6761\u4EF6")]),default:j(()=>[M(Xk,{"business-object":P(o),type:P(r)},null,8,["business-object","type"])]),_:1})):we("",!0),P(c)?(X(),ue(x,{name:"condition",key:"form"},{title:j(()=>[M(g,{icon:"ep:list"}),ve("\u8868\u5355")]),default:j(()=>[M(E,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1})):we("",!0),P(r).indexOf("Task")!==-1?(X(),ue(x,{name:"task",key:"task"},{title:j(()=>[M(g,{icon:"ep:checked"}),ve("\u4EFB\u52A1\uFF08\u5BA1\u6279\u4EBA\uFF09")]),default:j(()=>[M(Hk,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1})):we("",!0),P(r).indexOf("Task")!==-1?(X(),ue(x,{name:"multiInstance",key:"multiInstance"},{title:j(()=>[M(g,{icon:"ep:help-filled"}),ve("\u591A\u5B9E\u4F8B\uFF08\u4F1A\u7B7E\u914D\u7F6E\uFF09")]),default:j(()=>[M(Wk,{"business-object":P(o),type:P(r)},null,8,["business-object","type"])]),_:1})):we("",!0),M(x,{name:"listeners",key:"listeners"},{title:j(()=>[M(g,{icon:"ep:bell-filled"}),ve("\u6267\u884C\u76D1\u542C\u5668")]),default:j(()=>[M(aP,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1}),P(r)==="UserTask"?(X(),ue(x,{name:"taskListeners",key:"taskListeners"},{title:j(()=>[M(g,{icon:"ep:bell-filled"}),ve("\u4EFB\u52A1\u76D1\u542C\u5668")]),default:j(()=>[M(mP,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1})):we("",!0),M(x,{name:"extensions",key:"extensions"},{title:j(()=>[M(g,{icon:"ep:circle-plus-filled"}),ve("\u6269\u5C55\u5C5E\u6027")]),default:j(()=>[M(lP,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1}),M(x,{name:"other",key:"other"},{title:j(()=>[M(g,{icon:"ep:promotion"}),ve("\u5176\u4ED6")]),default:j(()=>[M(Ok,{id:P(i)},null,8,["id"])]),_:1})]),_:1},8,["modelValue"])],4)}}});_l.install=function(e){e.component(_l.name,_l)};const fP={class:"my-process-designer"},vP={class:"my-process-designer__container"},Sl=Ze({name:"MyProcessViewer",__name:"ProcessViewer",props:{value:{type:String,default:""},prefix:{type:String,default:"camunda"},activityData:{type:Array,default:()=>[]},processInstanceData:{type:Object,default:()=>{}},taskData:{type:Array,default:()=>[]}},emits:["destroy"],setup(e,{emit:t}){const n=e;ko("configGlobal",n);const i=t;let r;const o=G(""),a=G([]),c=G(void 0),l=G([]),u=G(),p=G(null),h=G(null),v=async w=>{let S=`Process_${new Date().getTime()}`,D=`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,s=w||Wb(S,D,n.prefix);try{let{warnings:d}=await r.importXML(s);d&&d.length&&d.forEach(m=>console.warn(m)),await f(),r.get("canvas").zoom("fit-viewport","auto")}catch(d){console.error(d)}},f=async()=>{var C;const w=a.value;if(w.length===0)return;let S=r.get("canvas"),D=w.find(R=>!R.endTime),s=w[w.length-1],d=!1,m=[];(C=r.getDefinitions().rootElements[0].flowElements)==null||C.forEach(R=>{var N,L,T;let I=w.find(b=>b.key===R.id);if(I){if(R.$type==="bpmn:UserTask"){const b=l.value.find(V=>V.id===I.taskId);if(!b)return;if(d)return void m.push(R.id);if(S.addMarker(R.id,g(b.status)),b.status===1&&(d=!0),b.status!==2)return;const B=x(I);B==null||B.forEach(V=>{let H=w.find(q=>q.key===V.targetRef.id);H?S.addMarker(V.id,H.endTime?"highlight":"highlight-todo"):V.targetRef.$type==="bpmn:ExclusiveGateway"?(S.addMarker(V.id,I.endTime?"highlight":"highlight-todo"),S.addMarker(V.targetRef.id,I.endTime?"highlight":"highlight-todo")):V.targetRef.$type==="bpmn:EndEvent"&&(D||s.key!==R.id||(S.addMarker(V.id,"highlight"),S.addMarker(V.targetRef.id,"highlight")),I.endTime||(S.addMarker(V.id,"highlight-todo"),S.addMarker(V.targetRef.id,"highlight-todo")))})}else if(R.$type==="bpmn:ExclusiveGateway"){let b,B;S.addMarker(R.id,y(I)),(N=R.outgoing)==null||N.forEach(V=>{let H=w.find(q=>q.key===V.targetRef.id);H&&(B&&B.type!=="endEvent"||(b=V,B=H))}),b&&B&&S.addMarker(b.id,y(B))}else if(R.$type==="bpmn:ParallelGateway")S.addMarker(R.id,y(I)),(L=R.outgoing)==null||L.forEach(b=>{const B=w.find(V=>V.key===b.targetRef.id);B&&(S.addMarker(b.id,y(B)),S.addMarker(b.targetRef.id,y(B)))});else if(R.$type==="bpmn:StartEvent")S.addMarker(R.id,"highlight"),(T=R.outgoing)==null||T.forEach(b=>{w.find(B=>B.key===b.targetRef.id)&&(S.addMarker(b.id,"highlight"),S.addMarker(R.id,"highlight"))});else if(R.$type==="bpmn:EndEvent"){if(!c.value||c.value.status===1)return;S.addMarker(R.id,g(c.value.status))}else if(R.$type==="bpmn:ServiceTask"){if(I.startTime>0&&I.endTime===0&&S.addMarker(R.id,g(1)),I.endTime>0){S.addMarker(R.id,g(2));const b=x(I);b==null||b.forEach(B=>{S.addMarker(B.id,g(2))})}}else if(R.$type==="bpmn:SequenceFlow"){let b=w.find(B=>B.key===R.targetRef.id);b&&S.addMarker(R.id,y(b))}}}),Bx(m)||(l.value=l.value.filter(R=>!m.includes(R.taskDefinitionKey)))},y=w=>w.endTime?"highlight":"highlight-todo",g=w=>w===1?"highlight-todo":w===2?"highlight":w===3?"highlight-reject":w===4?"highlight-cancel":w===5?"highlight-return":w===6||w===7||w===0?"highlight-todo":"",x=w=>{if(w.outgoing&&w.outgoing.length>0)return w.outgoing;const S=r.getDefinitions().rootElements[0].flowElements,D=[];return S.forEach(s=>{s.$type==="bpmn:SequenceFlow"&&s.sourceRef.id===w.key&&D.push(s)}),D},E=w=>{var D;w.value=w,!p.value&&(p.value={}),!h.value&&(h.value=r.get("overlays"));const S=a.value.find(s=>s.key===w.value.id);if(S&&!p.value[w.value.id]&&w.value.type!=="bpmn:Process"){let s=`

Elemet id: ${w.value.id}

Elemet type: ${w.value.type}

`;if(w.value.type==="bpmn:StartEvent"&&c.value)s=`

\u53D1\u8D77\u4EBA\uFF1A${c.value.startUser.nickname}

\u90E8\u95E8\uFF1A${c.value.startUser.deptName}

\u521B\u5EFA\u65F6\u95F4\uFF1A${Dr(c.value.createTime)}`;else if(w.value.type==="bpmn:UserTask"){let d=l.value.find(R=>R.id===S.taskId);if(!d)return;let m=$l(Po.BPM_TASK_STATUS),C="";m.forEach(R=>{R.value==d.status&&(C=R.label)}),s=`

\u5BA1\u6279\u4EBA\uFF1A${d.assigneeUser.nickname}

\u90E8\u95E8\uFF1A${d.assigneeUser.deptName}

\u7ED3\u679C\uFF1A${C}

\u521B\u5EFA\u65F6\u95F4\uFF1A${Dr(d.createTime)}

`,d.endTime&&(s+=`

\u7ED3\u675F\u65F6\u95F4\uFF1A${Dr(d.endTime)}

`),d.reason&&(s+=`

\u5BA1\u6279\u5EFA\u8BAE\uFF1A${d.reason}

`)}else if(w.value.type==="bpmn:ServiceTask"&&c.value)S.startTime>0&&(s=`

\u521B\u5EFA\u65F6\u95F4\uFF1A${Dr(S.startTime)}

`),S.endTime>0&&(s+=`

\u7ED3\u675F\u65F6\u95F4\uFF1A${Dr(S.endTime)}

`),console.log(s);else if(w.value.type==="bpmn:EndEvent"&&c.value){let d=$l(Po.BPM_TASK_STATUS),m="";d.forEach(C=>{C.value==c.value.status&&(m=C.label)}),s=`

\u7ED3\u679C\uFF1A${m}

`,c.value.endTime&&(s+=`

\u7ED3\u675F\u65F6\u95F4\uFF1A${Dr(c.value.endTime)}

`)}p.value[w.value.id]=(D=Be(h.value))==null?void 0:D.add(w.value,{position:{left:0,bottom:0},html:`
${s}
`})}},_=w=>{Be(h.value).remove({element:w}),p.value[w.id]=null};return Pr(()=>{o.value=n.value,a.value=n.activityData,r||(r=new Zn({container:u.value,bpmnRenderer:{}})),v(o.value),(()=>{const w=r.get("eventBus");w.on("element.hover",function(S){let D=S?S.element:null;E(D)}),w.on("element.out",function(S){let D=S?S.element:null;_(D)})})()}),An(()=>{r&&r.destroy(),i("destroy",r),r=null}),nt(()=>n.value,w=>{o.value=w,v(o.value)}),nt(()=>n.activityData,w=>{a.value=w,v(o.value)}),nt(()=>n.processInstanceData,w=>{c.value=w,v(o.value)}),nt(()=>n.taskData,w=>{l.value=w,v(o.value)}),(w,S)=>(X(),Ae("div",fP,[De("div",vP,[De("div",{class:"my-process-designer__canvas",style:{height:"760px"},ref_key:"bpmnCanvas",ref:u},null,512)])]))}});Sl.install=function(e){e.component(Sl.name,Sl)};export{Gc as P,El as _,Oe as a,sk as b,A as c,Ft as d,V0 as e,$0 as f,Pi as g,_l as h,Pe as i,Sl as j};