| H A D | bpmn-modeler.production.min.js | 10 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+s+a+"</svg>"}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}};$e.prototype._setDefinitions=function(e){this._definitions=e};$e.prototype.getModules=function(){return this._modules};$e.prototype.clear=function(){this.getDefinitions()&&tr.prototype.clear.call(this)};$e.prototype.destroy=function(){tr.prototype.destroy.call(this),Wt(this._container)};$e.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)};$e.prototype.off=function(e,t){this.get("eventBus").off(e,t)};$e.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=_e(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()};$e.prototype.getDefinitions=function(){return this._definitions};$e.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))};$e.prototype._init=function(e,t,n){let r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,r,i),s=C(Nt(n,["additionalModules"]),{canvas:C({},n.canvas,{container:e}),modules:a});tr.call(this,s),n&&n.container&&this.attachTo(n.container)};$e.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)};$e.prototype._createContainer=function(e){let t=ue('<div class="bjs-container"></div>');return vt(t,{width:mh(e.width),height:mh(e.height),position:e.position}),t};$e.prototype._createModdle=function(e){let t=C({},this._moddleExtensions,e.moddleExtensions);return new ph(t)};$e.prototype._modules=[];function Nc(e,t){return e.warnings=t,e}function YS(e){let n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}var XS={width:"100%",height:"100%",position:"relative"};function mh(e){return e+(ne(e)?"px":"")}function ZS(e,t){return t&&re(e.diagrams,function(n){return n.id===t})||null}function QS(e){let n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Xl+"</a>",r=ue(n);vt(_e("svg",r),Zl),vt(r,Ql,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),se.bind(r,"click",function(i){dh(),i.preventDefault()})}function Ai(e){$e.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)}B(Ai,$e);Ai.prototype._createModdle=function(e){var t=$e.prototype._createModdle.call(this,e);return t.ids=new En([32,36,1]),t};Ai.prototype._collectIds=function(e,t){var n=e.$model,r=n.ids,i;r.clear();for(i in t)r.claim(i,t[i])};N();N();function ie(e,t){return h(e,"bpmn:CallActivity")?!1:h(e,"bpmn:SubProcess")?(t=t||ce(e),t&&h(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):h(e,"bpmn:Participant")?!!j(e).processRef:!0}function Me(e){if(!(!h(e,"bpmn:Participant")&&!h(e,"bpmn:Lane"))){var t=ce(e).isHorizontal;return t===void 0?!0:t}}function hh(e){return e&&j(e).isInterrupting!==!1}function Qe(e){return e&&!!j(e).triggeredByEvent}function Er(e,t){var n=j(e).eventDefinitions;return Lt(n,function(r){return h(r,t)})}function vh(e){return Er(e,"bpmn:ErrorEventDefinition")}function gh(e){return Er(e,"bpmn:EscalationEventDefinition")}function yh(e){return Er(e,"bpmn:CompensateEventDefinition")}N();var ir={width:90,height:20},_h=15;function mn(e){return h(e,"bpmn:Event")||h(e,"bpmn:Gateway")||h(e,"bpmn:DataStoreReference")||h(e,"bpmn:DataObjectReference")||h(e,"bpmn:DataInput")||h(e,"bpmn:DataOutput")||h(e,"bpmn:SequenceFlow")||h(e,"bpmn:MessageFlow")||h(e,"bpmn:Group")}function Xr(e){return ee(e.label)}function JS(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=e1(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o)<Math.PI/2?s-=_h:a+=_h,{x:a,y:s}}function e1(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}}function La(e){return e.waypoints?JS(e.waypoints):h(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+ir.height/2}:{x:e.x+e.width/2,y:e.y+e.height+ir.height/2}}function bh(e,t){var n,r,i,o=e.label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(ir.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=La(t),r=ir),C({x:n.x-r.width/2,y:n.y-r.height/2},r)}function xh(e){if(h(e,"bpmn:FlowElement")||h(e,"bpmn:Participant")||h(e,"bpmn:Lane")||h(e,"bpmn:SequenceFlow")||h(e,"bpmn:MessageFlow")||h(e,"bpmn:DataInput")||h(e,"bpmn:DataOutput"))return"name";if(h(e,"bpmn:TextAnnotation"))return"text";if(h(e,"bpmn:Group"))return"categoryValueRef"}function t1(e){var t=e.categoryValueRef;return t&&t.value||""}function gt(e){var t=e.businessObject,n=xh(t);if(n)return n==="categoryValueRef"?t1(t):t[n]||""}function Eh(e,t){var n=e.businessObject,r=xh(n);if(r)if(r==="categoryValueRef"){if(!n[r])return e;n[r].value=t}else n[r]=t;return e}function wh(e){return ee(e)&&mn(e.labelTarget)}N();var wr=7;function Jl(e){let t=[];return E(e.incoming,n=>{h(n,"bpmn:Association")&&h(n.source,"bpmn:TextAnnotation")&&t.push({annotation:n.source,association:n})}),E(e.outgoing,n=>{h(n,"bpmn:Association")&&h(n.target,"bpmn:TextAnnotation")&&t.push({annotation:n.target,association:n})}),t}function Ti(e){let t=new Map;return E(Ta(e,!0,-1),n=>{E(Jl(n),r=>{t.has(r.annotation)||t.set(r.annotation,{annotation:r.annotation,associations:[]}),t.get(r.annotation).associations.push(r.association)})}),[...t.values()]}N();var Oc="hsl(225, 10%, 15%)",n1="white";function jn(e,t){return Lt(e.eventDefinitions,function(n){return n.$type===t})}function Sh(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function Ch(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function ge(e,t,n){var r=ce(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||n1}function Y(e,t,n){var r=ce(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||Oc}function go(e,t,n,r){var i=ce(e),o=i.get("label");return r||o&&o.get("color:color")||t||Y(e,n)}function Bc(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return br(i)}function ja(e,t){var n=e.x,r=e.y,i=e.width,o=e.height,a=[["M",n+t,r],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return br(a)}function Rh(e){var t=e.width,n=e.height,r=e.x,i=e.y,o=t/2,a=n/2,s=[["M",r+o,i],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return br(s)}function Ph(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return br(o)}function yo(e,t={}){return{width:hn(e,t),height:Yt(e,t)}}function hn(e,t={}){return dt(t,"width")?t.width:e.width}function Yt(e,t={}){return dt(t,"height")?t.height:e.height}var r1=new En,i1=10,Ic=3,o1=1.5,Lc=10,a1=4,_o=.95,s1=1,c1=.25;function Sr(e,t,n,r,i,o,a){Cn.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor;function p(P){return n.computeStyle(P,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Oc,strokeWidth:2,fill:"white"})}function l(P){return n.computeStyle(P,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Oc,strokeWidth:2})}function f(P,_){var{ref:y={x:0,y:0},scale:M=1,element:D,parentGfx:F=i._svg}=_,V=U("marker",{id:P,viewBox:"0 0 20 20",refX:y.x,refY:y.y,markerWidth:20*M,markerHeight:20*M,orient:"auto"});J(V,D);var ae=_e(":scope > defs",F);ae||(ae=U("defs"),J(F,ae)),J(ae,V)}function d(P,_,y,M){var D=r1.nextPrefixed("marker-");return m(P,D,_,y,M),"url(#"+D+")"}function m(P,_,y,M,D){if(y==="sequenceflow-end"){var F=U("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:D,stroke:D,strokeWidth:1})});f(_,{element:F,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(y==="messageflow-start"){var V=U("circle",{cx:6,cy:6,r:3.5,...p({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:V,ref:{x:6,y:6},parentGfx:P})}if(y==="messageflow-end"){var ae=U("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:M,stroke:D,strokeWidth:1,strokeDasharray:[1e4,1]})});f(_,{element:ae,ref:{x:8.5,y:5},parentGfx:P})}if(y==="association-start"){var be=U("path",{d:"M 11 5 L 1 10 L 11 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:be,ref:{x:1,y:10},scale:.5,parentGfx:P})}if(y==="association-end"){var ft=U("path",{d:"M 1 5 L 11 10 L 1 15",...l({fill:"none",stroke:D,strokeWidth:1.5,strokeDasharray:[1e4,1]})});f(_,{element:ft,ref:{x:11,y:10},scale:.5,parentGfx:P})}if(y==="conditional-flow-marker"){var at=U("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:M,stroke:D})});f(_,{element:at,ref:{x:-1,y:10},scale:.5,parentGfx:P})}if(y==="conditional-default-flow-marker"){var St=U("path",{d:"M 6 4 L 10 16",...p({stroke:D,fill:"none"})});f(_,{element:St,ref:{x:0,y:10},scale:.5,parentGfx:P})}}function g(P,_,y,M,D={}){Se(M)&&(D=M,M=0),M=M||0,D=p(D);var F=_/2,V=y/2,ae=U("circle",{cx:F,cy:V,r:Math.round((_+y)/4-M),...D});return J(P,ae),ae}function v(P,_,y,M,D,F){Se(D)&&(F=D,D=0),D=D||0,F=p(F);var V=U("rect",{x:D,y:D,width:_-D*2,height:y-D*2,rx:M,ry:M,...F});return J(P,V),V}function w(P,_,y,M){var D=_/2,F=y/2,V=[{x:D,y:0},{x:_,y:F},{x:D,y},{x:0,y:F}],ae=V.map(function(ft){return ft.x+","+ft.y}).join(" ");M=p(M);var be=U("polygon",{...M,points:ae});return J(P,be),be}function S(P,_,y,M){y=l(y);var D=Xn(_,y,M);return J(P,D),D}function x(P,_,y){return S(P,_,y,5)}function b(P,_,y){y=l(y);var M=U("path",{...y,d:_});return J(P,M),M}function R(P,_,y,M){return b(_,y,C({"data-marker":P},M))}function A(P){return Gt[P]}function O(P){return function(_,y,M){return A(P)(_,y,M)}}var T={"bpmn:MessageEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.235,my:.315}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill),V=M?ge(_,s,y.fill):Y(_,c,y.stroke),ae=b(P,D,{fill:F,stroke:V,strokeWidth:1});return ae},"bpmn:TimerEventDefinition":function(P,_,y={}){var M=y.width||_.width,D=y.height||_.height,F=y.width?1:2,V=g(P,M,D,.2*D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:F}),ae=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}});b(P,ae,{stroke:Y(_,c,y.stroke),strokeWidth:F});for(var be=0;be<12;be++){var ft=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:M,containerHeight:D,position:{mx:.5,my:.5}}),at=M/2,St=D/2;b(P,ft,{strokeWidth:1,stroke:Y(_,c,y.stroke),transform:"rotate("+be*30+","+St+","+at+")"})}return V},"bpmn:EscalationEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(P,_,y={}){var M=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.222}});return b(P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.2,my:.722}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),F=M?Y(_,c,y.stroke):"none",V=b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1});return Rc(V,45),V},"bpmn:CompensateEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.22,my:.5}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.5,my:.2}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{strokeWidth:1,fill:F,stroke:Y(_,c,y.stroke)})},"bpmn:MultipleEventDefinition":function(P,_,y={},M){var D=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.211,my:.36}}),F=M?Y(_,c,y.stroke):ge(_,s,y.fill);return b(P,D,{fill:F,stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(P,_,y={}){var M=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:y.width||_.width,containerHeight:y.height||_.height,position:{mx:.458,my:.194}});return b(P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(P,_,y={}){var M=g(P,_.width,_.height,8,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:4});return M}};function I(P,_,y={},M){var D=j(P),F=Sh(D),V=M||P;return D.get("eventDefinitions")&&D.get("eventDefinitions").length>1?D.get("parallelMultiple")?T["bpmn:ParallelMultipleEventDefinition"](_,V,y,F):T["bpmn:MultipleEventDefinition"](_,V,y,F):jn(D,"bpmn:MessageEventDefinition")?T["bpmn:MessageEventDefinition"](_,V,y,F):jn(D,"bpmn:TimerEventDefinition")?T["bpmn:TimerEventDefinition"](_,V,y,F):jn(D,"bpmn:ConditionalEventDefinition")?T["bpmn:ConditionalEventDefinition"](_,V,y,F):jn(D,"bpmn:SignalEventDefinition")?T["bpmn:SignalEventDefinition"](_,V,y,F):jn(D,"bpmn:EscalationEventDefinition")?T["bpmn:EscalationEventDefinition"](_,V,y,F):jn(D,"bpmn:LinkEventDefinition")?T["bpmn:LinkEventDefinition"](_,V,y,F):jn(D,"bpmn:ErrorEventDefinition")?T["bpmn:ErrorEventDefinition"](_,V,y,F):jn(D,"bpmn:CancelEventDefinition")?T["bpmn:CancelEventDefinition"](_,V,y,F):jn(D,"bpmn:CompensateEventDefinition")?T["bpmn:CompensateEventDefinition"](_,V,y,F):jn(D,"bpmn:TerminateEventDefinition")?T["bpmn:TerminateEventDefinition"](_,V,y,F):null}var L={ParticipantMultiplicityMarker:function(P,_,y={}){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2-6)/M,my:(D-15)/D}});R("participant-multiplicity",P,F,{strokeWidth:2,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},SubProcessMarker:function(P,_,y={}){var M=v(P,14,14,0,{strokeWidth:1,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)});Fe(M,_.width/2-7.5,_.height-20);var D=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2-7.5)/_.width,my:(_.height-20)/_.height}});R("sub-process",P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},ParallelMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.parallel)/M,my:(D-20)/D}});R("parallel",P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},SequentialMarker:function(P,_,y){var M=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.seq)/_.width,my:(_.height-19)/_.height}});R("sequential",P,M,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},CompensationMarker:function(P,_,y){var M=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+y.compensation)/_.width,my:(_.height-13)/_.height}});R("compensation",P,M,{strokeWidth:1,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})},LoopMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.loop)/M,my:(D-7)/D}});R("loop",P,F,{strokeWidth:1.5,fill:"none",stroke:Y(_,c,y.stroke),strokeMiterlimit:.5})},AdhocMarker:function(P,_,y){var M=hn(_,y),D=Yt(_,y),F=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:(M/2+y.adhoc)/M,my:(D-15)/D}});R("adhoc",P,F,{strokeWidth:1,fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke)})}};function W(P,_,y,M){L[P](_,y,M)}function z(P,_,y=[],M={}){M={fill:M.fill,stroke:M.stroke,width:hn(_,M),height:Yt(_,M)};var D=j(_),F=y.includes("SubProcessMarker");F?M={...M,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:M={...M,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},D.get("isForCompensation")&&y.push("CompensationMarker"),h(D,"bpmn:AdHocSubProcess")&&(y.push("AdhocMarker"),F||C(M,{compensation:M.compensation-18}));var V=D.get("loopCharacteristics"),ae=V&&V.get("isSequential");V&&(C(M,{compensation:M.compensation-18}),y.includes("AdhocMarker")&&C(M,{seq:-23,loop:-18,parallel:-24}),ae===void 0&&y.push("LoopMarker"),ae===!1&&y.push("ParallelMarker"),ae===!0&&y.push("SequentialMarker")),y.includes("CompensationMarker")&&y.length===1&&C(M,{compensation:-8}),E(y,function(be){W(be,P,_,M)})}function K(P,_,y={}){y=C({size:{width:100}},y);var M=o.createText(_||"",y);return pe(M).add("djs-label"),J(P,M),M}function ve(P,_,y,M={}){var D=j(_),F=yo({x:_.x,y:_.y,width:_.width,height:_.height},M);return K(P,D.name,{align:y,box:F,padding:7,style:{fill:go(_,u,c,M.stroke)}})}function Jt(P,_,y={}){var M={width:_.width,height:_.height,x:_.width/2+_.x,y:_.height/2+_.y};return K(P,gt(_),{box:M,style:C({},o.getExternalStyle(),{fill:go(_,u,c,y.stroke)})})}function ke(P,_,y,M={}){var D=Me(y),F=K(P,_,{box:{height:30,width:D?Yt(y,M):hn(y,M)},align:"center-middle",style:{fill:go(y,u,c,M.stroke)}});if(D){var V=-1*Yt(y,M);fo(F,0,-V,270)}}function ye(P,_,y={}){var{width:M,height:D}=yo(_,y);return v(P,M,D,Lc,{...y,fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke)})}function he(P,_,y={}){var M=j(_),D=ge(_,s,y.fill),F=Y(_,c,y.stroke);return(M.get("associationDirection")==="One"||M.get("associationDirection")==="Both")&&(y.markerEnd=d(P,"association-end",D,F)),M.get("associationDirection")==="Both"&&(y.markerStart=d(P,"association-start",D,F)),y=Ee(y,["markerStart","markerEnd"]),x(P,_.waypoints,{...y,stroke:F,strokeDasharray:"0, 5"})}function we(P,_,y={}){var M=ge(_,s,y.fill),D=Y(_,c,y.stroke),F=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),V=b(P,F,{fill:M,fillOpacity:_o,stroke:D}),ae=j(_);if(Ch(ae)){var be=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});b(P,be,{strokeWidth:2,fill:M,stroke:D})}return V}function Ie(P,_,y={}){return g(P,_.width,_.height,{fillOpacity:_o,...y,fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke)})}function Ze(P,_,y={}){return w(P,_.width,_.height,{fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke)})}function H(P,_,y={}){var M=v(P,hn(_,y),Yt(_,y),0,{fill:ge(_,s,y.fill),fillOpacity:y.fillOpacity||_o,stroke:Y(_,c,y.stroke),strokeWidth:1.5}),D=j(_);if(h(D,"bpmn:Lane")){var F=D.get("name");ke(P,F,_,y)}return M}function G(P,_,y={}){var M=ye(P,_,y),D=ie(_);if(Qe(_)&&($(M,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!D)){var F=j(_).flowElements||[],V=F.filter(ae=>h(ae,"bpmn:StartEvent"));V.length===1&&oe(V[0],P,y,_)}return ve(P,_,D?"center-top":"center-middle",y),D?z(P,_,void 0,y):z(P,_,["SubProcessMarker"],y),M}function oe(P,_,y,M){var D=22,F={fill:ge(M,s,y.fill),stroke:Y(M,c,y.stroke),width:D,height:D},V=j(P).isInterrupting,ae=V?0:3,be=V?1:1.2,ft=20,at=(D-ft)/2,St="translate("+at+","+at+")";g(_,ft,ft,{fill:F.fill,stroke:F.stroke,strokeWidth:be,strokeDasharray:ae,transform:St}),I(P,_,F,M)}function xe(P,_,y={}){var M=ye(P,_,y);return ve(P,_,"center-middle",y),z(P,_,void 0,y),M}var Gt=this.handlers={"bpmn:AdHocSubProcess":function(P,_,y={}){return ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]),G(P,_,y)},"bpmn:Association":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,y)},"bpmn:BoundaryEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=j(_),F=D.get("cancelActivity");y={strokeWidth:1.5,fill:ge(_,s,y.fill),fillOpacity:s1,stroke:Y(_,c,y.stroke)},F||(y.strokeDasharray="6");var V=Ie(P,_,y);return g(P,_.width,_.height,Ic,{...y,fill:"none"}),M&&I(_,P,y),V},"bpmn:BusinessRuleTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),F=b(P,D);$(F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1});var V=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),ae=b(P,V);return $(ae,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:CallActivity":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),G(P,_,{strokeWidth:5,...y})},"bpmn:ComplexGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:DataInput":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=we(P,_,y);return b(P,M,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1}),D},"bpmn:DataInputAssociation":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,{...y,markerEnd:d(P,"association-end",ge(_,s,y.fill),Y(_,c,y.stroke))})},"bpmn:DataObject":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),we(P,_,y)},"bpmn:DataObjectReference":O("bpmn:DataObject"),"bpmn:DataOutput":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getRawPath("DATA_ARROW"),D=we(P,_,y);return b(P,M,{strokeWidth:1,fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke)}),D},"bpmn:DataOutputAssociation":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),he(P,_,{...y,markerEnd:d(P,"association-end",ge(_,s,y.fill),Y(_,c,y.stroke))})},"bpmn:DataStoreReference":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return b(P,M,{fill:ge(_,s,y.fill),fillOpacity:_o,stroke:Y(_,c,y.stroke),strokeWidth:2})},"bpmn:EndEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=Ie(P,_,{...y,strokeWidth:4});return M&&I(_,P,y),D},"bpmn:EventBasedGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=Ze(P,_,y);g(P,_.width,_.height,_.height*.2,{fill:ge(_,"none",y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1});var F=M.get("eventGatewayType"),V=!!M.get("instantiate");function ae(){var ft=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});b(P,ft,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:2})}if(F==="Parallel"){var be=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});b(P,be,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1})}else F==="Exclusive"&&(V||g(P,_.width,_.height,_.height*.26,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1}),ae());return D},"bpmn:ExclusiveGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.32,my:.3}}),F=ce(_);return F.get("isMarkerVisible")&&b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:Gateway":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),Ze(P,_,y)},"bpmn:Group":function(P,_,y={}){return y=Ee(y,["fill","stroke","width","height"]),v(P,_.width,_.height,Lc,{stroke:Y(_,c,y.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:hn(_,y),height:Yt(_,y)})},"bpmn:InclusiveGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y);return g(P,_.width,_.height,_.height*.24,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:2.5}),M},"bpmn:IntermediateEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=Ie(P,_,{...y,strokeWidth:1.5});return g(P,_.width,_.height,Ic,{fill:"none",stroke:Y(_,c,y.stroke),strokeWidth:1.5}),M&&I(_,P,y),D},"bpmn:IntermediateCatchEvent":O("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":O("bpmn:IntermediateEvent"),"bpmn:Lane":function(P,_,y={}){return y=Ee(y,["fill","stroke","width","height"]),H(P,_,{...y,fillOpacity:c1})},"bpmn:ManualTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5}),M},"bpmn:MessageFlow":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=ce(_),F=ge(_,s,y.fill),V=Y(_,c,y.stroke),ae=x(P,_.waypoints,{markerEnd:d(P,"messageflow-end",F,V),markerStart:d(P,"messageflow-start",F,V),stroke:V,strokeDasharray:"10, 11",strokeWidth:1.5});if(M.get("messageRef")){var be=ae.getPointAtLength(ae.getTotalLength()/2),ft=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:be.x,y:be.y}}),at={strokeWidth:1};D.get("messageVisibleKind")==="initiating"?(at.fill=F,at.stroke=V):(at.fill=V,at.stroke=F);var St=b(P,ft,at),xn=M.get("messageRef"),Be=xn.get("name"),yr=K(P,Be,{align:"center-top",fitBox:!0,style:{fill:V}}),lc=St.getBBox(),pn=yr.getBBox(),me=be.x-pn.width/2,Te=be.y+lc.height/2+i1;fo(yr,me,Te,0)}return ae},"bpmn:ParallelGateway":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=Ze(P,_,y),D=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:Participant":function(P,_,y={}){y=Ee(y,["fill","stroke","width","height"]);var M=H(P,_,y),D=ie(_),F=Me(_),V=j(_),ae=V.get("name");if(D){var be=F?[{x:30,y:0},{x:30,y:Yt(_,y)}]:[{x:0,y:30},{x:hn(_,y),y:30}];S(P,be,{stroke:Y(_,c,y.stroke),strokeWidth:o1}),ke(P,ae,_,y)}else{var ft=yo(_,y);F||(ft.height=hn(_,y),ft.width=Yt(_,y));var at=K(P,ae,{box:ft,align:"center-middle",style:{fill:go(_,u,c,y.stroke)}});if(!F){var St=-1*Yt(_,y);fo(at,0,-St,270)}}return V.get("participantMultiplicity")&&W("ParticipantMultiplicityMarker",P,_,y),M},"bpmn:ReceiveTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=j(_),D=xe(P,_,y),F;return M.get("instantiate")?(g(P,28,28,20*.22,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),F=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):F=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),D},"bpmn:ScriptTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:SendTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return b(P,D,{fill:Y(_,c,y.stroke),stroke:ge(_,s,y.fill),strokeWidth:1}),M},"bpmn:SequenceFlow":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=ge(_,s,y.fill),D=Y(_,c,y.stroke),F=x(P,_.waypoints,{markerEnd:d(P,"sequenceflow-end",M,D),stroke:D}),V=j(_),{source:ae}=_;if(ae){var be=j(ae);V.get("conditionExpression")&&h(be,"bpmn:Activity")&&$(F,{markerStart:d(P,"conditional-flow-marker",M,D)}),be.get("default")&&(h(be,"bpmn:Gateway")||h(be,"bpmn:Activity"))&&be.get("default")===V&&$(F,{markerStart:d(P,"conditional-default-flow-marker",M,D)})}return F},"bpmn:ServiceTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y);g(P,10,10,{fill:ge(_,s,y.fill),stroke:"none",transform:"translate(6, 6)"});var D=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});b(P,D,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),g(P,10,10,{fill:ge(_,s,y.fill),stroke:"none",transform:"translate(11, 10)"});var F=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return b(P,F,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:1}),M},"bpmn:StartEvent":function(P,_,y={}){var{renderIcon:M=!0}=y;y=Ee(y,["fill","stroke"]);var D=j(_);D.get("isInterrupting")||(y={...y,strokeDasharray:"6"});var F=Ie(P,_,y);return M&&I(_,P,y),F},"bpmn:SubProcess":function(P,_,y={}){return ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]),G(P,_,y)},"bpmn:Task":function(P,_,y={}){return y=Ee(y,["fill","stroke"]),xe(P,_,y)},"bpmn:TextAnnotation":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var{width:M,height:D}=yo(_,y),F=v(P,M,D,0,0,{fill:"none",stroke:"none"}),V=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:M,containerHeight:D,position:{mx:0,my:0}});b(P,V,{stroke:Y(_,c,y.stroke)});var ae=j(_),be=ae.get("text")||"";return K(P,be,{align:"left-top",box:yo(_,y),padding:wr,style:{fill:go(_,u,c,y.stroke)}}),F},"bpmn:Transaction":function(P,_,y={}){ie(_)?y=Ee(y,["fill","stroke","width","height"]):y=Ee(y,["fill","stroke"]);var M=G(P,_,{strokeWidth:1.5,...y}),D=n.style(["no-fill","no-events"],{stroke:Y(_,c,y.stroke),strokeWidth:1.5}),F=ie(_);return F||(y={}),v(P,hn(_,y),Yt(_,y),Lc-Ic,Ic,D),M},"bpmn:UserTask":function(P,_,y={}){y=Ee(y,["fill","stroke"]);var M=xe(P,_,y),D=15,F=12,V=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:D,y:F}});b(P,V,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5});var ae=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:D,y:F}});b(P,ae,{fill:ge(_,s,y.fill),stroke:Y(_,c,y.stroke),strokeWidth:.5});var be=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:D,y:F}});return b(P,be,{fill:Y(_,c,y.stroke),stroke:Y(_,c,y.stroke),strokeWidth:.5}),M},label:function(P,_,y={}){return Jt(P,_,y)}};this._drawPath=b,this._renderer=A}B(Sr,Cn);Sr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];Sr.prototype.canRender=function(e){return h(e,"bpmn:BaseElement")};Sr.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Sr.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};Sr.prototype.getShapePath=function(e){return ee(e)?ja(e,a1):h(e,"bpmn:Event")?Bc(e):h(e,"bpmn:Activity")?ja(e,Lc):h(e,"bpmn:Gateway")?Rh(e):Ph(e)};function Ee(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}N();N();var u1=0,p1={width:150,height:50};function l1(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function f1(e){return Se(e)?C({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var ef=null;function d1(){return ef||(ef=document.createElement("canvas").getContext("2d")),ef}function m1(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(Th(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function Th(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function h1(e,t){var n=d1();if(!n)return{width:0,height:0};n.font=m1(t),"letterSpacing"in n&&(n.letterSpacing=Th(t.letterSpacing)||"0px");var r=e==="",i=r?"dummy":e.replace(/\s+$/,""),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function v1(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=h1(i,n),o.width=i?o.width:0,i===" "||i===""||o.width<Math.round(t)||i.length<2)return g1(e,i,r,o);i=_1(i,o.width,t)}}function g1(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}var Ah="\xAD";function y1(e,t){var n=e.split(/(\s|-|\u00AD)/g),r,i=[],o=0;if(n.length>1)for(;r=n.shift();)if(r.length+o<t)i.push(r),o+=r.length;else{(r==="-"||r===Ah)&&i.pop();break}var a=i[i.length-1];return a&&a===Ah&&(i[i.length-1]="-"),i.join("")}function _1(e,t,n){var r=Math.max(e.length*(n/t),1),i=y1(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function bo(e){this._config=C({},{size:p1,padding:u1,style:{},align:"center-top"},e||{})}bo.prototype.createText=function(e,t){return this.layoutText(e,t).element};bo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions};bo.prototype.layoutText=function(e,t){for(var n=C({},this._config.size,t.box),r=C({},this._config.style,t.style),i=l1(t.align||this._config.align),o=f1(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=b1(r),c=e.split(/\u00AD?\r?\n/),u=[],p=n.width-o.left-o.right;c.length;)u.push(v1(c,p,r));i.vertical==="middle"&&(o.top=o.bottom=0);var l=Ge(u,function(v,w,S){return v+(s||w.height)},0)+o.top+o.bottom,f=Ge(u,function(v,w,S){return w.width>v?w.width:v},0),d=o.top;i.vertical==="middle"&&(d+=(n.height-l)/2),d-=(s||u[0].height)/4;var m=U("text");$(m,r),E(u,function(v){var w;switch(d+=s||v.height,i.horizontal){case"left":w=o.left;break;case"right":w=(a?f:p)-o.right-v.width;break;default:w=Math.max(((a?f:p)-v.width)/2+o.left,0)}var S=U("tspan");$(S,{x:w,y:d}),S.textContent=v.text,J(m,S)});var g={width:f,height:l};return{dimensions:g,element:m}};function b1(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var x1=12,E1=1.2,w1=40;function jc(e){var t=C({fontFamily:"Arial, sans-serif",fontSize:x1,fontWeight:"normal",lineHeight:E1},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=C({},t,{fontSize:n},e&&e.externalStyle||{}),i=new bo({style:t});this.getExternalLabelBounds=function(a,s){var c={width:Math.max(a.width,ir.width),height:30},u=o(s,c,{style:r});return{x:Math.round(a.x+a.width/2-u.width/2),y:a.y,width:Math.ceil(u.width),height:Math.ceil(u.height)}},this.getTextAnnotationBounds=function(a,s){var c=o(s,a,{style:t,align:"left-top",padding:wr});return{x:a.x,y:a.y,width:a.width,height:Math.max(w1,Math.round(c.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,c){return i.getDimensions(a,C({box:s},c))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}jc.$inject=["config.textRenderer"];function tf(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,u=0;u<r.heightElements.length;u++)a["y"+u]=r.heightElements[u]*s;for(var p=0;p<r.widthElements.length;p++)a["x"+p]=r.widthElements[p]*c}var l=P1(r.d,{mx:i,my:o,e:a});return l}}var S1=/\{([^{}]+)\}/g,C1=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function R1(e,t,n){var r=n;return t.replace(C1,function(i,o,a,s,c){o=o||s,r&&(o in r&&(r=r[o]),typeof r=="function"&&c&&(r=r()))}),r=(r==null||r==n?e:r)+"",r}function P1(e,t){return String(e).replace(S1,function(n,r){return R1(n,r,t)})}var Mh={__init__:["bpmnRenderer"],bpmnRenderer:["type",Sr],textRenderer:["type",jc],pathMap:["type",tf]};function nf(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,r){return t[r]||"{"+r+"}"})}var Zr={translate:["value",nf]};N();function Fc(e,t,n){return C({id:e.id,type:e.$type,businessObject:e,di:t},n)}function A1(e,t,n){var r=e.waypoint;return!r||r.length<2?[X(t),X(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function Dh(e,t,n){return new Error(`element ${Rt(t)} referenced by ${Rt(e)}#${n} not yet drawn`)}function Fn(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}Fn.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];Fn.prototype.add=function(e,t,n){var r,i,o;if(h(t,"bpmndi:BPMNPlane")){var a=h(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(Fc(e,t,a)),this._canvas.addRootElement(r)}else if(h(t,"bpmndi:BPMNShape")){var s=!ie(e,t),c=M1(e);i=n&&(n.hidden||n.collapsed);var u=t.bounds;r=this._elementFactory.createShape(Fc(e,t,{collapsed:s,hidden:i,x:Math.round(u.x),y:Math.round(u.y),width:Math.round(u.width),height:Math.round(u.height),isFrame:c})),h(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),h(e,"bpmn:Lane")&&(o=0),h(e,"bpmn:DataStoreReference")&&(T1(n,X(u))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else if(h(t,"bpmndi:BPMNEdge")){var p=this._getSource(e),l=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Fc(e,t,{hidden:i,source:p,target:l,waypoints:A1(t,p,l)})),h(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}else throw new Error(`unknown di ${Rt(t)} for element ${Rt(e)}`);return mn(e)&>(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r};Fn.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Rt(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw Dh(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};Fn.prototype.addLabel=function(e,t,n){var r,i,o;return r=bh(t,n),i=gt(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(Fc(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!gt(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(o,n.parent)};Fn.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(r=r&&r[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(r=e.$parent),n=r&&this._getElement(r),n)return n;throw r?Dh(e,r,t+"Ref"):new Error(`${Rt(e)}#${t} Ref not specified`)};Fn.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};Fn.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};Fn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function T1(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function M1(e){return h(e,"bpmn:Group")}var kh={__depends__:[Zr],bpmnImporter:["type",Fn]};var Nh={__depends__:[Mh,kh]};N();function or(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}or.prototype.next=function(){return this._prefix+ ++this._counter};var D1=new or("ov"),k1=500;function yt(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=D1,this._overlayDefaults=C({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=N1(n.getContainer()),this._init()}yt.$inject=["config.overlays","eventBus","canvas","elementRegistry"];yt.prototype.get=function(e){if(st(e)&&(e={id:e}),st(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Q(t.overlays,Ct({type:e.type})):t.overlays.slice():[]}else return e.type?Q(this._overlays,Ct({type:e.type})):e.id?this._overlays[e.id]:null};yt.prototype.add=function(e,t,n){if(Se(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=C({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};yt.prototype.remove=function(e){var t=this.get(e)||[];q(t)||(t=[t]);var n=this;E(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(Wt(r.html),Wt(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),i){var o=i.overlays.indexOf(r);o!==-1&&i.overlays.splice(o,1)}})};yt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};yt.prototype.show=function(){Hc(this._overlayRoot)};yt.prototype.hide=function(){Hc(this._overlayRoot,!1)};yt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Hr(this._overlayRoot)};yt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Ce(t);r=o.x,i=o.y}Oh(n,r,i),nt(e.html,"data-container-id",t.id)};yt.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,o=t.top;if(t.right!==void 0){var a;r.waypoints?a=Ce(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Ce(r).height:s=r.height,o=t.bottom*-1+s}Oh(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};yt.prototype._createOverlayContainer=function(e){var t=ue('<div class="djs-overlays" />');vt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};yt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Bh(this._overlayRoot,n)};yt.prototype._getOverlayContainer=function(e,t){var n=re(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};yt.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,o;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),st(r)&&(r=ue(r)),o=this._getOverlayContainer(n),i=ue('<div class="djs-overlay" data-overlay-id="'+t+'">'),vt(i,{position:"absolute"}),i.appendChild(r),e.type&&Ne(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Hc(i,a===s),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())};yt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(r!==s||n&&(Ue(i)&&i>t.scale||Ue(o)&&o<t.scale))&&(c=!1),Hc(a,c),this._updateOverlayScale(e,t)};yt.prototype._updateOverlayScale=function(e,t){var n=e.scale,r,i,o=e.htmlContainer,a,s="";n!==!0&&(n===!1?(r=1,i=1):(r=n.min,i=n.max),Ue(r)&&t.scale<r&&(a=(1/t.scale||1)*r),Ue(i)&&t.scale>i&&(a=(1/t.scale||1)*i)),Ue(a)&&(s="scale("+a+","+a+")"),Bh(o,s)};yt.prototype._updateOverlaysVisibilty=function(e){var t=this;E(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};yt.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,o=t.get({element:i});E(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(i);if(a){Wt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",k1,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(E(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Ne(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function N1(e){var t=ue('<div class="djs-overlay-container" />');return vt(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Oh(e,t,n){vt(e,{left:t+"px",top:n+"px"})}function Hc(e,t){e.style.display=t===!1?"none":""}function Bh(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var Qr={__init__:["overlays"],overlays:["type",yt]};function $c(e,t,n,r){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(_c(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),r.updateContainments(o)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}$c.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var xo={__init__:["changeSupport"],changeSupport:["type",$c]};N();var O1=1e3;function k(e){this._eventBus=e}k.$inject=["eventBus"];function B1(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}k.prototype.on=function(e,t,n,r,i,o){if((Le(t)||ne(t))&&(o=i,i=r,r=n,n=t,t=null),Le(n)&&(o=i,i=r,r=n,n=O1),Se(i)&&(o=i,i=!1),!Le(r))throw new Error("handlerFn must be a function");q(e)||(e=[e]);var a=this._eventBus;E(e,function(s){var c=["commandStack",s,t].filter(function(u){return u}).join(".");a.on(c,n,i?B1(r,o):r,o)})};k.prototype.canExecute=Cr("canExecute");k.prototype.preExecute=Cr("preExecute");k.prototype.preExecuted=Cr("preExecuted");k.prototype.execute=Cr("execute");k.prototype.executed=Cr("executed");k.prototype.postExecute=Cr("postExecute");k.prototype.postExecuted=Cr("postExecuted");k.prototype.revert=Cr("revert");k.prototype.reverted=Cr("reverted");function Cr(e){return function(n,r,i,o,a){(Le(n)||ne(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function Fa(e,t){t.invoke(k,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}B(Fa,k);Fa.$inject=["canvas","injector"];var Ih={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Fa]};N();function Rr(e){return CSS.escape(e)}var I1={"&":"&","<":"<",">":">",'"':""","'":"'"};function Hn(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return I1[t]})}var Lh="_plane";function rf(e){var t=e.id;return L1(t)}function vn(e){var t=e.id;return h(e,"bpmn:SubProcess")?jh(t):t}function Jr(e){return jh(e)}function Eo(e){var t=ce(e);return h(t,"bpmndi:BPMNPlane")}function jh(e){return e+Lh}function L1(e){return e.replace(new RegExp(Lh+"$"),"")}var j1="bjs-breadcrumbs-shown";function zc(e,t,n){var r=ue('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=Ne(i);i.appendChild(r);var a=[];e.on("element.changed",function(c){var u=c.element,p=j(u),l=re(a,function(f){return f===p});l&&s()});function s(c){c&&(a=F1(c));var u=a.flatMap(function(l){var f=n.findRoot(vn(l))||n.findRoot(l.id);if(!f&&h(l,"bpmn:Process")){var d=t.find(function(v){var w=j(v);return w&&w.get("processRef")===l});f=d&&n.findRoot(d.id)}if(!f)return[];var m=Hn(l.name||l.id),g=ue('<li><span class="bjs-crumb"><a title="'+m+'">'+m+"</a></span></li>");return g.addEventListener("click",function(){n.setRootElement(f)}),g});r.innerHTML="";var p=u.length>1;o.toggle(j1,p),u.forEach(function(l){r.appendChild(l)})}e.on("root.set",function(c){s(c.element)})}zc.$inject=["eventBus","elementRegistry","canvas"];function F1(e){for(var t=j(e),n=[],r=t;r;r=r.$parent)(h(r,"bpmn:SubProcess")||h(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function Gc(e,t){var n=null,r=new H1;e.on("root.set",function(i){var o=i.element,a=t.viewbox(),s=r.get(o);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!h(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,u=(a.y-s.y)*a.scale;(c!==0||u!==0)&&t.scroll({dx:c,dy:u}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}Gc.$inject=["eventBus","canvas"];function H1(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var Fh={x:180,y:160};function Pr(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}Pr.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=e.diagrams.filter(r=>r.plane).flatMap(r=>t._createNewDiagrams(r.plane));n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}};Pr.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;h(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),z1(a,e)&&r.push({diElement:o,parent:s})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,i.push(a)}}),r.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),i};Pr.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=$1(e),r={x:n.x-Fh.x,y:n.y-Fh.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-r.x,o.y=o.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})};Pr.prototype._moveToDiPlane=function(e,t){var n=Hh(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};Pr.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n};Pr.$inject=["eventBus","moddle"];function Hh(e){return h(e,"bpmndi:BPMNDiagram")?e:Hh(e.$parent)}function $1(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=Z(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),Si(t)}function z1(e,t){var n=e.$parent;return!(!h(n,"bpmn:SubProcess")||n===t.bpmnElement||te(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Vc=250,G1='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',V1="bjs-drilldown-empty";function ar(e,t,n,r,i){k.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Vc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Vc,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Vc,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Vc,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}B(ar,k);ar.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};ar.prototype._canDrillDown=function(e){var t=this._canvas;return h(e,"bpmn:SubProcess")&&t.findRoot(vn(e))};ar.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=j(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Ne(r.html).toggle(V1,!i)}};ar.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=j(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ue('<button type="button" class="bjs-drilldown">'+G1+"</button>"),a=r.get("name")||r.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(vn(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};ar.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};ar.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var $h={__depends__:[Qr,xo,Ih],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",zc],drilldownCentering:["type",Gc],drilldownOverlayBehavior:["type",ar],subprocessCompatibility:["type",Pr]};N();function zh(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Ar(e){return e.originalEvent||e.srcEvent}function Wc(e){zh(e),zh(Ar(e))}function An(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 Uc(){return/mac/i.test(navigator.platform)}function Gh(e,t){return(Ar(e)||e).button===t}function gn(e){return Gh(e,0)}function Vh(e){return Gh(e,1)}function Tr(e){var t=Ar(e)||e;return gn(e)?Uc()?t.metaKey:t.ctrlKey:!1}function Mi(e){var t=Ar(e)||e;return gn(e)&&t.shiftKey}function W1(e){return!0}function qc(e){return gn(e)||Vh(e)}var Wh=500;function Kc(e,t,n){var r=this;function i(T,I,L){if(!s(T,I)){var W,z,K;L?z=t.getGraphics(L):(W=I.delegateTarget||I.target,W&&(z=W,L=t.get(z))),!(!z||!L)&&(K=e.fire(T,{element:L,gfx:z,originalEvent:I}),K===!1&&(I.stopPropagation(),I.preventDefault()))}}var o={};function a(T){return o[T]}function s(T,I){var L=u[T]||gn;return!L(I)}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"},u={"element.contextmenu":W1,"element.mousedown":qc,"element.mouseup":qc,"element.click":qc,"element.dblclick":qc};function p(T,I,L){var W=c[T];if(!W)throw new Error("unmapped DOM event name <"+T+">");return i(W,I,L)}var l="svg, .djs-element";function f(T,I,L,W){var z=o[L]=function(K){i(L,K)};W&&(u[L]=W),z.$delegate=bt.bind(T,l,I,z)}function d(T,I,L){var W=a(L);W&&bt.unbind(T,I,W.$delegate)}function m(T){E(c,function(I,L){f(T,L,I)})}function g(T){E(c,function(I,L){d(T,L,I)})}e.on("canvas.destroy",function(T){g(T.svg)}),e.on("canvas.init",function(T){m(T.svg)}),e.on(["shape.added","connection.added"],function(T){var I=T.element,L=T.gfx;e.fire("interactionEvents.createHit",{element:I,gfx:L})}),e.on(["shape.changed","connection.changed"],Wh,function(T){var I=T.element,L=T.gfx;e.fire("interactionEvents.updateHit",{element:I,gfx:L})}),e.on("interactionEvents.createHit",Wh,function(T){var I=T.element,L=T.gfx;r.createDefaultHit(I,L)}),e.on("interactionEvents.updateHit",function(T){var I=T.element,L=T.gfx;r.updateDefaultHit(I,L)});var v=R("djs-hit djs-hit-stroke"),w=R("djs-hit djs-hit-click-stroke"),S=R("djs-hit djs-hit-all"),x=R("djs-hit djs-hit-no-move"),b={all:S,"click-stroke":w,stroke:v,"no-move":x};function R(T,I){return I=C({stroke:"white",strokeWidth:15},I||{}),n.cls(T,["no-fill","no-border"],I)}function A(T,I){var L=b[I];if(!L)throw new Error("invalid hit type <"+I+">");return $(T,L),T}function O(T,I){J(T,I)}this.removeHits=function(T){var I=xi(".djs-hit",T);E(I,Pe)},this.createDefaultHit=function(T,I){var L=T.waypoints,W=T.isFrame,z;return L?this.createWaypointsHit(I,L):(z=W?"stroke":"all",this.createBoxHit(I,z,{width:T.width,height:T.height}))},this.createWaypointsHit=function(T,I){var L=Xn(I);return A(L,"stroke"),O(T,L),L},this.createBoxHit=function(T,I,L){L=C({x:0,y:0},L);var W=U("rect");return A(W,I),$(W,L),O(T,W),W},this.updateDefaultHit=function(T,I){var L=_e(".djs-hit",I);if(L)return T.waypoints?Pa(L,T.waypoints):$(L,{width:T.width,height:T.height}),L},this.fire=i,this.triggerMouseEvent=p,this.mouseHandler=a,this.registerEvent=f,this.unregisterEvent=d}Kc.$inject=["eventBus","elementRegistry","styles"];var ei={__init__:["interactionEvents"],interactionEvents:["type",Kc]};N();function ti(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}ti.$inject=["eventBus","canvas"];ti.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}};ti.prototype.get=function(){return this._selectedElements};ti.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};ti.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();q(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(a){var s=i.findRoot(a);return o===s}),t?E(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};N();var Uh="hover",qh="selected";function Yc(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function r(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Uh)}),t.on("element.out",function(i){r(i.element,Uh)}),t.on("selection.changed",function(i){function o(u){r(u,qh)}function a(u){n(u,qh)}var s=i.oldSelection,c=i.newSelection;E(s,function(u){c.indexOf(u)===-1&&o(u)}),E(c,function(u){s.indexOf(u)===-1&&a(u)})})}Yc.$inject=["canvas","eventBus"];N();function Xc(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,c=o.hints||{},u=c.autoSelect;if(a){if(u===!1)return;q(u)?t.select(u):t.select(s.filter(U1))}}),e.on("connect.end",500,function(i){var o=i.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],a=r.get(i.context.shape.id),s=re(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(i){if(gn(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Mi(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Xc.$inject=["eventBus","selection","canvas","elementRegistry"];function U1(e){return!e.hidden}var rt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ei],selection:["type",ti],selectionVisuals:["type",Yc],selectionBehavior:["type",Xc]};function nn(e){$e.call(this,e)}B(nn,$e);nn.prototype._modules=[Nh,$h,Qr,rt,Zr];nn.prototype._moddleExtensions={};N();N();var Kh=["c","C"],Yh=["v","V"],q1=["d","D"],K1=["x","X"],Xh=["y","Y"],of=["z","Z"];function Zh(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function xt(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Ke(e,t){return e=q(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function Zc(e){return e.shiftKey}function Qh(e){return xt(e)&&Ke(Kh,e)}function Jh(e){return xt(e)&&Ke(Yh,e)}function ev(e){return xt(e)&&Ke(q1,e)}function tv(e){return xt(e)&&Ke(K1,e)}function nv(e){return xt(e)&&!Zc(e)&&Ke(of,e)}function rv(e){return xt(e)&&(Ke(Xh,e)||Ke(of,e)&&Zc(e))}var Qc="keyboard.keydown",Y1="keyboard.keyup",X1=1e3,iv="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Mt(e,t){var n=this;this._config=e=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()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(iv));var r=e&&e.bind!==!1;t.on("canvas.init",function(i){n._target=i.svg,r&&n.bind(),n._fire("init")})}Mt.$inject=["config.keyboard","eventBus"];Mt.prototype._keydownHandler=function(e){this._keyHandler(e,Qc)};Mt.prototype._keyupHandler=function(e){this._keyHandler(e,Y1)};Mt.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var r={keyEvent:e};n=this._eventBus.fire(t||Qc,r),n&&e.preventDefault()}};Mt.prototype._isEventIgnored=function(e){return!1};Mt.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(iv)),this.unbind(),e=this._node=this._target,se.bind(e,"keydown",this._keydownHandler),se.bind(e,"keyup",this._keyupHandler),this._fire("bind")};Mt.prototype.getBinding=function(){return this._node};Mt.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),se.unbind(e,"keydown",this._keydownHandler),se.unbind(e,"keyup",this._keyupHandler)),this._node=null};Mt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})};Mt.prototype.addListener=function(e,t,n){Le(e)&&(n=t,t=e,e=X1),this._eventBus.on(n||Qc,e,t)};Mt.prototype.removeListener=function(e,t){this._eventBus.off(t||Qc,e)};Mt.prototype.hasModifier=Zh;Mt.prototype.isCmd=xt;Mt.prototype.isShift=Zc;Mt.prototype.isKey=Ke;var Z1=500;function Mr(e,t){var n=this;e.on("editorActions.init",Z1,function(r){var i=r.editorActions;n.registerBindings(t,i)})}Mr.$inject=["eventBus","keyboard"];Mr.prototype.registerBindings=function(e,t){function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("undo",function(r){var i=r.keyEvent;if(nv(i))return t.trigger("undo"),!0}),n("redo",function(r){var i=r.keyEvent;if(rv(i))return t.trigger("redo"),!0}),n("copy",function(r){var i=r.keyEvent;if(Qh(i))return t.trigger("copy"),!0}),n("paste",function(r){var i=r.keyEvent;if(Jh(i))return t.trigger("paste"),!0}),n("duplicate",function(r){var i=r.keyEvent;if(ev(i))return t.trigger("duplicate"),!0}),n("cut",function(r){var i=r.keyEvent;if(tv(i))return t.trigger("cut"),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(Ke(["+","Add","="],i)&&xt(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(r){var i=r.keyEvent;if(Ke(["-","Subtract"],i)&&xt(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(r){var i=r.keyEvent;if(Ke("0",i)&&xt(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(r){var i=r.keyEvent;if(Ke(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};var wo={__init__:["keyboard","keyboardBindings"],keyboard:["type",Mt],keyboardBindings:["type",Mr]};N();var Q1={moveSpeed:50,moveSpeedAccelerated:200};function Jc(e,t,n){var r=this;this._config=C({},Q1,e||{}),t.addListener(i);function i(o){var a=o.keyEvent,s=r._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,u;switch(a.key){case"ArrowLeft":case"Left":u="left";break;case"ArrowUp":case"Up":u="up";break;case"ArrowRight":case"Right":u="right";break;case"ArrowDown":case"Down":u="down";break}return r.moveCanvas({speed:c,direction:u}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,u=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=u;break;case"up":s=u;break;case"right":a=-u;break;case"down":s=-u;break}n.scroll({dx:a,dy:s})}}Jc.$inject=["config.keyboardMove","keyboard","canvas"];var eu={__depends__:[wo],__init__:["keyboardMove"],keyboardMove:["type",Jc]};var J1=/^djs-cursor-.*$/;function Di(e){var t=Ne(document.body);t.removeMatching(J1),e&&t.add("djs-cursor-"+e)}function tu(){Di(null)}var eC=5e3;function nu(e,t){t=t||"element.click";function n(){return!1}return e.once(t,eC,n),function(){e.off(t,n)}}function So(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Dt(e,t){return{x:e.x-t.x,y:e.y-t.y}}var tC=15;function ru(e,t){var n;function r(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,r):e.off("element.mousedown",r)});function i(s){var c=n.start,u=n.button,p=An(s),l=Dt(p,c);if(!n.dragging&&nC(l)>tC&&(n.dragging=!0,u===0&&nu(e),Di("grab")),n.dragging){var f=n.last||n.start;l=Dt(p,f),t.scroll({dx:l.x,dy:l.y}),n.last=p}s.preventDefault()}function o(s){se.unbind(document,"mousemove",i),se.unbind(document,"mouseup",o),n=null,tu()}function a(s){if(!Bn(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:An(s)},se.bind(document,"mousemove",i),se.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}ru.$inject=["eventBus","canvas"];function nC(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var iu={__init__:["moveCanvas"],moveCanvas:["type",ru]};function Ha(e){return Math.log(e)/Math.log(10)}function af(e,t){var n=Ha(e.min),r=Ha(e.max),i=Math.abs(n)+Math.abs(r);return i/t}function ov(e,t){return Math.max(e.min,Math.min(e.max,t))}N();var rC=Math.sign||function(e){return e>=0?1:-1},sf={min:.2,max:4},av=10,iC=.1,oC=.75;function Tn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=tt(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||oC;var r=this;t.on("canvas.mouseover",function(){r._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){r._init(!1)})}Tn.$inject=["config.zoomScroll","eventBus","canvas"];Tn.prototype.scroll=function(t){this._canvas.scroll(t)};Tn.prototype.reset=function(){this._canvas.zoom("fit-viewport")};Tn.prototype.zoom=function(t,n){var r=af(sf,av*2);this._totalDelta+=t,Math.abs(this._totalDelta)>iC&&(this._zoom(t,n,r),this._totalDelta=0)};Tn.prototype._handleWheel=function(t){if(this._enabled){var n=this._container;t.preventDefault();var r=t.ctrlKey||Uc()&&t.metaKey,i=t.shiftKey,o=-1*this._scale,a;if(r?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,r){var s=n.getBoundingClientRect(),c={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*rC(t.deltaY)*o,this.zoom(a,c)}else i?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}};Tn.prototype.stepZoom=function(t,n){var r=af(sf,av);this._zoom(t,n,r)};Tn.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=Ha(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s=Math.pow(10,a);r.zoom(ov(sf,s),t)};Tn.prototype.toggle=function(t){var n=this._container,r=this._handleWheel,i=this._enabled;return typeof t=="undefined"&&(t=!i),i!==t&&se[t?"bind":"unbind"](n,"wheel",r,!1),this._enabled=t,t};Tn.prototype._init=function(e){this.toggle(e)};var ou={__init__:["zoomScroll"],zoomScroll:["type",Tn]};function sr(e){nn.call(this,e)}B(sr,nn);sr.prototype._navigationModules=[eu,iu,ou];sr.prototype._modules=[].concat(nn.prototype._modules,sr.prototype._navigationModules);N();function cf(e){return e&&e[e.length-1]}function sv(e){return e.y}function cv(e){return e.x}var aC={left:cv,center:cv,right:function(e){return e.x+e.width},top:sv,middle:sv,bottom:function(e){return e.y+e.height}};function ni(e,t){this._modeling=e,this._rules=t}ni.$inject=["modeling","rules"];ni.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",r="width";return t.indexOf(e)!==-1&&(n="y",r="height"),{axis:n,dimension:r}};ni.prototype._isType=function(e,t){return t.indexOf(e)!==-1};ni.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),r=n.axis,i=n.dimension,o={},a={},s=!1,c,u,p;function l(f,d){return Math.round((f[r]+d[r]+d[i])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][r];else if(this._isType(e,["right","bottom"]))p=cf(t),o[e]=p[r]+p[i];else if(this._isType(e,["center","middle"])){if(E(t,function(f){var d=f[r]+Math.round(f[i]/2);a[d]?a[d].elements.push(f):a[d]={elements:[f],center:d}}),c=At(a,function(f){return f.elements.length>1&&(s=!0),f.elements.length}),s)return o[e]=cf(c).center,o;u=t[0],t=At(t,function(f){return f[r]+f[i]}),p=cf(t),o[e]=l(u,p)}return o};ni.prototype.trigger=function(e,t){var n=this._modeling,r,i=Q(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(r=this._rules.allowed("elements.align",{elements:i}),q(r)&&(i=r),!(i.length<2||!r)){var o=aC[t],a=At(i,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};var uv={__init__:["alignElements"],alignElements:["type",ni]};var sC=new or;function ri(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}ri.$inject=["eventBus"];ri.prototype.schedule=function(e,t=sC.next()){this.cancel(t);let n=this._schedule(e,t);return this._scheduled[t]=n,n.promise};ri.prototype._schedule=function(e,t){let n=cC();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(i){n.reject(i)}}catch(i){console.error("Scheduler#_schedule execution failed",i)}}),promise:n.promise}};ri.prototype.cancel=function(e){let t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)};ri.prototype._cancel=function(e){clearTimeout(e.executionId)};function cC(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var pv={scheduler:["type",ri]};N();var uC="djs-element-hidden",au=".entry",pC=1e3,lv=8,lC=300;function it(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}it.$inject=["canvas","elementRegistry","eventBus","scheduler"];it.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,r=n.length?n.length===1?n[0]:n:null;r?e.open(r,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,r=e._current;if(r){var i=r.target,o=q(i)?i:[i],a=o.filter(function(c){return n.includes(c)});if(a.length){e.close();var s=o.filter(function(c){return e._elementRegistry.get(c.id)});s.length&&e._updateAndOpen(s.length>1?s:s[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,r=e._current,i=q(r.target)?r.target:[r.target];i.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()};it.prototype._createContainer=function(){var e=ue('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e};it.prototype.registerProvider=function(e,t){t||(t=e,e=pC),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})};it.prototype.getEntries=function(e){var t=this._getProviders(),n=q(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return E(t,function(i){if(Le(i[n])){var o=i[n](e);Le(o)?r=o(r):E(o,function(a,s){r[s]=a})}}),r};it.prototype.trigger=function(e,t,n){var r=this,i,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(i=nt(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){r._mouseout=r.triggerEntry(i,"hover",o,n)},lC);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)};it.prototype.triggerEntry=function(e,t,n,r){if(this.isShown()){var i=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(Le(s)){if(t==="click")return s(n,i,r)}else if(s[t])return s[t](n,i,r);n.preventDefault()}}}};it.prototype.open=function(e,t){if(!(!t&&this.isOpen(e))){var n=this._eventBus.fire("contextPad.open.allowed",{target:e});n!==!1&&(this.close(),this._updateAndOpen(e))}};it.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};it.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),r;E(t,function(i,o){var a=i.group||"default",s=ue(i.html||'<div class="entry" draggable="true"></div>'),c;nt(s,"data-action",o),c=_e("[data-group="+Rr(a)+"]",n),c||(c=ue('<div class="group"></div>'),nt(c,"data-group",a),n.appendChild(c)),c.appendChild(s),i.className&&fC(s,i.className),i.title&&nt(s,"title",i.title),i.imageUrl&&(r=ue("<img>"),nt(r,"src",i.imageUrl),r.style.width="100%",r.style.height="100%",s.appendChild(r))}),Ne(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})};it.prototype._createHtml=function(e){var t=this,n=ue('<div class="djs-context-pad"></div>');return bt.bind(n,au,"click",function(r){t.trigger("click",r)}),bt.bind(n,au,"dragstart",function(r){t.trigger("dragstart",r)}),bt.bind(n,au,"mouseover",function(r){t.trigger("mouseover",r)}),bt.bind(n,au,"mouseout",function(r){t.trigger("mouseout",r)}),se.bind(n,"mousedown",function(r){r.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n};it.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&mC(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}};it.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)};it.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return q(e)!==q(n)?!1:q(e)?e.length===n.length&&ln(e,function(r){return n.includes(r)}):n===e};it.prototype.isShown=function(){return this.isOpen()&&Ne(this._current.html).has("open")};it.prototype.show=function(){this.isOpen()&&(Ne(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))};it.prototype.hide=function(){this.isOpen()&&(Ne(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))};it.prototype._getPosition=function(e){if(!q(e)&&de(e)){var t=this._canvas.viewbox(),n=dC(e),r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:r+lv*this._canvas.zoom(),top:i}}var o=this._canvas.getContainer(),a=o.getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+lv*this._canvas.zoom(),top:s.top-a.top}};it.prototype._updatePosition=function(){let e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(r){r in n&&(t.style[r]=n[r]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")};it.prototype._updateVisibility=function(){let e=()=>{if(this.isOpen()){var t=this,n=this._current.target,r=q(n)?n:[n],i=r.some(function(o){return t._canvas.hasMarker(o,uC)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")};it.prototype._getTargetBounds=function(e){var t=this,n=q(e)?e:[e],r=n.map(function(i){return t._canvas.getGraphics(i)});return r.reduce(function(i,o){let a=o.getBoundingClientRect();return i.top=Math.min(i.top,a.top),i.right=Math.max(i.right,a.right),i.bottom=Math.max(i.bottom,a.bottom),i.left=Math.min(i.left,a.left),i.x=i.left,i.y=i.top,i.width=i.right-i.left,i.height=i.bottom-i.top,i},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function fC(e,t){var n=Ne(e);t=q(t)?t:t.split(/\s+/g),t.forEach(function(r){n.add(r)})}function dC(e){return e.waypoints[e.waypoints.length-1]}function mC(e,t){return e=q(e)?e:[e],t=q(t)?t:[t],e.length===t.length&&ln(e,function(n){return t.includes(n)})}var su={__depends__:[ei,pv,Qr],contextPad:["type",it]};var mu,Ye,vv,hC,ii,fv,gv,yv,uf,uu,$a,_v,df,pf,lf,vC,lu={},fu=[],gC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hu=Array.isArray;function Dr(e,t){for(var n in t)e[n]=t[n];return e}function mf(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vu(e,t,n){var r,i,o,a={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?mu.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return pu(e,a,r,i,null)}function pu(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++vv:i,__i:-1,__u:0};return i==null&&Ye.vnode!=null&&Ye.vnode(o),o}function gu(e){return e.children}function za(e,t){this.props=e,this.context=t}function Co(e,t){if(t==null)return e.__?Co(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Co(e):null}function yC(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=Dr({},t);o.__v=t.__v+1,Ye.vnode&&Ye.vnode(o),hf(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n==null?Co(t):n,!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,wv(r,o,i),t.__e=t.__=null,o.__e!=n&&bv(o)}}function bv(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),bv(e)}function dv(e){(!e.__d&&(e.__d=!0)&&ii.push(e)&&!du.__r++||fv!=Ye.debounceRendering)&&((fv=Ye.debounceRendering)||gv)(du)}function du(){try{for(var e,t=1;ii.length;)ii.length>t&&ii.sort(yv),e=ii.shift(),t=ii.length,yC(e)}finally{ii.length=du.__r=0}}function xv(e,t,n,r,i,o,a,s,c,u,p){var l,f,d,m,g,v,w,S=r&&r.__k||fu,x=t.length;for(c=_C(n,t,S,c,x),l=0;l<x;l++)(d=n.__k[l])!=null&&(f=d.__i!=-1&&S[d.__i]||lu,d.__i=l,v=hf(e,d,f,i,o,a,s,c,u,p),m=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&vf(f.ref,null,d),p.push(d.ref,d.__c||m,d)),g==null&&m!=null&&(g=m),(w=!!(4&d.__u))||f.__k===d.__k?(c=Ev(d,c,e,w),w&&f.__e&&(f.__e=null)):typeof d.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),d.__u&=-7);return n.__e=g,c}function _C(e,t,n,r,i){var o,a,s,c,u,p=n.length,l=p,f=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[o]=pu(null,a,null,null,null):hu(a)?a=e.__k[o]=pu(gu,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[o]=pu(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+f,a.__=e,a.__b=e.__b+1,s=null,(u=a.__i=bC(a,n,c,l))!=-1&&(l--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(i>p?f--:i<p&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=c&&(u==c-1?f--:u==c+1?f++:(u>c?f--:f++,a.__u|=4))):e.__k[o]=null;if(l)for(o=0;o<p;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Co(s)),Cv(s,s));return r}function Ev(e,t,n,r){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=Ev(i[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Co(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function bC(e,t,n,r){var i,o,a,s=e.key,c=e.type,u=t[n],p=u!=null&&(2&u.__u)==0;if(u===null&&s==null||p&&s==u.key&&c==u.type)return n;if(r>(p?1:0)){for(i=n-1,o=n+1;i>=0||o<t.length;)if((u=t[a=i>=0?i--:o++])!=null&&(2&u.__u)==0&&s==u.key&&c==u.type)return a}return-1}function mv(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||gC.test(t)?n:n+"px"}function cu(e,t,n,r,i){var o,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||mv(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||mv(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(_v,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[$a]=r[$a]:(n[$a]=df,e.addEventListener(t,o?lf:pf,o)):e.removeEventListener(t,o?lf:pf,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function hv(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[uu]==null)t[uu]=df++;else if(t[uu]<n[$a])return;return n(Ye.event?Ye.event(t):t)}}}function hf(e,t,n,r,i,o,a,s,c,u){var p,l,f,d,m,g,v,w,S,x,b,R,A,O,T,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(p=Ye.__b)&&p(t);e:if(typeof I=="function")try{if(w=t.props,S=I.prototype&&I.prototype.render,x=(p=I.contextType)&&r[p.__c],b=p?x?x.props.value:p.__:r,n.__c?v=(l=t.__c=n.__c).__=l.__E:(S?t.__c=l=new I(w,b):(t.__c=l=new za(w,b),l.constructor=I,l.render=EC),x&&x.sub(l),l.state||(l.state={}),l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),S&&l.__s==null&&(l.__s=l.state),S&&I.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Dr({},l.__s)),Dr(l.__s,I.getDerivedStateFromProps(w,l.__s))),d=l.props,m=l.state,l.__v=t,f)S&&I.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),S&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(S&&I.getDerivedStateFromProps==null&&w!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(w,b),t.__v==n.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(w,l.__s,b)===!1){t.__v!=n.__v&&(l.props=w,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(L){L&&(L.__=t)}),fu.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(w,l.__s,b),S&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,m,g)})}if(l.context=b,l.props=w,l.__P=e,l.__e=!1,R=Ye.__r,A=0,S)l.state=l.__s,l.__d=!1,R&&R(t),p=l.render(l.props,l.state,l.context),fu.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,R&&R(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++A<25);l.state=l.__s,l.getChildContext!=null&&(r=Dr(Dr({},r),l.getChildContext())),S&&!f&&l.getSnapshotBeforeUpdate!=null&&(g=l.getSnapshotBeforeUpdate(d,m)),O=p!=null&&p.type===gu&&p.key==null?Sv(p.props.children):p,s=xv(e,hu(O)?O:[O],t,n,r,i,o,a,s,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&a.push(l),v&&(l.__E=l.__=null)}catch(L){if(t.__v=null,c||o!=null)if(L.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(T=o.length;T--;)mf(o[T]);ff(t)}else t.__e=n.__e,t.__k=n.__k,L.then||ff(t);Ye.__e(L,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=xC(n.__e,t,n,r,i,o,a,c,u);return(p=Ye.diffed)&&p(t),128&t.__u?void 0:s}function ff(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ff))}function wv(e,t,n){for(var r=0;r<n.length;r++)vf(n[r],n[++r],n[++r]);Ye.__c&&Ye.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){Ye.__e(o,i.__v)}})}function Sv(e){return typeof e!="object"||e==null||e.__b>0?e:hu(e)?e.map(Sv):e.constructor!==void 0?null:Dr({},e)}function xC(e,t,n,r,i,o,a,s,c){var u,p,l,f,d,m,g,v=n.props||lu,w=t.props,S=t.type;if(S=="svg"?i="http://www.w3.org/2000/svg":S=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((d=o[u])&&"setAttribute"in d==!!S&&(S?d.localName==S:d.nodeType==3)){e=d,o[u]=null;break}}if(e==null){if(S==null)return document.createTextNode(w);e=document.createElementNS(i,S,w.is&&w),s&&(Ye.__m&&Ye.__m(t,o),s=!1),o=null}if(S==null)v===w||s&&e.data==w||(e.data=w);else{if(o=S=="textarea"&&w.defaultValue!=null?null:o&&mu.call(e.childNodes),!s&&o!=null)for(v={},u=0;u<e.attributes.length;u++)v[(d=e.attributes[u]).name]=d.value;for(u in v)d=v[u],u=="dangerouslySetInnerHTML"?l=d:u=="children"||u in w||u=="value"&&"defaultValue"in w||u=="checked"&&"defaultChecked"in w||cu(e,u,null,d,i);for(u in w)d=w[u],u=="children"?f=d:u=="dangerouslySetInnerHTML"?p=d:u=="value"?m=d:u=="checked"?g=d:s&&typeof d!="function"||v[u]===d||cu(e,u,d,v[u],i);if(p)s||l&&(p.__html==l.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(l&&(e.innerHTML=""),xv(t.type=="template"?e.content:e,hu(f)?f:[f],t,n,r,S=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&Co(n,0),s,c),o!=null)for(u=o.length;u--;)mf(o[u]);s&&S!="textarea"||(u="value",S=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[u]||S=="progress"&&!m||S=="option"&&m!=v[u])&&cu(e,u,m,v[u],i),u="checked",g!=null&&g!=e[u]&&cu(e,u,g,v[u],i))}return e}function vf(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(i){Ye.__e(i,n)}}function Cv(e,t,n){var r,i;if(Ye.unmount&&Ye.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||vf(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){Ye.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Cv(r[i],t,n||typeof e.type!="function");n||mf(e.__e),e.__c=e.__=e.__e=void 0}function EC(e,t,n){return this.constructor(e,n)}function yu(e,t,n){var r,i,o,a;t==document&&(t=document.documentElement),Ye.__&&Ye.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],a=[],hf(t,e=(!r&&n||t).__k=vu(gu,null,[e]),i||lu,lu,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?mu.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,a),wv(o,e,a)}mu=fu.slice,Ye={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},vv=0,hC=function(e){return e!=null&&e.constructor===void 0},za.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Dr({},this.state),typeof e=="function"&&(e=e(Dr({},n),this.props)),e&&Dr(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),dv(this))},za.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),dv(this))},za.prototype.render=gu,ii=[],gv=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yv=function(e,t){return e.__v.__b-t.__v.__b},du.__r=0,uf=Math.random().toString(8),uu="__d"+uf,$a="__a"+uf,_v=/(PointerCapture)$|Capture$/i,df=0,pf=hv(!1),lf=hv(!0),vC=0;var Pv=function(e,t,n,r){var i;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];a===3?r[0]=s:a===4?r[1]=Object.assign(r[1]||{},s):a===5?(r[1]=r[1]||{})[t[++o]]=s:a===6?r[1][t[++o]]+=s+"":a?(i=e.apply(s,Pv(e,s,n,["",null])),r.push(i),s[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):r.push(s)}return r},Rv=new Map;function Av(e){var t=Rv.get(this);return t||(t=new Map,Rv.set(this,t)),(t=Pv(this,t.get(e)||(t.set(e,t=(function(n){for(var r,i,o=1,a="",s="",c=[0],u=function(f){o===1&&(f||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,f,a):o===3&&(f||a)?(c.push(3,f,a),o=2):o===2&&a==="..."&&f?c.push(4,f,0):o===2&&a&&!f?c.push(5,0,!0,a):o>=5&&((a||!f&&o===5)&&(c.push(o,0,a,i),o=6),f&&(c.push(o,f,0,i),o=6)),a=""},p=0;p<n.length;p++){p&&(o===1&&u(),u(p));for(var l=0;l<n[p].length;l++)r=n[p][l],o===1?r==="<"?(u(),c=[c],o=3):a+=r:o===4?a==="--"&&r===">"?(o=1,a=""):a=r+a[0]:s?r===s?s="":a+=r:r==='"'||r==="'"?s=r:r===">"?(u(),o=1):o&&(r==="="?(o=5,i=a,a=""):r==="/"&&(o<5||n[p][l+1]===">")?(u(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):r===" "||r===" "||r===` property
|