Home
last modified time | relevance | path

Searched refs:scrollToElement (Results 1 – 6 of 6) sorted by relevance

/plugin/bpmnioeditor/vendor/bpmnio-js/
Dbpmn-modeler.production.min.js7 …nslate(e.dx,e.dy).multiply(n),gn(t,n)})),{x:n.e,y:n.f}},yn.prototype.scrollToElement=function(e,t)… method in yn
33 …t.width/2,y:r.y}}(e.source,t)})),e.on("autoPlace.end",(function(e){n.scrollToElement(e.shape)})),t…
34scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected"…
Dbpmn-modeler.development.js5325 Canvas.prototype.scrollToElement = function(element, padding) {
26232 canvas.scrollToElement(event.shape);
57182 this._canvas.scrollToElement(element, { top: 400 });
57203 this._canvas.scrollToElement(element, { top: 400 });
/plugin/bpmnio/vendor/dmn-js/dist/
H A Ddmn-modeler.production.min.js13 `),this},this.appendIndent=function(){return e&&n.write(t.join(" ")),this},this.indent=function(){return t.push(""),this},this.unindent=function(){return t.pop(),this}}function n1(n){n=T({format:!1,preamble:!0},n||{});function e(t,i){var r=i||new kI,o=new RI(r,n.format);n.preamble&&o.append(dI);var s=new je,a=t.$model;if(s.getNamespaces().mapDefaultPrefixes(TI(a)),s.build(t).serializeTo(o),!i)return r.value}return{toXML:e}}function TI(n){let e=n.config&&n.config.nsMap||{},t={};for(let i in iv)t[i]=iv[i];for(let i in e){let r=e[i];t[r]=i}for(let i of n.getPackages())t[i.prefix]=i.uri;return t}function Yd(n,e){dn.call(this,n,e)}Yd.prototype=Object.create(dn.prototype);Yd.prototype.fromXML=function(n,e,t){Ie(e)||(t=e,e="dmn:Definitions");var i=new Gd(T({model:this,lax:!0},t)),r=i.handler(e);return i.fromXML(n,r)};Yd.prototype.toXML=function(n,e){var t=new n1(e);return new Promise(function(i,r){try{var o=t.toXML(n);return i({xml:o})}catch(s){return r(s)}})};var AI="DC",MI="dc",PI="http://www.omg.org/spec/DMN/20180521/DC/",DI=[{name:"Dimension",properties:[{name:"width",isAttr:!0,type:"Real"},{name:"height",isAttr:!0,type:"Real"}]},{name:"Bounds",properties:[{name:"height",isAttr:!0,type:"Real"},{name:"width",isAttr:!0,type:"Real"},{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Point",properties:[{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Color",properties:[{name:"red",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"green",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"blue",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"}]}],II=[],LI=[{name:"AlignmentKind",literalValues:[{name:"start"},{name:"center"},{name:"end"}]}],BI={name:AI,prefix:MI,uri:PI,types:DI,associations:II,enumerations:LI},NI="DI",$I="di",jI="http://www.omg.org/spec/DMN/20180521/DI/",FI=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"style",isReference:!0,type:"Style",xml:{serialize:"property"}},{name:"sharedStyle",isReference:!0,isVirtual:!0,type:"Style"}]},{name:"Diagram",superClass:["DiagramElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"}]},{name:"Shape",isAbstract:!0,properties:[{name:"bounds",type:"dc:Bounds"}],superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,properties:[{name:"waypoint",type:"dc:Point",isMany:!0,xml:{serialize:"property"}}],superClass:["DiagramElement"]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],qI=[],VI=[],HI={tagAlias:"lowerCase"},zI={name:NI,prefix:$I,uri:jI,types:FI,associations:qI,enumerations:VI,xml:HI},WI="DMN",UI="dmn",QI="https://www.omg.org/spec/DMN/20191111/MODEL/",KI=[{name:"AuthorityRequirement",superClass:["DMNElement"],properties:[{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"typeLanguage",type:"String",isAttr:!0},{name:"itemComponent",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"functionItem",type:"FunctionItem"},{name:"isCollection",isAttr:!0,type:"Boolean"}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"import",type:"Import",isMany:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0},{name:"drgElement",type:"DRGElement",isMany:!0},{name:"artifact",type:"Artifact",isMany:!0},{name:"elementCollection",type:"ElementCollection",isMany:!0},{name:"businessContextElement",type:"BusinessContextElement",isMany:!0},{name:"namespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"dmnDI",type:"dmndi:DMNDI"}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"type",type:"String"},{name:"owner",type:"DMNElementReference",xml:{serialize:"property"}},{name:"locationURI",type:"String",isAttr:!0}]},{name:"DecisionRule",superClass:["DMNElement"],properties:[{name:"inputEntry",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}},{name:"outputEntry",type:"LiteralExpression",isMany:!0,xml:{serialize:"property"}},{name:"annotationEntry",type:"RuleAnnotation",isMany:!0,xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String",xml:{serialize:"property"}},{name:"allowedAnswers",type:"String",xml:{serialize:"property"}},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"supportedObjective",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"impactedPerformanceIndicator",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionMaker",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionOwner",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"usingProcess",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"usingTask",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"decisionLogic",type:"Expression"}]},{name:"Invocation",superClass:["Expression"],properties:[{name:"calledFunction",type:"Expression"},{name:"binding",type:"Binding",isMany:!0}]},{name:"OrganisationalUnit",superClass:["BusinessContextElement"],properties:[{name:"decisionMade",type:"Decision",isReference:!0,isMany:!0},{name:"decisionOwned",type:"Decision",isReference:!0,isMany:!0}]},{name:"Import",superClass:["NamedElement"],properties:[{name:"importType",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"namespace",type:"String",isAttr:!0}]},{name:"InformationRequirement",superClass:["DMNElement"],properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ElementCollection",superClass:["NamedElement"],properties:[{name:"drgElement",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"],properties:[]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"extensionElements",type:"ExtensionElements"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"extensionAttribute",type:"ExtensionAttribute",isMany:!0},{name:"label",isAttr:!0,type:"String"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",isMany:!0,xml:{serialize:"property"}},{name:"annotation",type:"RuleAnnotationClause",isMany:!0,xml:{serialize:"property"}},{name:"rule",type:"DecisionRule",isMany:!0,xml:{serialize:"property"}},{name:"hitPolicy",type:"HitPolicy",isAttr:!0,default:"UNIQUE"},{name:"aggregation",type:"BuiltinAggregator",isAttr:!0},{name:"preferredOrientation",type:"DecisionTableOrientation",isAttr:!0},{name:"outputLabel",isAttr:!0,type:"String"}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"text",type:"String"},{name:"importedValues",type:"ImportedValues"}]},{name:"Binding",properties:[{name:"parameter",type:"InformationItem",xml:{serialize:"property"}},{name:"bindingFormula",type:"Expression"}]},{name:"KnowledgeRequirement",superClass:["DMNElement"],properties:[{name:"requiredKnowledge",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["Invocable"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0}]},{name:"BusinessContextElement",isAbstract:!0,superClass:["NamedElement"],properties:[{name:"URI",type:"String",isAttr:!0}]},{name:"PerformanceIndicator",superClass:["BusinessContextElement"],properties:[{name:"impactingDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"body",type:"Expression"},{name:"kind",type:"FunctionKind",isAttr:!0}]},{name:"Context",superClass:["Expression"],properties:[{name:"contextEntry",type:"ContextEntry",isMany:!0}]},{name:"ContextEntry",superClass:["DMNElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"value",type:"Expression"}]},{name:"List",superClass:["Expression"],properties:[{name:"elements",isMany:!0,type:"Expression"}]},{name:"Relation",superClass:["Expression"],properties:[{name:"column",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"row",type:"List",isMany:!0,xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"typeRef",isAttr:!0,type:"String"}]},{name:"UnaryTests",superClass:["Expression"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"DecisionService",superClass:["Invocable"],properties:[{name:"outputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"encapsulatedDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputData",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"ExtensionAttribute",properties:[{name:"value",type:"Element"},{name:"valueRef",type:"Element",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Element",isAbstract:!0,properties:[{name:"extensionAttribute",type:"ExtensionAttribute",isAttr:!0,isReference:!0},{name:"elements",type:"ExtensionElements",isAttr:!0,isReference:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"],properties:[]},{name:"Association",superClass:["Artifact"],properties:[{name:"sourceRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"targetRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"associationDirection",type:"AssociationDirection",isAttr:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",isAttr:!0,type:"String",default:"text/plain"}]},{name:"RuleAnnotationClause",properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"RuleAnnotation",properties:[{name:"text",type:"String"}]},{name:"Invocable",isAbstract:!0,superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"Group",superClass:["Artifact"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"FunctionItem",superClass:["DMNElement"],properties:[{name:"parameters",isMany:!0,type:"InformationItem",xml:{serialize:"property"}},{name:"outputTypeRef",isAttr:!0,type:"String"}]},{name:"DMNElementReference",properties:[{isAttr:!0,name:"href",type:"String"}]}],GI=[{name:"HitPolicy",literalValues:[{name:"UNIQUE"},{name:"FIRST"},{name:"PRIORITY"},{name:"ANY"},{name:"COLLECT"},{name:"RULE ORDER"},{name:"OUTPUT ORDER"}]},{name:"BuiltinAggregator",literalValues:[{name:"SUM"},{name:"COUNT"},{name:"MIN"},{name:"MAX"}]},{name:"DecisionTableOrientation",literalValues:[{name:"Rule-as-Row"},{name:"Rule-as-Column"},{name:"CrossTable"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"FunctionKind",literalValues:[{name:"FEEL"},{name:"Java"},{name:"PMML"}]}],XI=[],YI={tagAlias:"lowerCase"},ZI={name:WI,prefix:UI,uri:QI,types:KI,enumerations:GI,associations:XI,xml:YI},JI="DMNDI",eL="dmndi",tL="https://www.omg.org/spec/DMN/20191111/DMNDI/",nL=[{name:"DMNDI",properties:[{name:"diagrams",type:"DMNDiagram",isMany:!0},{name:"styles",type:"DMNStyle",isMany:!0}]},{name:"DMNStyle",superClass:["di:Style"],properties:[{name:"fillColor",type:"dc:Color",isAttr:!0},{name:"strokeColor",type:"dc:Color",isAttr:!0},{name:"fontColor",type:"dc:Color",isAttr:!0},{name:"fontSize",isAttr:!0,type:"Real"},{name:"fontFamily",isAttr:!0,type:"String"},{name:"fontItalic",isAttr:!0,type:"Boolean"},{name:"fontBold",isAttr:!0,type:"Boolean"},{name:"fontUnderline",isAttr:!0,type:"Boolean"},{name:"fontStrikeThrough",isAttr:!0,type:"Boolean"},{name:"labelHorizontalAlignment",type:"dc:AlignmentKind",isAttr:!0},{name:"labelVerticalAlignment",type:"dc:AlignmentKind",isAttr:!0}]},{name:"DMNDiagram",superClass:["di:Diagram"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"size",type:"Size"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"diagramElements",type:"DMNDiagramElement",isMany:!0}]},{name:"DMNDiagramElement",isAbstract:!0,superClass:["di:DiagramElement"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"label",type:"DMNLabel"}]},{name:"DMNLabel",superClass:["di:Shape"],properties:[{name:"text",type:"Text"}]},{name:"DMNShape",superClass:["di:Shape","DMNDiagramElement"],properties:[{name:"isListedInputData",isAttr:!0,type:"Boolean"},{name:"decisionServiceDividerLine",type:"DMNDecisionServiceDividerLine"},{name:"isCollapsed",isAttr:!0,type:"Boolean"}]},{name:"DMNEdge",superClass:["di:Edge","DMNDiagramElement"],properties:[{name:"sourceElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0},{name:"targetElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0}]},{name:"DMNDecisionServiceDividerLine",superClass:["di:Edge"]},{name:"Text",properties:[{name:"text",isBody:!0,type:"String"}]},{name:"Size",superClass:["dc:Dimension"]}],iL=[],rL=[],oL={name:JI,prefix:eL,uri:tL,types:nL,associations:iL,enumerations:rL},sL="bpmn.io DI for DMN",aL="http://bpmn.io/schema/dmn/biodi/2.0",lL="biodi",cL={tagAlias:"lowerCase"},uL=[{name:"DecisionTable",isAbstract:!0,extends:["dmn:DecisionTable"],properties:[{name:"annotationsWidth",isAttr:!0,type:"Integer"}]},{name:"OutputClause",isAbstract:!0,extends:["dmn:OutputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]},{name:"InputClause",isAbstract:!0,extends:["dmn:InputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]}],fL={name:sL,uri:aL,prefix:lL,xml:cL,types:uL},hL={dc:BI,di:zI,dmn:ZI,dmndi:oL,biodi:fL};function i1(n,e){var t=T({},hL,n);return new Yd(t,e)}var yt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};yt.td=yt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];yt.option=yt.optgroup=[1,'<select multiple="multiple">',"</select>"];yt.thead=yt.tbody=yt.colgroup=yt.caption=yt.tfoot=[1,"<table>","</table>"];yt.polyline=yt.ellipse=yt.polygon=yt.circle=yt.text=yt.line=yt.path=yt.rect=yt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function te(n,e=globalThis.document){var c;if(typeof n!="string")throw new TypeError("String expected");let t=/^<!--(.*?)-->$/s.exec(n);if(t)return e.createComment(t[1]);let i=(c=/<([\w:]+)/.exec(n))==null?void 0:c[1];if(!i)return e.createTextNode(n);if(n=n.trim(),i==="body"){let u=e.createElement("html");u.innerHTML=n;let{lastChild:f}=u;return f.remove(),f}let[r,o,s]=Object.hasOwn(yt,i)?yt[i]:yt._default,a=e.createElement("div");for(a.innerHTML=o+n+s;r--;)a=a.lastChild;if(a.firstChild===a.lastChild){let{firstChild:u}=a;return u.remove(),u}let l=e.createDocumentFragment();return l.append(...a.childNodes),l}function dL(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(i){if(i!=="default"&&!(i in n)){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}})}),Object.freeze(n)}function is(n,...e){let t=n.style;return k(e,function(i){i&&k(i,function(r,o){t[o]=r})}),n}function et(n,e,t){return arguments.length==2?n.getAttribute(e):t===null?n.removeAttribute(e):(n.setAttribute(e,t),n)}var pL=Object.prototype.toString;function ee(n){return new to(n)}function to(n){if(!n||!n.nodeType)throw new Error("A DOM element reference is required");this.el=n,this.list=n.classList}to.prototype.add=function(n){return this.list.add(n),this};to.prototype.remove=function(n){return pL.call(n)=="[object RegExp]"?this.removeMatching(n):(this.list.remove(n),this)};to.prototype.removeMatching=function(n){let e=this.array();for(let t=0;t<e.length;t++)n.test(e[t])&&this.remove(e[t]);return this};to.prototype.toggle=function(n,e){return typeof e!="undefined"?e!==this.list.toggle(n,e)&&this.list.toggle(n):this.list.toggle(n),this};to.prototype.array=function(){return Array.from(this.list)};to.prototype.has=to.prototype.contains=function(n){return this.list.contains(n)};function no(n){for(var e;e=n.firstChild;)n.removeChild(e);return n}function De(n,e,t){var i=t?n:n.parentNode;return i&&typeof i.closest=="function"&&i.closest(e)||null}function mL(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zd={},r1;function gL(){if(r1)return Zd;r1=1;var n,e,t;function i(){n=window.addEventListener?"addEventListener":"attachEvent",e=window.removeEventListener?"removeEventListener":"detachEvent",t=n!=="addEventListener"?"on":""}return Zd.bind=function(r,o,s,a){return n||i(),r[n](t+o,s,a||!1),s},Zd.unbind=function(r,o,s,a){return e||i(),r[e](t+o,s,a||!1),s},Zd}var o1=gL(),yL=mL(o1),q=dL({__proto__:null,default:yL},[o1]),s1=["focus","blur"];function vL(n,e,t,i,r){return s1.indexOf(t)!==-1&&(r=!0),q.bind(n,t,function(o){var s=o.target||o.srcElement;o.delegateTarget=De(s,e,!0),o.delegateTarget&&i.call(n,o)},r)}function xL(n,e,t,i){return s1.indexOf(e)!==-1&&(i=!0),q.unbind(n,e,t,i)}var _t={bind:vL,unbind:xL};function hr(n,e){return n&&typeof n.matches=="function"&&n.matches(e)||!1}function X(n,e){return e=e||document,e.querySelector(n)}function pn(n,e){return e=e||document,e.querySelectorAll(n)}function Qe(n){n.parentNode&&n.parentNode.removeChild(n)}function ha(n){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(e>=1&&ge(arguments[e-1])){var t=arguments[e-1];console.warn(new Error("Passing callbacks to "+bL(n.name)+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);n.apply(this,i).then(function(r){var o=Object.keys(r)[0];return t(null,r[o])},function(r){return t(r,r.warnings)})}else return n.apply(this,arguments)}}function bL(n){return n.replace("bound ","")}var _L={width:"100%",height:"100%",position:"relative"},rs=class{constructor(e={}){M(this,"_viewsChanged",()=>{this._emit("views.changed",{views:this._views,activeView:this._activeView})});this._eventBus=new ut,this._viewsChanged=Mi(this._viewsChanged,0),this._views=[],this._viewers={},this.open=ha(this.open.bind(this)),this.importXML=ha(this.importXML.bind(this)),this.saveXML=ha(this.saveXML.bind(this)),this._init(e)}importXML(e,t){var i=this;return t=t||{open:!0},new Promise(function(o,s){var a=i._activeView;i._clear().then(()=>{e=i._emit("import.parse.start",{xml:e})||e;var l;i._moddle.fromXML(e,"dmn:Definitions").then(c=>{var u=c.rootElement,f=c.references,h=c.elementsById;if(l=c.warnings,u=i._emit("import.parse.complete",r({error:null,definitions:u,elementsById:h,references:f,warnings:l}))||u,i._setDefinitions(u),!t.open){i._emit("import.done",{error:null,warnings:l}),o({warnings:l});return}var d=i._getInitialView(i._views,a);if(!d){var p=new Error("no displayable contents");return i._emit("import.done",{error:p,warnings:l}),p.warnings=l,s(p)}i.open(d).then(m=>({warnings:m.warnings})).catch(m=>({error:m,warnings:m.warnings})).then(m=>{var g=[].concat(l,m.warnings);i._emit("import.done",{error:m.error,warnings:g}),m.error?(m.error.warnings=g,s(m.error)):o({warnings:g})})}).catch(c=>(l=c.warnings,c=wL(c,e)||CL(c)||c,i._emit("import.parse.complete",r({error:c,warnings:l})),i._emit("import.done",{error:c,warnings:l}),c.warnings=l,s(c)))}).catch(l=>(i._emit("import.done",{error:l,warnings:[]}),l.warnings=[],s(l)))});function r(o){var s=i._eventBus.createEvent(o);return Object.defineProperty(s,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:o.warnings,references:o.references,elementsById:o.elementsById}}}),s}}getDefinitions(){return this._definitions}getActiveView(){return this._activeView}getActiveViewer(){var e=this.getActiveView();return e&&this._getViewer(e)}getView(e){return this._views.filter(function(t){return t.element===e})[0]}getViews(){return this._views}saveXML(e){var t=this;e=e||{};var i=this._definitions;return new Promise(function(r,o){if(!i){o(new Error("no definitions loaded"));return}i=t._emit("saveXML.start",{definitions:i})||i,t._moddle.toXML(i,e).then(function(s){var a=s.xml;return a=t._emit("saveXML.serialized",{xml:a})||a,{xml:a}}).catch(s=>({error:s})).then(s=>{t._emit("saveXML.done",s),s.error?o(s.error):r({xml:s.xml})})})}on(...e){this._eventBus.on(...e)}off(...e){this._eventBus.off(...e)}once(...e){this._eventBus.once(...e)}attachTo(e){e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=X(e)),e.appendChild(this._container),this._emit("attach",{})}detach(){this._emit("detach",{}),Qe(this._container)}destroy(){Object.keys(this._viewers).forEach(e=>{var t=this._viewers[e];c1(t,"destroy")}),Qe(this._container)}_init(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];let t=te('<div class="dmn-js-parent"></div>'),i=T({},_L,e);T(t.style,{width:a1(i.width),height:a1(i.height),position:i.position}),this._container=t,e.container&&this.attachTo(e.container)}_clear(){return this._switchView(null)}open(e){return this._switchView(e)}_setDefinitions(e){this._definitions=e,this._updateViews()}_updateViews(){var e=this._definitions;if(!e){this._views=[],this._switchView(null);return}var t=this._getViewProviders(),i=[e,...e.drgElement||[]],r=this._views,o=[];for(var s of i){var a=ye(t,function(d){return typeof d.opens=="string"?d.opens===s.$type:d.opens(s)});if(a){var l={element:s,id:s.id,name:s.name,type:a.id};o.push(l)}}var c=this._activeView,u;if(c&&(u=ye(o,function(d){return Jd(c,d)})||this._getInitialView(o),!u)){this._switchView(null);return}var f=!Jd(c,u)||l1(c,u),h=r.length!==o.length||!kt(o,function(d){return ye(r,function(p){return Jd(p,d)&&!l1(p,d)})});this._activeView=u,this._views=o,(f||h)&&this._viewsChanged()}_getInitialView(e,t){var i;return t&&(i=ye(e,function(r){return Jd(r,t)})||ye(e,function(r){return r.type===t})),i||e[0]}_switchView(e){var t=this;return new Promise(function(i,r){var o=(u,f)=>{t._viewsChanged(),u?r(u):i(f)},s=t.getActiveView(),a,l=e&&t._getViewer(e),c=e&&e.element;if(s&&(a=t._getViewer(s),a!==l&&(c1(a,"clear"),a.detach())),t._activeView=e,l){a!==l&&l.attachTo(t._container),t._emit("import.render.start",{view:e,element:c}),l.open(c).then(u=>{t._emit("import.render.complete",{view:e,error:null,warnings:u.warnings}),o(null,u)}).catch(u=>{t._emit("import.render.complete",{view:e,error:u,warnings:u.warnings}),o(u,null)});return}o()})}_getViewer(e){var t=e.type,i=this._viewers[t];return i||(i=this._viewers[t]=this._createViewer(e.type),this._emit("viewer.created",{type:t,viewer:i})),i}_createViewer(e){var t=ye(this._getViewProviders(),function(s){return s.id===e});if(!t)throw new Error("no provider for view type <"+e+">");var i=t.constructor,r=this._options[e]||{},o=this._options.common||{};return new i({...o,...r,additionalModules:[...r.additionalModules||[],{_parent:["value",this],moddle:["value",this._moddle]}]})}_emit(...e){return this._eventBus.fire(...e)}_createModdle(e){return new i1(e.moddleExtensions)}_getViewProviders(){return[]}};function a1(n){return n+(se(n)?"px":"")}function wL(n,e){if(n.message!=="failed to parse document as <dmn:Definitions>")return null;var t=e.indexOf('"http://www.omg.org/spec/DMN/20151101/dmn.xsd"')!==-1&&"1.1"||e.indexOf('"http://www.omg.org/spec/DMN/20180521/MODEL/"')!==-1&&"1.2";return t?(n=new Error("unsupported DMN "+t+" file detected; only DMN 1.3 files can be opened"),console.error("Cannot open what looks like a DMN "+t+" diagram. Please refer to https://bpmn.io/l/dmn-compatibility.html to learn how to make the toolkit compatible with older DMN files",n),n):null}function CL(n){var e=/unparsable content <([^>]+)> detected([\s\S]*)$/,t=e.exec(n.message);return t?(n.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid DMN 1.3 diagram file"+t[2],n):null}function Jd(n,e){return Me(n)?Me(e)?n.element===e.element||n.id===e.id:!1:!Me(e)}function l1(n,e){return!n||!e||n.name!==e.name}function c1(n,e){ge(n[e])&&n[e]()}function EL(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var cv={exports:{}},u1;function SL(){if(u1)return cv.exports;u1=1;var n=cv.exports=function(e,t){if(t||(t=16),e===void 0&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(t),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(t)*r;for(var o=i-Math.floor(i),s="",r=0;r<Math.floor(i);r++){var a=Math.floor(Math.random()*t).toString(t);s=a+s}if(o){var l=Math.pow(t,o),a=Math.floor(Math.random()*l).toString(t);s=a+s}var c=parseInt(s,t);return c!==1/0&&c>=Math.pow(2,e)?n(e,t):s};return n.rack=function(e,t,i){var r=function(s){var a=0;do{if(a++>10)if(i)e+=i;else throw new Error("too many ID collisions, use more bits");var l=n(e,t)}while(Object.hasOwnProperty.call(o,l));return o[l]=s,l},o=r.hats={};return r.get=function(s){return r.hats[s]},r.set=function(s,a){return r.hats[s]=a,r},r.bits=e||128,r.base=t||16,r},cv.exports}var OL=SL(),kL=EL(OL);function qn(n){if(!(this instanceof qn))return new qn(n);n=n||[128,36,1],this._seed=n.length?kL.rack(n[0],n[1],n[2]):n}qn.prototype.next=function(n){return this._seed(n||!0)};qn.prototype.nextPrefixed=function(n,e){var t;do t=n+this.next(!0);while(this.assigned(t));return this.claim(t,e),t};qn.prototype.claim=function(n,e){this._seed.set(n,e||!0)};qn.prototype.assigned=function(n){return this._seed.get(n)||!1};qn.prototype.unclaim=function(n){delete this._seed.hats[n]};qn.prototype.clear=function(){var n=this._seed.hats,e;for(e in n)this.unclaim(e)};function O(n,e){var t=Ke(n);return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function ie(n){return O(n,"dmn:InputClause")}function Te(n){return O(n,"dmn:OutputClause")}function Ke(n){return n&&n.businessObject||n}function f1(n){return Ke(n).name}function Ge(n,e){return zd(e,function(t){return O(n,t)})}function dr(n){var e=Ke(n);if(O(e,"dmn:Decision"))return e.get("decisionLogic");if(O(e,"dmn:BusinessKnowledgeModel")){var t=e.get("encapsulatedLogic");return t&&t.get("body")}}var RL="https://www.omg.org/spec/DMN/20191111/FEEL/";function h1(n){for(let e=n;e;e=e.$parent){let t=e.get("expressionLanguage");if(t)return!!(t===RL||/feel/i.test(t));if(O(e,"dmn:FunctionDefinition"))return(e.get("kind")||"FEEL")==="FEEL"}return!0}var Yu=class extends rs{_init(e){super._init(e),this.on("import.parse.complete",t=>{t.error||this._collectIds(t.definitions,t.elementsById)}),this.on("destroy",()=>{this._moddle.ids.clear()}),this.on("viewer.created",({viewer:t})=>{t.on("elements.changed",({elements:i})=>{var r=i.some(function(o){return Ge(o,["dmn:Decision","dmn:Definitions","dmn:BusinessKnowledgeModel"])});r&&this._updateViews()})})}_collectIds(e,t){var i=e.$model,r=i.ids,o;r.clear();for(o in t)r.claim(o,t[o])}_createModdle(e){var t=super._createModdle(e);return t.ids=new qn([32,36,1]),t}};function fe(n,e){e&&(n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}var TL=/^class[ {]/;function AL(n){return TL.test(n.toString())}function fv(n){return Array.isArray(n)}function uv(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ep(...n){n.length===1&&fv(n[0])&&(n=n[0]),n=[...n];let e=n.pop();return e.$inject=n,e}var ML=/constructor\s*[^(]*\(\s*([^)]*)\)/m,PL=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,DL=/\/\*([^*]*)\*\//m;function IL(n){if(typeof n!="function")throw new Error(`Cannot annotate "${n}". Expected a function!`);let e=n.toString().match(AL(n)?ML:PL);if(!e)return[];let t=e[1]||e[2];return t&&t.split(",").map(i=>{let r=i.match(DL);return(r&&r[1]||i).trim()})||[]}function os(n,e){let t=e||{get:function(v,x){if(i.push(v),x===!1)return null;throw a(`No provider for "${v}"!`)}},i=[],r=this._providers=Object.create(t._providers||null),o=this._instances=Object.create(null),s=o.injector=this,a=function(v){let x=i.join(" -> ");return i.length=0,new Error(x?`${v} (Resolving: ${x})`:v)};function l(v,x){if(!r[v]&&v.includes(".")){let C=v.split("."),E=l(C.shift());for(;C.length;)E=E[C.shift()];return E}if(uv(o,v))return o[v];if(uv(r,v)){if(i.indexOf(v)!==-1)throw i.push(v),a("Cannot resolve circular dependency!");return i.push(v),o[v]=r[v][0](r[v][1]),i.pop(),o[v]}return t.get(v,x)}function c(v,x){if(typeof x=="undefined"&&(x={}),typeof v!="function")if(fv(v))v=ep(v.slice());else throw a(`Cannot invoke "${v}". Expected a function!`);let E=(v.$inject||IL(v)).map(S=>uv(x,S)?x[S]:l(S));return{fn:v,dependencies:E}}function u(v){let{fn:x,dependencies:C}=c(v),E=Function.prototype.bind.call(x,null,...C);return new E}function f(v,x,C){let{fn:E,dependencies:S}=c(v,C);return E.apply(x,S)}function h(v){return ep(x=>v.get(x))}function d(v,x){if(x&&x.length){let C=Object.create(null),E=Object.create(null),S=[],w=[],R=[],A,I,D,N;for(let W in r)A=r[W],x.indexOf(W)!==-1&&(A[2]==="private"?(I=S.indexOf(A[3]),I===-1?(D=A[3].createChild([],x),N=h(D),S.push(A[3]),w.push(D),R.push(N),C[W]=[N,W,"private",D]):C[W]=[R[I],W,"private",w[I]]):C[W]=[A[2],A[1]],E[W]=!0),(A[2]==="factory"||A[2]==="type")&&A[1].$scope&&x.forEach(Re=>{A[1].$scope.indexOf(Re)!==-1&&(C[W]=[A[2],A[1]],E[Re]=!0)});x.forEach(W=>{if(!E[W])throw new Error('No provider for "'+W+'". Cannot use provider from the parent!')}),v.unshift(C)}return new os(v,s)}let p={factory:f,type:u,value:function(v){return v}};function m(v,x){let C=v.__init__||[];return function(){C.forEach(E=>{typeof E=="string"?x.get(E):x.invoke(E)})}}function g(v){let x=v.__exports__;if(x){let C=v.__modules__,E=Object.keys(v).reduce((I,D)=>(D!=="__exports__"&&D!=="__modules__"&&D!=="__init__"&&D!=="__depends__"&&(I[D]=v[D]),I),Object.create(null)),S=(C||[]).concat(E),w=d(S),R=ep(function(I){return w.get(I)});x.forEach(function(I){r[I]=[R,I,"private",w]});let A=(v.__init__||[]).slice();return A.unshift(function(){w.init()}),v=Object.assign({},v,{__init__:A}),m(v,w)}return Object.keys(v).forEach(function(C){if(C==="__init__"||C==="__depends__")return;let E=v[C];if(E[2]==="private"){r[C]=E;return}let S=E[0],w=E[1];r[C]=[p[S],LL(S,w),S]}),m(v,s)}function b(v,x){return v.indexOf(x)!==-1||(v=(x.__depends__||[]).reduce(b,v),v.indexOf(x)!==-1)?v:v.concat(x)}function _(v){let x=v.reduce(b,[]).map(g),C=!1;return function(){C||(C=!0,x.forEach(E=>E()))}}this.get=l,this.invoke=f,this.instantiate=u,this.createChild=d,this.init=_(n)}function LL(n,e){return n!=="value"&&fv(e)&&(e=ep(e.slice())),e}var BL=1e3;function mn(n,e){var t=this;e=e||BL,n.on(["render.shape","render.connection"],e,function(i,r){var o=i.type,s=r.element,a=r.gfx,l=r.attrs;if(t.canRender(s))return o==="render.shape"?t.drawShape(a,s,l):t.drawConnection(a,s,l)}),n.on(["render.getShapePath","render.getConnectionPath"],e,function(i,r){if(t.canRender(r))return i.type==="render.getShapePath"?t.getShapePath(r):t.getConnectionPath(r)})}mn.prototype.canRender=function(n){};mn.prototype.drawShape=function(n,e){};mn.prototype.drawConnection=function(n,e){};mn.prototype.getShapePath=function(n){};mn.prototype.getConnectionPath=function(n){};function NL(n,e){if(n.ownerDocument!==e.ownerDocument)try{return e.ownerDocument.importNode(n,!0)}catch{}return n}function g1(n,e){return e.appendChild(NL(n,e))}function K(n,e){return g1(e,n),n}var pv=2,y1={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":pv,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":pv,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function $L(n,e){return y1[e]?n.style[e]:n.getAttributeNS(null,e)}function v1(n,e,t){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=y1[i];r?(r===pv&&typeof t=="number"&&(t=String(t)+"px"),n.style[i]=t):n.setAttributeNS(null,e,t)}function jL(n,e){var t=Object.keys(e),i,r;for(i=0,r;r=t[i];i++)v1(n,r,e[r])}function j(n,e,t){if(typeof e=="string")if(t!==void 0)v1(n,e,t);else return $L(n,e);else jL(n,e);return n}var FL=Object.prototype.toString;function ne(n){return new io(n)}function io(n){if(!n||!n.nodeType)throw new Error("A DOM element reference is required");this.el=n,this.list=n.classList}io.prototype.add=function(n){return this.list.add(n),this};io.prototype.remove=function(n){return FL.call(n)=="[object RegExp]"?this.removeMatching(n):(this.list.remove(n),this)};io.prototype.removeMatching=function(n){let e=this.array();for(let t=0;t<e.length;t++)n.test(e[t])&&this.remove(e[t]);return this};io.prototype.toggle=function(n,e){return typeof e!="undefined"?e!==this.list.toggle(n,e)&&this.list.toggle(n):this.list.toggle(n),this};io.prototype.array=function(){return Array.from(this.list)};io.prototype.has=io.prototype.contains=function(n){return this.list.contains(n)};function ss(n){for(var e;e=n.firstChild;)n.removeChild(e);return n}function gv(n){return n.cloneNode(!0)}var yv={svg:"http://www.w3.org/2000/svg"},d1='<svg xmlns="'+yv.svg+'"';function x1(n){var e=!1;n.substring(0,4)==="<svg"?n.indexOf(yv.svg)===-1&&(n=d1+n.substring(4)):(n=d1+">"+n+"</svg>",e=!0);var t=qL(n);if(!e)return t;for(var i=document.createDocumentFragment(),r=t.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function qL(n){var e;return e=new DOMParser,e.async=!1,e.parseFromString(n,"text/xml")}function Q(n,e){var t;return n=n.trim(),n.charAt(0)==="<"?(t=x1(n).firstChild,t=document.importNode(t,!0)):t=document.createElementNS(yv.svg,n),e&&j(t,e),t}var hv=null;function mv(){return hv===null&&(hv=Q("svg")),hv}function p1(n,e){var t,i,r=Object.keys(e);for(t=0;i=r[t];t++)n[i]=e[i];return n}function b1(n,e,t,i,r,o){var s=mv().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return p1(s,n);case 6:return p1(s,{a:n,b:e,c:t,d:i,e:r,f:o})}}function da(n){return n?mv().createSVGTransformFromMatrix(n):mv().createSVGTransform()}var m1=/([&<>]{1})/g,VL=/([&<>\n\r"]{1})/g,HL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function dv(n,e){function t(i,r){return HL[r]||r}return n.replace(e,t)}function _1(n,e){var t,i,r,o,s;switch(n.nodeType){case 3:e.push(dv(n.textContent,m1));break;case 1:if(e.push("<",n.tagName),n.hasAttributes())for(r=n.attributes,t=0,i=r.length;t<i;++t)o=r.item(t),e.push(" ",o.name,'="',dv(o.value,VL),'"');if(n.hasChildNodes()){for(e.push(">"),s=n.childNodes,t=0,i=s.length;t<i;++t)_1(s.item(t),e);e.push("</",n.tagName,">")}else e.push("/>");break;case 8:e.push("<!--",dv(n.nodeValue,m1),"-->");break;case 4:e.push("<![CDATA[",n.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+n.nodeType)}return e}function zL(n,e){var t=x1(e);if(ss(n),!!e){UL(t)||(t=t.documentElement);for(var i=QL(t.childNodes),r=0;r<i.length;r++)g1(i[r],n)}}function WL(n){for(var e=n.firstChild,t=[];e;)_1(e,t),e=e.nextSibling;return t.join("")}function UL(n){return n.nodeName==="#document-fragment"}function w1(n,e){if(e!==void 0){try{zL(n,e)}catch(t){throw new Error("error parsing SVG: "+t.message)}return n}else return WL(n)}function QL(n){return Array.prototype.slice.call(n)}function Fe(n){var e=n.parentNode;return e&&e.removeChild(n),n}function KL(n,e){return e instanceof SVGMatrix?n.createSVGTransformFromMatrix(e):e}function GL(n,e){var t,i;for(n.clear(),t=0;i=e[t];t++)n.appendItem(KL(n,i))}function as(n,e){var t=n.transform.baseVal;return e&&(Array.isArray(e)||(e=[e]),GL(t,e)),t.consolidate()}function np(n){return n.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function XL(n){return["M",n.x,n.y]}function vv(n){return["L",n.x,n.y]}function YL(n,e,t){return["C",n.x,n.y,e.x,e.y,t.x,t.y]}function ZL(n,e){let t=n.length,i=[XL(n[0])];for(let r=1;r<t;r++){let o=n[r-1],s=n[r],a=n[r+1];if(!a||!e){i.push(vv(s));continue}let l=Math.min(e,xv(s.x-o.x,s.y-o.y),xv(a.x-s.x,a.y-s.y));if(!l){i.push(vv(s));continue}let c=tp(s,o,l),u=tp(s,o,l*.5),f=tp(s,a,l),h=tp(s,a,l*.5);i.push(vv(c)),i.push(YL(u,h,f))}return i}function tp(n,e,t){let i=e.x-n.x,r=e.y-n.y,o=xv(i,r),s=t/o;return{x:n.x+i*s,y:n.y+r*s}}function xv(n,e){return Math.sqrt(Math.pow(n,2)+Math.pow(e,2))}function ro(n,e,t){se(e)&&(t=e,e=null),e||(e={});let i=Q("path",e);return se(t)&&(i.dataset.cornerRadius=String(t)),bv(i,n)}function bv(n,e){let t=parseInt(n.dataset.cornerRadius,10)||0;return j(n,{d:np(ZL(e,t))}),n}function E1(n){return Ee(n,function(e){return!ye(n,function(t){return t!==e&&S1(e,t)})})}function S1(n,e){if(e){if(n===e)return e;if(n.parent)return S1(n.parent,e)}}function C1(n,e,t){var i=!t||n.indexOf(e)===-1;return i&&n.push(e),i}function _v(n,e,t){t=t||0,F(n)||(n=[n]),k(n,function(i,r){var o=e(i,r,t);F(o)&&o.length&&_v(o,e,t+1)})}function JL(n,e,t){var i=[],r=[];return _v(n,function(o,s,a){C1(i,o,e);var l=o.children;if((t===-1||a<t)&&l&&C1(r,l,e))return l}),i}function O1(n,e){return JL(n,!e,-1)}function k1(n,e,t){Hu(e)&&(e=!0),Pe(e)&&(t=e,e=!0),t=t||{};var i=Zu(t.allShapes),r=Zu(t.allConnections),o=Zu(t.enclosedElements),s=Zu(t.enclosedConnections),a=Zu(t.topLevel,e&&ur(n,function(u){return u.id}));function l(u){a[u.source.id]&&a[u.target.id]&&(a[u.id]=[u]),i[u.source.id]&&i[u.target.id]&&(s[u.id]=o[u.id]=u),r[u.id]=u}function c(u){if(o[u.id]=u,u.waypoints)s[u.id]=r[u.id]=u;else return i[u.id]=u,k(u.incoming,l),k(u.outgoing,l),u.children}return _v(n,c),{allShapes:i,allConnections:r,topLevel:a,enclosedConnections:s,enclosedElements:o}}function Tt(n,e){e=!!e,F(n)||(n=[n]);var t,i,r,o;return k(n,function(s){var a=s;s.waypoints&&!e&&(a=Tt(s.waypoints,!0));var l=a.x,c=a.y,u=a.height||0,f=a.width||0;(l<t||t===void 0)&&(t=l),(c<i||i===void 0)&&(i=c),(l+f>r||r===void 0)&&(r=l+f),(c+u>o||o===void 0)&&(o=c+u)}),{x:t,y:i,height:o-i,width:r-t}}function wv(n,e){var t={};return k(n,function(i){var r=i;r.waypoints&&(r=Tt(r)),!se(e.y)&&r.x>e.x&&(t[i.id]=i),!se(e.x)&&r.y>e.y&&(t[i.id]=i),r.x>e.x&&r.y>e.y&&(se(e.width)&&se(e.height)&&r.width+r.x<e.width+e.x&&r.height+r.y<e.height+e.y||!se(e.width)||!se(e.height))&&(t[i.id]=i)}),t}function ip(n){return"waypoints"in n?"connection":"x"in n?"shape":"root"}function rp(n){return!!(n&&n.isFrame)}function Zu(n,e){return T({},n||{},e||{})}var eB=1;function Di(n,e){mn.call(this,n,eB),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}fe(Di,mn);Di.prototype.canRender=function(){return!0};Di.prototype.drawShape=function(e,t,i){var r=Q("rect");return j(r,{x:0,y:0,width:t.width||0,height:t.height||0}),rp(t)?j(r,T({},this.FRAME_STYLE,i||{})):j(r,T({},this.SHAPE_STYLE,i||{})),K(e,r),r};Di.prototype.drawConnection=function(e,t,i){var r=ro(t.waypoints,T({},this.CONNECTION_STYLE,i||{}));return K(e,r),r};Di.prototype.getShapePath=function(e){var t=e.x,i=e.y,r=e.width,o=e.height,s=[["M",t,i],["l",r,0],["l",0,o],["l",-r,0],["z"]];return np(s)};Di.prototype.getConnectionPath=function(e){var t=e.waypoints,i,r,o=[];for(i=0;r=t[i];i++)r=r.original||r,o.push([i===0?"M":"L",r.x,r.y]);return np(o)};Di.$inject=["eventBus","styles"];function Cv(){var n={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(t,i,r){var o=this.style(i,r);return T(o,{class:t})},this.style=function(t,i){!F(t)&&!i&&(i=t,t=[]);var r=st(t,function(o,s){return T(o,n[s]||{})},{});return i?T(r,i):r},this.computeStyle=function(t,i,r){return F(i)||(r=i,i=[]),e.style(i||[],T({},r,t||{}))}}var R1={__init__:["defaultRenderer"],defaultRenderer:["type",Di],styles:["type",Cv]};function Vn(n,e){if(!n||!e)return-1;var t=n.indexOf(e);return t!==-1&&n.splice(t,1),t}function zt(n,e,t){if(!(!n||!e)){typeof t!="number"&&(t=-1);var i=n.indexOf(e);if(i!==-1){if(i===t)return;if(t!==-1)n.splice(i,1);else return}t!==-1?n.splice(t,0,e):n.push(e)}}function op(n,e){return!n||!e?-1:n.indexOf(e)}function pa(n,e){return!n||!e?-1:Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function sp(n,e,t,i){if(typeof i=="undefined"&&(i=5),!n||!e||!t)return!1;var r=(e.x-n.x)*(t.y-n.y)-(e.y-n.y)*(t.x-n.x),o=pa(n,e);return Math.abs(r/o)<=i}var tB=2;function pr(n,e){var t=Array.from(arguments).flat();let i={x:"v",y:"h"};for(let[r,o]of Object.entries(i))if(nB(r,t))return o;return!1}function nB(n,e){let t=e[0];return kt(e,function(i){return Math.abs(t[n]-i[n])<=tB})}function Ju(n,e){return{x:Math.round(n.x+(e.x-n.x)/2),y:Math.round(n.y+(e.y-n.y)/2)}}var iB=/,?([a-z]),?/gi,T1=parseFloat,ft=Math,oo=ft.PI,Ii=ft.min,Li=ft.max,A1=ft.pow,ao=ft.abs,rB=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,oB=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,M1=Array.isArray||function(n){return n instanceof Array};function sB(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function aB(n,e){for(var t=0,i=n.length;t<i;t++)if(n[t]===e)return n.push(n.splice(t,1)[0])}function lB(n){function e(){var t=Array.prototype.slice.call(arguments,0),i=t.join("\u2400"),r=e.cache=e.cache||{},o=e.count=e.count||[];return sB(r,i)?(aB(o,i),r[i]):(o.length>=1e3&&delete r[o.shift()],o.push(i),r[i]=n(...arguments),r[i])}return e}function cB(n){if(!n)return null;var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=[];return String(n).replace(rB,function(i,r,o){var s=[],a=r.toLowerCase();for(o.replace(oB,function(l,c){c&&s.push(+c)}),a=="m"&&s.length>2&&(t.push([r,...s.splice(0,2)]),a="l",r=r=="m"?"l":"L");s.length>=e[a]&&(t.push([r,...s.splice(0,e[a])]),!!e[a]););}),t.toString=Sv,t}function uB(n){for(var e=0,t=n.length;e<t;e++){var i=n[e][0];if(typeof i=="string"&&i!==i.toUpperCase())return!1}return!0}function fB(n){for(var e=0,t=n.length;e<t;e++){var i=n[e][0];if(i!=="M"&&i!=="C")return!1}return!0}function Ev(n,e,t,i){return arguments.length===1&&(e=n.y,t=n.width,i=n.height,n=n.x),{x:n,y:e,width:t,height:i,x2:n+t,y2:e+i}}function Sv(){return this.join(",").replace(iB,"$1")}function hB(n){for(var e=new Array(n.length),t=0,i=n.length;t<i;t++)for(var r=n[t],o=e[t]=new Array(r.length),s=0,a=r.length;s<a;s++)o[s]=r[s];return e.toString=Sv,e}function P1(n,e,t,i,r,o,s,a,l){var c=1-l,u=A1(c,3),f=A1(c,2),h=l*l,d=h*l,p=u*n+f*3*l*t+c*3*l*l*r+d*s,m=u*e+f*3*l*i+c*3*l*l*o+d*a;return{x:lp(p),y:lp(m)}}function D1(n){var e=vB(...n);return Ev(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0)}function so(n,e,t){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function dB(n,e){return n=Ev(n),e=Ev(e),so(e,n.x,n.y)||so(e,n.x2,n.y)||so(e,n.x,n.y2)||so(e,n.x2,n.y2)||so(n,e.x,e.y)||so(n,e.x2,e.y)||so(n,e.x,e.y2)||so(n,e.x2,e.y2)||(n.x<e.x2&&n.x>e.x||e.x<n.x2&&e.x>n.x)&&(n.y<e.y2&&n.y>e.y||e.y<n.y2&&e.y>n.y)}function I1(n,e,t,i,r){var o=-3*e+9*t-9*i+3*r,s=n*o+6*e-12*t+6*i;return n*s-3*e+3*t}function L1(n,e,t,i,r,o,s,a,l){l==null&&(l=1),l=l>1?1:l<0?0:l;for(var c=l/2,u=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,p=0;p<u;p++){var m=c*f[p]+c,g=I1(m,n,t,r,s),b=I1(m,e,i,o,a),_=g*g+b*b;d+=h[p]*ft.sqrt(_)}return c*d}function pB(n,e,t,i,r,o,s,a){if(!(Li(n,t)<Ii(r,s)||Ii(n,t)>Li(r,s)||Li(e,i)<Ii(o,a)||Ii(e,i)>Li(o,a))){var l=(n*i-e*t)*(r-s)-(n-t)*(r*a-o*s),c=(n*i-e*t)*(o-a)-(e-i)*(r*a-o*s),u=(n-t)*(o-a)-(e-i)*(r-s);if(u){var f=lp(l/u),h=lp(c/u),d=+f.toFixed(2),p=+h.toFixed(2);if(!(d<+Ii(n,t).toFixed(2)||d>+Li(n,t).toFixed(2)||d<+Ii(r,s).toFixed(2)||d>+Li(r,s).toFixed(2)||p<+Ii(e,i).toFixed(2)||p>+Li(e,i).toFixed(2)||p<+Ii(o,a).toFixed(2)||p>+Li(o,a).toFixed(2)))return{x:f,y:h}}}}function lp(n){return Math.round(n*1e11)/1e11}function mB(n,e,t){var i=D1(n),r=D1(e);if(!dB(i,r))return t?0:[];var o=L1(...n),s=L1(...e),a=B1(n)?1:~~(o/5)||1,l=B1(e)?1:~~(s/5)||1,c=new Array(a+1),u=new Array(l+1),f={},h=t?0:[],d,p;for(d=0;d<a+1;d++){var m=P1(...n,d/a);c[d]={x:m.x,y:m.y,t:d/a}}for(d=0;d<l+1;d++)m=P1(...e,d/l),u[d]={x:m.x,y:m.y,t:d/l};for(d=0;d<a;d++)for(p=0;p<l;p++){var g=c[d],b=c[d+1],_=u[p],v=u[p+1],x=ao(b.x-g.x)<.01?"y":"x",C=ao(v.x-_.x)<.01?"y":"x",E=pB(g.x,g.y,b.x,b.y,_.x,_.y,v.x,v.y),S;if(E){if(S=E.x.toFixed(9)+"#"+E.y.toFixed(9),f[S])continue;f[S]=!0;var w=g.t+ao((E[x]-g[x])/(b[x]-g[x]))*(b.t-g.t),R=_.t+ao((E[C]-_[C])/(v[C]-_[C]))*(v.t-_.t);w>=0&&w<=1&&R>=0&&R<=1&&(t?h++:h.push({x:E.x,y:E.y,t1:w,t2:R}))}}return h}function ef(n,e,t){n=$1(n),e=$1(e);for(var i,r,o,s,a,l,c,u,f,h,d=t?0:[],p=0,m=n.length;p<m;p++){var g=n[p];if(g[0]=="M")i=a=g[1],r=l=g[2];else{g[0]=="C"?(f=[i,r,...g.slice(1)],i=f[6],r=f[7]):(f=[i,r,i,r,a,l,a,l],i=a,r=l);for(var b=0,_=e.length;b<_;b++){var v=e[b];if(v[0]=="M")o=c=v[1],s=u=v[2];else{v[0]=="C"?(h=[o,s,...v.slice(1)],o=h[6],s=h[7]):(h=[o,s,o,s,c,u,c,u],o=c,s=u);var x=mB(f,h,t);if(t)d+=x;else{for(var C=0,E=x.length;C<E;C++)x[C].segment1=p,x[C].segment2=b,x[C].bez1=f,x[C].bez2=h;d=d.concat(x)}}}}}return d}function gB(n){return M1(n)&&M1(n[0])}function yB(n){if(uB(n))return n;var e=new Array(n.length),t=0,i=0,r=0,o=0,s=0,a;n[0][0]=="M"&&(t=+n[0][1],i=+n[0][2],r=t,o=i,s++,e[0]=["M",t,i]);for(var l,c,u=s,f=n.length;u<f;u++){if(c=n[u],a=c[0],e[u]=l=new Array(c.length),a!=a.toUpperCase())switch(l[0]=a.toUpperCase(),l[0]){case"A":l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5],l[6]=+c[6]+t,l[7]=+c[7]+i;break;case"V":l[1]=+c[1]+i;break;case"H":l[1]=+c[1]+t;break;case"M":r=+c[1]+t,o=+c[2]+i;default:for(var h=1,d=c.length;h<d;h++)l[h]=+c[h]+(h%2?t:i)}else for(var p=0,m=c.length;p<m;p++)l[p]=c[p];switch(a=a.toUpperCase(),l[0]){case"Z":t=+r,i=+o;break;case"H":t=l[1];break;case"V":i=l[1];break;case"M":r=l[l.length-2],o=l[l.length-1];default:t=l[l.length-2],i=l[l.length-1]}}return e.toString=Sv,e}function B1(n){return n[0]===n[2]&&n[1]===n[3]&&n[4]===n[6]&&n[5]===n[7]}function ap(n,e,t,i){return[n,e,t,i,t,i]}function N1(n,e,t,i,r,o){var s=.3333333333333333,a=2/3;return[s*n+a*t,s*e+a*i,s*r+a*t,s*o+a*i,r,o]}function j1(n,e,t,i,r,o,s,a,l,c){var u=oo*120/180,f=oo/180*(+r||0),h=[],d,p=lB(function(Zo,fi,$n){var jn=Zo*ft.cos($n)-fi*ft.sin($n),ar=Zo*ft.sin($n)+fi*ft.cos($n);return{x:jn,y:ar}});if(c)S=c[0],w=c[1],C=c[2],E=c[3];else{d=p(n,e,-f),n=d.x,e=d.y,d=p(a,l,-f),a=d.x,l=d.y;var m=(n-a)/2,g=(e-l)/2,b=m*m/(t*t)+g*g/(i*i);b>1&&(b=ft.sqrt(b),t=b*t,i=b*i);var _=t*t,v=i*i,x=(o==s?-1:1)*ft.sqrt(ao((_*v-_*g*g-v*m*m)/(_*g*g+v*m*m))),C=x*t*g/i+(n+a)/2,E=x*-i*m/t+(e+l)/2,S=ft.asin(((e-E)/i).toFixed(9)),w=ft.asin(((l-E)/i).toFixed(9));S=n<C?oo-S:S,w=a<C?oo-w:w,S<0&&(S=oo*2+S),w<0&&(w=oo*2+w),s&&S>w&&(S=S-oo*2),!s&&w>S&&(w=w-oo*2)}var R=w-S;if(ao(R)>u){var A=w,I=a,D=l;w=S+u*(s&&w>S?1:-1),a=C+t*ft.cos(w),l=E+i*ft.sin(w),h=j1(a,l,t,i,r,0,s,I,D,[w,A,C,E])}R=w-S;var N=ft.cos(S),W=ft.sin(S),Re=ft.cos(w),_e=ft.sin(w),ue=ft.tan(R/4),re=4/3*t*ue,me=4/3*i*ue,Ue=[n,e],$e=[n+re*W,e-me*N],Ct=[a+re*_e,l-me*Re],Nt=[a,l];if($e[0]=2*Ue[0]-$e[0],$e[1]=2*Ue[1]-$e[1],c)return[$e,Ct,Nt].concat(h);h=[$e,Ct,Nt].concat(h).join().split(",");for(var fn=[],ct=0,Ti=h.length;ct<Ti;ct++)fn[ct]=ct%2?p(h[ct-1],h[ct],f).y:p(h[ct],h[ct+1],f).x;return fn}function vB(n,e,t,i,r,o,s,a){for(var l=[],c=[[],[]],u,f,h,d,p,m,g,b,_=0;_<2;++_){if(_==0?(f=6*n-12*t+6*r,u=-3*n+9*t-9*r+3*s,h=3*t-3*n):(f=6*e-12*i+6*o,u=-3*e+9*i-9*o+3*a,h=3*i-3*e),ao(u)<1e-12){if(ao(f)<1e-12)continue;d=-h/f,0<d&&d<1&&l.push(d);continue}g=f*f-4*h*u,b=ft.sqrt(g),!(g<0)&&(p=(-f+b)/(2*u),0<p&&p<1&&l.push(p),m=(-f-b)/(2*u),0<m&&m<1&&l.push(m))}for(var v=l.length,x=v,C;v--;)d=l[v],C=1-d,c[0][v]=C*C*C*n+3*C*C*d*t+3*C*d*d*r+d*d*d*s,c[1][v]=C*C*C*e+3*C*C*d*i+3*C*d*d*o+d*d*d*a;return c[0][x]=n,c[1][x]=e,c[0][x+1]=s,c[1][x+1]=a,c[0].length=c[1].length=x+2,{x0:Ii(...c[0]),y0:Ii(...c[1]),x1:Li(...c[0]),y1:Li(...c[1])}}function $1(n){if(gB(n)||(n=cB(n)),fB(n))return n;for(var e=hB(yB(n)),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(h,d,p){var m,g;if(!h)return["C",d.x,d.y,d.x,d.y,d.x,d.y];switch(!(h[0]in{T:1,Q:1})&&(d.qx=d.qy=null),h[0]){case"M":d.X=h[1],d.Y=h[2];break;case"A":h=["C",...j1(d.x,d.y,...h.slice(1))];break;case"S":p=="C"||p=="S"?(m=d.x*2-d.bx,g=d.y*2-d.by):(m=d.x,g=d.y),h=["C",m,g,...h.slice(1)];break;case"T":p=="Q"||p=="T"?(d.qx=d.x*2-d.qx,d.qy=d.y*2-d.qy):(d.qx=d.x,d.qy=d.y),h=["C",...N1(d.x,d.y,d.qx,d.qy,h[1],h[2])];break;case"Q":d.qx=h[1],d.qy=h[2],h=["C",...N1(d.x,d.y,h[1],h[2],h[3],h[4])];break;case"L":h=["C",...ap(d.x,d.y,h[1],h[2])];break;case"H":h=["C",...ap(d.x,d.y,h[1],d.y)];break;case"V":h=["C",...ap(d.x,d.y,d.x,h[1])];break;case"Z":h=["C",...ap(d.x,d.y,d.X,d.Y)];break}return h},r=function(h,d){if(h[d].length>7){h[d].shift();for(var p=h[d];p.length;)o[d]="A",h.splice(d++,0,["C",...p.splice(0,6)]);h.splice(d,1),c=e.length}},o=[],s="",a="",l=0,c=e.length;l<c;l++){e[l]&&(s=e[l][0]),s!="C"&&(o[l]=s,l&&(a=o[l-1])),e[l]=i(e[l],t,a),o[l]!="A"&&s=="C"&&(o[l]="C"),r(e,l);var u=e[l],f=u.length;t.x=u[f-2],t.y=u[f-1],t.bx=T1(u[f-4])||t.x,t.by=T1(u[f-3])||t.y}return e}function Xe(n){return Pe(n)&&Zr(n,"waypoints")}function Bi(n){return Pe(n)&&Zr(n,"labelTarget")}function F1(n){return{x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)}}function ma(n){return{x:Math.round(n.x),y:Math.round(n.y)}}function G(n){return{top:n.y,right:n.x+(n.width||0),bottom:n.y+(n.height||0),left:n.x}}function Ov(n){return{x:n.left,y:n.top,width:n.right-n.left,height:n.bottom-n.top}}function xB(n){return ma({x:n.x+(n.width||0)/2,y:n.y+(n.height||0)/2})}function bB(n){for(var e=n.waypoints,t=e.reduce(function(c,u,f){var h=e[f-1];if(h){var d=c[c.length-1],p=d&&d.endLength||0,m=wB(h,u);c.push({start:h,end:u,startLength:p,endLength:p+m,length:m})}return c},[]),i=t.reduce(function(c,u){return c+u.length},0),r=i/2,o=0,s=t[o];s.endLength<r;)s=t[++o];var a=(r-s.startLength)/s.length,l={x:s.start.x+(s.end.x-s.start.x)*a,y:s.start.y+(s.end.y-s.start.y)*a};return l}function le(n){return Xe(n)?bB(n):xB(n)}function vt(n,e,t){t=t||0,Pe(t)||(t={x:t,y:t});var i=G(n),r=G(e),o=i.bottom+t.y<=r.top,s=i.left-t.x>=r.right,a=i.top-t.y>=r.bottom,l=i.right+t.x<=r.left,c=o?"top":a?"bottom":null,u=l?"left":s?"right":null;return u&&c?c+"-"+u:u||c||"intersect"}function tf(n,e,t){var i=_B(n,e);return i.length===1||i.length===2&&pa(i[0],i[1])<1?ma(i[0]):i.length>1?(i=Fn(i,function(r){var o=Math.floor(r.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,r.segment2+"#"+o}),ma(i[t?0:i.length-1])):null}function _B(n,e){return ef(n,e)}function q1(n){n=n.slice();for(var e=0,t,i,r;n[e];)t=n[e],i=n[e-1],r=n[e+1],pa(t,r)===0||sp(i,r,t)?n.splice(e,1):e++;return n}function wB(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function cp(n,e){return Math.round(n*e)/e}function V1(n){return se(n)?n+"px":n}function CB(n){for(;n.parent;)n=n.parent;return n}function EB(n){n=T({},{width:"100%",height:"100%"},n);let e=n.container||document.body,t=document.createElement("div");return t.setAttribute("class","djs-container djs-parent"),is(t,{position:"relative",overflow:"hidden",width:V1(n.width),height:V1(n.height)}),e.appendChild(t),t}function H1(n,e,t){let i=Q("g");ne(i).add(e);let r=t!==void 0?t:n.childNodes.length-1;return n.insertBefore(i,n.childNodes[r]||null),i}var SB="base",z1=0,OB=1,kB={shape:["x","y","width","height"],connection:["waypoints"]};function Y(n,e,t,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=t,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(n||{})}Y.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];Y.prototype._init=function(n){let e=this._eventBus,t=this._container=EB(n),i=this._svg=Q("svg");j(i,{width:"100%",height:"100%"}),et(i,"tabindex",0),n.autoFocus&&e.on("element.hover",()=>{this.restoreFocus()}),e.on("element.mousedown",500,o=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),i.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),i.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),K(t,i);let r=this._viewport=H1(i,"viewport");n.deferUpdate&&(this._viewboxChanged=Mi(at(this._viewboxChanged,this),300)),e.on("diagram.init",()=>{e.fire("canvas.init",{svg:i,viewport:r})}),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)};Y.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let n=this._container.parentNode;n&&n.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};Y.prototype._setFocused=function(n){n!=this._focused&&(this._focused=n,this._eventBus.fire("canvas.focus.changed",{focused:n}))};Y.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{let t=ip(e);t==="root"?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};Y.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};Y.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};Y.prototype.isFocused=function(){return this._focused};Y.prototype.getDefaultLayer=function(){return this.getLayer(SB,z1)};Y.prototype.getLayer=function(n,e){if(!n)throw new Error("must specify a name");let t=this._layers[n];if(t||(t=this._layers[n]=this._createLayer(n,e)),typeof e!="undefined"&&t.index!==e)throw new Error("layer <"+n+"> already created at index <"+e+">");return t.group};Y.prototype._getChildIndex=function(n){return st(this._layers,function(e,t){return t.visible&&n>=t.index&&e++,e},0)};Y.prototype._createLayer=function(n,e){typeof e=="undefined"&&(e=OB);let t=this._getChildIndex(e);return{group:H1(this._viewport,"layer-"+n,t),index:e,visible:!0}};Y.prototype.showLayer=function(n){if(!n)throw new Error("must specify a name");let e=this._layers[n];if(!e)throw new Error("layer <"+n+"> does not exist");let t=this._viewport,i=e.group,r=e.index;if(e.visible)return i;let o=this._getChildIndex(r);return t.insertBefore(i,t.childNodes[o]||null),e.visible=!0,i};Y.prototype.hideLayer=function(n){if(!n)throw new Error("must specify a name");let e=this._layers[n];if(!e)throw new Error("layer <"+n+"> does not exist");let t=e.group;return e.visible&&(Fe(t),e.visible=!1),t};Y.prototype._removeLayer=function(n){let e=this._layers[n];e&&(delete this._layers[n],Fe(e.group))};Y.prototype.getActiveLayer=function(){let n=this._findPlaneForRoot(this.getRootElement());return n?n.layer:null};Y.prototype.findRoot=function(n){return typeof n=="string"&&(n=this._elementRegistry.get(n)),n?(this._findPlaneForRoot(CB(n))||{}).rootElement:void 0};Y.prototype.getRootElements=function(){return this._planes.map(function(n){return n.rootElement})};Y.prototype._findPlaneForRoot=function(n){return ye(this._planes,function(e){return e.rootElement===n})};Y.prototype.getContainer=function(){return this._container};Y.prototype._updateMarker=function(n,e,t){let i;n.id||(n=this._elementRegistry.get(n)),n.markers=n.markers||new Set,i=this._elementRegistry._elements[n.id],i&&(k([i.gfx,i.secondaryGfx],function(r){r&&(t?(n.markers.add(e),ne(r).add(e)):(n.markers.delete(e),ne(r).remove(e)))}),this._eventBus.fire("element.marker.update",{element:n,gfx:i.gfx,marker:e,add:!!t}))};Y.prototype.addMarker=function(n,e){this._updateMarker(n,e,!0)};Y.prototype.removeMarker=function(n,e){this._updateMarker(n,e,!1)};Y.prototype.hasMarker=function(n,e){return n.id||(n=this._elementRegistry.get(n)),n.markers?n.markers.has(e):!1};Y.prototype.toggleMarker=function(n,e){this.hasMarker(n,e)?this.removeMarker(n,e):this.addMarker(n,e)};Y.prototype.getRootElement=function(){let n=this._rootElement;return n||this._planes.length?n:this.setRootElement(this.addRootElement(null))};Y.prototype.addRootElement=function(n){let e=this._rootsIdx++;n||(n={id:"__implicitroot_"+e,children:[],isImplicit:!0});let t=n.layer="root-"+e;this._ensureValid("root",n);let i=this.getLayer(t,z1);return this.hideLayer(t),this._addRoot(n,i),this._planes.push({rootElement:n,layer:i}),n};Y.prototype.removeRootElement=function(n){if(typeof n=="string"&&(n=this._elementRegistry.get(n)),!!this._findPlaneForRoot(n))return this._removeRoot(n),this._removeLayer(n.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==n}),this._rootElement===n&&(this._rootElement=null),n};Y.prototype.setRootElement=function(n){if(n===this._rootElement)return n;let e;if(!n)throw new Error("rootElement required");return e=this._findPlaneForRoot(n),e||(n=this.addRootElement(n)),this._setRoot(n),n};Y.prototype._removeRoot=function(n){let e=this._elementRegistry,t=this._eventBus;t.fire("root.remove",{element:n}),t.fire("root.removed",{element:n}),e.remove(n)};Y.prototype._addRoot=function(n,e){let t=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:n}),t.add(n,e),i.fire("root.added",{element:n,gfx:e})};Y.prototype._setRoot=function(n,e){let t=this._rootElement;t&&(this._elementRegistry.updateGraphics(t,null,!0),this.hideLayer(t.layer)),n&&(e||(e=this._findPlaneForRoot(n).layer),this._elementRegistry.updateGraphics(n,this._svg,!0),this.showLayer(n.layer)),this._rootElement=n,this._eventBus.fire("root.set",{element:n})};Y.prototype._ensureValid=function(n,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element <"+e.id+"> already exists");let t=kB[n];if(!kt(t,function(r){return typeof e[r]!="undefined"}))throw new Error("must supply { "+t.join(", ")+" } with "+n)};Y.prototype._setParent=function(n,e,t){zt(e.children,n,t),n.parent=e};Y.prototype._addElement=function(n,e,t,i){t=t||this.getRootElement();let r=this._eventBus,o=this._graphicsFactory;this._ensureValid(n,e),r.fire(n+".add",{element:e,parent:t}),this._setParent(e,t,i);let s=o.create(n,e,i);return this._elementRegistry.add(e,s),o.update(n,e,s),r.fire(n+".added",{element:e,gfx:s}),e};Y.prototype.addShape=function(n,e,t){return this._addElement("shape",n,e,t)};Y.prototype.addConnection=function(n,e,t){return this._addElement("connection",n,e,t)};Y.prototype._removeElement=function(n,e){let t=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(n=t.get(n.id||n),!!n)return r.fire(e+".remove",{element:n}),i.remove(n),Vn(n.parent&&n.parent.children,n),n.parent=null,r.fire(e+".removed",{element:n}),t.remove(n),n};Y.prototype.removeShape=function(n){return this._removeElement(n,"shape")};Y.prototype.removeConnection=function(n){return this._removeElement(n,"connection")};Y.prototype.getGraphics=function(n,e){return this._elementRegistry.getGraphics(n,e)};Y.prototype._changeViewbox=function(n){this._eventBus.fire("canvas.viewbox.changing"),n.apply(this),this._cachedViewbox=null,this._viewboxChanged()};Y.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};Y.prototype.viewbox=function(n){if(n===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let e=this._viewport,t=this.getSize(),i,r,o,s,a,l,c;if(n)this._changeViewbox(function(){a=Math.min(t.width/n.width,t.height/n.height);let u=this._svg.createSVGMatrix().scale(a).translate(-n.x,-n.y);as(e,u)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},s=as(e),r=s?s.matrix:b1(),a=cp(r.a,1e3),l=cp(-r.e||0,1e3),c=cp(-r.f||0,1e3),n=this._cachedViewbox={x:l?l/a:0,y:c?c/a:0,width:t.width/a,height:t.height/a,scale:a,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:t},n;return n};Y.prototype.scroll=function(n){let e=this._viewport,t=e.getCTM();return n&&this._changeViewbox(function(){n=T({dx:0,dy:0},n||{}),t=this._svg.createSVGMatrix().translate(n.dx,n.dy).multiply(t),W1(e,t)}),{x:t.e,y:t.f}};Y.prototype.scrollToElement=function(n,e){let t=100;typeof n=="string"&&(n=this._elementRegistry.get(n));let i=this.findRoot(n);if(i!==this.getRootElement()&&this.setRootElement(i),i===n)return;e||(e={}),typeof e=="number"&&(t=e),e={top:e.top||t,right:e.right||t,bottom:e.bottom||t,left:e.left||t};let r=Tt(n),o=G(r),s=this.viewbox(),a=this.zoom(),l,c;s.y+=e.top/a,s.x+=e.left/a,s.width-=(e.right+e.left)/a,s.height-=(e.bottom+e.top)/a;let u=G(s);if(!(r.width<s.width&&r.height<s.height))l=r.x-s.x,c=r.y-s.y;else{let h=Math.max(0,o.right-u.right),d=Math.min(0,o.left-u.left),p=Math.max(0,o.bottom-u.bottom),m=Math.min(0,o.top-u.top);l=h||d,c=p||m}this.scroll({dx:-l*a,dy:-c*a})};Y.prototype.zoom=function(n,e){if(!n)return this.viewbox(n).scale;if(n==="fit-viewport")return this._fitViewport(e);let t,i;return this._changeViewbox(function(){typeof e!="object"&&(t=this.viewbox().outer,e={x:t.width/2,y:t.height/2}),i=this._setZoom(n,e)}),cp(i.a,1e3)};function W1(n,e){let t="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";n.setAttribute("transform",t)}Y.prototype._fitViewport=function(n){let e=this.viewbox(),t=e.outer,i=e.inner,r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=t.width&&i.y+i.height<=t.height&&!n?o={x:0,y:0,width:Math.max(i.width+i.x,t.width),height:Math.max(i.height+i.y,t.height)}:(r=Math.min(1,t.width/i.width,t.height/i.height),o={x:i.x+(n?i.width/2-t.width/r/2:0),y:i.y+(n?i.height/2-t.height/r/2:0),width:t.width/r,height:t.height/r}),this.viewbox(o),this.viewbox(!1).scale};Y.prototype._setZoom=function(n,e){let t=this._svg,i=this._viewport,r=t.createSVGMatrix(),o=t.createSVGPoint(),s,a,l,c,u;l=i.getCTM();let f=l.a;return e?(s=T(o,e),a=s.matrixTransform(l.inverse()),c=r.translate(a.x,a.y).scale(1/f*n).translate(-a.x,-a.y),u=l.multiply(c)):u=r.scale(n),W1(this._viewport,u),u};Y.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};Y.prototype.getAbsoluteBBox=function(n){let e=this.viewbox(),t;n.waypoints?t=this.getGraphics(n).getBBox():t=n;let i=t.x*e.scale-e.x*e.scale,r=t.y*e.scale-e.y*e.scale,o=t.width*e.scale,s=t.height*e.scale;return{x:i,y:r,width:o,height:s}};Y.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var ga="data-element-id";function tn(n){this._elements={},this._eventBus=n}tn.$inject=["eventBus"];tn.prototype.add=function(n,e,t){var i=n.id;this._validateId(i),j(e,ga,i),t&&j(t,ga,i),this._elements[i]={element:n,gfx:e,secondaryGfx:t}};tn.prototype.remove=function(n){var e=this._elements,t=n.id||n,i=t&&e[t];i&&(j(i.gfx,ga,""),i.secondaryGfx&&j(i.secondaryGfx,ga,""),delete e[t])};tn.prototype.updateId=function(n,e){this._validateId(e),typeof n=="string"&&(n=this.get(n)),this._eventBus.fire("element.updateId",{element:n,newId:e});var t=this.getGraphics(n),i=this.getGraphics(n,!0);this.remove(n),n.id=e,this.add(n,t,i)};tn.prototype.updateGraphics=function(n,e,t){var i=n.id||n,r=this._elements[i];return t?r.secondaryGfx=e:r.gfx=e,e&&j(e,ga,i),e};tn.prototype.get=function(n){var e;typeof n=="string"?e=n:e=n&&j(n,ga);var t=this._elements[e];return t&&t.element};tn.prototype.filter=function(n){var e=[];return this.forEach(function(t,i){n(t,i)&&e.push(t)}),e};tn.prototype.find=function(n){for(var e=this._elements,t=Object.keys(e),i=0;i<t.length;i++){var r=t[i],o=e[r],s=o.element,a=o.gfx;if(n(s,a))return s}};tn.prototype.getAll=function(){return this.filter(function(n){return n})};tn.prototype.forEach=function(n){var e=this._elements;Object.keys(e).forEach(function(t){var i=e[t],r=i.element,o=i.gfx;return n(r,o)})};tn.prototype.getGraphics=function(n,e){var t=n.id||n,i=this._elements[t];return i&&(e?i.secondaryGfx:i.gfx)};tn.prototype._validateId=function(n){if(!n)throw new Error("element must have an id");if(this._elements[n])throw new Error("element with id "+n+" already added")};function RB(n,e,t,i){var r=t.inverse;return Object.defineProperty(n,"remove",{value:function(o){var s=this.indexOf(o);return s!==-1&&(this.splice(s,1),e.unset(o,r,i)),o}}),Object.defineProperty(n,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(n,"add",{value:function(o,s){var a=this.indexOf(o);if(typeof s=="undefined"){if(a!==-1)return;s=this.length}a!==-1&&this.splice(a,1),this.splice(s,0,o),a===-1&&e.set(o,r,i)}}),Object.defineProperty(n,"__refs_collection",{value:!0}),n}function TB(n){return n.__refs_collection===!0}function AB(n,e){return Object.prototype.hasOwnProperty.call(n,e.name||e)}function U1(n,e,t){var i=RB(t[e.name]||[],n,e,t);Object.defineProperty(t,e.name,{enumerable:e.enumerable,value:i}),i.length&&i.forEach(function(r){n.set(r,e.inverse,t)})}function MB(n,e,t){var i=e.inverse,r=t[e.name];Object.defineProperty(t,e.name,{configurable:e.configurable,enumerable:e.enumerable,get:function(){return r},set:function(o){if(o!==r){var s=r;r=null,s&&n.unset(s,i,t),r=o,n.set(r,i,t)}}})}function nn(n,e){if(!(this instanceof nn))return new nn(n,e);n.inverse=e,e.inverse=n,this.props={},this.props[n.name]=n,this.props[e.name]=e}nn.prototype.bind=function(n,e){if(typeof e=="string"){if(!this.props[e])throw new Error("no property <"+e+"> in ref");e=this.props[e]}e.collection?U1(this,e,n):MB(this,e,n)};nn.prototype.ensureRefsCollection=function(n,e){var t=n[e.name];return TB(t)||U1(this,e,n),t};nn.prototype.ensureBound=function(n,e){AB(n,e)||this.bind(n,e)};nn.prototype.unset=function(n,e,t){n&&(this.ensureBound(n,e),e.collection?this.ensureRefsCollection(n,e).remove(t):n[e.name]=void 0)};nn.prototype.set=function(n,e,t){n&&(this.ensureBound(n,e),e.collection?this.ensureRefsCollection(n,e).add(t):n[e.name]=t)};var kv=new nn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),K1=new nn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Q1=new nn({name:"attachers",collection:!0},{name:"host"}),G1=new nn({name:"outgoing",collection:!0},{name:"source"}),X1=new nn({name:"incoming",collection:!0},{name:"target"});function ya(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(n){var e=this.label,t=this.labels;!n&&e?t.remove(e):t.add(n,0)}}),kv.bind(this,"parent"),K1.bind(this,"labels"),G1.bind(this,"outgoing"),X1.bind(this,"incoming")}function nf(){ya.call(this),kv.bind(this,"children"),Q1.bind(this,"host"),Q1.bind(this,"attachers")}fe(nf,ya);function Y1(){ya.call(this),kv.bind(this,"children")}fe(Y1,nf);function Z1(){nf.call(this),K1.bind(this,"labelTarget")}fe(Z1,nf);function J1(){ya.call(this),G1.bind(this,"source"),X1.bind(this,"target")}fe(J1,ya);var PB={connection:J1,shape:nf,label:Z1,root:Y1};function eC(n,e){var t=PB[n];if(!t)throw new Error("unknown type: <"+n+">");return T(new t,e)}function tC(n){return n instanceof ya}function Hn(){this._uid=12}Hn.prototype.createRoot=function(n){return this.create("root",n)};Hn.prototype.createLabel=function(n){return this.create("label",n)};Hn.prototype.createShape=function(n){return this.create("shape",n)};Hn.prototype.createConnection=function(n){return this.create("connection",n)};Hn.prototype.create=function(n,e){return e=T({},e||{}),e.id||(e.id=n+"_"+this._uid++),eC(n,e)};function ls(n){return n.childNodes[0]}function nC(n){return n.parentNode.childNodes[1]}function iC(n,e,t,i,r){var o=da();o.setTranslate(e,t);var s=da();s.setRotate(i||0,0,0);var a=da();a.setScale(r||1,r||1),as(n,[o,s,a])}function jt(n,e,t){var i=da();i.setTranslate(e,t),as(n,i)}function rC(n,e){var t=da();t.setRotate(e,0,0),as(n,t)}function rn(n,e){this._eventBus=n,this._elementRegistry=e}rn.$inject=["eventBus","elementRegistry"];rn.prototype._getChildrenContainer=function(n){var e=this._elementRegistry.getGraphics(n),t;return n.parent?(t=nC(e),t||(t=Q("g"),ne(t).add("djs-children"),K(e.parentNode,t))):t=e,t};rn.prototype._clear=function(n){var e=ls(n);return no(e),e};rn.prototype._createContainer=function(n,e,t,i){var r=Q("g");ne(r).add("djs-group"),typeof t!="undefined"?oC(r,e,e.childNodes[t]):K(e,r);var o=Q("g");ne(o).add("djs-element"),ne(o).add("djs-"+n),i&&ne(o).add("djs-frame"),K(r,o);var s=Q("g");return ne(s).add("djs-visual"),K(o,s),o};rn.prototype.create=function(n,e,t){var i=this._getChildrenContainer(e.parent);return this._createContainer(n,i,t,rp(e))};rn.prototype.updateContainments=function(n){var e=this,t=this._elementRegistry,i;i=st(n,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),k(i,function(r){var o=r.children;if(o){var s=e._getChildrenContainer(r);k(o.slice().reverse(),function(a){var l=t.getGraphics(a);oC(l.parentNode,s)})}})};rn.prototype.drawShape=function(n,e,t={}){var i=this._eventBus;return i.fire("render.shape",{gfx:n,element:e,attrs:t})};rn.prototype.getShapePath=function(n){var e=this._eventBus;return e.fire("render.getShapePath",n)};rn.prototype.drawConnection=function(n,e,t={}){var i=this._eventBus;return i.fire("render.connection",{gfx:n,element:e,attrs:t})};rn.prototype.getConnectionPath=function(n){var e=this._eventBus;return e.fire("render.getConnectionPath",n)};rn.prototype.update=function(n,e,t){if(e.parent){var i=this._clear(t);if(n==="shape")this.drawShape(i,e),jt(t,e.x,e.y);else if(n==="connection")this.drawConnection(i,e);else throw new Error("unknown type: "+n);e.hidden?j(t,"display","none"):j(t,"display","block")}};rn.prototype.remove=function(n){var e=this._elementRegistry.getGraphics(n);Fe(e.parentNode)};function oC(n,e,t){var i=t||e.firstChild;n!==i&&e.insertBefore(n,i)}var sC={__depends__:[R1],__init__:["canvas"],canvas:["type",Y],elementRegistry:["type",tn],elementFactory:["type",Hn],eventBus:["type",ut],graphicsFactory:["type",rn]};function DB(n){var e=new os(n);return e.init(),e}function IB(n){n=n||{};var e={config:["value",n]},t=[e,sC].concat(n.modules||[]);return DB(t)}function mr(n,e){this._injector=e||IB(n),this.get("eventBus").fire("diagram.init")}mr.prototype.get=function(n,e){return this._injector.get(n,e)};mr.prototype.invoke=function(n,e,t){return this._injector.invoke(n,e,t)};mr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")};mr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var LB=new nn({name:"dmnElementRef",enumerable:!0},{name:"di",configurable:!0});function Rv(n,e){var t=[];function i(b){var _=b.gfx;if(_)throw new Error("already rendered "+b.id);return n.element(b)}function r(b){return n.root(b)}function o(b){try{var _=b.di&&i(b);return _}catch(v){g(v.message,{element:b,error:v})}}function s(b,_){var v=b.dmnDI;if(!v)throw new Error("no dmndi:DMNDI");var x=v.diagrams||[];if(_&&x.indexOf(_)===-1)throw new Error("diagram not part of dmndi:DMNDI");if(!_&&x&&x.length&&(_=x[0]),!_)throw new Error("no diagram to display");b.di=_,f(_),r(b),a(b.get("drgElement")),l(b.get("artifact")),m()}function a(b){k(b,function(_){o(_),u(_)})}function l(b){k(b,function(_){O(_,"dmn:Association")?c(_):o(_)})}function c(b){p(function(){o(b)})}function u(b){k(["informationRequirement","knowledgeRequirement","authorityRequirement"],function(_){k(b[_],function(v){p(function(){o(v)})})})}function f(b){k(b.diagramElements,h)}function h(b){d(b)}function d(b){var _=b.dmnElementRef;_?_.di?g("multiple DI elements defined for element",{element:_}):(LB.bind(_,"di"),_.di=b):g("no DMN element referenced in element",{element:b})}function p(b){t.push(b)}function m(){k(t,function(b){b()})}function g(b,_){n.error(b,_)}return{handleDefinitions:s}}function aC(n,e,t){var i=n.get("drdImporter"),r=n.get("eventBus"),o,s=[];function a(l){var c={root:function(f){return i.root(f)},element:function(f,h){return i.add(f,h)},error:function(f,h){s.push({message:f,context:h})}},u=new Rv(c);u.handleDefinitions(l)}r.fire("import.start",{definitions:e});try{a(e)}catch(l){o=l}r.fire("import.done",{error:o,warnings:s}),t(o,s)}var Lv="$NO_OP",BB="a runtime error occured! Use Inferno in development environment to find the error.",dp=Array.isArray;function Bv(n){var e=typeof n;return e==="string"||e==="number"}function we(n){return pp(n)||Ye(n)}function lo(n){return Ye(n)||n===!1||NB(n)||pp(n)}function ve(n){return typeof n=="function"}function va(n){return typeof n=="string"}function Pv(n){return typeof n=="number"}function Ye(n){return n===null}function NB(n){return n===!0}function pp(n){return n===void 0}function $B(n){throw n||(n=BB),new Error("Inferno Error: "+n)}function sf(n,e){var t={};if(n)for(var i in n)t[i]=n[i];if(e)for(var r in e)t[r]=e[r];return t}var rf="$";function Nv(n,e,t,i,r,o,s,a){return{childFlags:n,children:e,className:t,dom:null,flags:i,key:r===void 0?null:r,parentVNode:null,props:o===void 0?null:o,ref:s===void 0?null:s,type:a}}function y(n,e,t,i,r,o,s,a){var l=r===void 0?1:r,c=Nv(l,i,t,n,s,o,a,e),u=Wn.createVNode;return typeof u=="function"&&u(c),l===0&&gC(c,c.children),c}function P(n,e,t,i,r){(n&2)>0&&(n=e.prototype&&ve(e.prototype.render)?4:8);var o=e.defaultProps;if(!we(o)){t||(t={});for(var s in o)pp(t[s])&&(t[s]=o[s])}if((n&8)>0){var a=e.defaultHooks;if(!we(a))if(!r)r=a;else for(var l in a)pp(r[l])&&(r[l]=a[l])}var c=Nv(1,null,null,n,i,t,r,e),u=Wn.createVNode;return ve(u)&&u(c),c}function Z(n,e){return Nv(1,we(n)?"":n,null,16,e,null,null,null)}function En(n){var e=n.props;if(e){var t=n.flags;t&481&&(e.children!==void 0&&we(n.children)&&gC(n,e.children),e.className!==void 0&&(n.className=e.className||null,e.className=void 0)),e.key!==void 0&&(n.key=e.key,e.key=void 0),e.ref!==void 0&&(t&8?n.ref=sf(n.ref,e.ref):n.ref=e.ref,e.ref=void 0)}return n}function Wt(n){var e,t=n.flags;if(t&14){var i,r=n.props;if(!Ye(r)){i={};for(var o in r)i[o]=r[o]}e=P(t,n.type,i,n.key,n.ref)}else t&481?e=y(t,n.type,n.className,n.children,n.childFlags,n.props,n.key,n.ref):t&16?e=Z(n.children,n.key):t&1024&&(e=n);return e}function pC(){return Z("",null)}function mC(n,e,t,i){for(var r=n.length;t<r;t++){var o=n[t];if(!lo(o)){var s=i+rf+t;if(dp(o))mC(o,e,0,s);else{if(Bv(o))o=Z(o,s);else{var a=o.key,l=va(a)&&a[0]===rf;(!Ye(o.dom)||l)&&(o=Wt(o)),Ye(a)||l?o.key=s:o.key=i+a}e.push(o)}}}}function gC(n,e){var t,i=1;if(lo(e))t=e;else if(va(e))i=2,t=Z(e);else if(Pv(e))i=2,t=Z(e+"");else if(dp(e)){var r=e.length;if(r===0)t=null,i=1;else{(Object.isFrozen(e)||e.$===!0)&&(e=e.slice()),i=8;for(var o=0;o<r;o++){var s=e[o];if(lo(s)||dp(s)){t=t||e.slice(0,o),mC(e,t,o,"");break}else if(Bv(s))t=t||e.slice(0,o),t.push(Z(s,rf+o));else{var a=s.key,l=Ye(s.dom),c=Ye(a),u=!c&&va(a)&&a[0]===rf;!l||c||u?(t=t||e.slice(0,o),(!l||u)&&(s=Wt(s)),(c||u)&&(s.key=rf+o),t.push(s)):t&&t.push(s)}}t=t||e,t.$=!0}}else t=e,Ye(e.dom)||(t=Wt(e)),i=2;return n.children=t,n.childFlags=i,n}var Wn={afterRender:null,beforeRender:null,createVNode:null,renderComplete:null};var cs="http://www.w3.org/1999/xlink",Tv="http://www.w3.org/XML/1998/namespace",jB="http://www.w3.org/2000/svg",lC={"xlink:actuate":cs,"xlink:arcrole":cs,"xlink:href":cs,"xlink:role":cs,"xlink:show":cs,"xlink:title":cs,"xlink:type":cs,"xml:base":Tv,"xml:lang":Tv,"xml:space":Tv},At={},Ni=[];function mp(n,e){n.appendChild(e)}function up(n,e,t){we(t)?mp(n,e):n.insertBefore(e,t)}function FB(n,e){return e?document.createElementNS(jB,n):document.createElement(n)}function $v(n,e,t){n.replaceChild(e,t)}function qB(n,e){n.removeChild(e)}function jv(n){for(var e;(e=n.shift())!==void 0;)e()}var fp={},Av={};function yC(n,e,t){var i=fp[n],r=t.$EV;e?(i||(Av[n]=WB(n),fp[n]=0),r||(r=t.$EV={}),r[n]||fp[n]++,r[n]=e):r&&r[n]&&(fp[n]--,i===1&&(document.removeEventListener(vC(n),Av[n]),Av[n]=null),r[n]=e)}function VB(n){return ve(n.composedPath)?n.composedPath()[0]:n.target}function HB(n,e,t,i){for(var r=VB(n);!Ye(r);){if(e&&r.disabled)return;var o=r.$EV;if(o){var s=o[t];if(s&&(i.dom=r,s.event?s.event(s.data,n):s(n),n.cancelBubble))return}r=r.parentNode}}function vC(n){return n.substr(2).toLowerCase()}function zB(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function WB(n){var e=function(i){var r=i.type,o=r==="click"||r==="dblclick";if(o&&i.button!==0)return i.stopPropagation(),!1;i.stopPropagation=zB;var s={dom:document};Object.defineProperty(i,"currentTarget",{configurable:!0,get:function(){return s.dom}}),HB(i,o,n,s)};return document.addEventListener(vC(n),e),e}function xC(n,e){var t=document.createElement("i");return t.innerHTML=e,t.innerHTML===n.innerHTML}function UB(n,e){return!!(e&&e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html&&xC(n,e.dangerouslySetInnerHTML.__html))}function cC(n,e,t){if(n[e]){var i=n[e];i.event?i.event(i.data,t):i(t)}else{var r=e.toLowerCase();n[r]&&n[r](t)}}function lf(n,e){var t=function(r){r.stopPropagation();var o=this.$V;if(o){var s=o.props||At,a=o.dom;if(va(n))cC(s,n,r);else for(var l=0;l<n.length;l++)cC(s,n[l],r);if(ve(e)){var c=this.$V,u=c.props||At;e(u,a,!1,c)}}};return Object.defineProperty(t,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),t}function Fv(n){return n==="checkbox"||n==="radio"}var QB=lf("onInput",qv),KB=lf(["onClick","onChange"],qv);function bC(n){n.stopPropagation()}bC.wrapped=!0;function GB(n,e){Fv(e.type)?(n.onchange=KB,n.onclick=bC):n.oninput=QB}function qv(n,e){var t=n.type,i=n.value,r=n.checked,o=n.multiple,s=n.defaultValue,a=!we(i);t&&t!==e.type&&e.setAttribute("type",t),!we(o)&&o!==e.multiple&&(e.multiple=o),!we(s)&&!a&&(e.defaultValue=s+""),Fv(t)?(a&&(e.value=i),we(r)||(e.checked=r)):a&&e.value!==i?(e.defaultValue=i,e.value=i):we(r)||(e.checked=r)}function uC(n,e){var t=n.type;if(t==="optgroup"){var i=n.children,r=n.childFlags;if(r&12)for(var o=0,s=i.length;o<s;o++)Mv(i[o],e);else r===2&&Mv(i,e)}else Mv(n,e)}function Mv(n,e){var t=n.props||At,i=n.dom;i.value=t.value,dp(e)&&e.indexOf(t.value)!==-1||t.value===e?i.selected=!0:(!we(e)||!we(t.selected))&&(i.selected=t.selected||!1)}var XB=lf("onChange",_C);function YB(n){n.onchange=XB}function _C(n,e,t,i){var r=!!n.multiple;!we(n.multiple)&&r!==e.multiple&&(e.multiple=r);var o=i.childFlags;if((o&1)===0){var s=i.children,a=n.value;if(t&&we(a)&&(a=n.defaultValue),o&12)for(var l=0,c=s.length;l<c;l++)uC(s[l],a);else o===2&&uC(s,a)}}var ZB=lf("onInput",wC),JB=lf("onChange");function eN(n,e){n.oninput=ZB,e.onChange&&(n.onchange=JB)}function wC(n,e,t){var i=n.value,r=e.value;if(we(i)){if(t){var o=n.defaultValue;!we(o)&&o!==r&&(e.defaultValue=o,e.value=o)}}else r!==i&&(e.defaultValue=i,e.value=i)}function CC(n,e,t,i,r,o){n&64?qv(i,t):n&256?_C(i,t,r,e):n&128&&wC(i,t,r),o&&(t.$V=e)}function tN(n,e,t){n&64?GB(e,t):n&256?YB(e):n&128&&eN(e,t)}function EC(n){return n.type&&Fv(n.type)?!we(n.checked):!we(n.value)}function zn(n,e){us(n),e&&n.dom&&(qB(e,n.dom),n.dom=null)}function us(n){var e=n.flags;if(e&481){var t=n.ref,i=n.props;ve(t)&&t(null);var r=n.children,o=n.childFlags;if(o&12?Vv(r):o===2&&us(r),!Ye(i))for(var s in i)switch(s){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":yC(s,null,n.dom);break}}else{var a=n.children;if(a)if(e&14){var l=n.ref;e&4?(ve(a.componentWillUnmount)&&a.componentWillUnmount(),ve(l)&&l(null),a.$UN=!0,a.$LI&&us(a.$LI)):(!we(l)&&ve(l.onComponentWillUnmount)&&l.onComponentWillUnmount(n.dom,n.props||At),us(a))}else e&1024&&zn(a,n.type)}}function Vv(n){for(var e=0,t=n.length;e<t;e++)us(n[e])}function hp(n,e){Vv(e),n.textContent=""}function nN(n,e){return function(t){n(e.data,t)}}function iN(n,e,t){var i=n.toLowerCase();if(!ve(e)&&!we(e)){var r=e.event;r&&ve(r)&&(t[i]=nN(r,e))}else{var o=t[i];(!o||!o.wrapped)&&(t[i]=e)}}function fC(n,e){switch(n){case"animationIterationCount":case"borderImageOutset":case"borderImageSlice":case"borderImageWidth":case"boxFlex":case"boxFlexGroup":case"boxOrdinalGroup":case"columnCount":case"fillOpacity":case"flex":case"flexGrow":case"flexNegative":case"flexOrder":case"flexPositive":case"flexShrink":case"floodOpacity":case"fontWeight":case"gridColumn":case"gridRow":case"lineClamp":case"lineHeight":case"opacity":case"order":case"orphans":case"stopOpacity":case"strokeDasharray":case"strokeDashoffset":case"strokeMiterlimit":case"strokeOpacity":case"strokeWidth":case"tabSize":case"widows":case"zIndex":case"zoom":return e;default:return e+"px"}}function rN(n,e,t){var i=t.style,r,o;if(va(e)){i.cssText=e;return}if(!we(n)&&!va(n)){for(r in e)o=e[r],o!==n[r]&&(i[r]=Pv(o)?fC(r,o):o);for(r in n)we(e[r])&&(i[r]="")}else for(r in e)o=e[r],i[r]=Pv(o)?fC(r,o):o}function Dv(n,e,t,i,r,o,s){switch(n){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":yC(n,t,i);break;case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":break;case"autoFocus":i.autofocus=!!t;break;case"allowfullscreen":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":i[n]=!!t;break;case"defaultChecked":case"value":case"volume":if(o&&n==="value")return;var a=we(t)?"":t;i[n]!==a&&(i[n]=a);break;case"dangerouslySetInnerHTML":var l=e&&e.__html||"",c=t&&t.__html||"";l!==c&&!we(c)&&!xC(i,c)&&(Ye(s)||(s.childFlags&12?Vv(s.children):s.childFlags===2&&us(s.children),s.children=null,s.childFlags=1),i.innerHTML=c);break;default:n[0]==="o"&&n[1]==="n"?iN(n,t,i):we(t)?i.removeAttribute(n):n==="style"?rN(e,t,i):r&&lC[n]?i.setAttributeNS(lC[n],n,t):i.setAttribute(n,t);break}}function SC(n,e,t,i,r){var o=!1,s=(e&448)>0;s&&(o=EC(t),o&&tN(e,i,t));for(var a in t)Dv(a,null,t[a],i,r,o,null);s&&CC(e,n,i,t,!0,o)}function OC(n,e,t,i){var r=new e(t,i);if(n.children=r,r.$V=n,r.$BS=!1,r.context=i,r.props===At&&(r.props=t),r.$UN=!1,ve(r.componentWillMount)){if(r.$BR=!0,r.componentWillMount(),r.$PSS){var o=r.state,s=r.$PS;if(Ye(o))r.state=s;else for(var a in s)o[a]=s[a];r.$PSS=!1,r.$PS=null}r.$BR=!1}ve(Wn.beforeRender)&&Wn.beforeRender(r);var l=cf(r.render(t,r.state,i),n),c;return ve(r.getChildContext)&&(c=r.getChildContext()),we(c)?r.$CX=i:r.$CX=sf(i,c),ve(Wn.afterRender)&&Wn.afterRender(r),r.$LI=l,r}function cf(n,e){return lo(n)?n=pC():Bv(n)?n=Z(n,null):(n.dom&&(n=Wt(n)),n.flags&14&&(n.parentVNode=e)),n}function on(n,e,t,i){var r=n.flags;if(r&481)return kC(n,e,t,i);if(r&14)return oN(n,e,t,i,(r&4)>0);if(r&512||r&16)return Iv(n,e);if(r&1024)return on(n.children,n.type,t,!1),n.dom=Iv(pC(),e)}function Iv(n,e){var t=n.dom=document.createTextNode(n.children);return Ye(e)||mp(e,t),t}function kC(n,e,t,i){var r=n.flags,o=n.children,s=n.props,a=n.className,l=n.ref,c=n.childFlags;i=i||(r&32)>0;var u=FB(n.type,i);if(n.dom=u,!we(a)&&a!==""&&(i?u.setAttribute("class",a):u.className=a),Ye(e)||mp(e,u),(c&1)===0){var f=i===!0&&n.type!=="foreignObject";c===2?on(o,u,t,f):c&12&&of(o,u,t,f)}return Ye(s)||SC(n,r,s,u,i),ve(l)&&Hv(u,l),u}function of(n,e,t,i){for(var r=0,o=n.length;r<o;r++){var s=n[r];Ye(s.dom)||(n[r]=s=Wt(s)),on(s,e,t,i)}}function oN(n,e,t,i,r){var o,s=n.type,a=n.props||At,l=n.ref;if(r){var c=OC(n,s,a,t);n.dom=o=on(c.$LI,null,c.$CX,i),RC(n,l,c),c.$UPD=!1}else{var u=cf(s(a,t),n);n.children=u,n.dom=o=on(u,null,t,i),TC(a,l,o)}return Ye(e)||mp(e,o),o}function sN(n){return function(){n.$UPD=!0,n.componentDidMount(),n.$UPD=!1}}function RC(n,e,t){ve(e)&&e(t),ve(t.componentDidMount)&&Ni.push(sN(t))}function aN(n,e,t){return function(){return n.onComponentDidMount(e,t)}}function TC(n,e,t){we(e)||(ve(e.onComponentWillMount)&&e.onComponentWillMount(n),ve(e.onComponentDidMount)&&Ni.push(aN(e,t,n)))}function Hv(n,e){Ni.push(function(){return e(n)})}function lN(n,e,t,i,r){var o=n.type,s=n.ref,a=n.props||At;if(r){var l=OC(n,o,a,t),c=l.$LI;af(c,e,l.$CX,i),n.dom=c.dom,RC(n,s,l),l.$UPD=!1}else{var u=cf(o(a,t),n);af(u,e,t,i),n.children=u,n.dom=u.dom,TC(a,s,e)}}function cN(n,e,t,i){var r=n.children,o=n.props,s=n.className,a=n.flags,l=n.ref;if(i=i||(a&32)>0,e.nodeType!==1||e.tagName.toLowerCase()!==n.type){var c=kC(n,null,t,i);n.dom=c,$v(e.parentNode,c,e)}else{n.dom=e;var u=e.firstChild,f=n.childFlags;if((f&1)===0){for(var h=null;u;)h=u.nextSibling,u.nodeType===8&&(u.data==="!"?e.replaceChild(document.createTextNode(""),u):e.removeChild(u)),u=h;if(u=e.firstChild,f===2)Ye(u)?on(r,e,t,i):(h=u.nextSibling,af(r,u,t,i),u=h);else if(f&12)for(var d=0,p=r.length;d<p;d++){var m=r[d];Ye(u)?on(m,e,t,i):(h=u.nextSibling,af(m,u,t,i),u=h)}for(;u;)h=u.nextSibling,e.removeChild(u),u=h}else!Ye(e.firstChild)&&!UB(e,o)&&(e.textContent="",a&448&&(e.defaultValue=""));Ye(o)||SC(n,a,o,e,i),we(s)?e.className!==""&&e.removeAttribute("class"):i?e.setAttribute("class",s):e.className=s,ve(l)&&Hv(e,l)}}function uN(n,e){if(e.nodeType!==3){var t=Iv(n,null);n.dom=t,$v(e.parentNode,t,e)}else{var i=n.children;e.nodeValue!==i&&(e.nodeValue=i),n.dom=e}}function af(n,e,t,i){var r=n.flags;r&14?lN(n,e,t,i,(r&4)>0):r&481?cN(n,e,t,i):r&16?uN(n,e):r&512?n.dom=e:$B()}function fN(n,e,t){var i=e.firstChild;if(!Ye(i))for(lo(n)||af(n,i,At,!1),i=e.firstChild;i=i.nextSibling;)e.removeChild(i);Ni.length>0&&jv(Ni),e.$V=n,ve(t)&&t()}function zv(n,e,t,i,r){us(n),$v(t,on(e,null,i,r),n.dom)}function gr(n,e,t,i,r){var o=e.flags|0;n.flags!==o||o&2048?zv(n,e,t,i,r):o&481?pN(n,e,t,i,r,o):o&14?mN(n,e,t,i,r,(o&4)>0):o&16?gN(n,e):o&512?e.dom=n.dom:dN(n,e,i)}function hN(n,e){n.textContent!==e.children&&(n.textContent=e.children)}function dN(n,e,t){var i=n.type,r=e.type,o=e.children;if(AC(n.childFlags,e.childFlags,n.children,o,i,t,!1),e.dom=n.dom,i!==r&&!lo(o)){var s=o.dom;i.removeChild(s),r.appendChild(s)}}function pN(n,e,t,i,r,o){var s=e.type;if(n.type!==s)zv(n,e,t,i,r);else{var a=n.dom,l=n.props,c=e.props,u=!1,f=!1,h;if(e.dom=a,r=r||(o&32)>0,l!==c){var d=l||At;if(h=c||At,h!==At){u=(o&448)>0,u&&(f=EC(h));for(var p in h){var m=d[p],g=h[p];m!==g&&Dv(p,m,g,a,r,f,n)}}if(d!==At)for(var b in d)!h.hasOwnProperty(b)&&!we(d[b])&&Dv(b,d[b],null,a,r,f,n)}var _=n.children,v=e.children,x=e.ref,C=n.className,E=e.className;o&4096?hN(a,v):AC(n.childFlags,e.childFlags,_,v,a,i,r&&s!=="foreignObject"),u&&CC(o,e,a,h,!1,f),C!==E&&(we(E)?a.removeAttribute("class"):r?a.setAttribute("class",E):a.className=E),ve(x)&&n.ref!==x&&Hv(a,x)}}function AC(n,e,t,i,r,o,s){switch(n){case 2:switch(e){case 2:gr(t,i,r,o,s);break;case 1:zn(t,r);break;default:zn(t,r),of(i,r,o,s);break}break;case 1:switch(e){case 2:on(i,r,o,s);break;case 1:break;default:of(i,r,o,s);break}break;default:if(e&12){var a=t.length,l=i.length;a===0?l>0&&of(i,r,o,s):l===0?hp(r,t):e===8&&n===8?vN(t,i,r,o,s,a,l):yN(t,i,r,o,s,a,l)}else e===1?hp(r,t):e===2&&(hp(r,t),on(i,r,o,s));break}}function MC(n,e,t,i,r,o,s,a,l){var c=n.state,u=n.props;t.children=n;var f;if(!n.$UN){if(u!==i||i===At){if(!l&&ve(n.componentWillReceiveProps)){if(n.$BR=!0,n.componentWillReceiveProps(i,o),n.$UN)return;n.$BR=!1}n.$PSS&&(e=sf(e,n.$PS),n.$PSS=!1,n.$PS=null)}var h=!!n.shouldComponentUpdate;if(a||!h||h&&n.shouldComponentUpdate(i,e,o)){ve(n.componentWillUpdate)&&(n.$BS=!0,n.componentWillUpdate(i,e,o),n.$BS=!1),n.props=i,n.state=e,n.context=o,ve(Wn.beforeRender)&&Wn.beforeRender(n),f=n.render(i,e,o),ve(Wn.afterRender)&&Wn.afterRender(n);var d=f!==Lv,p;if(ve(n.getChildContext)&&(p=n.getChildContext()),we(p)?p=o:p=sf(o,p),n.$CX=p,d){var m=n.$LI,g=cf(f,t);gr(m,g,r,p,s),n.$LI=g,ve(n.componentDidUpdate)&&n.componentDidUpdate(u,c)}}else n.props=i,n.state=e,n.context=o;t.dom=n.$LI.dom}}function mN(n,e,t,i,r,o){var s=e.type,a=n.key,l=e.key;if(n.type!==s||a!==l)zv(n,e,t,i,r);else{var c=e.props||At;if(o){var u=n.children;u.$UPD=!0,u.$V=e,MC(u,u.state,e,c,t,i,r,!1,!1),u.$UPD=!1}else{var f=!0,h=n.props,d=e.ref,p=!we(d),m=n.children;if(e.dom=n.dom,e.children=m,p&&ve(d.onComponentShouldUpdate)&&(f=d.onComponentShouldUpdate(h,c)),f!==!1){p&&ve(d.onComponentWillUpdate)&&d.onComponentWillUpdate(h,c);var g=s(c,i);g!==Lv&&(g=cf(g,e),gr(m,g,t,i,r),e.children=g,e.dom=g.dom,p&&ve(d.onComponentDidUpdate)&&d.onComponentDidUpdate(h,c))}else m.flags&14&&(m.parentVNode=e)}}}function gN(n,e){var t=e.children,i=n.dom;t!==n.children&&(i.nodeValue=t),e.dom=i}function yN(n,e,t,i,r,o,s){for(var a=o>s?s:o,l=0,c,u;l<a;l++)c=e[l],u=n[l],c.dom&&(c=e[l]=Wt(c)),gr(u,c,t,i,r),n[l]=c;if(o<s)for(l=a;l<s;l++)c=e[l],c.dom&&(c=e[l]=Wt(c)),on(c,t,i,r);else if(o>s)for(l=a;l<o;l++)zn(n[l],t)}function vN(n,e,t,i,r,o,s){var a=o-1,l=s-1,c,u=0,f=n[u],h=e[u],d;e:{for(;f.key===h.key;){if(h.dom&&(e[u]=h=Wt(h)),gr(f,h,t,i,r),n[u]=h,u++,u>a||u>l)break e;f=n[u],h=e[u]}for(f=n[a],h=e[l];f.key===h.key;){if(h.dom&&(e[l]=h=Wt(h)),gr(f,h,t,i,r),n[a]=h,a--,l--,u>a||u>l)break e;f=n[a],h=e[l]}}if(u>a){if(u<=l){d=l+1;for(var p=d<s?e[d].dom:null;u<=l;)h=e[u],h.dom&&(e[u]=h=Wt(h)),u++,up(t,on(h,null,i,r),p)}}else if(u>l)for(;u<=a;)zn(n[u++],t);else{var m=u,g=u,b=a-u+1,_=l-u+1,v=[];for(c=0;c<_;c++)v.push(0);var x=b===o,C=!1,E=0,S=0;if(s<4||(b|_)<32)for(c=m;c<=a;c++)if(f=n[c],S<_){for(u=g;u<=l;u++)if(h=e[u],f.key===h.key){if(v[u-g]=c+1,x)for(x=!1;c>m;)zn(n[m++],t);E>u?C=!0:E=u,h.dom&&(e[u]=h=Wt(h)),gr(f,h,t,i,r),S++;break}!x&&u>l&&zn(f,t)}else x||zn(f,t);else{var w={};for(c=g;c<=l;c++)w[e[c].key]=c;for(c=m;c<=a;c++)if(f=n[c],S<_)if(u=w[f.key],u!==void 0){if(x)for(x=!1;c>m;)zn(n[m++],t);h=e[u],v[u-g]=c+1,E>u?C=!0:E=u,h.dom&&(e[u]=h=Wt(h)),gr(f,h,t,i,r),S++}else x||zn(f,t);else x||zn(f,t)}if(x)hp(t,n),of(e,t,i,r);else if(C){var R=xN(v);for(u=R.length-1,c=_-1;c>=0;c--)v[c]===0?(E=c+g,h=e[E],h.dom&&(e[E]=h=Wt(h)),d=E+1,up(t,on(h,null,i,r),d<s?e[d].dom:null)):u<0||c!==R[u]?(E=c+g,h=e[E],d=E+1,up(t,h.dom,d<s?e[d].dom:null)):u--}else if(S!==_)for(c=_-1;c>=0;c--)v[c]===0&&(E=c+g,h=e[E],h.dom&&(e[E]=h=Wt(h)),d=E+1,up(t,on(h,null,i,r),d<s?e[d].dom:null))}}function xN(n){var e=n.slice(),t=[0],i,r,o,s,a,l=n.length;for(i=0;i<l;i++){var c=n[i];if(c!==0){if(r=t[t.length-1],n[r]<c){e[i]=r,t.push(i);continue}for(o=0,s=t.length-1;o<s;)a=(o+s)/2|0,n[t[a]]<c?o=a+1:s=a;c<n[t[o]]&&(o>0&&(e[i]=t[o-1]),t[o]=i)}}for(o=t.length,s=t[o-1];o-- >0;)t[o]=s,s=e[s];return t}function xa(n,e,t){if(n!==Lv){var i=e.$V;if(we(i)?lo(n)||(n.dom&&(n=Wt(n)),Ye(e.firstChild)?(on(n,e,At,!1),e.$V=n):fN(n,e),i=n):we(n)?(zn(i,e),e.$V=null):(n.dom&&(n=Wt(n)),gr(i,n,e,At,!1),i=e.$V=n),Ni.length>0&&jv(Ni),ve(t)&&t(),ve(Wn.renderComplete)&&Wn.renderComplete(i),i&&i.flags&14)return i.children}}function PC(n,e){return y(1024,e,null,n,0,null,lo(n)?null:n.key,null)}var hC=typeof Promise=="undefined"?null:Promise.resolve(),bN=typeof requestAnimationFrame=="undefined"?setTimeout:requestAnimationFrame.bind(window);function _N(n){return hC?hC.then(n):bN(n)}function dC(n,e,t,i){ve(e)&&(e=e(n.state,n.props,n.context));var r=n.$PS;if(we(r))n.$PS=e;else for(var o in e)r[o]=e[o];if(!n.$PSS&&!n.$BR)if(!n.$UPD)n.$PSS=!0,n.$UPD=!0,DC(n,i,t),n.$UPD=!1;else{var s=n.$QU;Ye(s)&&(s=n.$QU=[],_N(wN(n,s))),ve(t)&&s.push(t)}else n.$PSS=!0,n.$BR&&ve(t)&&Ni.push(t.bind(n))}function wN(n,e){return function(){n.$QU=null,n.$UPD=!0,DC(n,!1,function(){for(var t=0,i=e.length;t<i;t++)e[t].call(n)}),n.$UPD=!1}}function DC(n,e,t){if(!n.$UN){if(e||!n.$BR){n.$PSS=!1;var i=n.$PS,r=n.state,o=sf(r,i),s=n.props,a=n.context;n.$PS=null;var l=n.$V,c=n.$LI,u=c.dom&&c.dom.parentNode;if(MC(n,o,l,s,u,a,(l.flags&32)>0,e,!0),n.$UN)return;if((n.$LI.flags&1024)===0)for(var f=n.$LI.dom;!Ye(l=l.parentVNode);)(l.flags&14)>0&&(l.dom=f);Ni.length>0&&jv(Ni)}else n.state=n.$PS,n.$PS=null;ve(t)&&t.call(n)}}var L=(function(){function n(t,i){this.state=null,this.props=void 0,this.context=void 0,this.refs=void 0,this.$BR=!1,this.$BS=!0,this.$PSS=!1,this.$PS=null,this.$LI=null,this.$V=null,this.$UN=!1,this.$CX=null,this.$UPD=!0,this.$QU=null,this.props=t||At,this.context=i||At}var e=n.prototype;return e.forceUpdate=function(i){this.$UN||dC(this,{},i,!0)},e.setState=function(i,r){if(!this.$UN)if(!this.$BS)dC(this,i,r,!1);else return},e.render=function(i,r,o){},n})();L.defaultProps=void 0;var IC='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="#000000" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="#000000" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';function Wv(n){var e='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100;">'+IC+"</a>",t=te(e);n.appendChild(t),q.bind(t,"click",function(i){kN(),i.preventDefault()})}var co=class extends L{constructor(e,t){super(e,t),this.node=null}componentDidMount(){Wv(this.node)}render(){return y(1,"div",null,null,1,null,null,e=>this.node=e)}};function Uv(n){return n.join(";")}var CN=Uv(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"]),EN=Uv(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"]),SN=Uv(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"]),ON='<div class="bjs-powered-by-lightbox" style="'+CN+'"><div class="backdrop" style="'+EN+'"></div><div class="notice" style="'+SN+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;">'+IC+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',uf;function kN(){uf||(uf=te(ON),_t.bind(uf,".backdrop","click",function(n){document.body.removeChild(uf)})),document.body.appendChild(uf)}var RN=new qn,gp="hsl(225, 10%, 15%)";function ff(n,e,t,i,r,o){mn.call(this,e);var s=RN.next(),a=i.computeStyle,l={},c=n&&n.defaultFillColor||"white",u=n&&n.defaultStrokeColor||gp,f=n&&n.defaultLabelColor;function h(S,w,R){var A=S+"-"+BC(w)+"-"+BC(R)+"-"+s;return l[A]||p(A,S,w,R),"url(#"+A+")"}function d(S,w){var R=T({strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},w.attrs),A=w.ref||{x:0,y:0},I=w.scale||1;R.strokeDasharray==="none"&&(R.strokeDasharray=[1e4,1]);var D=Q("marker");j(w.element,R),K(D,w.element),j(D,{id:S,viewBox:"0 0 20 20",refX:A.x,refY:A.y,markerWidth:20*I,markerHeight:20*I,orient:"auto"});var N=X("defs",o._svg);N||(N=Q("defs"),K(o._svg,N)),K(N,D),l[S]=D}function p(S,w,R,A){if(w==="association-start"){var I=Q("path");j(I,{d:"M 11 5 L 1 10 L 11 15"}),d(S,{element:I,attrs:{fill:"none",stroke:A,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}else if(w==="association-end"){var D=Q("path");j(D,{d:"M 1 5 L 11 10 L 1 15"}),d(S,{element:D,attrs:{fill:"none",stroke:A,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}else if(w==="information-requirement-end"){var N=Q("path");j(N,{d:"M 1 5 L 11 10 L 1 15 Z"}),d(S,{element:N,attrs:{fill:A,stroke:"none"},ref:{x:11,y:10},scale:1})}else if(w==="knowledge-requirement-end"){var W=Q("path");j(W,{d:"M 1 3 L 11 10 L 1 17"}),d(S,{element:W,attrs:{fill:"none",stroke:A,strokeWidth:2},ref:{x:11,y:10},scale:.8})}else if(w==="authority-requirement-end"){var Re=Q("circle");j(Re,{cx:3,cy:3,r:3}),d(S,{element:Re,attrs:{fill:A,stroke:"none"},ref:{x:3,y:3},scale:.9})}}function m(S,w,R,A,I,D){Pe(I)&&(D=I,I=0),I=I||0,D=a(D,{stroke:gp,strokeWidth:2,fill:"white"});var N=Q("rect");return j(N,{x:I,y:I,width:w-I*2,height:R-I*2,rx:A,ry:A}),j(N,D),K(S,N),N}function g(S,w,R){var A=r.createText(w||"",R);return et(A,"class","djs-label"),K(S,A),A}function b(S,w,R,A){var I=f1(w);return A=T({box:w,align:R,padding:5,style:{fill:NC(w,f,u)}},A),g(S,I,A)}function _(S,w,R){R=a(R,["no-fill"],{strokeWidth:2,stroke:gp});var A=Q("path");return j(A,{d:w}),j(A,R),K(S,A),A}var v={"dmn:Decision":function(S,w){var R=m(S,w.width,w.height,0,{stroke:$i(w,u),fill:uo(w,c)});return b(S,w,"center-middle"),R},"dmn:KnowledgeSource":function(S,w){var R=t.getScaledPath("KNOWLEDGE_SOURCE",{xScaleFactor:1.021,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:0,my:.075}}),A=_(S,R,{strokeWidth:2,fill:uo(w,c),stroke:$i(w,u)});return b(S,w,"center-middle"),A},"dmn:BusinessKnowledgeModel":function(S,w){var R=t.getScaledPath("BUSINESS_KNOWLEDGE_MODEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:0,my:.3}}),A=_(S,R,{strokeWidth:2,fill:uo(w,c),stroke:$i(w,u)});return b(S,w,"center-middle"),A},"dmn:InputData":function(S,w){var R=m(S,w.width,w.height,22,{stroke:$i(w,u),fill:uo(w,c)});return b(S,w,"center-middle"),R},"dmn:TextAnnotation":function(S,w){var R={fill:"none",stroke:"none"},A=m(S,w.width,w.height,0,0,R),I=t.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:0,my:0}});_(S,I,{stroke:$i(w,u)});var D=LC(w).text||"";return g(S,D,{style:{fill:NC(w,f,u)},box:w,align:"left-top",padding:5}),A},"dmn:Association":function(S,w){var R=LC(w),A=uo(w,c),I=$i(w,u),D={stroke:I,strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};return(R.associationDirection==="One"||R.associationDirection==="Both")&&(D.markerEnd=h("association-end",A,I)),R.associationDirection==="Both"&&(D.markerStart=h("association-start",A,I)),E(S,w.waypoints,D)},"dmn:InformationRequirement":function(S,w){var R=uo(w,c),A=$i(w,u),I={stroke:A,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:h("information-requirement-end",R,A)};return E(S,w.waypoints,I)},"dmn:KnowledgeRequirement":function(S,w){var R=uo(w,c),A=$i(w,u),I={stroke:A,strokeWidth:1,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:h("knowledge-requirement-end",R,A)};return E(S,w.waypoints,I)},"dmn:AuthorityRequirement":function(S,w){var R=uo(w,c),A=$i(w,u),I={stroke:A,strokeWidth:1.5,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:h("authority-requirement-end",R,A)};return E(S,w.waypoints,I)}};function x(S,w){var R=v[w.type];return R?R(S,w):mn.prototype.drawShape.apply(this,[S,w])}function C(S,w){var R=w.type,A=v[R];return A?A(S,w):mn.prototype.drawConnection.apply(this,[S,w])}function E(S,w,R){R=a(R,["no-fill"],{stroke:gp,strokeWidth:2,fill:"none"});var A=ro(w,R);return K(S,A),A}this.canRender=function(S){return O(S,"dmn:DMNElement")||O(S,"dmn:InformationRequirement")||O(S,"dmn:KnowledgeRequirement")||O(S,"dmn:AuthorityRequirement")},this.drawShape=x,this.drawConnection=C}fe(ff,mn);ff.$inject=["config.drdRenderer","eventBus","pathMap","styles","textRenderer","canvas"];function LC(n){return n.businessObject}function BC(n){return n.replace(/[^0-9a-zA-z]+/g,"_")}function $i(n,e){return e}function uo(n,e){return e}function NC(n,e,t){return e||$i(n,t)}var TN=0,AN={width:150,height:50};function MN(n){var e=n.split("-");return{horizontal:e[0]||"center",vertical:e[1]||"top"}}function PN(n){return Pe(n)?T({top:0,left:0,right:0,bottom:0},n):{top:n,left:n,right:n,bottom:n}}var Qv=null;function DN(){return Qv||(Qv=document.createElement("canvas").getContext("2d")),Qv}function IN(n){var e=[];return n.fontStyle&&e.push(n.fontStyle),n.fontVariant&&e.push(n.fontVariant),n.fontWeight&&e.push(n.fontWeight),n.fontStretch&&e.push(n.fontStretch),e.push(jC(n.fontSize)||"12px"),e.push(n.fontFamily||"sans-serif"),e.join(" ")}function jC(n){if(n!=null)return typeof n=="number"||/^-?\d+(\.\d+)?$/.test(n)?n+"px":n}function LN(n,e){var t=DN();if(!t)return{width:0,height:0};t.font=IN(e),"letterSpacing"in t&&(t.letterSpacing=jC(e.letterSpacing)||"0px");var i=n==="",r=i?"dummy":n.replace(/\s+$/,""),o=t.measureText(r);return{width:i?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function BN(n,e,t){for(var i=n.shift(),r=i,o;;){if(o=LN(r,t),o.width=r?o.width:0,r===" "||r===""||o.width<Math.round(e)||r.length<2)return NN(n,r,i,o);r=jN(r,o.width,e)}}function NN(n,e,t,i){if(e.length<t.length){var r=t.slice(e.length).trim();n.unshift(r)}return{width:i.width,height:i.height,text:e}}var $C="\xAD";function $N(n,e){var t=n.split(/(\s|-|\u00AD)/g),i,r=[],o=0;if(t.length>1)for(;i=t.shift();)if(i.length+o<e)r.push(i),o+=i.length;else{(i==="-"||i===$C)&&r.pop();break}var s=r[r.length-1];return s&&s===$C&&(r[r.length-1]="-"),r.join("")}function jN(n,e,t){var i=Math.max(n.length*(t/e),1),r=$N(n,i);return r||(r=n.slice(0,Math.max(Math.round(i-1),1))),r}function ba(n){this._config=T({},{size:AN,padding:TN,style:{},align:"center-top"},n||{})}ba.prototype.createText=function(n,e){return this.layoutText(n,e).element};ba.prototype.getDimensions=function(n,e){return this.layoutText(n,e).dimensions};ba.prototype.layoutText=function(n,e){for(var t=T({},this._config.size,e.box),i=T({},this._config.style,e.style),r=MN(e.align||this._config.align),o=PN(e.padding!==void 0?e.padding:this._config.padding),s=e.fitBox||!1,a=FN(i),l=n.split(/\u00AD?\r?\n/),c=[],u=t.width-o.left-o.right;l.length;)c.push(BN(l,u,i));r.vertical==="middle"&&(o.top=o.bottom=0);var f=st(c,function(g,b,_){return g+(a||b.height)},0)+o.top+o.bottom,h=st(c,function(g,b,_){return b.width>g?b.width:g},0),d=o.top;r.vertical==="middle"&&(d+=(t.height-f)/2),d-=(a||c[0].height)/4;var p=Q("text");j(p,i),k(c,function(g){var b;switch(d+=a||g.height,r.horizontal){case"left":b=o.left;break;case"right":b=(s?h:u)-o.right-g.width;break;default:b=Math.max(((s?h:u)-g.width)/2+o.left,0)}var _=Q("tspan");j(_,{x:b,y:d}),_.textContent=g.text,K(p,_)});var m={width:h,height:f};return{dimensions:m,element:p}};function FN(n){if("fontSize"in n&&"lineHeight"in n)return n.lineHeight*parseInt(n.fontSize,10)}var qN=12,VN=1.2,HN=30;function yp(n){var e=T({fontFamily:"Arial, sans-serif",fontSize:qN,fontWeight:"normal",lineHeight:VN},n&&n.defaultStyle||{}),t=parseInt(e.fontSize,10)-1,i=T({},e,{fontSize:t},n&&n.externalStyle||{}),r=new ba({style:e});this.getExternalLabelBounds=function(o,s){var a=r.getDimensions(s,{box:{width:90,height:30,x:o.width/2+o.x,y:o.height/2+o.y},style:i});return{x:Math.round(o.x+o.width/2-a.width/2),y:Math.round(o.y),width:Math.ceil(a.width),height:Math.ceil(a.height)}},this.getTextAnnotationBounds=function(o,s){var a=r.getDimensions(s,{box:o,style:e,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(HN,Math.round(a.height))}},this.createText=function(o,s){return r.createText(o,s||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}yp.$inject=["config.textRenderer"];function Kv(){this.pathMap={KNOWLEDGE_SOURCE:{d:"m {mx},{my} l 0,{e.y0} c {e.x0},{e.y1} {e.x1},-{e.y2} {e.x2},-{e.y3} c {e.x3},-{e.y4} {e.x4},{e.y5} {e.x5},{e.y6} l 0,-{e.y7}z",width:100,height:65,widthElements:[29.8,48.4,67.2,12.2,19.8,30.8],heightElements:[55.3,19.7,4.2,6.7,2.3,1.6,6.2,54.6]},BUSINESS_KNOWLEDGE_MODEL:{d:"m {mx},{my} l {e.x0},-{e.y0} l {e.x1},0 l 0,{e.y1} l -{e.x2},{e.y2} l -{e.x3},0z",width:125,height:45,widthElements:[13.8,109.2,13.8,109.1],heightElements:[13.2,29.8,13.2]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",width:10,height:30,widthElements:[10],heightElements:[30]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var i=this.pathMap[e],r,o;t.abspos?(r=t.abspos.x,o=t.abspos.y):(r=t.containerWidth*t.position.mx,o=t.containerHeight*t.position.my);var s={};if(t.position){for(var a=t.containerHeight/i.height*t.yScaleFactor,l=t.containerWidth/i.width*t.xScaleFactor,c=0;c<i.heightElements.length;c++)s["y"+c]=i.heightElements[c]*a;for(var u=0;u<i.widthElements.length;u++)s["x"+u]=i.widthElements[u]*l}var f=QN(i.d,{mx:r,my:o,e:s});return f}}var zN=/\{([^{}]+)\}/g,WN=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function UN(n,e,t){var i=t;return e.replace(WN,function(r,o,s,a,l){o=o||a,i&&(o in i&&(i=i[o]),typeof i=="function"&&l&&(i=i()))}),i=(i==null||i==t?n:i)+"",i}function QN(n,e){return String(n).replace(zN,function(t,i){return UN(t,i,e)})}var FC={__init__:["drdRenderer"],drdRenderer:["type",ff],textRenderer:["type",yp],pathMap:["type",Kv]};function yr(n,e,t,i){this._eventBus=n,this._canvas=e,this._elementRegistry=i,this._elementFactory=t}yr.$inject=["eventBus","canvas","elementFactory","elementRegistry"];yr.prototype.root=function(n){var e=this._elementFactory.createRoot(Gv(n));return this._canvas.setRootElement(e),e};yr.prototype.add=function(n){var e=this._elementFactory,t=this._canvas,i=this._eventBus,r=n.di,o,s,a,l,c,u;if(r.$instanceOf("dmndi:DMNShape"))u=r.bounds,c=Gv(n,{x:Math.round(u.x),y:Math.round(u.y),width:Math.round(u.width),height:Math.round(u.height)}),o=e.createShape(c),t.addShape(o),i.fire("drdElement.added",{element:o,di:r});else if(r.$instanceOf("dmndi:DMNEdge"))s=KN(r),a=this._getSource(n),l=this._getTarget(n),a&&l&&(c=Gv(n,{hidden:!1,source:a,target:l,waypoints:s}),o=e.createConnection(c),t.addConnection(o),i.fire("drdElement.added",{element:o,di:r}));else throw new Error("unknown di for element "+n.id);return o};yr.prototype._getSource=function(n){var e,t;if(O(n,"dmn:Association")?t=n.sourceRef:O(n,"dmn:InformationRequirement")?t=n.requiredDecision||n.requiredInput:O(n,"dmn:KnowledgeRequirement")?t=n.requiredKnowledge:O(n,"dmn:AuthorityRequirement")&&(t=n.requiredDecision||n.requiredInput||n.requiredAuthority),t&&(e=t.href),e)return this._getShape(qC(e))};yr.prototype._getTarget=function(n){return O(n,"dmn:Association")?n.targetRef&&this._getShape(qC(n.targetRef.href)):this._getShape(n.$parent.id)};yr.prototype._getShape=function(n){return this._elementRegistry.get(n)};function Gv(n,e){return T({id:n.id,type:n.$type,businessObject:n},e)}function KN(n){var e=n.waypoint;if(e)return Vt(e,function(t){var i={x:t.x,y:t.y};return T({original:i},i)})}function qC(n){return n.split("#").pop()}var VC={drdImporter:["type",yr]};var HC={__depends__:[FC,VC]};function Xv(n,e){return e=e||{},n.replace(/{([^}]+)}/g,function(t,i){return e[i]||"{"+i+"}"})}var qe={translate:["value",Xv]};function zC(n){!n||typeof n.stopPropagation!="function"||n.stopPropagation()}function vr(n){return n.originalEvent||n.srcEvent}function vp(n){zC(n),zC(vr(n))}function Un(n){return n.pointers&&n.pointers.length&&(n=n.pointers[0]),n.touches&&n.touches.length&&(n=n.touches[0]),n?{x:n.clientX,y:n.clientY}:null}function xp(){return/mac/i.test(navigator.platform)}function WC(n,e){return(vr(n)||n).button===e}function Sn(n){return WC(n,0)}function UC(n){return WC(n,1)}function hf(n){var e=vr(n)||n;return Sn(n)?xp()?e.metaKey:e.ctrlKey:!1}function df(n){var e=vr(n)||n;return Sn(n)&&e.shiftKey}function GN(n){return!0}function bp(n){return Sn(n)||UC(n)}var QC=500;function _p(n,e,t){var i=this;function r(w,R,A){if(!a(w,R)){var I,D,N;A?D=e.getGraphics(A):(I=R.delegateTarget||R.target,I&&(D=I,A=e.get(D))),!(!D||!A)&&(N=n.fire(w,{element:A,gfx:D,originalEvent:R}),N===!1&&(R.stopPropagation(),R.preventDefault()))}}var o={};function s(w){return o[w]}function a(w,R){var A=c[w]||Sn;return!A(R)}var l={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":GN,"element.mousedown":bp,"element.mouseup":bp,"element.click":bp,"element.dblclick":bp};function u(w,R,A){var I=l[w];if(!I)throw new Error("unmapped DOM event name <"+w+">");return r(I,R,A)}var f="svg, .djs-element";function h(w,R,A,I){var D=o[A]=function(N){r(A,N)};I&&(c[A]=I),D.$delegate=_t.bind(w,f,R,D)}function d(w,R,A){var I=s(A);I&&_t.unbind(w,R,I.$delegate)}function p(w){k(l,function(R,A){h(w,A,R)})}function m(w){k(l,function(R,A){d(w,A,R)})}n.on("canvas.destroy",function(w){m(w.svg)}),n.on("canvas.init",function(w){p(w.svg)}),n.on(["shape.added","connection.added"],function(w){var R=w.element,A=w.gfx;n.fire("interactionEvents.createHit",{element:R,gfx:A})}),n.on(["shape.changed","connection.changed"],QC,function(w){var R=w.element,A=w.gfx;n.fire("interactionEvents.updateHit",{element:R,gfx:A})}),n.on("interactionEvents.createHit",QC,function(w){var R=w.element,A=w.gfx;i.createDefaultHit(R,A)}),n.on("interactionEvents.updateHit",function(w){var R=w.element,A=w.gfx;i.updateDefaultHit(R,A)});var g=C("djs-hit djs-hit-stroke"),b=C("djs-hit djs-hit-click-stroke"),_=C("djs-hit djs-hit-all"),v=C("djs-hit djs-hit-no-move"),x={all:_,"click-stroke":b,stroke:g,"no-move":v};function C(w,R){return R=T({stroke:"white",strokeWidth:15},R||{}),t.cls(w,["no-fill","no-border"],R)}function E(w,R){var A=x[R];if(!A)throw new Error("invalid hit type <"+R+">");return j(w,A),w}function S(w,R){K(w,R)}this.removeHits=function(w){var R=pn(".djs-hit",w);k(R,Fe)},this.createDefaultHit=function(w,R){var A=w.waypoints,I=w.isFrame,D;return A?this.createWaypointsHit(R,A):(D=I?"stroke":"all",this.createBoxHit(R,D,{width:w.width,height:w.height}))},this.createWaypointsHit=function(w,R){var A=ro(R);return E(A,"stroke"),S(w,A),A},this.createBoxHit=function(w,R,A){A=T({x:0,y:0},A);var I=Q("rect");return E(I,R),j(I,A),S(w,I),I},this.updateDefaultHit=function(w,R){var A=X(".djs-hit",R);if(A)return w.waypoints?bv(A,w.waypoints):j(A,{width:w.width,height:w.height}),A},this.fire=r,this.triggerMouseEvent=u,this.mouseHandler=s,this.registerEvent=h,this.unregisterEvent=d}_p.$inject=["eventBus","elementRegistry","styles"];var fo={__init__:["interactionEvents"],interactionEvents:["type",_p]};function ho(n,e){this._eventBus=n,this._canvas=e,this._selectedElements=[];var t=this;n.on(["shape.remove","connection.remove"],function(i){var r=i.element;t.deselect(r)}),n.on(["diagram.clear","root.set"],function(i){t.select(null)})}ho.$inject=["eventBus","canvas"];ho.prototype.deselect=function(n){var e=this._selectedElements,t=e.indexOf(n);if(t!==-1){var i=e.slice();e.splice(t,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}};ho.prototype.get=function(){return this._selectedElements};ho.prototype.isSelected=function(n){return this._selectedElements.indexOf(n)!==-1};ho.prototype.select=function(n,e){var t=this._selectedElements,i=t.slice();F(n)||(n=n?[n]:[]);var r=this._canvas,o=r.getRootElement();n=n.filter(function(s){var a=r.findRoot(s);return o===a}),e?k(n,function(s){t.indexOf(s)===-1&&t.push(s)}):this._selectedElements=t=n.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})};var KC="hover",GC="selected";function wp(n,e){this._canvas=n;function t(r,o){n.addMarker(r,o)}function i(r,o){n.removeMarker(r,o)}e.on("element.hover",function(r){t(r.element,KC)}),e.on("element.out",function(r){i(r.element,KC)}),e.on("selection.changed",function(r){function o(c){i(c,GC)}function s(c){t(c,GC)}var a=r.oldSelection,l=r.newSelection;k(a,function(c){l.indexOf(c)===-1&&o(c)}),k(l,function(c){a.indexOf(c)===-1&&s(c)})})}wp.$inject=["canvas","eventBus"];function Cp(n,e,t,i){n.on("create.end",500,function(r){var o=r.context,s=o.canExecute,a=o.elements,l=o.hints||{},c=l.autoSelect;if(s){if(c===!1)return;F(c)?e.select(c):e.select(a.filter(XN))}}),n.on("connect.end",500,function(r){var o=r.context,s=o.connection;s&&e.select(s)}),n.on("shape.move.end",500,function(r){var o=r.previousSelection||[],s=i.get(r.context.shape.id),a=ye(o,function(l){return s.id===l.id});a||e.select(s)}),n.on("element.click",function(r){if(Sn(r)){var o=r.element;o===t.getRootElement()&&(o=null);var s=e.isSelected(o),a=e.get().length>1,l=df(r);if(s&&a)return l?e.deselect(o):e.select(o);s?e.deselect(o):e.select(o,l)}})}Cp.$inject=["eventBus","selection","canvas","elementRegistry"];function XN(n){return!n.hidden}var ht={__init__:["selectionVisuals","selectionBehavior"],__depends__:[fo],selection:["type",ho],selectionVisuals:["type",wp],selectionBehavior:["type",Cp]};function po(n){this._counter=0,this._prefix=(n?n+"-":"")+Math.floor(Math.random()*1e9)+"-"}po.prototype.next=function(){return this._prefix+ ++this._counter};var YN=new po("ov"),ZN=500;function xt(n,e,t,i){this._eventBus=e,this._canvas=t,this._elementRegistry=i,this._ids=YN,this._overlayDefaults=T({show:null,scale:!0},n&&n.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=JN(t.getContainer()),this._init()}xt.$inject=["config.overlays","eventBus","canvas","elementRegistry"];xt.prototype.get=function(n){if(Ie(n)&&(n={id:n}),Ie(n.element)&&(n.element=this._elementRegistry.get(n.element)),n.element){var e=this._getOverlayContainer(n.element,!0);return e?n.type?Ee(e.overlays,la({type:n.type})):e.overlays.slice():[]}else return n.type?Ee(this._overlays,la({type:n.type})):n.id?this._overlays[n.id]:null};xt.prototype.add=function(n,e,t){if(Pe(e)&&(t=e,e=null),n.id||(n=this._elementRegistry.get(n)),!t.position)throw new Error("must specifiy overlay position");if(!t.html)throw new Error("must specifiy overlay html");if(!n)throw new Error("invalid element specified");var i=this._ids.next();return t=T({},this._overlayDefaults,t,{id:i,type:e,element:n,html:t.html}),this._addOverlay(t),i};xt.prototype.remove=function(n){var e=this.get(n)||[];F(e)||(e=[e]);var t=this;k(e,function(i){var r=t._getOverlayContainer(i.element,!0);if(i&&(Qe(i.html),Qe(i.htmlContainer),delete i.htmlContainer,delete i.element,delete t._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})};xt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};xt.prototype.show=function(){Ep(this._overlayRoot)};xt.prototype.hide=function(){Ep(this._overlayRoot,!1)};xt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],no(this._overlayRoot)};xt.prototype._updateOverlayContainer=function(n){var e=n.element,t=n.html,i=e.x,r=e.y;if(e.waypoints){var o=Tt(e);i=o.x,r=o.y}XC(t,i,r),et(n.html,"data-container-id",e.id)};xt.prototype._updateOverlay=function(n){var e=n.position,t=n.htmlContainer,i=n.element,r=e.left,o=e.top;if(e.right!==void 0){var s;i.waypoints?s=Tt(i).width:s=i.width,r=e.right*-1+s}if(e.bottom!==void 0){var a;i.waypoints?a=Tt(i).height:a=i.height,o=e.bottom*-1+a}XC(t,r||0,o||0),this._updateOverlayVisibilty(n,this._canvas.viewbox())};xt.prototype._createOverlayContainer=function(n){var e=te('<div class="djs-overlays" />');is(e,{position:"absolute"}),this._overlayRoot.appendChild(e);var t={html:e,element:n,overlays:[]};return this._updateOverlayContainer(t),this._overlayContainers.push(t),t};xt.prototype._updateRoot=function(n){var e=n.scale||1,t="matrix("+[e,0,0,e,-1*n.x*e,-1*n.y*e].join(",")+")";YC(this._overlayRoot,t)};xt.prototype._getOverlayContainer=function(n,e){var t=ye(this._overlayContainers,function(i){return i.element===n});return!t&&!e?this._createOverlayContainer(n):t};xt.prototype._addOverlay=function(n){var e=n.id,t=n.element,i=n.html,r,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Ie(i)&&(i=te(i)),o=this._getOverlayContainer(t),r=te('<div class="djs-overlay" data-overlay-id="'+e+'">'),is(r,{position:"absolute"}),r.appendChild(i),n.type&&ee(r).add("djs-overlay-"+n.type);var s=this._canvas.findRoot(t),a=this._canvas.getRootElement();Ep(r,s===a),n.htmlContainer=r,o.overlays.push(n),o.html.appendChild(r),this._overlays[e]=n,this._updateOverlay(n),this._updateOverlayVisibilty(n,this._canvas.viewbox())};xt.prototype._updateOverlayVisibilty=function(n,e){var t=n.show,i=this._canvas.findRoot(n.element),r=t&&t.minZoom,o=t&&t.maxZoom,s=n.htmlContainer,a=this._canvas.getRootElement(),l=!0;(i!==a||t&&(Me(r)&&r>e.scale||Me(o)&&o<e.scale))&&(l=!1),Ep(s,l),this._updateOverlayScale(n,e)};xt.prototype._updateOverlayScale=function(n,e){var t=n.scale,i,r,o=n.htmlContainer,s,a="";t!==!0&&(t===!1?(i=1,r=1):(i=t.min,r=t.max),Me(i)&&e.scale<i&&(s=(1/e.scale||1)*i),Me(r)&&e.scale>r&&(s=(1/e.scale||1)*r)),Me(s)&&(a="scale("+s+","+s+")"),YC(o,a)};xt.prototype._updateOverlaysVisibilty=function(n){var e=this;k(this._overlays,function(t){e._updateOverlayVisibilty(t,n)})};xt.prototype._init=function(){var n=this._eventBus,e=this;function t(i){e._updateRoot(i),e._updateOverlaysVisibilty(i),e.show()}n.on("canvas.viewbox.changing",function(i){e.hide()}),n.on("canvas.viewbox.changed",function(i){t(i.viewbox)}),n.on(["shape.remove","connection.remove"],function(i){var r=i.element,o=e.get({element:r});k(o,function(l){e.remove(l.id)});var s=e._getOverlayContainer(r);if(s){Qe(s.html);var a=e._overlayContainers.indexOf(s);a!==-1&&e._overlayContainers.splice(a,1)}}),n.on("element.changed",ZN,function(i){var r=i.element,o=e._getOverlayContainer(r,!0);o&&(k(o.overlays,function(s){e._updateOverlay(s)}),e._updateOverlayContainer(o))}),n.on("element.marker.update",function(i){var r=e._getOverlayContainer(i.element,!0);r&&ee(r.html)[i.add?"add":"remove"](i.marker)}),n.on("root.set",function(){e._updateOverlaysVisibilty(e._canvas.viewbox())}),n.on("diagram.clear",this.clear,this)};function JN(n){var e=te('<div class="djs-overlay-container" />');return is(e,{position:"absolute",width:0,height:0}),n.insertBefore(e,n.firstChild),e}function XC(n,e,t){is(n,{left:e+"px",top:t+"px"})}function Ep(n,e){n.style.display=e===!1?"none":""}function YC(n,e){n.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(t){n.style[t+"transform"]=e})}var mo={__init__:["overlays"],overlays:["type",xt]};function _a(n,e,t){this._eventBus=n,this._canvas=e,this._translate=t,n.on("diagram.init",function(){this._init()},this),n.on("import.done",function(i){i.error||this.update()},this),this.HTML_MARKUP='<div class="dmn-definitions"><div class="dmn-definitions-name" title="'+this._translate("Definition name")+'" spellcheck="false"></div><div class="dmn-definitions-id" title="'+this._translate("Definition ID")+'" spellcheck="false"></div></div>'}_a.$inject=["eventBus","canvas","translate"];_a.prototype._init=function(){var n=this._canvas,e=this._eventBus,t=n.getContainer(),i=this._container=te(this.HTML_MARKUP);t.appendChild(i),this.nameElement=X(".dmn-definitions-name",this._container),this.idElement=X(".dmn-definitions-id",this._container),_t.bind(i,".dmn-definitions-name, .dmn-definitions-id","mousedown",function(r){r.stopPropagation()}),e.fire("definitionIdView.create",{html:i})};_a.prototype.update=function(){var n=this._canvas.getRootElement().businessObject;this.nameElement.textContent=n.name,this.idElement.textContent=n.id};function wa(n,e){function t(i,r){var o=e.getContainer();ee(o).toggle(i,r)}n.on("palette.create",function(){t("with-palette",!0)}),n.on("palette.changed",function(i){t("with-palette-two-column",i.twoColumn)})}wa.$inject=["eventBus","canvas"];var Ca={__depends__:[qe],__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",_a],definitionPropertiesPaletteAdapter:["type",wa]};var ZC=[{className:"dmn-icon-decision-table",matches:function(n){var e=Ke(n);return O(e,"dmn:Decision")&&O(e.decisionLogic,"dmn:DecisionTable")},title:"Open decision table"},{className:"dmn-icon-literal-expression",matches:function(n){var e=dr(n);return O(e,"dmn:LiteralExpression")},title:"Open literal expression"}],Ea=class{constructor(e,t,i,r,o){this._injector=e,this._eventBus=t,this._overlays=i,this._translate=o,this._config=r||{enabled:!0},t.on(["shape.added"],({element:s})=>{for(let l=0;l<ZC.length;l++){let{matches:c,className:u,title:f}=ZC[l];var a=c&&c(s);a&&this.addOverlay(s,u,f)}})}addOverlay(e,t,i){let r=this._config.enabled!==!1,o=this._getOverlayNode(t,i,r),s=this._overlays.add(e,{position:{top:2,left:2},html:o});r&&(ee(o).add("interactive"),this.bindEventListener(e,o,s))}_getOverlayNode(e,t,i){let r=document.createElement("div");if(r.className="drill-down-overlay",!i){let s=document.createElement("span");return s.className=e,r.appendChild(s),r}let o=document.createElement("button");return o.type="button",o.className=e,o.title=this._translate(t),r.appendChild(o),r}bindEventListener(e,t,i){let r=this._overlays,o=this._eventBus,s=r._overlayRoot;_t.bind(s,'[data-overlay-id="'+i+'"]',"click",()=>{o.fire("drillDown.click",{element:e})!==!1&&this.drillDown(e)})}drillDown(e){let t=this._injector.get("_parent",!1);if(!t)return!1;let i=t.getView(e.businessObject);return i?(t.open(i),!0):!1}};Ea.$inject=["injector","eventBus","overlays","config.drillDown","translate"];var JC={__depends__:[mo,qe],__init__:["drillDown"],drillDown:["type",Ea]};function Et(n){this._container=this._createContainer(),Wv(this._container),this._init(this._container,n)}fe(Et,mr);Et.prototype.saveSVG=ha(function(n){var e=this;return new Promise(function(t){var i=e.get("canvas"),r=i.getActiveLayer(),o=X("defs",i._svg),s=w1(r),a=o&&o.outerHTML||"",l=r.getBBox(),c=`<?xml version="1.0" encoding="utf-8"?>
16 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+a+s+"</svg>";t({svg:c})})});Et.prototype.getModules=function(){return this._modules};Et.prototype.destroy=function(){mr.prototype.destroy.call(this),Qe(this._container)};Et.prototype.on=function(n,e,t,i){return this.get("eventBus").on(n,e,t,i)};Et.prototype.off=function(n,e){this.get("eventBus").off(n,e)};Et.prototype._init=function(n,e){var{additionalModules:t,canvas:i,...r}=e,o=e.modules||this.getModules(),s=[{drd:["value",this]}],a=[...s,...o,...t||[]],l={...r,canvas:{...i,container:n},modules:a};mr.call(this,l),e&&e.container&&this.attachTo(e.container)};Et.prototype._emit=function(n,e){return this.get("eventBus").fire(n,e)};Et.prototype._createContainer=function(){return te('<div class="dmn-drd-container"></div>')};Et.prototype.open=function(n){var e=this;return new Promise((t,i)=>{var r;try{return e._definitions&&e.clear(),e._definitions=n,aC(e,n,function(o,s){o?(o.warnings=s||[],i(o)):t({warnings:s||[]})})}catch(o){r=o}r?(r.warnings=r.warnings||[],i(r)):t({warnings:[]})})};Et.prototype.attachTo=function(n){if(!n)throw new Error("parentNode required");this.detach();var e=this._container;n.appendChild(e),this._emit("attach",{}),this.get("canvas").resized()};Et.prototype.detach=function(){var n=this._container,e=n.parentNode;e&&(this._emit("detach",{}),e.removeChild(n))};Et.prototype._modules=[HC,qe,ht,mo,Ca,JC];function Yv(n){return{x:n.x+n.width/2,y:n.y+n.height/2}}function xr(n,e){return{x:n.x-e.x,y:n.y-e.y}}function pf(n){return Math.log(n)/Math.log(10)}function Zv(n,e){var t=pf(n.min),i=pf(n.max),r=Math.abs(t)+Math.abs(i);return r/e}function eE(n,e){return Math.max(n.min,Math.min(n.max,e))}var e$=Math.sign||function(n){return n>=0?1:-1},Jv={min:.2,max:4},tE=10,t$=.1,n$=.75;function Qn(n,e,t){n=n||{},this._enabled=!1,this._canvas=t,this._container=t._container,this._handleWheel=at(this._handleWheel,this),this._totalDelta=0,this._scale=n.scale||n$;var i=this;e.on("canvas.mouseover",function(){i._init(n.enabled!==!1)}),e.on("canvas.mouseout",function(){i._init(!1)})}Qn.$inject=["config.zoomScroll","eventBus","canvas"];Qn.prototype.scroll=function(e){this._canvas.scroll(e)};Qn.prototype.reset=function(){this._canvas.zoom("fit-viewport")};Qn.prototype.zoom=function(e,t){var i=Zv(Jv,tE*2);this._totalDelta+=e,Math.abs(this._totalDelta)>t$&&(this._zoom(e,t,i),this._totalDelta=0)};Qn.prototype._handleWheel=function(e){if(this._enabled){var t=this._container;e.preventDefault();var i=e.ctrlKey||xp()&&e.metaKey,r=e.shiftKey,o=-1*this._scale,s;if(i?o*=e.deltaMode===0?.02:.32:o*=e.deltaMode===0?1:16,i){var a=t.getBoundingClientRect(),l={x:e.clientX-a.left,y:e.clientY-a.top};s=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*e$(e.deltaY)*o,this.zoom(s,l)}else r?s={dx:o*e.deltaY,dy:0}:s={dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(s)}};Qn.prototype.stepZoom=function(e,t){var i=Zv(Jv,tE);this._zoom(e,t,i)};Qn.prototype._zoom=function(n,e,t){var i=this._canvas,r=n>0?1:-1,o=pf(i.zoom()),s=Math.round(o/t)*t;s+=t*r;var a=Math.pow(10,s);i.zoom(eE(Jv,a),e)};Qn.prototype.toggle=function(e){var t=this._container,i=this._handleWheel,r=this._enabled;return typeof e=="undefined"&&(e=!r),r!==e&&q[e?"bind":"unbind"](t,"wheel",i,!1),this._enabled=e,e};Qn.prototype._init=function(n){this.toggle(n)};var nE={__init__:["zoomScroll"],zoomScroll:["type",Qn]};var i$=/^djs-cursor-.*$/;function mf(n){var e=ee(document.body);e.removeMatching(i$),n&&e.add("djs-cursor-"+n)}function Sp(){mf(null)}var r$=5e3;function Op(n,e){e=e||"element.click";function t(){return!1}return n.once(e,r$,t),function(){n.off(e,t)}}var o$=15;function kp(n,e){var t;function i(a){return s(a.originalEvent)}n.on("canvas.focus.changed",function(a){a.focused?n.on("element.mousedown",500,i):n.off("element.mousedown",i)});function r(a){var l=t.start,c=t.button,u=Un(a),f=xr(u,l);if(!t.dragging&&s$(f)>o$&&(t.dragging=!0,c===0&&Op(n),mf("grab")),t.dragging){var h=t.last||t.start;f=xr(u,h),e.scroll({dx:f.x,dy:f.y}),t.last=u}a.preventDefault()}function o(a){q.unbind(document,"mousemove",r),q.unbind(document,"mouseup",o),t=null,Sp()}function s(a){if(!De(a.target,".djs-draggable")){var l=a.button;if(!(l>=2||a.ctrlKey||a.shiftKey||a.altKey))return t={button:l,start:Un(a)},q.bind(document,"mousemove",r),q.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!t}}kp.$inject=["eventBus","canvas"];function s$(n){return Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}var iE={__init__:["moveCanvas"],moveCanvas:["type",kp]};function Sa(n){return CSS.escape(n)}var a$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function rE(n){return n=""+n,n&&n.replace(/[&<>"']/g,function(e){return a$[e]})}var oE=["c","C"],sE=["v","V"],l$=["d","D"],c$=["x","X"],aE=["y","Y"],ex=["z","Z"];function lE(n){return n.ctrlKey||n.metaKey||n.shiftKey||n.altKey}function Mt(n){return n.altKey?!1:n.ctrlKey||n.metaKey}function Ve(n,e){return n=F(n)?n:[n],n.indexOf(e.key)!==-1||n.indexOf(e.code)!==-1}function Rp(n){return n.shiftKey}function cE(n){return Mt(n)&&Ve(oE,n)}function uE(n){return Mt(n)&&Ve(sE,n)}function fE(n){return Mt(n)&&Ve(l$,n)}function hE(n){return Mt(n)&&Ve(c$,n)}function Tp(n){return Mt(n)&&!Rp(n)&&Ve(ex,n)}function Ap(n){return Mt(n)&&(Ve(aE,n)||Ve(ex,n)&&Rp(n))}var pE=300;function J(n,e,t,i){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=n,this._eventBus=e,this._selection=t,this._translate=i,this._container=this._getBoxHtml(),this._searchInput=X(J.INPUT_SELECTOR,this._container),this._resultsContainer=X(J.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),e.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}J.$inject=["canvas","eventBus","selection","translate"];J.prototype._bindEvents=function(){var n=this;function e(t,i,r,o){n._eventMaps.push({el:t,type:r,listener:_t.bind(t,i,r,o)})}e(document,"html","click",function(t){n.close(!1)}),e(this._container,J.INPUT_SELECTOR,"click",function(t){t.stopPropagation(),t.delegateTarget.focus()}),e(this._container,J.RESULT_SELECTOR,"mouseover",function(t){t.stopPropagation(),n._scrollToNode(t.delegateTarget),n._preselect(t.delegateTarget)}),e(this._container,J.RESULT_SELECTOR,"click",function(t){t.stopPropagation(),n._select(t.delegateTarget)}),e(this._container,J.INPUT_SELECTOR,"keydown",function(t){Ve("ArrowUp",t)&&t.preventDefault(),Ve("ArrowDown",t)&&t.preventDefault()}),e(this._container,J.INPUT_SELECTOR,"keyup",function(t){if(Ve("Escape",t))return n.close();if(Ve("Enter",t)){var i=n._getCurrentResult();return i?n._select(i):n.close(!1)}if(Ve("ArrowUp",t))return n._scrollToDirection(!0);if(Ve("ArrowDown",t))return n._scrollToDirection();Ve(["ArrowLeft","ArrowRight"],t)||n._search(t.delegateTarget.value)})};J.prototype._unbindEvents=function(){this._eventMaps.forEach(function(n){_t.unbind(n.el,n.type,n.listener)})};J.prototype._search=function(n){var e=this;if(this._clearResults(),!!n.trim()){var t=this._searchProvider.find(n);if(t=t.filter(function(r){return!e._canvas.getRootElements().includes(r.element)}),!t.length){this._selection.select(null);return}t.forEach(function(r){var o=r.element.id,s=e._createResultNode(r,o);e._results[o]={element:r.element,node:s}});var i=X(J.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}};J.prototype._scrollToDirection=function(n){var e=this._getCurrentResult();if(e){var t=n?e.previousElementSibling:e.nextElementSibling;t&&(this._scrollToNode(t),this._preselect(t))}};J.prototype._scrollToNode=function(n){if(!(!n||n===this._getCurrentResult())){var e=n.offsetTop,t=this._resultsContainer.scrollTop,i=e-this._resultsContainer.clientHeight+n.clientHeight;e<t?this._resultsContainer.scrollTop=e:t<i&&(this._resultsContainer.scrollTop=i)}};J.prototype._clearResults=function(){no(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")};J.prototype._getCurrentResult=function(){return X(J.RESULT_SELECTED_SELECTOR,this._resultsContainer)};J.prototype._createResultNode=function(n,e){var t=te(J.RESULT_HTML);return n.primaryTokens.length>0&&dE(t,n.primaryTokens,J.RESULT_PRIMARY_HTML),dE(t,n.secondaryTokens,J.RESULT_SECONDARY_HTML),et(t,J.RESULT_ID_ATTRIBUTE,e),this._resultsContainer.appendChild(t),t};J.prototype.registerProvider=function(n){this._searchProvider=n};J.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,ee(this._canvas.getContainer()).add("djs-search-open"),ee(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};J.prototype.close=function(n=!0){this.isOpen()&&(n&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,ee(this._canvas.getContainer()).remove("djs-search-open"),ee(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};J.prototype.toggle=function(){this.isOpen()?this.close():this.open()};J.prototype.isOpen=function(){return this._open};J.prototype._preselect=function(n){var e=this._getCurrentResult();if(n!==e){e&&ee(e).remove(J.RESULT_SELECTED_CLASS);var t=et(n,J.RESULT_ID_ATTRIBUTE),i=this._results[t].element;ee(n).add(J.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:pE}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}};J.prototype._select=function(n){var e=et(n,J.RESULT_ID_ATTRIBUTE),t=this._results[e].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(t,{top:pE}),this._selection.select(t),this._eventBus.fire("searchPad.selected",t)};J.prototype._getBoxHtml=function(){let n=te(J.BOX_HTML),e=X(J.INPUT_SELECTOR,n);return e&&e.setAttribute("aria-label",this._translate("Search in diagram")),n};function dE(n,e,t){var i=u$(e),r=te(t);r.innerHTML=i,n.appendChild(r)}function u$(n){var e="";return n.forEach(function(t){var i=rE(t.value||t.matched||t.normal),r=t.match||t.matched;r?e+='<b class="'+J.RESULT_HIGHLIGHT_CLASS+'">'+i+"</b>":e+=i}),e!==""?e:null}J.CONTAINER_SELECTOR=".djs-search-container";J.INPUT_SELECTOR=".djs-search-input input";J.RESULTS_CONTAINER_SELECTOR=".djs-search-results";J.RESULT_SELECTOR=".djs-search-result";J.RESULT_SELECTED_CLASS="djs-search-result-selected";J.RESULT_SELECTED_SELECTOR="."+J.RESULT_SELECTED_CLASS;J.RESULT_ID_ATTRIBUTE="data-result-id";J.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";J.BOX_HTML=`<div class="djs-search-container djs-scrollable">
24 </div>`;J.RESULT_HTML='<div class="djs-search-result"></div>';J.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>';J.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';var mE={__depends__:[qe,mo,ht],searchPad:["type",J]};function gE(n){if(O(n,"dmn:Decision")||O(n,"dmn:BusinessKnowledgeModel")||O(n,"dmn:InputData")||O(n,"dmn:KnowledgeSource"))return"name";if(O(n,"dmn:TextAnnotation"))return"text"}function fs(n){var e=n.businessObject,t=gE(e);if(t)return e[t]||""}function yE(n,e,t){var i=n.businessObject,r=gE(i);return r&&(i[r]=e),t&&(n.hidden=!e),n}function gf(n,e,t){this._elementRegistry=n,this._canvas=t,e.registerProvider(this)}gf.$inject=["elementRegistry","searchPad","canvas"];gf.prototype.find=function(n){let e=this._canvas.getRootElement(),t=this._elementRegistry.filter(function(i){return!i.labelTarget});return t=Ee(t,function(i){return i!==e}),t=Vt(t,function(i){return{primaryTokens:xE(fs(i),n),secondaryTokens:xE(i.id,n),element:i}}),t=Ee(t,function(i){return vE(i.primaryTokens)||vE(i.secondaryTokens)}),t=Fn(t,function(i){return fs(i.element)+i.element.id}),t};function vE(n){return Ee(n,function(t){return!!t.matched}).length>0}function xE(n,e){let t=[],i=n;if(!n)return t;n=n.toLowerCase(),e=e.toLowerCase();let r=n.indexOf(e);return r>-1?(r!==0&&t.push({normal:i.substr(0,r)}),t.push({matched:i.substr(r,e.length)}),e.length+r<n.length&&t.push({normal:i.substr(e.length+r,n.length)})):t.push({normal:i}),t}var bE={__depends__:[mE],__init__:["dmnSearch"],dmnSearch:["type",gf]};function br(n){Et.call(this,n)}fe(br,Et);br.prototype._navigationModules=[nE,iE,bE];br.prototype._modules=[].concat(br.prototype._modules,br.prototype._navigationModules);function tx(n){return n&&n[n.length-1]}function _E(n){return n.y}function wE(n){return n.x}var f$={left:wE,center:wE,right:function(n){return n.x+n.width},top:_E,middle:_E,bottom:function(n){return n.y+n.height}};function go(n,e){this._modeling=n,this._rules=e}go.$inject=["modeling","rules"];go.prototype._getOrientationDetails=function(n){var e=["top","bottom","middle"],t="x",i="width";return e.indexOf(n)!==-1&&(t="y",i="height"),{axis:t,dimension:i}};go.prototype._isType=function(n,e){return e.indexOf(n)!==-1};go.prototype._alignmentPosition=function(n,e){var t=this._getOrientationDetails(n),i=t.axis,r=t.dimension,o={},s={},a=!1,l,c,u;function f(h,d){return Math.round((h[i]+d[i]+d[r])/2)}if(this._isType(n,["left","top"]))o[n]=e[0][i];else if(this._isType(n,["right","bottom"]))u=tx(e),o[n]=u[i]+u[r];else if(this._isType(n,["center","middle"])){if(k(e,function(h){var d=h[i]+Math.round(h[r]/2);s[d]?s[d].elements.push(h):s[d]={elements:[h],center:d}}),l=Fn(s,function(h){return h.elements.length>1&&(a=!0),h.elements.length}),a)return o[n]=tx(l).center,o;c=e[0],e=Fn(e,function(h){return h[i]+h[r]}),u=tx(e),o[n]=f(c,u)}return o};go.prototype.trigger=function(n,e){var t=this._modeling,i,r=Ee(n,function(l){return!(l.waypoints||l.host||l.labelTarget)});if(i=this._rules.allowed("elements.align",{elements:r}),F(i)&&(r=i),!(r.length<2||!i)){var o=f$[e],s=Fn(r,o),a=this._alignmentPosition(e,s);t.alignElements(s,a)}};var CE={__init__:["alignElements"],alignElements:["type",go]};var h$=10,ix=50,d$=250;function rx(n,e,t,i){for(var r;r=p$(n,t,e);)t=i(e,t,r);return t}function EE(n){return function(e,t,i){var r={x:t.x,y:t.y};return["x","y"].forEach(function(o){var s=n[o];if(s){var a=o==="x"?"width":"height",l=s.margin,c=s.minDistance;l<0?r[o]=Math.min(i[o]+l-e[a]/2,t[o]-c+l):r[o]=Math.max(i[o]+i[a]+l+e[a]/2,t[o]+c+l)}}),r}}function p$(n,e,t){var i={x:e.x-t.width/2,y:e.y-t.height/2,width:t.width,height:t.height},r=m$(n);return ye(r,function(o){if(o===t)return!1;var s=vt(o,i,h$);return s==="intersect"})}function SE(n,e){e||(e={});function t(p){return p.source===n?1:-1}var i=e.defaultDistance||ix,r=e.direction||"e",o=e.filter,s=e.getWeight||t,a=e.maxDistance||d$,l=e.reference||"start";o||(o=v$);function c(p,m){return r==="n"?l==="start"?G(p).top-G(m).bottom:l==="center"?G(p).top-le(m).y:G(p).top-G(m).top:r==="w"?l==="start"?G(p).left-G(m).right:l==="center"?G(p).left-le(m).x:G(p).left-G(m).left:r==="s"?l==="start"?G(m).top-G(p).bottom:l==="center"?le(m).y-G(p).bottom:G(m).bottom-G(p).bottom:l==="start"?G(m).left-G(p).right:l==="center"?le(m).x-G(p).right:G(m).right-G(p).right}var u=n.incoming.filter(o).map(function(p){var m=s(p),g=m<0?c(p.source,n):c(n,p.source);return{id:p.source.id,distance:g,weight:m}}),f=n.outgoing.filter(o).map(function(p){var m=s(p),g=m>0?c(n,p.target):c(p.target,n);return{id:p.target.id,distance:g,weight:m}}),h=u.concat(f).reduce(function(p,m){return p[m.id+"__weight_"+m.weight]=m,p},{}),d=st(h,function(p,m){var g=m.distance,b=m.weight;return g<0||g>a||(p[String(g)]||(p[String(g)]=0),p[String(g)]+=1*b,(!p.distance||p[p.distance]<p[String(g)])&&(p.distance=g)),p},{});return d.distance||i}function m$(n){var e=nx(n);return n.host&&(e=e.concat(nx(n.host))),n.attachers&&(e=e.concat(n.attachers.reduce(function(t,i){return t.concat(nx(i))},[]))),e}function nx(n){return y$(n).concat(g$(n))}function g$(n){return n.incoming.map(function(e){return e.source})}function y$(n){return n.outgoing.map(function(e){return e.target})}function v$(){return!0}var x$=100;function Mp(n,e,t){n.on("autoPlace",x$,function(i){var r=i.shape,o=i.source;return b$(o,r)}),n.on("autoPlace.end",function(i){t.scrollToElement(i.shape)}),this.append=function(i,r,o){n.fire("autoPlace.start",{source:i,shape:r});var s=n.fire("autoPlace",{source:i,shape:r}),a=e.appendShape(i,r,s,i.parent,o);return n.fire("autoPlace.end",{source:i,shape:a}),a}}Mp.$inject=["eventBus","modeling","canvas"];function b$(n,e,t){t||(t={});var i=t.defaultDistance||ix,r=le(n),o=G(n);return{x:o.right+i+e.width/2,y:r.y}}function Pp(n,e){n.on("autoPlace.end",500,function(t){e.select(t.shape)})}Pp.$inject=["eventBus","selection"];var OE={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Mp],autoPlaceSelectionBehavior:["type",Pp]};var _$={width:135,height:46},ox={width:180,height:80},w$={width:125,height:45},C$={width:100,height:63};function _r(n){Hn.call(this),this._drdFactory=n}fe(_r,Hn);_r.$inject=["drdFactory"];_r.prototype.baseCreate=Hn.prototype.create;_r.prototype.create=function(n,e){return this.createDrdElement(n,e)};_r.prototype.createDrdElement=function(n,e){var t=this._drdFactory,i;e=e||{};var r=e.businessObject;if(!r){if(!e.type)throw new Error("no shape type specified");r=t.create(e.type)}return r.di||(n==="connection"?r.di=t.createDiEdge(r,[]):n==="shape"&&(r.di=t.createDiShape(r,{}))),i=this._getDefaultSize(r),e=T({businessObject:r,id:r.id},i,e),this.baseCreate(n,e)};_r.prototype._getDefaultSize=function(n){return O(n,"dmn:BusinessKnowledgeModel")?_$:O(n,"dmn:Decision")?ox:O(n,"dmn:InputData")?w$:O(n,"dmn:KnowledgeSource")?C$:{width:100,height:80}};var sx="left",kE="right",Dp=60,RE=ox.width;function AE(n,e){if(O(e,"dmn:TextAnnotation"))return E$(n,e);if(O(e,"dmn:DRGElement"))return S$(n,e)}function E$(n,e){var t=G(n),i={x:t.right+e.width/2,y:t.top-50-e.height/2},r={y:{margin:-30,minDistance:20}};return rx(n,e,i,EE(r))}function S$(n,e){var t=G(n),i=le(n);function r(a){return a.target===n?1:-1}var o=SE(n,{defaultDistance:180,direction:"s",getWeight:r,filter:O$,reference:"center"}),s={x:i.x,y:t.bottom+o};return rx(n,e,s,k$(n))}function O$(n){return!O(n,"dmn:Association")}function TE(n,e){return Math.abs(e.x-n.x)}function k$(n){var e=le(n),t,i;return function(r,o,s){var a;return t?(o.x<e.x?t=s:i=s,TE(e,le(t))<TE(e,le(i))?a=sx:a=kE):(t=s,i=s,le(s).x-e.x>0?a=sx:a=kE),a===sx?{x:Math.min(le(t).x-RE-Dp,G(t).left-Dp-r.width/2),y:o.y}:{x:Math.max(le(i).x+RE+Dp,G(i).right+Dp+r.width/2),y:o.y}}}function Ip(n){n.on("autoPlace",function(e){var t=e.shape,i=e.source;return AE(i,t)})}Ip.$inject=["eventBus"];var ME={__depends__:[OE],__init__:["dmnAutoPlace"],dmnAutoPlace:["type",Ip]};var PE=1500;function Lp(n,e,t){var i=this,r=t.get("dragging",!1);function o(s){if(!s.hover){var a=s.originalEvent,l=i._findTargetGfx(a),c=l&&n.get(l);l&&c&&(s.stopPropagation(),r.hover({element:c,gfx:l}),r.move(a))}}r&&e.on("drag.start",function(s){e.once("drag.move",PE,function(a){o(a)})}),(function(){var s,a;e.on("element.hover",function(l){s=l.gfx,a=l.element}),e.on("element.hover",PE,function(l){a&&e.fire("element.out",{element:a,gfx:s})}),e.on("element.out",function(){s=null,a=null})})(),this._findTargetGfx=function(s){var a,l;if(s instanceof MouseEvent)return a=Un(s),l=document.elementFromPoint(a.x,a.y),R$(l)}}Lp.$inject=["elementRegistry","eventBus","injector"];function R$(n){return De(n,"svg, .djs-element",!0)}var DE={__init__:["hoverFix"],hoverFix:["type",Lp]};var Oa=Math.round,IE="djs-drag-active";function hs(n){n.preventDefault()}function T$(n){return typeof TouchEvent!="undefined"&&n instanceof TouchEvent}function A$(n){return Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}function Bp(n,e,t,i){var r={threshold:5,trapClick:!0},o;function s(v){var x=e.viewbox(),C=e._container.getBoundingClientRect();return{x:x.x+(v.x-C.left)/x.scale,y:x.y+(v.y-C.top)/x.scale}}function a(v,x){x=x||o;var C=n.createEvent(T({},x.payload,x.data,{isTouch:x.isTouch}));return n.fire("drag."+v,C)===!1?!1:n.fire(x.prefix+"."+v,C)}function l(v){var x=v.filter(function(C){return i.get(C.id)});x.length&&t.select(x)}function c(v,x){var C=o.payload,E=o.displacement,S=o.globalStart,w=Un(v),R=xr(w,S),A=o.localStart,I=s(w),D=xr(I,A);if(!o.active&&(x||A$(R)>o.threshold)){if(T(C,{x:Oa(A.x+E.x),y:Oa(A.y+E.y),dx:0,dy:0},{originalEvent:v}),a("start")===!1)return g();o.active=!0,o.keepSelection||(C.previousSelection=t.get(),t.select(null)),o.cursor&&mf(o.cursor),e.addMarker(e.getRootElement(),IE)}vp(v),o.active&&(T(C,{x:Oa(I.x+E.x),y:Oa(I.y+E.y),dx:Oa(D.x),dy:Oa(D.y)},{originalEvent:v}),a("move"))}function u(v){var x,C=!0;o.active&&(v&&(o.payload.originalEvent=v,vp(v)),C=a("end")),C===!1&&a("rejected"),x=b(C!==!0),a("ended",x)}function f(v){Ve("Escape",v)&&(hs(v),g())}function h(v){var x;o.active&&(x=Op(n),setTimeout(x,400),hs(v)),u(v)}function d(v){c(v)}function p(v){var x=o.payload;x.hoverGfx=v.gfx,x.hover=v.element,a("hover")}function m(v){a("out");var x=o.payload;x.hoverGfx=null,x.hover=null}function g(v){var x;if(o){var C=o.active;C&&a("cancel"),x=b(v),C&&a("canceled",x)}}function b(v){var x,C;a("cleanup"),Sp(),o.trapClick?C=h:C=u,q.unbind(document,"mousemove",c),q.unbind(document,"dragstart",hs),q.unbind(document,"selectstart",hs),q.unbind(document,"mousedown",C,!0),q.unbind(document,"mouseup",C,!0),q.unbind(document,"keyup",f),q.unbind(document,"touchstart",d,!0),q.unbind(document,"touchcancel",g,!0),q.unbind(document,"touchmove",c,!0),q.unbind(document,"touchend",u,!0),n.off("element.hover",p),n.off("element.out",m),e.removeMarker(e.getRootElement(),IE);var E=o.payload.previousSelection;return v!==!1&&E&&!t.get().length&&l(E),x=o,o=null,x}function _(v,x,C,E){o&&g(!1),typeof x=="string"&&(E=C,C=x,x=null),E=T({},r,E||{});var S=E.data||{},w,R,A,I,D;if(E.trapClick?I=h:I=u,v?(w=vr(v)||v,R=Un(v),vp(v),w.type==="dragstart"&&hs(w)):(w=null,R={x:0,y:0}),A=s(R),x||(x=A),D=T$(w),o=T({prefix:C,data:S,payload:{},globalStart:R,displacement:xr(x,A),localStart:A,isTouch:D},E),E.manual||(D?(q.bind(document,"touchstart",d,!0),q.bind(document,"touchcancel",g,!0),q.bind(document,"touchmove",c,!0),q.bind(document,"touchend",u,!0)):(q.bind(document,"mousemove",c),q.bind(document,"dragstart",hs),q.bind(document,"selectstart",hs),q.bind(document,"mousedown",I,!0),q.bind(document,"mouseup",I,!0)),q.bind(document,"keyup",f),n.on("element.hover",p),n.on("element.out",m)),a("init")===!1)return g(),!1;E.autoActivate&&c(v,!0)}n.on("diagram.destroy",g),this.init=_,this.move=c,this.hover=p,this.out=m,this.end=u,this.cancel=g,this.context=function(){return o},this.setOptions=function(v){T(r,v)}}Bp.$inject=["eventBus","canvas","selection","elementRegistry"];var gn={__depends__:[DE,ht],dragging:["type",Bp]};function yo(n,e,t){this._canvas=t,this._opts=T({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},n);var i=this;e.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),e.on(["drag.cleanup"],function(){i.stopScroll()})}yo.$inject=["config.autoScroll","eventBus","canvas"];yo.prototype.startScroll=function(n){var e=this._canvas,t=this._opts,i=this,r=e.getContainer().getBoundingClientRect(),o=[n.x,n.y,r.width-n.x,r.height-n.y];this.stopScroll();for(var s=0,a=0,l=0;l<4;l++)M$(o[l],t.scrollThresholdOut[l],t.scrollThresholdIn[l])&&(l===0?s=t.scrollStep:l==1?a=t.scrollStep:l==2?s=-t.scrollStep:l==3&&(a=-t.scrollStep));(s!==0||a!==0)&&(e.scroll({dx:s,dy:a}),this._scrolling=setTimeout(function(){i.startScroll(n)},t.scrollRepeatTimeout))};function M$(n,e,t){return e<n&&n<t}yo.prototype.stopScroll=function(){clearTimeout(this._scrolling)};yo.prototype.setOptions=function(n){this._opts=T({},this._opts,n)};yo.prototype._toBorderPoint=function(n){var e=this._canvas._container.getBoundingClientRect(),t=Un(n.originalEvent);return{x:t.x-e.left,y:t.y-e.top}};var LE={__depends__:[gn],__init__:["autoScroll"],autoScroll:["type",yo]};function yf(n){this._commandStack=n.get("commandStack",!1)}yf.$inject=["injector"];yf.prototype.allowed=function(n,e){var t=!0,i=this._commandStack;return i&&(t=i.canExecute(n,e)),t===void 0?!0:t};var yn={__init__:["rules"],rules:["type",yf]};var Np=Math.round,P$=Math.max;function D$(n,e){var t=n.x,i=n.y;return[["M",t,i],["m",0,-e],["a",e,e,0,1,1,0,2*e],["a",e,e,0,1,1,0,-2*e],["z"]]}function I$(n){var e=[];return n.forEach(function(t,i){e.push([i===0?"M":"L",t.x,t.y])}),e}var BE=10;function L$(n,e){var t,i;for(t=0;i=n[t];t++)if(pa(i,e)<=BE)return{point:n[t],bendpoint:!0,index:t};return null}function B$(n,e){var t=ef(D$(e,BE),I$(n)),i=t[0],r=t[t.length-1],o;return i?i!==r?i.segment2!==r.segment2?(o=P$(i.segment2,r.segment2)-1,{point:n[o],bendpoint:!0,index:o}):{point:{x:Np(i.x+r.x)/2,y:Np(i.y+r.y)/2},index:i.segment2}:{point:{x:Np(i.x),y:Np(i.y)},index:i.segment2}:null}function NE(n,e){return L$(n,e)||B$(n,e)}function N$(n){return Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}function $$(n,e,t){var i=[{n:n[0]-t[0],lambda:e[0]},{n:n[1]-t[1],lambda:e[1]}],r=i[0].n*e[0]+i[1].n*e[1],o=i[0].lambda*e[0]+i[1].lambda*e[1];return-r/o}function ax(n,e){var t=e[0],i=e[1],r={x:i.x-t.x,y:i.y-t.y},o=$$([t.x,t.y],[r.x,r.y],[n.x,n.y]);return{x:t.x+o*r.x,y:t.y+o*r.y}}function $E(n,e){var t=ax(n,e),i={x:t.x-n.x,y:t.y-n.y};return N$(i)}var lx="djs-bendpoint",cx="djs-segment-dragger";function j$(n,e){var t=Un(e),i=n._container.getBoundingClientRect(),r;r={x:i.left,y:i.top};var o=n.viewbox();return{x:o.x+(t.x-r.x)/o.scale,y:o.y+(t.y-r.y)/o.scale}}function vf(n,e,t){var i=j$(n,t),r=NE(e,i);return r}function xf(n,e){var t=Q("g");ne(t).add(lx),K(n,t);var i=Q("circle");j(i,{cx:0,cy:0,r:4}),ne(i).add("djs-visual"),K(t,i);var r=Q("circle");return j(r,{cx:0,cy:0,r:10}),ne(r).add("djs-hit"),K(t,r),e&&ne(t).add(e),t}function F$(n,e,t,i){var r=Q("g");K(n,r);var o=18,s=6,a=11,l=q$(e,t,i),c=s+a,u=Q("rect");j(u,{x:-o/2,y:-s/2,width:o,height:s}),ne(u).add("djs-visual"),K(r,u);var f=Q("rect");return j(f,{x:-l/2,y:-c/2,width:l,height:c}),ne(f).add("djs-hit"),K(r,f),rC(r,i==="v"?90:0,0,0),r}function jp(n,e,t){var i=Q("g"),r=Ju(e,t),o=pr(e,t);return K(n,i),F$(i,e,t,o),ne(i).add(cx),ne(i).add(o==="h"?"horizontal":"vertical"),jt(i,r.x,r.y),i}function $p(n){return Math.abs(Math.round(n*2/3))}function jE(n,e){var t=V$(n,e);return ax(n,t)}function q$(n,e,t){var i=e.x-n.x,r=e.y-n.y;return $p(t==="h"?i:r)}function V$(n,e){for(var t=e.waypoints,i=1/0,r,o=0;o<t.length-1;o++){var s=t[o],a=t[o+1],l=$E(n,[s,a]);l<i&&(i=l,r=o)}return[t[r],t[r+1]]}function Fp(n,e,t,i,r){function o(v,x,C){var E=v.index,S=v.point,w,R,A,I,D,N;return E<=0||v.bendpoint?!1:(w=x[E-1],R=x[E],A=Ju(w,R),I=pr(w,R),D=Math.abs(S.x-A.x),N=Math.abs(S.y-A.y),I&&D<=C&&N<=C)}function s(v,x){var C=v.waypoints,E,S,w,R;return x.index<=0||x.bendpoint||(E={start:C[x.index-1],end:C[x.index]},S=pr(E.start,E.end),!S)?null:(S==="h"?w=E.end.x-E.start.x:w=E.end.y-E.start.y,R=$p(w)/2,R)}function a(v,x){var C=x.waypoints,E=vf(e,C,v),S;if(E){S=s(x,E);var w;if(o(E,C,S)?w=r.start(v,x,E.index):w=i.start(v,x,E.index,!E.bendpoint),w!==!1)return!0}}function l(v,x,C){q.bind(v,x,function(E){t.triggerMouseEvent(x,E,C),E.stopPropagation()})}function c(v,x){var C=e.getLayer("overlays"),E=X('.djs-bendpoints[data-element-id="'+Sa(v.id)+'"]',C);return!E&&x&&(E=Q("g"),j(E,{"data-element-id":v.id}),ne(E).add("djs-bendpoints"),K(C,E),l(E,"mousedown",v),l(E,"click",v),l(E,"dblclick",v)),E}function u(v,x){return X('.djs-segment-dragger[data-segment-idx="'+v+'"]',x)}function f(v,x){x.waypoints.forEach(function(C,E){var S=xf(v);K(v,S),jt(S,C.x,C.y)}),xf(v,"floating")}function h(v,x){for(var C=x.waypoints,E,S,w,R=1;R<C.length;R++)E=C[R-1],S=C[R],pr(E,S)&&(w=jp(v,E,S),j(w,{"data-segment-idx":R}),l(w,"mousemove",x))}function d(v){k(pn("."+lx,v),function(x){Fe(x)})}function p(v){k(pn("."+cx,v),function(x){Fe(x)})}function m(v){var x=c(v);return x||(x=c(v,!0),f(x,v),h(x,v)),x}function g(v){var x=c(v);x&&(p(x),d(x),h(x,v),f(x,v))}function b(v,x){var C=X(".floating",v),E=x.point;C&&jt(C,E.x,E.y)}function _(v,x,C){var E=u(x.index,v),S=C[x.index-1],w=C[x.index],R=x.point,A=Ju(S,w),I=pr(S,w),D,N;E&&(D=H$(E),N={x:R.x-A.x,y:R.y-A.y},I==="v"&&(N={x:N.y,y:N.x}),jt(D,N.x,N.y))}n.on("connection.changed",function(v){g(v.element)}),n.on("connection.remove",function(v){var x=c(v.element);x&&Fe(x)}),n.on("element.marker.update",function(v){var x=v.element,C;x.waypoints&&(C=m(x),v.add?ne(C).add(v.marker):ne(C).remove(v.marker))}),n.on("element.mousemove",function(v){var x=v.element,C=x.waypoints,E,S;if(C){if(E=c(x,!0),S=vf(e,C,v.originalEvent),!S)return;b(E,S),S.bendpoint||_(E,S,C)}}),n.on("element.mousedown",function(v){if(Sn(v)){var x=v.originalEvent,C=v.element;if(C.waypoints)return a(x,C)}}),n.on("selection.changed",function(v){var x=v.newSelection,C=x[0];C&&C.waypoints&&m(C)}),n.on("element.hover",function(v){var x=v.element;x.waypoints&&m(x)}),n.on("element.updateId",function(v){var x=v.element,C=v.newId;if(x.waypoints){var E=c(x);E&&j(E,{"data-element-id":C})}}),this.addHandles=m,this.updateHandles=g,this.getBendpointsContainer=c,this.getSegmentDragger=u}Fp.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function H$(n){return X(".djs-visual",n)}var FE=Math.round,ds="reconnectStart",ps="reconnectEnd",bf="updateWaypoints";function wf(n,e,t,i,r,o){this._injector=n,this.start=function(s,a,l,c){var u=t.getGraphics(a),f=a.source,h=a.target,d=a.waypoints,p;!c&&l===0?p=ds:!c&&l===d.length-1?p=ps:p=bf;var m=p===bf?"connection.updateWaypoints":"connection.reconnect",g=r.allowed(m,{connection:a,source:f,target:h});if(g===!1&&(g=r.allowed(m,{connection:a,source:h,target:f})),g!==!1)return i.init(s,"bendpoint.move",{data:{connection:a,connectionGfx:u,context:{allowed:g,bendpointIndex:l,connection:a,source:f,target:h,insert:c,type:p}}})},e.on("bendpoint.move.hover",function(s){var a=s.context,l=a.connection,c=l.source,u=l.target,f=s.hover,h=a.type;a.hover=f;var d;if(f){var p=h===bf?"connection.updateWaypoints":"connection.reconnect";if(d=a.allowed=r.allowed(p,{connection:l,source:h===ds?f:c,target:h===ps?f:u}),d){a.source=h===ds?f:c,a.target=h===ps?f:u;return}d===!1&&(d=a.allowed=r.allowed(p,{connection:l,source:h===ps?f:u,target:h===ds?f:c})),d&&(a.source=h===ps?f:u,a.target=h===ds?f:c)}}),e.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(s){var a=s.context,l=a.type;a.hover=null,a.source=null,a.target=null,l!==bf&&(a.allowed=!1)}),e.on("bendpoint.move.end",function(s){var a=s.context,l=a.allowed,c=a.bendpointIndex,u=a.connection,f=a.insert,h=u.waypoints.slice(),d=a.source,p=a.target,m=a.type,g=a.hints||{},b={x:FE(s.x),y:FE(s.y)};if(!l)return!1;m===bf?(f?h.splice(c,0,b):h[c]=b,g.bendpointMove={insert:f,bendpointIndex:c},h=this.cropWaypoints(u,h),o.updateWaypoints(u,q1(h),g)):(m===ds?(g.docking="source",_f(a)&&(g.docking="target",g.newWaypoints=h.reverse())):m===ps&&(g.docking="target",_f(a)&&(g.docking="source",g.newWaypoints=h.reverse())),o.reconnect(u,d,p,b,g))},this)}wf.$inject=["injector","eventBus","canvas","dragging","rules","modeling"];wf.prototype.cropWaypoints=function(n,e){var t=this._injector.get("connectionDocking",!1);if(!t)return e;var i=n.waypoints;return n.waypoints=e,n.waypoints=t.getCroppedWaypoints(n),e=n.waypoints,n.waypoints=i,e};function _f(n){var e=n.hover,t=n.source,i=n.target,r=n.type;if(r===ds)return e&&i&&e===i&&t!==i;if(r===ps)return e&&t&&e===t&&t!==i}var z$="reconnectStart",W$="reconnectEnd",qE="updateWaypoints",Cf="connect-ok",qp="connect-not-ok",VE="connect-hover",HE="djs-updating",zE="djs-dragging",WE=1100;function Vp(n,e,t,i){this._injector=e;var r=e.get("connectionPreview",!1);t.on("bendpoint.move.start",function(o){var s=o.context,a=s.bendpointIndex,l=s.connection,c=s.insert,u=l.waypoints,f=u.slice();s.waypoints=u,c&&f.splice(a,0,{x:o.x,y:o.y}),l.waypoints=f;var h=s.draggerGfx=xf(i.getLayer("overlays"));ne(h).add("djs-dragging"),i.addMarker(l,zE),i.addMarker(l,HE)}),t.on("bendpoint.move.hover",function(o){var s=o.context,a=s.allowed,l=s.hover,c=s.type;if(l){if(i.addMarker(l,VE),c===qE)return;a?(i.removeMarker(l,qp),i.addMarker(l,Cf)):a===!1&&(i.removeMarker(l,Cf),i.addMarker(l,qp))}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],WE,function(o){var s=o.context,a=s.hover,l=s.target;a&&(i.removeMarker(a,VE),i.removeMarker(a,l?Cf:qp))}),t.on("bendpoint.move.move",function(o){var s=o.context,a=s.allowed,l=s.bendpointIndex,c=s.draggerGfx,u=s.hover,f=s.type,h=s.connection,d=h.source,p=h.target,m=h.waypoints.slice(),g={x:o.x,y:o.y},b=s.hints||{},_={};r&&(b.connectionStart&&(_.connectionStart=b.connectionStart),b.connectionEnd&&(_.connectionEnd=b.connectionEnd),f===z$?_f(s)?(_.connectionEnd=_.connectionEnd||g,_.source=p,_.target=u||d,m=m.reverse()):(_.connectionStart=_.connectionStart||g,_.source=u||d,_.target=p):f===W$?_f(s)?(_.connectionStart=_.connectionStart||g,_.source=u||p,_.target=d,m=m.reverse()):(_.connectionEnd=_.connectionEnd||g,_.source=d,_.target=u||p):(_.noCropping=!0,_.noLayout=!0,m[l]=g),f===qE&&(m=n.cropWaypoints(h,m)),_.waypoints=m,r.drawPreview(s,a,_)),jt(c,o.x,o.y)},this),t.on(["bendpoint.move.end","bendpoint.move.cancel"],WE,function(o){var s=o.context,a=s.connection,l=s.draggerGfx,c=s.hover,u=s.target,f=s.waypoints;a.waypoints=f,Fe(l),i.removeMarker(a,HE),i.removeMarker(a,zE),c&&(i.removeMarker(c,Cf),i.removeMarker(c,u?Cf:qp)),r&&r.cleanUp(s)})}Vp.$inject=["bendpointMove","injector","eventBus","canvas"];var UE="connect-hover",QE="djs-updating";function KE(n,e,t){return ux(n,e,n[e]+t)}function ux(n,e,t){return{x:e==="x"?t:n.x,y:e==="y"?t:n.y}}function U$(n,e,t,i){var r=Math.max(e[i],t[i]),o=Math.min(e[i],t[i]),s=20,a=Math.min(Math.max(o+s,n[i]),r-s);return ux(e,i,a)}function XE(n){return n==="x"?"y":"x"}function GE(n,e,t){var i,r;return n.original?n.original:(i=le(e),r=XE(t),ux(n,r,i[r]))}function Hp(n,e,t,i,r,o){var s=n.get("connectionDocking",!1);this.start=function(f,h,d){var p,m=t.getGraphics(h),g=d-1,b=d,_=h.waypoints,v=_[g],x=_[b],C=vf(t,_,f),E,S,w;if(E=pr(v,x),!!E)return S=E==="v"?"x":"y",g===0&&(v=GE(v,h.source,S)),b===_.length-1&&(x=GE(x,h.target,S)),C?w=C.point:w={x:(v.x+x.x)/2,y:(v.y+x.y)/2},p={connection:h,segmentStartIndex:g,segmentEndIndex:b,segmentStart:v,segmentEnd:x,axis:S,dragPosition:w},i.init(f,w,"connectionSegment.move",{cursor:S==="x"?"resize-ew":"resize-ns",data:{connection:h,connectionGfx:m,context:p}})};function a(f,h){if(!s)return h;var d=f.waypoints,p;return f.waypoints=h,p=s.getCroppedWaypoints(f),f.waypoints=d,p}function l(f){r.update("connection",f.connection,f.connectionGfx)}function c(f,h,d){var p=f.newWaypoints,m=f.segmentStartIndex+h,g=p[m],b=f.segmentEndIndex+h,_=p[b],v=XE(f.axis),x=U$(d,g,_,v);jt(f.draggerGfx,x.x,x.y)}function u(f,h){var d=0,p=f.filter(function(m,g){return sp(f[g-1],f[g+1],m)?(d=g<=h?d-1:d,!1):!0});return{waypoints:p,segmentOffset:d}}e.on("connectionSegment.move.start",function(f){var h=f.context,d=f.connection,p=t.getLayer("overlays");h.originalWaypoints=d.waypoints.slice(),h.draggerGfx=jp(p,h.segmentStart,h.segmentEnd),ne(h.draggerGfx).add("djs-dragging"),t.addMarker(d,QE)}),e.on("connectionSegment.move.move",function(f){var h=f.context,d=h.connection,p=h.segmentStartIndex,m=h.segmentEndIndex,g=h.segmentStart,b=h.segmentEnd,_=h.axis,v=h.originalWaypoints.slice(),x=KE(g,_,f["d"+_]),C=KE(b,_,f["d"+_]),E=v.length,S=0;v[p]=x,v[m]=C;var w,R;p<2&&(w=vt(d.source,x),p===1?w==="intersect"&&(v.shift(),v[0]=x,S--):w!=="intersect"&&(v.unshift(g),S++)),m>E-3&&(R=vt(d.target,C),m===E-2?R==="intersect"&&(v.pop(),v[v.length-1]=C):R!=="intersect"&&v.push(b)),h.newWaypoints=d.waypoints=a(d,v),c(h,S,f),h.newSegmentStartIndex=p+S,l(f)}),e.on("connectionSegment.move.hover",function(f){f.context.hover=f.hover,t.addMarker(f.hover,UE)}),e.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(f){var h=f.context.hover;h&&t.removeMarker(h,UE)}),e.on("connectionSegment.move.cleanup",function(f){var h=f.context,d=h.connection;h.draggerGfx&&Fe(h.draggerGfx),t.removeMarker(d,QE)}),e.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(f){var h=f.context,d=h.connection;d.waypoints=h.originalWaypoints,l(f)}),e.on("connectionSegment.move.end",function(f){var h=f.context,d=h.connection,p=h.newWaypoints,m=h.newSegmentStartIndex;p=p.map(function(C){return{original:C.original,x:Math.round(C.x),y:Math.round(C.y)}});var g=u(p,m),b=g.waypoints,_=a(d,b),v=g.segmentOffset,x={segmentMove:{segmentStartIndex:h.segmentStartIndex,newSegmentStartIndex:m+v}};o.updateWaypoints(d,_,x)})}Hp.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Q$=Math.abs,YE=Math.round;function ZE(n,e,t){t=t===void 0?10:t;var i,r;for(i=0;i<e.length;i++)if(r=e[i],Q$(r-n)<=t)return r}function JE(n){return{x:n.x,y:n.y}}function eS(n){return{x:n.x+n.width,y:n.y+n.height}}function ms(n,e){return!n||isNaN(n.x)||isNaN(n.y)?e:{x:YE(n.x+n.width/2),y:YE(n.y+n.height/2)}}function wr(n,e){var t=n.snapped;return t?typeof e=="string"?t[e]:t.x&&t.y:!1}function vn(n,e,t){if(typeof e!="string")throw new Error("axis must be in [x, y]");if(typeof t!="number"&&t!==!1)throw new Error("value must be Number or false");var i,r=n[e],o=n.snapped=n.snapped||{};return t===!1?o[e]=!1:(o[e]=!0,i=t-r,n[e]+=i,n["d"+e]+=i),r}function zp(n){return n.children||[]}var K$=Math.abs,tS=Math.round,fx=10;function Wp(n){function e(o,s){if(F(o)){for(var a=o.length;a--;)if(K$(o[a]-s)<=fx)return o[a]}else{o=+o;var l=s%o;if(l<fx)return s-l;if(l>o-fx)return s-l+o}return s}function t(o,s){if(o.waypoints)return jE(s,o);if(o.width)return{x:tS(o.width/2+o.x),y:tS(o.height/2+o.y)}}function i(o){var s=o.context,a=s.snapPoints,l=s.connection,c=l.waypoints,u=s.segmentStart,f=s.segmentStartIndex,h=s.segmentEnd,d=s.segmentEndIndex,p=s.axis;if(a)return a;var m=[c[f-1],u,h,c[d+1]];return f<2&&m.unshift(t(l.source,o)),d>c.length-3&&m.unshift(t(l.target,o)),s.snapPoints=a={horizontal:[],vertical:[]},k(m,function(g){g&&(g=g.original||g,p==="y"&&a.horizontal.push(g.y),p==="x"&&a.vertical.push(g.x))}),a}n.on("connectionSegment.move.move",1500,function(o){var s=i(o),a=o.x,l=o.y,c,u;if(s){c=e(s.vertical,a),u=e(s.horizontal,l);var f=a-c,h=l-u;T(o,{dx:o.dx-f,dy:o.dy-h,x:c,y:u}),(f||s.vertical.indexOf(a)!==-1)&&vn(o,"x",c),(h||s.horizontal.indexOf(l)!==-1)&&vn(o,"y",u)}});function r(o){var s=o.snapPoints,a=o.connection.waypoints,l=o.bendpointIndex;if(s)return s;var c=[a[l-1],a[l+1]];return o.snapPoints=s={horizontal:[],vertical:[]},k(c,function(u){u&&(u=u.original||u,s.horizontal.push(u.y),s.vertical.push(u.x))}),s}n.on(["connect.hover","connect.move","connect.end"],1500,function(o){var s=o.context,a=s.hover,l=a&&t(a,o);!Xe(a)||!l||!l.x||!l.y||(vn(o,"x",l.x),vn(o,"y",l.y))}),n.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var s=o.context,a=r(s),l=s.hover,c=l&&t(l,o),u=o.x,f=o.y,h,d;if(a){h=e(c?a.vertical.concat([c.x]):a.vertical,u),d=e(c?a.horizontal.concat([c.y]):a.horizontal,f);var p=u-h,m=f-d;T(o,{dx:o.dx-p,dy:o.dy-m,x:o.x-p,y:o.y-m}),(p||a.vertical.indexOf(u)!==-1)&&vn(o,"x",h),(m||a.horizontal.indexOf(f)!==-1)&&vn(o,"y",d)}})}Wp.$inject=["eventBus"];var nS={__depends__:[gn,yn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Fp],bendpointMove:["type",wf],bendpointMovePreview:["type",Vp],connectionSegmentMove:["type",Hp],bendpointSnapping:["type",Wp]};var G$=new po;function vo(n){this._scheduled={},n.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(e=>{this.cancel(e)})})}vo.$inject=["eventBus"];vo.prototype.schedule=function(n,e=G$.next()){this.cancel(e);let t=this._schedule(n,e);return this._scheduled[e]=t,t.promise};vo.prototype._schedule=function(n,e){let t=X$();return{executionId:setTimeout(()=>{try{this._scheduled[e]=null;try{t.resolve(n())}catch(r){t.reject(r)}}catch(r){console.error("Scheduler#_schedule execution failed",r)}}),promise:t.promise}};vo.prototype.cancel=function(n){let e=this._scheduled[n];e&&(this._cancel(e),this._scheduled[n]=null)};vo.prototype._cancel=function(n){clearTimeout(n.executionId)};function X$(){let n={};return n.promise=new Promise((e,t)=>{n.resolve=e,n.reject=t}),n}var iS={scheduler:["type",vo]};var Y$="djs-element-hidden",Up=".entry",Z$=1e3,rS=8,J$=300;function tt(n,e,t,i){this._canvas=n,this._elementRegistry=e,this._eventBus=t,this._scheduler=i,this._current=null,this._init()}tt.$inject=["canvas","elementRegistry","eventBus","scheduler"];tt.prototype._init=function(){var n=this;this._eventBus.on("selection.changed",function(e){var t=e.newSelection,i=t.length?t.length===1?t[0]:t:null;i?n.open(i,!0):n.close()}),this._eventBus.on("elements.changed",function(e){var t=e.elements,i=n._current;if(i){var r=i.target,o=F(r)?r:[r],s=o.filter(function(l){return t.includes(l)});if(s.length){n.close();var a=o.filter(function(l){return n._elementRegistry.get(l.id)});a.length&&n._updateAndOpen(a.length>1?a:a[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){n._updatePosition()}),this._eventBus.on("element.marker.update",function(e){if(n.isOpen()){var t=e.element,i=n._current,r=F(i.target)?i.target:[i.target];r.includes(t)&&n._updateVisibility()}}),this._container=this._createContainer()};tt.prototype._createContainer=function(){var n=te('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(n),n};tt.prototype.registerProvider=function(n,e){e||(e=n,n=Z$),this._eventBus.on("contextPad.getProviders",n,function(t){t.providers.push(e)})};tt.prototype.getEntries=function(n){var e=this._getProviders(),t=F(n)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return k(e,function(r){if(ge(r[t])){var o=r[t](n);ge(o)?i=o(i):k(o,function(s,a){i[a]=s})}}),i};tt.prototype.trigger=function(n,e,t){var i=this,r,o,s=e.delegateTarget||e.target;if(!s)return e.preventDefault();if(r=et(s,"data-action"),o=e.originalEvent||e,n==="mouseover"){this._timeout=setTimeout(function(){i._mouseout=i.triggerEntry(r,"hover",o,t)},J$);return}else if(n==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(r,n,o,t)};tt.prototype.triggerEntry=function(n,e,t,i){if(this.isShown()){var r=this._current.target,o=this._current.entries,s=o[n];if(s){var a=s.action;if(this._eventBus.fire("contextPad.trigger",{entry:s,event:t})!==!1){if(ge(a)){if(e==="click")return a(t,r,i)}else if(a[e])return a[e](t,r,i);t.preventDefault()}}}};tt.prototype.open=function(n,e){if(!(!e&&this.isOpen(n))){var t=this._eventBus.fire("contextPad.open.allowed",{target:n});t!==!1&&(this.close(),this._updateAndOpen(n))}};tt.prototype._getProviders=function(){var n=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(n),n.providers};tt.prototype._updateAndOpen=function(n){var e=this.getEntries(n),t=this._createHtml(n),i;k(e,function(r,o){var s=r.group||"default",a=te(r.html||'<div class="entry" draggable="true"></div>'),l;et(a,"data-action",o),l=X("[data-group="+Sa(s)+"]",t),l||(l=te('<div class="group"></div>'),et(l,"data-group",s),t.appendChild(l)),l.appendChild(a),r.className&&ej(a,r.className),r.title&&et(a,"title",r.title),r.imageUrl&&(i=te("<img>"),et(i,"src",r.imageUrl),i.style.width="100%",i.style.height="100%",a.appendChild(i))}),ee(t).add("open"),this._current={entries:e,html:t,target:n},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})};tt.prototype._createHtml=function(n){var e=this,t=te('<div class="djs-context-pad"></div>');return _t.bind(t,Up,"click",function(i){e.trigger("click",i)}),_t.bind(t,Up,"dragstart",function(i){e.trigger("dragstart",i)}),_t.bind(t,Up,"mouseover",function(i){e.trigger("mouseover",i)}),_t.bind(t,Up,"mouseout",function(i){e.trigger("mouseout",i)}),q.bind(t,"mousedown",function(i){i.stopPropagation()}),this._container.appendChild(t),this._eventBus.fire("contextPad.create",{target:n,pad:t}),t};tt.prototype.getPad=function(n){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 e;return this.isOpen()&&nj(this._current.target,n)?e=this._current.html:e=this._createHtml(n),{html:e}};tt.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)};tt.prototype.isOpen=function(n){var e=this._current;if(!e)return!1;if(!n)return!0;var t=e.target;return F(n)!==F(t)?!1:F(n)?n.length===t.length&&kt(n,function(i){return t.includes(i)}):t===n};tt.prototype.isShown=function(){return this.isOpen()&&ee(this._current.html).has("open")};tt.prototype.show=function(){this.isOpen()&&(ee(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))};tt.prototype.hide=function(){this.isOpen()&&(ee(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))};tt.prototype._getPosition=function(n){if(!F(n)&&Xe(n)){var e=this._canvas.viewbox(),t=tj(n),i=t.x*e.scale-e.x*e.scale,r=t.y*e.scale-e.y*e.scale;return{left:i+rS*this._canvas.zoom(),top:r}}var o=this._canvas.getContainer(),s=o.getBoundingClientRect(),a=this._getTargetBounds(n);return{left:a.right-s.left+rS*this._canvas.zoom(),top:a.top-s.top}};tt.prototype._updatePosition=function(){let n=()=>{if(this.isOpen()){var e=this._current.html,t=this._getPosition(this._current.target);"x"in t&&"y"in t?(e.style.left=t.x+"px",e.style.top=t.y+"px"):["top","right","bottom","left"].forEach(function(i){i in t&&(e.style[i]=t[i]+"px")})}};this._scheduler.schedule(n,"ContextPad#_updatePosition")};tt.prototype._updateVisibility=function(){let n=()=>{if(this.isOpen()){var e=this,t=this._current.target,i=F(t)?t:[t],r=i.some(function(o){return e._canvas.hasMarker(o,Y$)});r?e.hide():e.show()}};this._scheduler.schedule(n,"ContextPad#_updateVisibility")};tt.prototype._getTargetBounds=function(n){var e=this,t=F(n)?n:[n],i=t.map(function(r){return e._canvas.getGraphics(r)});return i.reduce(function(r,o){let s=o.getBoundingClientRect();return r.top=Math.min(r.top,s.top),r.right=Math.max(r.right,s.right),r.bottom=Math.max(r.bottom,s.bottom),r.left=Math.min(r.left,s.left),r.x=r.left,r.y=r.top,r.width=r.right-r.left,r.height=r.bottom-r.top,r},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function ej(n,e){var t=ee(n);e=F(e)?e:e.split(/\s+/g),e.forEach(function(i){t.add(i)})}function tj(n){return n.waypoints[n.waypoints.length-1]}function nj(n,e){return n=F(n)?n:[n],e=F(e)?e:[e],n.length===e.length&&kt(n,function(t){return e.includes(t)})}var oS={__depends__:[fo,iS,mo],contextPad:["type",tt]};function Kp(n,e,t,i){function r(s,a){return i.allowed("connection.create",{source:s,target:a})}function o(s,a){return r(a,s)}n.on("connect.hover",function(s){var a=s.context,l=a.start,c=s.hover,u;if(a.hover=c,u=a.canExecute=r(l,c),!Yr(u)){if(u!==!1){a.source=l,a.target=c;return}u=a.canExecute=o(l,c),!Yr(u)&&u!==!1&&(a.source=c,a.target=l)}}),n.on(["connect.out","connect.cleanup"],function(s){var a=s.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),n.on("connect.end",function(s){var a=s.context,l=a.canExecute,c=a.connectionStart,u={x:s.x,y:s.y},f=a.source,h=a.target;if(!l)return!1;var d=null,p={connectionStart:Qp(a)?u:c,connectionEnd:Qp(a)?c:u};Pe(l)&&(d=l),a.connection=t.connect(f,h,d,p)}),this.start=function(s,a,l,c){Pe(l)||(c=l,l=le(a)),e.init(s,"connect",{autoActivate:c,data:{shape:a,context:{start:a,connectionStart:l}}})}}Kp.$inject=["eventBus","dragging","modeling","rules"];function Qp(n){var e=n.hover,t=n.source,i=n.target;return e&&t&&e===t&&t!==i}var ij=1100,rj=900,sS="connect-ok",aS="connect-not-ok";function Gp(n,e,t){var i=n.get("connectionPreview",!1);i&&e.on("connect.move",function(r){var o=r.context,s=o.canExecute,a=o.hover,l=o.source,c=o.start,u=o.startPosition,f=o.target,h=o.connectionStart||u,d=o.connectionEnd||{x:r.x,y:r.y},p=h,m=d;Qp(o)&&(p=d,m=h),i.drawPreview(o,s,{source:l||c,target:f||a,connectionStart:p,connectionEnd:m})}),e.on("connect.hover",rj,function(r){var o=r.context,s=r.hover,a=o.canExecute;a!==null&&t.addMarker(s,a?sS:aS)}),e.on(["connect.out","connect.cleanup"],ij,function(r){var o=r.hover;o&&(t.removeMarker(o,sS),t.removeMarker(o,aS))}),i&&e.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Gp.$inject=["injector","eventBus","canvas"];var lS={__depends__:[ht,yn,gn],__init__:["connectPreview"],connect:["type",Kp],connectPreview:["type",Gp]};var oj=new po("ps"),sj=["marker-start","marker-mid","marker-end"],aj=["circle","ellipse","line","path","polygon","polyline","path","rect"];function ji(n,e,t,i){this._elementRegistry=n,this._canvas=t,this._styles=i}ji.$inject=["elementRegistry","eventBus","canvas","styles"];ji.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")};ji.prototype.getGfx=function(n){return this._elementRegistry.getGraphics(n)};ji.prototype.addDragger=function(n,e,t,i="djs-dragger"){t=t||this.getGfx(n);var r=gv(t),o=t.getBoundingClientRect();return this._cloneMarkers(ls(r),i),j(r,this._styles.cls(i,[],{x:o.top,y:o.left})),K(e,r),j(r,"data-preview-support-element-id",n.id),r};ji.prototype.addFrame=function(n,e){var t=Q("rect",{class:"djs-resize-overlay",width:n.width,height:n.height,x:n.x,y:n.y});return K(e,t),j(t,"data-preview-support-element-id",n.id),t};ji.prototype._cloneMarkers=function(n,e="djs-dragger",t=n){var i=this;n.childNodes&&n.childNodes.forEach(r=>{i._cloneMarkers(r,e,t)}),fj(n)&&sj.forEach(function(r){if(j(n,r)){var o=lj(n,r,i._canvas.getContainer());o&&i._cloneMarker(t,n,o,r,e)}})};ji.prototype._cloneMarker=function(n,e,t,i,r="djs-dragger"){var o=[t.id,r,oj.next()].join("-"),s=X("marker#"+t.id,n);n=n||this._canvas._svg;var a=s||gv(t);a.id=o,ne(a).add(r);var l=X(":scope > defs",n);l||(l=Q("defs"),K(n,l)),K(l,a);var c=uj(a.id);j(e,i,c)};function lj(n,e,t){var i=cj(j(n,e));return X("marker#"+i,t||document)}function cj(n){return n.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function uj(n){return"url(#"+n+")"}function fj(n){return aj.indexOf(n.nodeName)!==-1}var ka={__init__:["previewSupport"],previewSupport:["type",ji]};var hj="drop-ok",cS="drop-not-ok",uS="attach-ok",fS="new-parent",hS="create",dj=2e3;function Xp(n,e,t,i,r){function o(l,c,u,f,h){if(!c)return!1;l=Ee(l,function(_){var v=_.labelTarget;return!_.parent&&!(Bi(_)&&l.indexOf(v)!==-1)});var d=ye(l,function(_){return!Xe(_)}),p=!1,m=!1,g=!1;pS(l)&&(p=r.allowed("shape.attach",{position:u,shape:d,target:c})),p||(pS(l)?g=r.allowed("shape.create",{position:u,shape:d,source:f,target:c}):g=r.allowed("elements.create",{elements:l,position:u,target:c}));var b=h.connectionTarget;return g||p?(d&&f&&(m=r.allowed("connection.create",{source:b===f?d:f,target:b===f?f:d,hints:{targetParent:c,targetAttach:p}})),{attach:p,connect:m}):g===null||p===null?null:!1}function s(l,c){[uS,hj,cS,fS].forEach(function(u){u===c?n.addMarker(l,u):n.removeMarker(l,u)})}t.on(["create.move","create.hover"],function(l){var c=l.context,u=c.elements,f=l.hover,h=c.source,d=c.hints||{};if(!f){c.canExecute=!1,c.target=null;return}dS(l);var p={x:l.x,y:l.y},m=c.canExecute=f&&o(u,f,p,h,d);f&&m!==null&&(c.target=f,m&&m.attach?s(f,uS):s(f,m?fS:cS))}),t.on(["create.end","create.out","create.cleanup"],function(l){var c=l.hover;c&&s(c,null)}),t.on("create.end",function(l){var c=l.context,u=c.source,f=c.shape,h=c.elements,d=c.target,p=c.canExecute,m=p&&p.attach,g=p&&p.connect,b=c.hints||{};if(p===!1||!d)return!1;dS(l);var _={x:l.x,y:l.y};g?f=i.appendShape(u,f,_,d,{attach:m,connection:g===!0?{}:g,connectionTarget:b.connectionTarget}):(h=i.createElements(h,_,d,T({},b,{attach:m})),f=ye(h,function(v){return!Xe(v)})),T(c,{elements:h,shape:f}),T(l,{elements:h,shape:f})});function a(){var l=e.context();l&&l.prefix===hS&&e.cancel()}t.on("create.init",function(){t.on("elements.changed",a),t.once(["create.cancel","create.end"],dj,function(){t.off("elements.changed",a)})}),this.start=function(l,c,u){F(c)||(c=[c]);var f=ye(c,function(p){return!Xe(p)});if(f){u=T({elements:c,hints:{},shape:f},u||{}),k(c,function(p){se(p.x)||(p.x=0),se(p.y)||(p.y=0)});var h=Ee(c,function(p){return!p.hidden}),d=Tt(h);k(c,function(p){Xe(p)&&(p.waypoints=Vt(p.waypoints,function(m){return{x:m.x-d.x-d.width/2,y:m.y-d.y-d.height/2}})),T(p,{x:p.x-d.x-d.width/2,y:p.y-d.y-d.height/2})}),e.init(l,hS,{cursor:"grabbing",autoActivate:!0,data:{shape:f,elements:c,context:u}})}}}Xp.$inject=["canvas","dragging","eventBus","modeling","rules"];function dS(n){var e=n.context,t=e.createConstraints;t&&(t.left&&(n.x=Math.max(n.x,t.left)),t.right&&(n.x=Math.min(n.x,t.right)),t.top&&(n.y=Math.max(n.y,t.top)),t.bottom&&(n.y=Math.min(n.y,t.bottom)))}function pS(n){return n&&n.length===1&&!Xe(n[0])}var pj=750;function Yp(n,e,t,i,r){function o(s){var a=Q("g");j(a,r.cls("djs-drag-group",["no-events"]));var l=Q("g");return s.forEach(function(c){var u;c.hidden||(c.waypoints?(u=t._createContainer("connection",l),t.drawConnection(ls(u),c)):(u=t._createContainer("shape",l),t.drawShape(ls(u),c),jt(u,c.x,c.y)),i.addDragger(c,a,u))}),a}e.on("create.move",pj,function(s){var a=s.hover,l=s.context,c=l.elements,u=l.dragGroup;u||(u=l.dragGroup=o(c));var f;a?(u.parentNode||(f=n.getActiveLayer(),K(f,u)),jt(u,s.x,s.y)):Fe(u)}),e.on("create.cleanup",function(s){var a=s.context,l=a.dragGroup;l&&Fe(l)})}Yp.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var Zp={__depends__:[gn,ka,yn,ht],__init__:["create","createPreview"],create:["type",Xp],createPreview:["type",Yp]};var om,He,xS,mj,xo,mS,bS,_S,hx,em,Ef,wS,gx,dx,px,gj,nm={},im=[],yj=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,sm=Array.isArray;function Cr(n,e){for(var t in e)n[t]=e[t];return n}function yx(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function am(n,e,t){var i,r,o,s={};for(o in e)o=="key"?i=e[o]:o=="ref"?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?om.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(o in n.defaultProps)s[o]===void 0&&(s[o]=n.defaultProps[o]);return tm(n,s,i,r,null)}function tm(n,e,t,i,r){var o={type:n,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r==null?++xS:r,__i:-1,__u:0};return r==null&&He.vnode!=null&&He.vnode(o),o}function lm(n){return n.children}function Sf(n,e){this.props=n,this.context=e}function Ra(n,e){if(e==null)return n.__?Ra(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Ra(n):null}function vj(n){if(n.__P&&n.__d){var e=n.__v,t=e.__e,i=[],r=[],o=Cr({},e);o.__v=e.__v+1,He.vnode&&He.vnode(o),vx(n.__P,o,e,n.__n,n.__P.namespaceURI,32&e.__u?[t]:null,i,t==null?Ra(e):t,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,OS(i,o,r),e.__e=e.__=null,o.__e!=t&&CS(o)}}function CS(n){if((n=n.__)!=null&&n.__c!=null)return n.__e=n.__c.base=null,n.__k.some(function(e){if(e!=null&&e.__e!=null)return n.__e=n.__c.base=e.__e}),CS(n)}function gS(n){(!n.__d&&(n.__d=!0)&&xo.push(n)&&!rm.__r++||mS!=He.debounceRendering)&&((mS=He.debounceRendering)||bS)(rm)}function rm(){try{for(var n,e=1;xo.length;)xo.length>e&&xo.sort(_S),n=xo.shift(),e=xo.length,vj(n)}finally{xo.length=rm.__r=0}}function ES(n,e,t,i,r,o,s,a,l,c,u){var f,h,d,p,m,g,b,_=i&&i.__k||im,v=e.length;for(l=xj(t,e,_,l,v),f=0;f<v;f++)(d=t.__k[f])!=null&&(h=d.__i!=-1&&_[d.__i]||nm,d.__i=f,g=vx(n,d,h,r,o,s,a,l,c,u),p=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&xx(h.ref,null,d),u.push(d.ref,d.__c||p,d)),m==null&&p!=null&&(m=p),(b=!!(4&d.__u))||h.__k===d.__k?(l=SS(d,l,n,b),b&&h.__e&&(h.__e=null)):typeof d.type=="function"&&g!==void 0?l=g:p&&(l=p.nextSibling),d.__u&=-7);return t.__e=m,l}function xj(n,e,t,i,r){var o,s,a,l,c,u=t.length,f=u,h=0;for(n.__k=new Array(r),o=0;o<r;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=n.__k[o]=tm(null,s,null,null,null):sm(s)?s=n.__k[o]=tm(lm,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=n.__k[o]=tm(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):n.__k[o]=s,l=o+h,s.__=n,s.__b=n.__b+1,a=null,(c=s.__i=bj(s,t,l,f))!=-1&&(f--,(a=t[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(r>u?h--:r<u&&h++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):n.__k[o]=null;if(f)for(o=0;o<u;o++)(a=t[o])!=null&&(2&a.__u)==0&&(a.__e==i&&(i=Ra(a)),RS(a,a));return i}function SS(n,e,t,i){var r,o;if(typeof n.type=="function"){for(r=n.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=n,e=SS(r[o],e,t,i));return e}n.__e!=e&&(i&&(e&&n.type&&!e.parentNode&&(e=Ra(n)),t.insertBefore(n.__e,e||null)),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function bj(n,e,t,i){var r,o,s,a=n.key,l=n.type,c=e[t],u=c!=null&&(2&c.__u)==0;if(c===null&&a==null||u&&a==c.key&&l==c.type)return t;if(i>(u?1:0)){for(r=t-1,o=t+1;r>=0||o<e.length;)if((c=e[s=r>=0?r--:o++])!=null&&(2&c.__u)==0&&a==c.key&&l==c.type)return s}return-1}function yS(n,e,t){e[0]=="-"?n.setProperty(e,t==null?"":t):n[e]=t==null?"":typeof t!="number"||yj.test(e)?t:t+"px"}function Jp(n,e,t,i,r){var o,s;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof i=="string"&&(n.style.cssText=i=""),i)for(e in i)t&&e in t||yS(n.style,e,"");if(t)for(e in t)i&&t[e]==i[e]||yS(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(wS,"$1")),s=e.toLowerCase(),e=s in n||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),n.l||(n.l={}),n.l[e+o]=t,t?i?t[Ef]=i[Ef]:(t[Ef]=gx,n.addEventListener(e,o?px:dx,o)):n.removeEventListener(e,o?px:dx,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t==null?"":t;break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function vS(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e[em]==null)e[em]=gx++;else if(e[em]<t[Ef])return;return t(He.event?He.event(e):e)}}}function vx(n,e,t,i,r,o,s,a,l,c){var u,f,h,d,p,m,g,b,_,v,x,C,E,S,w,R=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),o=[a=e.__e=t.__e]),(u=He.__b)&&u(e);e:if(typeof R=="function")try{if(b=e.props,_=R.prototype&&R.prototype.render,v=(u=R.contextType)&&i[u.__c],x=u?v?v.props.value:u.__:i,t.__c?g=(f=e.__c=t.__c).__=f.__E:(_?e.__c=f=new R(b,x):(e.__c=f=new Sf(b,x),f.constructor=R,f.render=wj),v&&v.sub(f),f.state||(f.state={}),f.__n=i,h=f.__d=!0,f.__h=[],f._sb=[]),_&&f.__s==null&&(f.__s=f.state),_&&R.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Cr({},f.__s)),Cr(f.__s,R.getDerivedStateFromProps(b,f.__s))),d=f.props,p=f.state,f.__v=e,h)_&&R.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),_&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(_&&R.getDerivedStateFromProps==null&&b!==d&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(b,x),e.__v==t.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(b,f.__s,x)===!1){e.__v!=t.__v&&(f.props=b,f.state=f.__s,f.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(A){A&&(A.__=e)}),im.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(b,f.__s,x),_&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(d,p,m)})}if(f.context=x,f.props=b,f.__P=n,f.__e=!1,C=He.__r,E=0,_)f.state=f.__s,f.__d=!1,C&&C(e),u=f.render(f.props,f.state,f.context),im.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,C&&C(e),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++E<25);f.state=f.__s,f.getChildContext!=null&&(i=Cr(Cr({},i),f.getChildContext())),_&&!h&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(d,p)),S=u!=null&&u.type===lm&&u.key==null?kS(u.props.children):u,a=ES(n,sm(S)?S:[S],e,t,i,r,o,s,a,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&s.push(f),g&&(f.__E=f.__=null)}catch(A){if(e.__v=null,l||o!=null)if(A.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else{for(w=o.length;w--;)yx(o[w]);mx(e)}else e.__e=t.__e,e.__k=t.__k,A.then||mx(e);He.__e(A,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=_j(t.__e,e,t,i,r,o,s,l,c);return(u=He.diffed)&&u(e),128&e.__u?void 0:a}function mx(n){n&&(n.__c&&(n.__c.__e=!0),n.__k&&n.__k.some(mx))}function OS(n,e,t){for(var i=0;i<t.length;i++)xx(t[i],t[++i],t[++i]);He.__c&&He.__c(e,n),n.some(function(r){try{n=r.__h,r.__h=[],n.some(function(o){o.call(r)})}catch(o){He.__e(o,r.__v)}})}function kS(n){return typeof n!="object"||n==null||n.__b>0?n:sm(n)?n.map(kS):n.constructor!==void 0?null:Cr({},n)}function _j(n,e,t,i,r,o,s,a,l){var c,u,f,h,d,p,m,g=t.props||nm,b=e.props,_=e.type;if(_=="svg"?r="http://www.w3.org/2000/svg":_=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((d=o[c])&&"setAttribute"in d==!!_&&(_?d.localName==_:d.nodeType==3)){n=d,o[c]=null;break}}if(n==null){if(_==null)return document.createTextNode(b);n=document.createElementNS(r,_,b.is&&b),a&&(He.__m&&He.__m(e,o),a=!1),o=null}if(_==null)g===b||a&&n.data==b||(n.data=b);else{if(o=_=="textarea"&&b.defaultValue!=null?null:o&&om.call(n.childNodes),!a&&o!=null)for(g={},c=0;c<n.attributes.length;c++)g[(d=n.attributes[c]).name]=d.value;for(c in g)d=g[c],c=="dangerouslySetInnerHTML"?f=d:c=="children"||c in b||c=="value"&&"defaultValue"in b||c=="checked"&&"defaultChecked"in b||Jp(n,c,null,d,r);for(c in b)d=b[c],c=="children"?h=d:c=="dangerouslySetInnerHTML"?u=d:c=="value"?p=d:c=="checked"?m=d:a&&typeof d!="function"||g[c]===d||Jp(n,c,d,g[c],r);if(u)a||f&&(u.__html==f.__html||u.__html==n.innerHTML)||(n.innerHTML=u.__html),e.__k=[];else if(f&&(n.innerHTML=""),ES(e.type=="template"?n.content:n,sm(h)?h:[h],e,t,i,_=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:t.__k&&Ra(t,0),a,l),o!=null)for(c=o.length;c--;)yx(o[c]);a&&_!="textarea"||(c="value",_=="progress"&&p==null?n.removeAttribute("value"):p!=null&&(p!==n[c]||_=="progress"&&!p||_=="option"&&p!=g[c])&&Jp(n,c,p,g[c],r),c="checked",m!=null&&m!=n[c]&&Jp(n,c,m,g[c],r))}return n}function xx(n,e,t){try{if(typeof n=="function"){var i=typeof n.__u=="function";i&&n.__u(),i&&e==null||(n.__u=n(e))}else n.current=e}catch(r){He.__e(r,t)}}function RS(n,e,t){var i,r;if(He.unmount&&He.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||xx(i,null,e)),(i=n.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){He.__e(o,e)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&RS(i[r],e,t||typeof n.type!="function");t||yx(n.__e),n.__c=n.__=n.__e=void 0}function wj(n,e,t){return this.constructor(n,t)}function cm(n,e,t){var i,r,o,s;e==document&&(e=document.documentElement),He.__&&He.__(n,e),r=(i=typeof t=="function")?null:t&&t.__k||e.__k,o=[],s=[],vx(e,n=(!i&&t||e).__k=am(lm,null,[n]),r||nm,nm,e.namespaceURI,!i&&t?[t]:r?null:e.firstChild?om.call(e.childNodes):null,o,!i&&t?t:r?r.__e:e.firstChild,i,s),OS(o,n,s)}om=im.slice,He={__e:function(n,e,t,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(n)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(n,i||{}),s=r.__d),s)return r.__E=r}catch(a){n=a}throw n}},xS=0,mj=function(n){return n!=null&&n.constructor===void 0},Sf.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Cr({},this.state),typeof n=="function"&&(n=n(Cr({},t),this.props)),n&&Cr(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),gS(this))},Sf.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),gS(this))},Sf.prototype.render=lm,xo=[],bS=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_S=function(n,e){return n.__v.__b-e.__v.__b},rm.__r=0,hx=Math.random().toString(8),em="__d"+hx,Ef="__a"+hx,wS=/(PointerCapture)$|Capture$/i,gx=0,dx=vS(!1),px=vS(!0),gj=0;var AS=function(n,e,t,i){var r;e[0]=0;for(var o=1;o<e.length;o++){var s=e[o++],a=e[o]?(e[0]|=s?1:2,t[e[o++]]):e[++o];s===3?i[0]=a:s===4?i[1]=Object.assign(i[1]||{},a):s===5?(i[1]=i[1]||{})[e[++o]]=a:s===6?i[1][e[++o]]+=a+"":s?(r=n.apply(a,AS(n,a,t,["",null])),i.push(r),a[0]?e[0]|=2:(e[o-2]=0,e[o]=r)):i.push(a)}return i},TS=new Map;function MS(n){var e=TS.get(this);return e||(e=new Map,TS.set(this,e)),(e=AS(this,e.get(n)||(e.set(n,e=(function(t){for(var i,r,o=1,s="",a="",l=[0],c=function(h){o===1&&(h||(s=s.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?l.push(0,h,s):o===3&&(h||s)?(l.push(3,h,s),o=2):o===2&&s==="..."&&h?l.push(4,h,0):o===2&&s&&!h?l.push(5,0,!0,s):o>=5&&((s||!h&&o===5)&&(l.push(o,0,s,r),o=6),h&&(l.push(o,h,0,r),o=6)),s=""},u=0;u<t.length;u++){u&&(o===1&&c(),c(u));for(var f=0;f<t[u].length;f++)i=t[u][f],o===1?i==="<"?(c(),l=[l],o=3):s+=i:o===4?s==="--"&&i===">"?(o=1,s=""):s=i+s[0]:a?i===a?a="":s+=i:i==='"'||i==="'"?a=i:i===">"?(c(),o=1):o&&(i==="="?(o=5,r=s,s=""):i==="/"&&(o<5||t[u][f+1]===">")?(c(),o===3&&(l=l[0]),o=l,(l=l[0]).push(2,0,o),o=0):i===" "||i===" "||i===`
[all...]
H A Ddmn-viewer.production.min.js13 `),this},this.appendIndent=function(){return e&&n.write(t.join(" ")),this},this.indent=function(){return t.push(""),this},this.unindent=function(){return t.pop(),this}}function fp(n){n=D({format:!1,preamble:!0},n||{});function e(t,i){var r=i||new h1,s=new d1(r,n.format);n.preamble&&s.append(Jb);var o=new ae,a=t.$model;if(o.getNamespaces().mapDefaultPrefixes(p1(a)),o.build(t).serializeTo(s),!i)return r.value}return{toXML:e}}function p1(n){let e=n.config&&n.config.nsMap||{},t={};for(let i in Pc)t[i]=Pc[i];for(let i in e){let r=e[i];t[r]=i}for(let i of n.getPackages())t[i.prefix]=i.uri;return t}function xa(n,e){nt.call(this,n,e)}xa.prototype=Object.create(nt.prototype);xa.prototype.fromXML=function(n,e,t){tt(e)||(t=e,e="dmn:Definitions");var i=new ya(D({model:this,lax:!0},t)),r=i.handler(e);return i.fromXML(n,r)};xa.prototype.toXML=function(n,e){var t=new fp(e);return new Promise(function(i,r){try{var s=t.toXML(n);return i({xml:s})}catch(o){return r(o)}})};var m1="DC",g1="dc",y1="http://www.omg.org/spec/DMN/20180521/DC/",v1=[{name:"Dimension",properties:[{name:"width",isAttr:!0,type:"Real"},{name:"height",isAttr:!0,type:"Real"}]},{name:"Bounds",properties:[{name:"height",isAttr:!0,type:"Real"},{name:"width",isAttr:!0,type:"Real"},{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Point",properties:[{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Color",properties:[{name:"red",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"green",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"blue",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"}]}],x1=[],b1=[{name:"AlignmentKind",literalValues:[{name:"start"},{name:"center"},{name:"end"}]}],w1={name:m1,prefix:g1,uri:y1,types:v1,associations:x1,enumerations:b1},O1="DI",k1="di",C1="http://www.omg.org/spec/DMN/20180521/DI/",S1=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"style",isReference:!0,type:"Style",xml:{serialize:"property"}},{name:"sharedStyle",isReference:!0,isVirtual:!0,type:"Style"}]},{name:"Diagram",superClass:["DiagramElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"}]},{name:"Shape",isAbstract:!0,properties:[{name:"bounds",type:"dc:Bounds"}],superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,properties:[{name:"waypoint",type:"dc:Point",isMany:!0,xml:{serialize:"property"}}],superClass:["DiagramElement"]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],E1=[],A1=[],_1={tagAlias:"lowerCase"},T1={name:O1,prefix:k1,uri:C1,types:S1,associations:E1,enumerations:A1,xml:_1},M1="DMN",R1="dmn",P1="https://www.omg.org/spec/DMN/20191111/MODEL/",D1=[{name:"AuthorityRequirement",superClass:["DMNElement"],properties:[{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"typeLanguage",type:"String",isAttr:!0},{name:"itemComponent",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"functionItem",type:"FunctionItem"},{name:"isCollection",isAttr:!0,type:"Boolean"}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"import",type:"Import",isMany:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0},{name:"drgElement",type:"DRGElement",isMany:!0},{name:"artifact",type:"Artifact",isMany:!0},{name:"elementCollection",type:"ElementCollection",isMany:!0},{name:"businessContextElement",type:"BusinessContextElement",isMany:!0},{name:"namespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"dmnDI",type:"dmndi:DMNDI"}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"type",type:"String"},{name:"owner",type:"DMNElementReference",xml:{serialize:"property"}},{name:"locationURI",type:"String",isAttr:!0}]},{name:"DecisionRule",superClass:["DMNElement"],properties:[{name:"inputEntry",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}},{name:"outputEntry",type:"LiteralExpression",isMany:!0,xml:{serialize:"property"}},{name:"annotationEntry",type:"RuleAnnotation",isMany:!0,xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String",xml:{serialize:"property"}},{name:"allowedAnswers",type:"String",xml:{serialize:"property"}},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"supportedObjective",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"impactedPerformanceIndicator",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionMaker",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionOwner",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"usingProcess",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"usingTask",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"decisionLogic",type:"Expression"}]},{name:"Invocation",superClass:["Expression"],properties:[{name:"calledFunction",type:"Expression"},{name:"binding",type:"Binding",isMany:!0}]},{name:"OrganisationalUnit",superClass:["BusinessContextElement"],properties:[{name:"decisionMade",type:"Decision",isReference:!0,isMany:!0},{name:"decisionOwned",type:"Decision",isReference:!0,isMany:!0}]},{name:"Import",superClass:["NamedElement"],properties:[{name:"importType",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"namespace",type:"String",isAttr:!0}]},{name:"InformationRequirement",superClass:["DMNElement"],properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ElementCollection",superClass:["NamedElement"],properties:[{name:"drgElement",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"],properties:[]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"extensionElements",type:"ExtensionElements"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"extensionAttribute",type:"ExtensionAttribute",isMany:!0},{name:"label",isAttr:!0,type:"String"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",isMany:!0,xml:{serialize:"property"}},{name:"annotation",type:"RuleAnnotationClause",isMany:!0,xml:{serialize:"property"}},{name:"rule",type:"DecisionRule",isMany:!0,xml:{serialize:"property"}},{name:"hitPolicy",type:"HitPolicy",isAttr:!0,default:"UNIQUE"},{name:"aggregation",type:"BuiltinAggregator",isAttr:!0},{name:"preferredOrientation",type:"DecisionTableOrientation",isAttr:!0},{name:"outputLabel",isAttr:!0,type:"String"}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"text",type:"String"},{name:"importedValues",type:"ImportedValues"}]},{name:"Binding",properties:[{name:"parameter",type:"InformationItem",xml:{serialize:"property"}},{name:"bindingFormula",type:"Expression"}]},{name:"KnowledgeRequirement",superClass:["DMNElement"],properties:[{name:"requiredKnowledge",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["Invocable"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0}]},{name:"BusinessContextElement",isAbstract:!0,superClass:["NamedElement"],properties:[{name:"URI",type:"String",isAttr:!0}]},{name:"PerformanceIndicator",superClass:["BusinessContextElement"],properties:[{name:"impactingDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"body",type:"Expression"},{name:"kind",type:"FunctionKind",isAttr:!0}]},{name:"Context",superClass:["Expression"],properties:[{name:"contextEntry",type:"ContextEntry",isMany:!0}]},{name:"ContextEntry",superClass:["DMNElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"value",type:"Expression"}]},{name:"List",superClass:["Expression"],properties:[{name:"elements",isMany:!0,type:"Expression"}]},{name:"Relation",superClass:["Expression"],properties:[{name:"column",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"row",type:"List",isMany:!0,xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"typeRef",isAttr:!0,type:"String"}]},{name:"UnaryTests",superClass:["Expression"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"DecisionService",superClass:["Invocable"],properties:[{name:"outputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"encapsulatedDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputData",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"ExtensionAttribute",properties:[{name:"value",type:"Element"},{name:"valueRef",type:"Element",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Element",isAbstract:!0,properties:[{name:"extensionAttribute",type:"ExtensionAttribute",isAttr:!0,isReference:!0},{name:"elements",type:"ExtensionElements",isAttr:!0,isReference:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"],properties:[]},{name:"Association",superClass:["Artifact"],properties:[{name:"sourceRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"targetRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"associationDirection",type:"AssociationDirection",isAttr:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",isAttr:!0,type:"String",default:"text/plain"}]},{name:"RuleAnnotationClause",properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"RuleAnnotation",properties:[{name:"text",type:"String"}]},{name:"Invocable",isAbstract:!0,superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"Group",superClass:["Artifact"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"FunctionItem",superClass:["DMNElement"],properties:[{name:"parameters",isMany:!0,type:"InformationItem",xml:{serialize:"property"}},{name:"outputTypeRef",isAttr:!0,type:"String"}]},{name:"DMNElementReference",properties:[{isAttr:!0,name:"href",type:"String"}]}],B1=[{name:"HitPolicy",literalValues:[{name:"UNIQUE"},{name:"FIRST"},{name:"PRIORITY"},{name:"ANY"},{name:"COLLECT"},{name:"RULE ORDER"},{name:"OUTPUT ORDER"}]},{name:"BuiltinAggregator",literalValues:[{name:"SUM"},{name:"COUNT"},{name:"MIN"},{name:"MAX"}]},{name:"DecisionTableOrientation",literalValues:[{name:"Rule-as-Row"},{name:"Rule-as-Column"},{name:"CrossTable"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"FunctionKind",literalValues:[{name:"FEEL"},{name:"Java"},{name:"PMML"}]}],I1=[],$1={tagAlias:"lowerCase"},L1={name:M1,prefix:R1,uri:P1,types:D1,enumerations:B1,associations:I1,xml:$1},N1="DMNDI",q1="dmndi",F1="https://www.omg.org/spec/DMN/20191111/DMNDI/",j1=[{name:"DMNDI",properties:[{name:"diagrams",type:"DMNDiagram",isMany:!0},{name:"styles",type:"DMNStyle",isMany:!0}]},{name:"DMNStyle",superClass:["di:Style"],properties:[{name:"fillColor",type:"dc:Color",isAttr:!0},{name:"strokeColor",type:"dc:Color",isAttr:!0},{name:"fontColor",type:"dc:Color",isAttr:!0},{name:"fontSize",isAttr:!0,type:"Real"},{name:"fontFamily",isAttr:!0,type:"String"},{name:"fontItalic",isAttr:!0,type:"Boolean"},{name:"fontBold",isAttr:!0,type:"Boolean"},{name:"fontUnderline",isAttr:!0,type:"Boolean"},{name:"fontStrikeThrough",isAttr:!0,type:"Boolean"},{name:"labelHorizontalAlignment",type:"dc:AlignmentKind",isAttr:!0},{name:"labelVerticalAlignment",type:"dc:AlignmentKind",isAttr:!0}]},{name:"DMNDiagram",superClass:["di:Diagram"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"size",type:"Size"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"diagramElements",type:"DMNDiagramElement",isMany:!0}]},{name:"DMNDiagramElement",isAbstract:!0,superClass:["di:DiagramElement"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"label",type:"DMNLabel"}]},{name:"DMNLabel",superClass:["di:Shape"],properties:[{name:"text",type:"Text"}]},{name:"DMNShape",superClass:["di:Shape","DMNDiagramElement"],properties:[{name:"isListedInputData",isAttr:!0,type:"Boolean"},{name:"decisionServiceDividerLine",type:"DMNDecisionServiceDividerLine"},{name:"isCollapsed",isAttr:!0,type:"Boolean"}]},{name:"DMNEdge",superClass:["di:Edge","DMNDiagramElement"],properties:[{name:"sourceElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0},{name:"targetElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0}]},{name:"DMNDecisionServiceDividerLine",superClass:["di:Edge"]},{name:"Text",properties:[{name:"text",isBody:!0,type:"String"}]},{name:"Size",superClass:["dc:Dimension"]}],V1=[],Q1=[],z1={name:N1,prefix:q1,uri:F1,types:j1,associations:V1,enumerations:Q1},W1="bpmn.io DI for DMN",H1="http://bpmn.io/schema/dmn/biodi/2.0",X1="biodi",U1={tagAlias:"lowerCase"},Y1=[{name:"DecisionTable",isAbstract:!0,extends:["dmn:DecisionTable"],properties:[{name:"annotationsWidth",isAttr:!0,type:"Integer"}]},{name:"OutputClause",isAbstract:!0,extends:["dmn:OutputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]},{name:"InputClause",isAbstract:!0,extends:["dmn:InputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]}],K1={name:W1,uri:H1,prefix:X1,xml:U1,types:Y1},G1={dc:w1,di:T1,dmn:L1,dmndi:z1,biodi:K1};function hp(n,e){var t=D({},G1,n);return new xa(t,e)}var Oe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};Oe.td=Oe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];Oe.option=Oe.optgroup=[1,'<select multiple="multiple">',"</select>"];Oe.thead=Oe.tbody=Oe.colgroup=Oe.caption=Oe.tfoot=[1,"<table>","</table>"];Oe.polyline=Oe.ellipse=Oe.polygon=Oe.circle=Oe.text=Oe.line=Oe.path=Oe.rect=Oe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function le(n,e=globalThis.document){var c;if(typeof n!="string")throw new TypeError("String expected");let t=/^<!--(.*?)-->$/s.exec(n);if(t)return e.createComment(t[1]);let i=(c=/<([\w:]+)/.exec(n))==null?void 0:c[1];if(!i)return e.createTextNode(n);if(n=n.trim(),i==="body"){let u=e.createElement("html");u.innerHTML=n;let{lastChild:f}=u;return f.remove(),f}let[r,s,o]=Object.hasOwn(Oe,i)?Oe[i]:Oe._default,a=e.createElement("div");for(a.innerHTML=s+n+o;r--;)a=a.lastChild;if(a.firstChild===a.lastChild){let{firstChild:u}=a;return u.remove(),u}let l=e.createDocumentFragment();return l.append(...a.childNodes),l}function J1(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(i){if(i!=="default"&&!(i in n)){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}})}),Object.freeze(n)}function yi(n,...e){let t=n.style;return B(e,function(i){i&&B(i,function(r,s){t[s]=r})}),n}function tr(n,e,t){return arguments.length==2?n.getAttribute(e):t===null?n.removeAttribute(e):(n.setAttribute(e,t),n)}var Z1=Object.prototype.toString;function vi(n){return new Hn(n)}function Hn(n){if(!n||!n.nodeType)throw new Error("A DOM element reference is required");this.el=n,this.list=n.classList}Hn.prototype.add=function(n){return this.list.add(n),this};Hn.prototype.remove=function(n){return Z1.call(n)=="[object RegExp]"?this.removeMatching(n):(this.list.remove(n),this)};Hn.prototype.removeMatching=function(n){let e=this.array();for(let t=0;t<e.length;t++)n.test(e[t])&&this.remove(e[t]);return this};Hn.prototype.toggle=function(n,e){return typeof e!="undefined"?e!==this.list.toggle(n,e)&&this.list.toggle(n):this.list.toggle(n),this};Hn.prototype.array=function(){return Array.from(this.list)};Hn.prototype.has=Hn.prototype.contains=function(n){return this.list.contains(n)};function wa(n){for(var e;e=n.firstChild;)n.removeChild(e);return n}function ew(n,e,t){var i=t?n:n.parentNode;return i&&typeof i.closest=="function"&&i.closest(e)||null}function tw(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ba={},dp;function nw(){if(dp)return ba;dp=1;var n,e,t;function i(){n=window.addEventListener?"addEventListener":"attachEvent",e=window.removeEventListener?"removeEventListener":"detachEvent",t=n!=="addEventListener"?"on":""}return ba.bind=function(r,s,o,a){return n||i(),r[n](t+s,o,a||!1),o},ba.unbind=function(r,s,o,a){return e||i(),r[e](t+s,o,a||!1),o},ba}var pp=nw(),iw=tw(pp),Oa=J1({__proto__:null,default:iw},[pp]),mp=["focus","blur"];function rw(n,e,t,i,r){return mp.indexOf(t)!==-1&&(r=!0),Oa.bind(n,t,function(s){var o=s.target||s.srcElement;s.delegateTarget=ew(o,e,!0),s.delegateTarget&&i.call(n,s)},r)}function sw(n,e,t,i){return mp.indexOf(e)!==-1&&(i=!0),Oa.unbind(n,e,t,i)}var On={bind:rw,unbind:sw};function jt(n,e){return e=e||document,e.querySelector(n)}function gp(n,e){return e=e||document,e.querySelectorAll(n)}function $e(n){n.parentNode&&n.parentNode.removeChild(n)}function nr(n){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(e>=1&&Ie(arguments[e-1])){var t=arguments[e-1];console.warn(new Error("Passing callbacks to "+ow(n.name)+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);n.apply(this,i).then(function(r){var s=Object.keys(r)[0];return t(null,r[s])},function(r){return t(r,r.warnings)})}else return n.apply(this,arguments)}}function ow(n){return n.replace("bound ","")}var aw={width:"100%",height:"100%",position:"relative"},Rs=class{constructor(e={}){$(this,"_viewsChanged",()=>{this._emit("views.changed",{views:this._views,activeView:this._activeView})});this._eventBus=new ye,this._viewsChanged=Gi(this._viewsChanged,0),this._views=[],this._viewers={},this.open=nr(this.open.bind(this)),this.importXML=nr(this.importXML.bind(this)),this.saveXML=nr(this.saveXML.bind(this)),this._init(e)}importXML(e,t){var i=this;return t=t||{open:!0},new Promise(function(s,o){var a=i._activeView;i._clear().then(()=>{e=i._emit("import.parse.start",{xml:e})||e;var l;i._moddle.fromXML(e,"dmn:Definitions").then(c=>{var u=c.rootElement,f=c.references,h=c.elementsById;if(l=c.warnings,u=i._emit("import.parse.complete",r({error:null,definitions:u,elementsById:h,references:f,warnings:l}))||u,i._setDefinitions(u),!t.open){i._emit("import.done",{error:null,warnings:l}),s({warnings:l});return}var d=i._getInitialView(i._views,a);if(!d){var p=new Error("no displayable contents");return i._emit("import.done",{error:p,warnings:l}),p.warnings=l,o(p)}i.open(d).then(m=>({warnings:m.warnings})).catch(m=>({error:m,warnings:m.warnings})).then(m=>{var y=[].concat(l,m.warnings);i._emit("import.done",{error:m.error,warnings:y}),m.error?(m.error.warnings=y,o(m.error)):s({warnings:y})})}).catch(c=>(l=c.warnings,c=lw(c,e)||cw(c)||c,i._emit("import.parse.complete",r({error:c,warnings:l})),i._emit("import.done",{error:c,warnings:l}),c.warnings=l,o(c)))}).catch(l=>(i._emit("import.done",{error:l,warnings:[]}),l.warnings=[],o(l)))});function r(s){var o=i._eventBus.createEvent(s);return Object.defineProperty(o,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:s.warnings,references:s.references,elementsById:s.elementsById}}}),o}}getDefinitions(){return this._definitions}getActiveView(){return this._activeView}getActiveViewer(){var e=this.getActiveView();return e&&this._getViewer(e)}getView(e){return this._views.filter(function(t){return t.element===e})[0]}getViews(){return this._views}saveXML(e){var t=this;e=e||{};var i=this._definitions;return new Promise(function(r,s){if(!i){s(new Error("no definitions loaded"));return}i=t._emit("saveXML.start",{definitions:i})||i,t._moddle.toXML(i,e).then(function(o){var a=o.xml;return a=t._emit("saveXML.serialized",{xml:a})||a,{xml:a}}).catch(o=>({error:o})).then(o=>{t._emit("saveXML.done",o),o.error?s(o.error):r({xml:o.xml})})})}on(...e){this._eventBus.on(...e)}off(...e){this._eventBus.off(...e)}once(...e){this._eventBus.once(...e)}attachTo(e){e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=jt(e)),e.appendChild(this._container),this._emit("attach",{})}detach(){this._emit("detach",{}),$e(this._container)}destroy(){Object.keys(this._viewers).forEach(e=>{var t=this._viewers[e];xp(t,"destroy")}),$e(this._container)}_init(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];let t=le('<div class="dmn-js-parent"></div>'),i=D({},aw,e);D(t.style,{width:yp(i.width),height:yp(i.height),position:i.position}),this._container=t,e.container&&this.attachTo(e.container)}_clear(){return this._switchView(null)}open(e){return this._switchView(e)}_setDefinitions(e){this._definitions=e,this._updateViews()}_updateViews(){var e=this._definitions;if(!e){this._views=[],this._switchView(null);return}var t=this._getViewProviders(),i=[e,...e.drgElement||[]],r=this._views,s=[];for(var o of i){var a=we(t,function(d){return typeof d.opens=="string"?d.opens===o.$type:d.opens(o)});if(a){var l={element:o,id:o.id,name:o.name,type:a.id};s.push(l)}}var c=this._activeView,u;if(c&&(u=we(s,function(d){return ka(c,d)})||this._getInitialView(s),!u)){this._switchView(null);return}var f=!ka(c,u)||vp(c,u),h=r.length!==s.length||!Es(s,function(d){return we(r,function(p){return ka(p,d)&&!vp(p,d)})});this._activeView=u,this._views=s,(f||h)&&this._viewsChanged()}_getInitialView(e,t){var i;return t&&(i=we(e,function(r){return ka(r,t)})||we(e,function(r){return r.type===t})),i||e[0]}_switchView(e){var t=this;return new Promise(function(i,r){var s=(u,f)=>{t._viewsChanged(),u?r(u):i(f)},o=t.getActiveView(),a,l=e&&t._getViewer(e),c=e&&e.element;if(o&&(a=t._getViewer(o),a!==l&&(xp(a,"clear"),a.detach())),t._activeView=e,l){a!==l&&l.attachTo(t._container),t._emit("import.render.start",{view:e,element:c}),l.open(c).then(u=>{t._emit("import.render.complete",{view:e,error:null,warnings:u.warnings}),s(null,u)}).catch(u=>{t._emit("import.render.complete",{view:e,error:u,warnings:u.warnings}),s(u,null)});return}s()})}_getViewer(e){var t=e.type,i=this._viewers[t];return i||(i=this._viewers[t]=this._createViewer(e.type),this._emit("viewer.created",{type:t,viewer:i})),i}_createViewer(e){var t=we(this._getViewProviders(),function(o){return o.id===e});if(!t)throw new Error("no provider for view type <"+e+">");var i=t.constructor,r=this._options[e]||{},s=this._options.common||{};return new i({...s,...r,additionalModules:[...r.additionalModules||[],{_parent:["value",this],moddle:["value",this._moddle]}]})}_emit(...e){return this._eventBus.fire(...e)}_createModdle(e){return new hp(e.moddleExtensions)}_getViewProviders(){return[]}};function yp(n){return n+(Ce(n)?"px":"")}function lw(n,e){if(n.message!=="failed to parse document as <dmn:Definitions>")return null;var t=e.indexOf('"http://www.omg.org/spec/DMN/20151101/dmn.xsd"')!==-1&&"1.1"||e.indexOf('"http://www.omg.org/spec/DMN/20180521/MODEL/"')!==-1&&"1.2";return t?(n=new Error("unsupported DMN "+t+" file detected; only DMN 1.3 files can be opened"),console.error("Cannot open what looks like a DMN "+t+" diagram. Please refer to https://bpmn.io/l/dmn-compatibility.html to learn how to make the toolkit compatible with older DMN files",n),n):null}function cw(n){var e=/unparsable content <([^>]+)> detected([\s\S]*)$/,t=e.exec(n.message);return t?(n.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid DMN 1.3 diagram file"+t[2],n):null}function ka(n,e){return ht(n)?ht(e)?n.element===e.element||n.id===e.id:!1:!ht(e)}function vp(n,e){return!n||!e||n.name!==e.name}function xp(n,e){Ie(n[e])&&n[e]()}var uw=/^class[ {]/;function fw(n){return uw.test(n.toString())}function qc(n){return Array.isArray(n)}function Nc(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ca(...n){n.length===1&&qc(n[0])&&(n=n[0]),n=[...n];let e=n.pop();return e.$inject=n,e}var hw=/constructor\s*[^(]*\(\s*([^)]*)\)/m,dw=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,pw=/\/\*([^*]*)\*\//m;function mw(n){if(typeof n!="function")throw new Error(`Cannot annotate "${n}". Expected a function!`);let e=n.toString().match(fw(n)?hw:dw);if(!e)return[];let t=e[1]||e[2];return t&&t.split(",").map(i=>{let r=i.match(pw);return(r&&r[1]||i).trim()})||[]}function xi(n,e){let t=e||{get:function(x,b){if(i.push(x),b===!1)return null;throw a(`No provider for "${x}"!`)}},i=[],r=this._providers=Object.create(t._providers||null),s=this._instances=Object.create(null),o=s.injector=this,a=function(x){let b=i.join(" -> ");return i.length=0,new Error(b?`${x} (Resolving: ${b})`:x)};function l(x,b){if(!r[x]&&x.includes(".")){let C=x.split("."),k=l(C.shift());for(;C.length;)k=k[C.shift()];return k}if(Nc(s,x))return s[x];if(Nc(r,x)){if(i.indexOf(x)!==-1)throw i.push(x),a("Cannot resolve circular dependency!");return i.push(x),s[x]=r[x][0](r[x][1]),i.pop(),s[x]}return t.get(x,b)}function c(x,b){if(typeof b=="undefined"&&(b={}),typeof x!="function")if(qc(x))x=Ca(x.slice());else throw a(`Cannot invoke "${x}". Expected a function!`);let k=(x.$inject||mw(x)).map(O=>Nc(b,O)?b[O]:l(O));return{fn:x,dependencies:k}}function u(x){let{fn:b,dependencies:C}=c(x),k=Function.prototype.bind.call(b,null,...C);return new k}function f(x,b,C){let{fn:k,dependencies:O}=c(x,C);return k.apply(b,O)}function h(x){return Ca(b=>x.get(b))}function d(x,b){if(b&&b.length){let C=Object.create(null),k=Object.create(null),O=[],v=[],A=[],S,M,_,P;for(let j in r)S=r[j],b.indexOf(j)!==-1&&(S[2]==="private"?(M=O.indexOf(S[3]),M===-1?(_=S[3].createChild([],b),P=h(_),O.push(S[3]),v.push(_),A.push(P),C[j]=[P,j,"private",_]):C[j]=[A[M],j,"private",v[M]]):C[j]=[S[2],S[1]],k[j]=!0),(S[2]==="factory"||S[2]==="type")&&S[1].$scope&&b.forEach(oe=>{S[1].$scope.indexOf(oe)!==-1&&(C[j]=[S[2],S[1]],k[oe]=!0)});b.forEach(j=>{if(!k[j])throw new Error('No provider for "'+j+'". Cannot use provider from the parent!')}),x.unshift(C)}return new xi(x,o)}let p={factory:f,type:u,value:function(x){return x}};function m(x,b){let C=x.__init__||[];return function(){C.forEach(k=>{typeof k=="string"?b.get(k):b.invoke(k)})}}function y(x){let b=x.__exports__;if(b){let C=x.__modules__,k=Object.keys(x).reduce((M,_)=>(_!=="__exports__"&&_!=="__modules__"&&_!=="__init__"&&_!=="__depends__"&&(M[_]=x[_]),M),Object.create(null)),O=(C||[]).concat(k),v=d(O),A=Ca(function(M){return v.get(M)});b.forEach(function(M){r[M]=[A,M,"private",v]});let S=(x.__init__||[]).slice();return S.unshift(function(){v.init()}),x=Object.assign({},x,{__init__:S}),m(x,v)}return Object.keys(x).forEach(function(C){if(C==="__init__"||C==="__depends__")return;let k=x[C];if(k[2]==="private"){r[C]=k;return}let O=k[0],v=k[1];r[C]=[p[O],gw(O,v),O]}),m(x,o)}function g(x,b){return x.indexOf(b)!==-1||(x=(b.__depends__||[]).reduce(g,x),x.indexOf(b)!==-1)?x:x.concat(b)}function w(x){let b=x.reduce(g,[]).map(y),C=!1;return function(){C||(C=!0,b.forEach(k=>k()))}}this.get=l,this.invoke=f,this.instantiate=u,this.createChild=d,this.init=w(n)}function gw(n,e){return n!=="value"&&qc(e)&&(e=Ca(e.slice())),e}function Vt(n,e){e&&(n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}var yw=1e3;function it(n,e){var t=this;e=e||yw,n.on(["render.shape","render.connection"],e,function(i,r){var s=i.type,o=r.element,a=r.gfx,l=r.attrs;if(t.canRender(o))return s==="render.shape"?t.drawShape(a,o,l):t.drawConnection(a,o,l)}),n.on(["render.getShapePath","render.getConnectionPath"],e,function(i,r){if(t.canRender(r))return i.type==="render.getShapePath"?t.getShapePath(r):t.getConnectionPath(r)})}it.prototype.canRender=function(n){};it.prototype.drawShape=function(n,e){};it.prototype.drawConnection=function(n,e){};it.prototype.getShapePath=function(n){};it.prototype.getConnectionPath=function(n){};function vw(n,e){if(n.ownerDocument!==e.ownerDocument)try{return e.ownerDocument.importNode(n,!0)}catch{}return n}function kp(n,e){return e.appendChild(vw(n,e))}function ve(n,e){return kp(e,n),n}var Vc=2,Cp={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Vc,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Vc,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function xw(n,e){return Cp[e]?n.style[e]:n.getAttributeNS(null,e)}function Sp(n,e,t){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Cp[i];r?(r===Vc&&typeof t=="number"&&(t=String(t)+"px"),n.style[i]=t):n.setAttributeNS(null,e,t)}function bw(n,e){var t=Object.keys(e),i,r;for(i=0,r;r=t[i];i++)Sp(n,r,e[r])}function K(n,e,t){if(typeof e=="string")if(t!==void 0)Sp(n,e,t);else return xw(n,e);else bw(n,e);return n}var ww=Object.prototype.toString;function Qt(n){return new Xn(n)}function Xn(n){if(!n||!n.nodeType)throw new Error("A DOM element reference is required");this.el=n,this.list=n.classList}Xn.prototype.add=function(n){return this.list.add(n),this};Xn.prototype.remove=function(n){return ww.call(n)=="[object RegExp]"?this.removeMatching(n):(this.list.remove(n),this)};Xn.prototype.removeMatching=function(n){let e=this.array();for(let t=0;t<e.length;t++)n.test(e[t])&&this.remove(e[t]);return this};Xn.prototype.toggle=function(n,e){return typeof e!="undefined"?e!==this.list.toggle(n,e)&&this.list.toggle(n):this.list.toggle(n),this};Xn.prototype.array=function(){return Array.from(this.list)};Xn.prototype.has=Xn.prototype.contains=function(n){return this.list.contains(n)};function Ow(n){for(var e;e=n.firstChild;)n.removeChild(e);return n}var zc={svg:"http://www.w3.org/2000/svg"},bp='<svg xmlns="'+zc.svg+'"';function Ep(n){var e=!1;n.substring(0,4)==="<svg"?n.indexOf(zc.svg)===-1&&(n=bp+n.substring(4)):(n=bp+">"+n+"</svg>",e=!0);var t=kw(n);if(!e)return t;for(var i=document.createDocumentFragment(),r=t.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function kw(n){var e;return e=new DOMParser,e.async=!1,e.parseFromString(n,"text/xml")}function ie(n,e){var t;return n=n.trim(),n.charAt(0)==="<"?(t=Ep(n).firstChild,t=document.importNode(t,!0)):t=document.createElementNS(zc.svg,n),e&&K(t,e),t}var Fc=null;function Qc(){return Fc===null&&(Fc=ie("svg")),Fc}function wp(n,e){var t,i,r=Object.keys(e);for(t=0;i=r[t];t++)n[i]=e[i];return n}function Ap(n,e,t,i,r,s){var o=Qc().createSVGMatrix();switch(arguments.length){case 0:return o;case 1:return wp(o,n);case 6:return wp(o,{a:n,b:e,c:t,d:i,e:r,f:s})}}function _p(n){return n?Qc().createSVGTransformFromMatrix(n):Qc().createSVGTransform()}var Op=/([&<>]{1})/g,Cw=/([&<>\n\r"]{1})/g,Sw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function jc(n,e){function t(i,r){return Sw[r]||r}return n.replace(e,t)}function Tp(n,e){var t,i,r,s,o;switch(n.nodeType){case 3:e.push(jc(n.textContent,Op));break;case 1:if(e.push("<",n.tagName),n.hasAttributes())for(r=n.attributes,t=0,i=r.length;t<i;++t)s=r.item(t),e.push(" ",s.name,'="',jc(s.value,Cw),'"');if(n.hasChildNodes()){for(e.push(">"),o=n.childNodes,t=0,i=o.length;t<i;++t)Tp(o.item(t),e);e.push("</",n.tagName,">")}else e.push("/>");break;case 8:e.push("<!--",jc(n.nodeValue,Op),"-->");break;case 4:e.push("<![CDATA[",n.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+n.nodeType)}return e}function Ew(n,e){var t=Ep(e);if(Ow(n),!!e){_w(t)||(t=t.documentElement);for(var i=Tw(t.childNodes),r=0;r<i.length;r++)kp(i[r],n)}}function Aw(n){for(var e=n.firstChild,t=[];e;)Tp(e,t),e=e.nextSibling;return t.join("")}function _w(n){return n.nodeName==="#document-fragment"}function Mp(n,e){if(e!==void 0){try{Ew(n,e)}catch(t){throw new Error("error parsing SVG: "+t.message)}return n}else return Aw(n)}function Tw(n){return Array.prototype.slice.call(n)}function bi(n){var e=n.parentNode;return e&&e.removeChild(n),n}function Mw(n,e){return e instanceof SVGMatrix?n.createSVGTransformFromMatrix(e):e}function Rw(n,e){var t,i;for(n.clear(),t=0;i=e[t];t++)n.appendItem(Mw(n,i))}function Ps(n,e){var t=n.transform.baseVal;return e&&(Array.isArray(e)||(e=[e]),Rw(t,e)),t.consolidate()}function Ea(n){return n.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function Pw(n){return["M",n.x,n.y]}function Wc(n){return["L",n.x,n.y]}function Dw(n,e,t){return["C",n.x,n.y,e.x,e.y,t.x,t.y]}function Bw(n,e){let t=n.length,i=[Pw(n[0])];for(let r=1;r<t;r++){let s=n[r-1],o=n[r],a=n[r+1];if(!a||!e){i.push(Wc(o));continue}let l=Math.min(e,Hc(o.x-s.x,o.y-s.y),Hc(a.x-o.x,a.y-o.y));if(!l){i.push(Wc(o));continue}let c=Sa(o,s,l),u=Sa(o,s,l*.5),f=Sa(o,a,l),h=Sa(o,a,l*.5);i.push(Wc(c)),i.push(Dw(u,h,f))}return i}function Sa(n,e,t){let i=e.x-n.x,r=e.y-n.y,s=Hc(i,r),o=t/s;return{x:n.x+i*o,y:n.y+r*o}}function Hc(n,e){return Math.sqrt(Math.pow(n,2)+Math.pow(e,2))}function ir(n,e,t){Ce(e)&&(t=e,e=null),e||(e={});let i=ie("path",e);return Ce(t)&&(i.dataset.cornerRadius=String(t)),Xc(i,n)}function Xc(n,e){let t=parseInt(n.dataset.cornerRadius,10)||0;return K(n,{d:Ea(Bw(e,t))}),n}function wi(n,e){e=!!e,_e(n)||(n=[n]);var t,i,r,s;return B(n,function(o){var a=o;o.waypoints&&!e&&(a=wi(o.waypoints,!0));var l=a.x,c=a.y,u=a.height||0,f=a.width||0;(l<t||t===void 0)&&(t=l),(c<i||i===void 0)&&(i=c),(l+f>r||r===void 0)&&(r=l+f),(c+u>s||s===void 0)&&(s=c+u)}),{x:t,y:i,height:s-i,width:r-t}}function Rp(n){return"waypoints"in n?"connection":"x"in n?"shape":"root"}function Aa(n){return!!(n&&n.isFrame)}var Iw=1;function rn(n,e){it.call(this,n,Iw),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Vt(rn,it);rn.prototype.canRender=function(){return!0};rn.prototype.drawShape=function(e,t,i){var r=ie("rect");return K(r,{x:0,y:0,width:t.width||0,height:t.height||0}),Aa(t)?K(r,D({},this.FRAME_STYLE,i||{})):K(r,D({},this.SHAPE_STYLE,i||{})),ve(e,r),r};rn.prototype.drawConnection=function(e,t,i){var r=ir(t.waypoints,D({},this.CONNECTION_STYLE,i||{}));return ve(e,r),r};rn.prototype.getShapePath=function(e){var t=e.x,i=e.y,r=e.width,s=e.height,o=[["M",t,i],["l",r,0],["l",0,s],["l",-r,0],["z"]];return Ea(o)};rn.prototype.getConnectionPath=function(e){var t=e.waypoints,i,r,s=[];for(i=0;r=t[i];i++)r=r.original||r,s.push([i===0?"M":"L",r.x,r.y]);return Ea(s)};rn.$inject=["eventBus","styles"];function Uc(){var n={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(t,i,r){var s=this.style(i,r);return D(s,{class:t})},this.style=function(t,i){!_e(t)&&!i&&(i=t,t=[]);var r=wt(t,function(s,o){return D(s,n[o]||{})},{});return i?D(r,i):r},this.computeStyle=function(t,i,r){return _e(i)||(r=i,i=[]),e.style(i||[],D({},r,t||{}))}}var Pp={__init__:["defaultRenderer"],defaultRenderer:["type",rn],styles:["type",Uc]};function Dp(n,e){if(!n||!e)return-1;var t=n.indexOf(e);return t!==-1&&n.splice(t,1),t}function Bp(n,e,t){if(!(!n||!e)){typeof t!="number"&&(t=-1);var i=n.indexOf(e);if(i!==-1){if(i===t)return;if(t!==-1)n.splice(i,1);else return}t!==-1?n.splice(t,0,e):n.push(e)}}var Ds=Math,wR=Ds.PI,OR=Ds.min,kR=Ds.max,CR=Ds.pow,SR=Ds.abs;function Yc(n){return{top:n.y,right:n.x+(n.width||0),bottom:n.y+(n.height||0),left:n.x}}function _a(n,e){return Math.round(n*e)/e}function Ip(n){return Ce(n)?n+"px":n}function $w(n){for(;n.parent;)n=n.parent;return n}function Lw(n){n=D({},{width:"100%",height:"100%"},n);let e=n.container||document.body,t=document.createElement("div");return t.setAttribute("class","djs-container djs-parent"),yi(t,{position:"relative",overflow:"hidden",width:Ip(n.width),height:Ip(n.height)}),e.appendChild(t),t}function $p(n,e,t){let i=ie("g");Qt(i).add(e);let r=t!==void 0?t:n.childNodes.length-1;return n.insertBefore(i,n.childNodes[r]||null),i}var Nw="base",Lp=0,qw=1,Fw={shape:["x","y","width","height"],connection:["waypoints"]};function V(n,e,t,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=t,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(n||{})}V.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];V.prototype._init=function(n){let e=this._eventBus,t=this._container=Lw(n),i=this._svg=ie("svg");K(i,{width:"100%",height:"100%"}),tr(i,"tabindex",0),n.autoFocus&&e.on("element.hover",()=>{this.restoreFocus()}),e.on("element.mousedown",500,s=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),i.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),i.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),ve(t,i);let r=this._viewport=$p(i,"viewport");n.deferUpdate&&(this._viewboxChanged=Gi(Ft(this._viewboxChanged,this),300)),e.on("diagram.init",()=>{e.fire("canvas.init",{svg:i,viewport:r})}),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)};V.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let n=this._container.parentNode;n&&n.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};V.prototype._setFocused=function(n){n!=this._focused&&(this._focused=n,this._eventBus.fire("canvas.focus.changed",{focused:n}))};V.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{let t=Rp(e);t==="root"?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};V.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};V.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};V.prototype.isFocused=function(){return this._focused};V.prototype.getDefaultLayer=function(){return this.getLayer(Nw,Lp)};V.prototype.getLayer=function(n,e){if(!n)throw new Error("must specify a name");let t=this._layers[n];if(t||(t=this._layers[n]=this._createLayer(n,e)),typeof e!="undefined"&&t.index!==e)throw new Error("layer <"+n+"> already created at index <"+e+">");return t.group};V.prototype._getChildIndex=function(n){return wt(this._layers,function(e,t){return t.visible&&n>=t.index&&e++,e},0)};V.prototype._createLayer=function(n,e){typeof e=="undefined"&&(e=qw);let t=this._getChildIndex(e);return{group:$p(this._viewport,"layer-"+n,t),index:e,visible:!0}};V.prototype.showLayer=function(n){if(!n)throw new Error("must specify a name");let e=this._layers[n];if(!e)throw new Error("layer <"+n+"> does not exist");let t=this._viewport,i=e.group,r=e.index;if(e.visible)return i;let s=this._getChildIndex(r);return t.insertBefore(i,t.childNodes[s]||null),e.visible=!0,i};V.prototype.hideLayer=function(n){if(!n)throw new Error("must specify a name");let e=this._layers[n];if(!e)throw new Error("layer <"+n+"> does not exist");let t=e.group;return e.visible&&(bi(t),e.visible=!1),t};V.prototype._removeLayer=function(n){let e=this._layers[n];e&&(delete this._layers[n],bi(e.group))};V.prototype.getActiveLayer=function(){let n=this._findPlaneForRoot(this.getRootElement());return n?n.layer:null};V.prototype.findRoot=function(n){return typeof n=="string"&&(n=this._elementRegistry.get(n)),n?(this._findPlaneForRoot($w(n))||{}).rootElement:void 0};V.prototype.getRootElements=function(){return this._planes.map(function(n){return n.rootElement})};V.prototype._findPlaneForRoot=function(n){return we(this._planes,function(e){return e.rootElement===n})};V.prototype.getContainer=function(){return this._container};V.prototype._updateMarker=function(n,e,t){let i;n.id||(n=this._elementRegistry.get(n)),n.markers=n.markers||new Set,i=this._elementRegistry._elements[n.id],i&&(B([i.gfx,i.secondaryGfx],function(r){r&&(t?(n.markers.add(e),Qt(r).add(e)):(n.markers.delete(e),Qt(r).remove(e)))}),this._eventBus.fire("element.marker.update",{element:n,gfx:i.gfx,marker:e,add:!!t}))};V.prototype.addMarker=function(n,e){this._updateMarker(n,e,!0)};V.prototype.removeMarker=function(n,e){this._updateMarker(n,e,!1)};V.prototype.hasMarker=function(n,e){return n.id||(n=this._elementRegistry.get(n)),n.markers?n.markers.has(e):!1};V.prototype.toggleMarker=function(n,e){this.hasMarker(n,e)?this.removeMarker(n,e):this.addMarker(n,e)};V.prototype.getRootElement=function(){let n=this._rootElement;return n||this._planes.length?n:this.setRootElement(this.addRootElement(null))};V.prototype.addRootElement=function(n){let e=this._rootsIdx++;n||(n={id:"__implicitroot_"+e,children:[],isImplicit:!0});let t=n.layer="root-"+e;this._ensureValid("root",n);let i=this.getLayer(t,Lp);return this.hideLayer(t),this._addRoot(n,i),this._planes.push({rootElement:n,layer:i}),n};V.prototype.removeRootElement=function(n){if(typeof n=="string"&&(n=this._elementRegistry.get(n)),!!this._findPlaneForRoot(n))return this._removeRoot(n),this._removeLayer(n.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==n}),this._rootElement===n&&(this._rootElement=null),n};V.prototype.setRootElement=function(n){if(n===this._rootElement)return n;let e;if(!n)throw new Error("rootElement required");return e=this._findPlaneForRoot(n),e||(n=this.addRootElement(n)),this._setRoot(n),n};V.prototype._removeRoot=function(n){let e=this._elementRegistry,t=this._eventBus;t.fire("root.remove",{element:n}),t.fire("root.removed",{element:n}),e.remove(n)};V.prototype._addRoot=function(n,e){let t=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:n}),t.add(n,e),i.fire("root.added",{element:n,gfx:e})};V.prototype._setRoot=function(n,e){let t=this._rootElement;t&&(this._elementRegistry.updateGraphics(t,null,!0),this.hideLayer(t.layer)),n&&(e||(e=this._findPlaneForRoot(n).layer),this._elementRegistry.updateGraphics(n,this._svg,!0),this.showLayer(n.layer)),this._rootElement=n,this._eventBus.fire("root.set",{element:n})};V.prototype._ensureValid=function(n,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element <"+e.id+"> already exists");let t=Fw[n];if(!Es(t,function(r){return typeof e[r]!="undefined"}))throw new Error("must supply { "+t.join(", ")+" } with "+n)};V.prototype._setParent=function(n,e,t){Bp(e.children,n,t),n.parent=e};V.prototype._addElement=function(n,e,t,i){t=t||this.getRootElement();let r=this._eventBus,s=this._graphicsFactory;this._ensureValid(n,e),r.fire(n+".add",{element:e,parent:t}),this._setParent(e,t,i);let o=s.create(n,e,i);return this._elementRegistry.add(e,o),s.update(n,e,o),r.fire(n+".added",{element:e,gfx:o}),e};V.prototype.addShape=function(n,e,t){return this._addElement("shape",n,e,t)};V.prototype.addConnection=function(n,e,t){return this._addElement("connection",n,e,t)};V.prototype._removeElement=function(n,e){let t=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(n=t.get(n.id||n),!!n)return r.fire(e+".remove",{element:n}),i.remove(n),Dp(n.parent&&n.parent.children,n),n.parent=null,r.fire(e+".removed",{element:n}),t.remove(n),n};V.prototype.removeShape=function(n){return this._removeElement(n,"shape")};V.prototype.removeConnection=function(n){return this._removeElement(n,"connection")};V.prototype.getGraphics=function(n,e){return this._elementRegistry.getGraphics(n,e)};V.prototype._changeViewbox=function(n){this._eventBus.fire("canvas.viewbox.changing"),n.apply(this),this._cachedViewbox=null,this._viewboxChanged()};V.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};V.prototype.viewbox=function(n){if(n===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let e=this._viewport,t=this.getSize(),i,r,s,o,a,l,c;if(n)this._changeViewbox(function(){a=Math.min(t.width/n.width,t.height/n.height);let u=this._svg.createSVGMatrix().scale(a).translate(-n.x,-n.y);Ps(e,u)});else return s=this._rootElement?this.getActiveLayer():null,i=s&&s.getBBox()||{},o=Ps(e),r=o?o.matrix:Ap(),a=_a(r.a,1e3),l=_a(-r.e||0,1e3),c=_a(-r.f||0,1e3),n=this._cachedViewbox={x:l?l/a:0,y:c?c/a:0,width:t.width/a,height:t.height/a,scale:a,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:t},n;return n};V.prototype.scroll=function(n){let e=this._viewport,t=e.getCTM();return n&&this._changeViewbox(function(){n=D({dx:0,dy:0},n||{}),t=this._svg.createSVGMatrix().translate(n.dx,n.dy).multiply(t),Np(e,t)}),{x:t.e,y:t.f}};V.prototype.scrollToElement=function(n,e){let t=100;typeof n=="string"&&(n=this._elementRegistry.get(n));let i=this.findRoot(n);if(i!==this.getRootElement()&&this.setRootElement(i),i===n)return;e||(e={}),typeof e=="number"&&(t=e),e={top:e.top||t,right:e.right||t,bottom:e.bottom||t,left:e.left||t};let r=wi(n),s=Yc(r),o=this.viewbox(),a=this.zoom(),l,c;o.y+=e.top/a,o.x+=e.left/a,o.width-=(e.right+e.left)/a,o.height-=(e.bottom+e.top)/a;let u=Yc(o);if(!(r.width<o.width&&r.height<o.height))l=r.x-o.x,c=r.y-o.y;else{let h=Math.max(0,s.right-u.right),d=Math.min(0,s.left-u.left),p=Math.max(0,s.bottom-u.bottom),m=Math.min(0,s.top-u.top);l=h||d,c=p||m}this.scroll({dx:-l*a,dy:-c*a})};V.prototype.zoom=function(n,e){if(!n)return this.viewbox(n).scale;if(n==="fit-viewport")return this._fitViewport(e);let t,i;return this._changeViewbox(function(){typeof e!="object"&&(t=this.viewbox().outer,e={x:t.width/2,y:t.height/2}),i=this._setZoom(n,e)}),_a(i.a,1e3)};function Np(n,e){let t="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";n.setAttribute("transform",t)}V.prototype._fitViewport=function(n){let e=this.viewbox(),t=e.outer,i=e.inner,r,s;return i.x>=0&&i.y>=0&&i.x+i.width<=t.width&&i.y+i.height<=t.height&&!n?s={x:0,y:0,width:Math.max(i.width+i.x,t.width),height:Math.max(i.height+i.y,t.height)}:(r=Math.min(1,t.width/i.width,t.height/i.height),s={x:i.x+(n?i.width/2-t.width/r/2:0),y:i.y+(n?i.height/2-t.height/r/2:0),width:t.width/r,height:t.height/r}),this.viewbox(s),this.viewbox(!1).scale};V.prototype._setZoom=function(n,e){let t=this._svg,i=this._viewport,r=t.createSVGMatrix(),s=t.createSVGPoint(),o,a,l,c,u;l=i.getCTM();let f=l.a;return e?(o=D(s,e),a=o.matrixTransform(l.inverse()),c=r.translate(a.x,a.y).scale(1/f*n).translate(-a.x,-a.y),u=l.multiply(c)):u=r.scale(n),Np(this._viewport,u),u};V.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};V.prototype.getAbsoluteBBox=function(n){let e=this.viewbox(),t;n.waypoints?t=this.getGraphics(n).getBBox():t=n;let i=t.x*e.scale-e.x*e.scale,r=t.y*e.scale-e.y*e.scale,s=t.width*e.scale,o=t.height*e.scale;return{x:i,y:r,width:s,height:o}};V.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var rr="data-element-id";function Xe(n){this._elements={},this._eventBus=n}Xe.$inject=["eventBus"];Xe.prototype.add=function(n,e,t){var i=n.id;this._validateId(i),K(e,rr,i),t&&K(t,rr,i),this._elements[i]={element:n,gfx:e,secondaryGfx:t}};Xe.prototype.remove=function(n){var e=this._elements,t=n.id||n,i=t&&e[t];i&&(K(i.gfx,rr,""),i.secondaryGfx&&K(i.secondaryGfx,rr,""),delete e[t])};Xe.prototype.updateId=function(n,e){this._validateId(e),typeof n=="string"&&(n=this.get(n)),this._eventBus.fire("element.updateId",{element:n,newId:e});var t=this.getGraphics(n),i=this.getGraphics(n,!0);this.remove(n),n.id=e,this.add(n,t,i)};Xe.prototype.updateGraphics=function(n,e,t){var i=n.id||n,r=this._elements[i];return t?r.secondaryGfx=e:r.gfx=e,e&&K(e,rr,i),e};Xe.prototype.get=function(n){var e;typeof n=="string"?e=n:e=n&&K(n,rr);var t=this._elements[e];return t&&t.element};Xe.prototype.filter=function(n){var e=[];return this.forEach(function(t,i){n(t,i)&&e.push(t)}),e};Xe.prototype.find=function(n){for(var e=this._elements,t=Object.keys(e),i=0;i<t.length;i++){var r=t[i],s=e[r],o=s.element,a=s.gfx;if(n(o,a))return o}};Xe.prototype.getAll=function(){return this.filter(function(n){return n})};Xe.prototype.forEach=function(n){var e=this._elements;Object.keys(e).forEach(function(t){var i=e[t],r=i.element,s=i.gfx;return n(r,s)})};Xe.prototype.getGraphics=function(n,e){var t=n.id||n,i=this._elements[t];return i&&(e?i.secondaryGfx:i.gfx)};Xe.prototype._validateId=function(n){if(!n)throw new Error("element must have an id");if(this._elements[n])throw new Error("element with id "+n+" already added")};function jw(n,e,t,i){var r=t.inverse;return Object.defineProperty(n,"remove",{value:function(s){var o=this.indexOf(s);return o!==-1&&(this.splice(o,1),e.unset(s,r,i)),s}}),Object.defineProperty(n,"contains",{value:function(s){return this.indexOf(s)!==-1}}),Object.defineProperty(n,"add",{value:function(s,o){var a=this.indexOf(s);if(typeof o=="undefined"){if(a!==-1)return;o=this.length}a!==-1&&this.splice(a,1),this.splice(o,0,s),a===-1&&e.set(s,r,i)}}),Object.defineProperty(n,"__refs_collection",{value:!0}),n}function Vw(n){return n.__refs_collection===!0}function Qw(n,e){return Object.prototype.hasOwnProperty.call(n,e.name||e)}function qp(n,e,t){var i=jw(t[e.name]||[],n,e,t);Object.defineProperty(t,e.name,{enumerable:e.enumerable,value:i}),i.length&&i.forEach(function(r){n.set(r,e.inverse,t)})}function zw(n,e,t){var i=e.inverse,r=t[e.name];Object.defineProperty(t,e.name,{configurable:e.configurable,enumerable:e.enumerable,get:function(){return r},set:function(s){if(s!==r){var o=r;r=null,o&&n.unset(o,i,t),r=s,n.set(r,i,t)}}})}function Ue(n,e){if(!(this instanceof Ue))return new Ue(n,e);n.inverse=e,e.inverse=n,this.props={},this.props[n.name]=n,this.props[e.name]=e}Ue.prototype.bind=function(n,e){if(typeof e=="string"){if(!this.props[e])throw new Error("no property <"+e+"> in ref");e=this.props[e]}e.collection?qp(this,e,n):zw(this,e,n)};Ue.prototype.ensureRefsCollection=function(n,e){var t=n[e.name];return Vw(t)||qp(this,e,n),t};Ue.prototype.ensureBound=function(n,e){Qw(n,e)||this.bind(n,e)};Ue.prototype.unset=function(n,e,t){n&&(this.ensureBound(n,e),e.collection?this.ensureRefsCollection(n,e).remove(t):n[e.name]=void 0)};Ue.prototype.set=function(n,e,t){n&&(this.ensureBound(n,e),e.collection?this.ensureRefsCollection(n,e).add(t):n[e.name]=t)};var Kc=new Ue({name:"children",enumerable:!0,collection:!0},{name:"parent"}),jp=new Ue({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Fp=new Ue({name:"attachers",collection:!0},{name:"host"}),Vp=new Ue({name:"outgoing",collection:!0},{name:"source"}),Qp=new Ue({name:"incoming",collection:!0},{name:"target"});function Bs(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(n){var e=this.label,t=this.labels;!n&&e?t.remove(e):t.add(n,0)}}),Kc.bind(this,"parent"),jp.bind(this,"labels"),Vp.bind(this,"outgoing"),Qp.bind(this,"incoming")}function Is(){Bs.call(this),Kc.bind(this,"children"),Fp.bind(this,"host"),Fp.bind(this,"attachers")}Vt(Is,Bs);function zp(){Bs.call(this),Kc.bind(this,"children")}Vt(zp,Is);function Wp(){Is.call(this),jp.bind(this,"labelTarget")}Vt(Wp,Is);function Hp(){Bs.call(this),Vp.bind(this,"source"),Qp.bind(this,"target")}Vt(Hp,Bs);var Ww={connection:Hp,shape:Is,label:Wp,root:zp};function Xp(n,e){var t=Ww[n];if(!t)throw new Error("unknown type: <"+n+">");return D(new t,e)}function Un(){this._uid=12}Un.prototype.createRoot=function(n){return this.create("root",n)};Un.prototype.createLabel=function(n){return this.create("label",n)};Un.prototype.createShape=function(n){return this.create("shape",n)};Un.prototype.createConnection=function(n){return this.create("connection",n)};Un.prototype.create=function(n,e){return e=D({},e||{}),e.id||(e.id=n+"_"+this._uid++),Xp(n,e)};function Up(n){return n.childNodes[0]}function Yp(n){return n.parentNode.childNodes[1]}function Kp(n,e,t){var i=_p();i.setTranslate(e,t),Ps(n,i)}function Ye(n,e){this._eventBus=n,this._elementRegistry=e}Ye.$inject=["eventBus","elementRegistry"];Ye.prototype._getChildrenContainer=function(n){var e=this._elementRegistry.getGraphics(n),t;return n.parent?(t=Yp(e),t||(t=ie("g"),Qt(t).add("djs-children"),ve(e.parentNode,t))):t=e,t};Ye.prototype._clear=function(n){var e=Up(n);return wa(e),e};Ye.prototype._createContainer=function(n,e,t,i){var r=ie("g");Qt(r).add("djs-group"),typeof t!="undefined"?Gp(r,e,e.childNodes[t]):ve(e,r);var s=ie("g");Qt(s).add("djs-element"),Qt(s).add("djs-"+n),i&&Qt(s).add("djs-frame"),ve(r,s);var o=ie("g");return Qt(o).add("djs-visual"),ve(s,o),s};Ye.prototype.create=function(n,e,t){var i=this._getChildrenContainer(e.parent);return this._createContainer(n,i,t,Aa(e))};Ye.prototype.updateContainments=function(n){var e=this,t=this._elementRegistry,i;i=wt(n,function(r,s){return s.parent&&(r[s.parent.id]=s.parent),r},{}),B(i,function(r){var s=r.children;if(s){var o=e._getChildrenContainer(r);B(s.slice().reverse(),function(a){var l=t.getGraphics(a);Gp(l.parentNode,o)})}})};Ye.prototype.drawShape=function(n,e,t={}){var i=this._eventBus;return i.fire("render.shape",{gfx:n,element:e,attrs:t})};Ye.prototype.getShapePath=function(n){var e=this._eventBus;return e.fire("render.getShapePath",n)};Ye.prototype.drawConnection=function(n,e,t={}){var i=this._eventBus;return i.fire("render.connection",{gfx:n,element:e,attrs:t})};Ye.prototype.getConnectionPath=function(n){var e=this._eventBus;return e.fire("render.getConnectionPath",n)};Ye.prototype.update=function(n,e,t){if(e.parent){var i=this._clear(t);if(n==="shape")this.drawShape(i,e),Kp(t,e.x,e.y);else if(n==="connection")this.drawConnection(i,e);else throw new Error("unknown type: "+n);e.hidden?K(t,"display","none"):K(t,"display","block")}};Ye.prototype.remove=function(n){var e=this._elementRegistry.getGraphics(n);bi(e.parentNode)};function Gp(n,e,t){var i=t||e.firstChild;n!==i&&e.insertBefore(n,i)}var Jp={__depends__:[Pp],__init__:["canvas"],canvas:["type",V],elementRegistry:["type",Xe],elementFactory:["type",Un],eventBus:["type",ye],graphicsFactory:["type",Ye]};function Hw(n){var e=new xi(n);return e.init(),e}function Xw(n){n=n||{};var e={config:["value",n]},t=[e,Jp].concat(n.modules||[]);return Hw(t)}function kn(n,e){this._injector=e||Xw(n),this.get("eventBus").fire("diagram.init")}kn.prototype.get=function(n,e){return this._injector.get(n,e)};kn.prototype.invoke=function(n,e,t){return this._injector.invoke(n,e,t)};kn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")};kn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function Q(n,e){var t=Ot(n);return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function Ot(n){return n&&n.businessObject||n}function Zp(n){return Ot(n).name}function Ta(n){var e=Ot(n);if(Q(e,"dmn:Decision"))return e.get("decisionLogic");if(Q(e,"dmn:BusinessKnowledgeModel")){var t=e.get("encapsulatedLogic");return t&&t.get("body")}}var Uw="https://www.omg.org/spec/DMN/20191111/FEEL/";function em(n){for(let e=n;e;e=e.$parent){let t=e.get("expressionLanguage");if(t)return!!(t===Uw||/feel/i.test(t));if(Q(e,"dmn:FunctionDefinition"))return(e.get("kind")||"FEEL")==="FEEL"}return!0}var Yw=new Ue({name:"dmnElementRef",enumerable:!0},{name:"di",configurable:!0});function Gc(n,e){var t=[];function i(g){var w=g.gfx;if(w)throw new Error("already rendered "+g.id);return n.element(g)}function r(g){return n.root(g)}function s(g){try{var w=g.di&&i(g);return w}catch(x){y(x.message,{element:g,error:x})}}function o(g,w){var x=g.dmnDI;if(!x)throw new Error("no dmndi:DMNDI");var b=x.diagrams||[];if(w&&b.indexOf(w)===-1)throw new Error("diagram not part of dmndi:DMNDI");if(!w&&b&&b.length&&(w=b[0]),!w)throw new Error("no diagram to display");g.di=w,f(w),r(g),a(g.get("drgElement")),l(g.get("artifact")),m()}function a(g){B(g,function(w){s(w),u(w)})}function l(g){B(g,function(w){Q(w,"dmn:Association")?c(w):s(w)})}function c(g){p(function(){s(g)})}function u(g){B(["informationRequirement","knowledgeRequirement","authorityRequirement"],function(w){B(g[w],function(x){p(function(){s(x)})})})}function f(g){B(g.diagramElements,h)}function h(g){d(g)}function d(g){var w=g.dmnElementRef;w?w.di?y("multiple DI elements defined for element",{element:w}):(Yw.bind(w,"di"),w.di=g):y("no DMN element referenced in element",{element:g})}function p(g){t.push(g)}function m(){B(t,function(g){g()})}function y(g,w){n.error(g,w)}return{handleDefinitions:o}}function tm(n,e,t){var i=n.get("drdImporter"),r=n.get("eventBus"),s,o=[];function a(l){var c={root:function(f){return i.root(f)},element:function(f,h){return i.add(f,h)},error:function(f,h){o.push({message:f,context:h})}},u=new Gc(c);u.handleDefinitions(l)}r.fire("import.start",{definitions:e});try{a(e)}catch(l){s=l}r.fire("import.done",{error:s,warnings:o}),t(s,o)}var ru="$NO_OP",Kw="a runtime error occured! Use Inferno in development environment to find the error.",Da=Array.isArray;function su(n){var e=typeof n;return e==="string"||e==="number"}function Z(n){return Ba(n)||fe(n)}function Yn(n){return fe(n)||n===!1||Gw(n)||Ba(n)}function G(n){return typeof n=="function"}function sr(n){return typeof n=="string"}function tu(n){return typeof n=="number"}function fe(n){return n===null}function Gw(n){return n===!0}function Ba(n){return n===void 0}function Jw(n){throw n||(n=Kw),new Error("Inferno Error: "+n)}function Ns(n,e){var t={};if(n)for(var i in n)t[i]=n[i];if(e)for(var r in e)t[r]=e[r];return t}var $s="$";function ou(n,e,t,i,r,s,o,a){return{childFlags:n,children:e,className:t,dom:null,flags:i,key:r===void 0?null:r,parentVNode:null,props:s===void 0?null:s,ref:o===void 0?null:o,type:a}}function E(n,e,t,i,r,s,o,a){var l=r===void 0?1:r,c=ou(l,i,t,n,o,s,a,e),u=Ct.createVNode;return typeof u=="function"&&u(c),l===0&&um(c,c.children),c}function F(n,e,t,i,r){(n&2)>0&&(n=e.prototype&&G(e.prototype.render)?4:8);var s=e.defaultProps;if(!Z(s)){t||(t={});for(var o in s)Ba(t[o])&&(t[o]=s[o])}if((n&8)>0){var a=e.defaultHooks;if(!Z(a))if(!r)r=a;else for(var l in a)Ba(r[l])&&(r[l]=a[l])}var c=ou(1,null,null,n,i,t,r,e),u=Ct.createVNode;return G(u)&&u(c),c}function xe(n,e){return ou(1,Z(n)?"":n,null,16,e,null,null,null)}function on(n){var e=n.props;if(e){var t=n.flags;t&481&&(e.children!==void 0&&Z(n.children)&&um(n,e.children),e.className!==void 0&&(n.className=e.className||null,e.className=void 0)),e.key!==void 0&&(n.key=e.key,e.key=void 0),e.ref!==void 0&&(t&8?n.ref=Ns(n.ref,e.ref):n.ref=e.ref,e.ref=void 0)}return n}function je(n){var e,t=n.flags;if(t&14){var i,r=n.props;if(!fe(r)){i={};for(var s in r)i[s]=r[s]}e=F(t,n.type,i,n.key,n.ref)}else t&481?e=E(t,n.type,n.className,n.children,n.childFlags,n.props,n.key,n.ref):t&16?e=xe(n.children,n.key):t&1024&&(e=n);return e}function lm(){return xe("",null)}function cm(n,e,t,i){for(var r=n.length;t<r;t++){var s=n[t];if(!Yn(s)){var o=i+$s+t;if(Da(s))cm(s,e,0,o);else{if(su(s))s=xe(s,o);else{var a=s.key,l=sr(a)&&a[0]===$s;(!fe(s.dom)||l)&&(s=je(s)),fe(a)||l?s.key=o:s.key=i+a}e.push(s)}}}}function um(n,e){var t,i=1;if(Yn(e))t=e;else if(sr(e))i=2,t=xe(e);else if(tu(e))i=2,t=xe(e+"");else if(Da(e)){var r=e.length;if(r===0)t=null,i=1;else{(Object.isFrozen(e)||e.$===!0)&&(e=e.slice()),i=8;for(var s=0;s<r;s++){var o=e[s];if(Yn(o)||Da(o)){t=t||e.slice(0,s),cm(e,t,s,"");break}else if(su(o))t=t||e.slice(0,s),t.push(xe(o,$s+s));else{var a=o.key,l=fe(o.dom),c=fe(a),u=!c&&sr(a)&&a[0]===$s;!l||c||u?(t=t||e.slice(0,s),(!l||u)&&(o=je(o)),(c||u)&&(o.key=$s+s),t.push(o)):t&&t.push(o)}}t=t||e,t.$=!0}}else t=e,fe(e.dom)||(t=je(e)),i=2;return n.children=t,n.childFlags=i,n}var Ct={afterRender:null,beforeRender:null,createVNode:null,renderComplete:null};var Oi="http://www.w3.org/1999/xlink",Jc="http://www.w3.org/XML/1998/namespace",Zw="http://www.w3.org/2000/svg",nm={"xlink:actuate":Oi,"xlink:arcrole":Oi,"xlink:href":Oi,"xlink:role":Oi,"xlink:show":Oi,"xlink:title":Oi,"xlink:type":Oi,"xml:base":Jc,"xml:lang":Jc,"xml:space":Jc},Me={},sn=[];function Ia(n,e){n.appendChild(e)}function Ma(n,e,t){Z(t)?Ia(n,e):n.insertBefore(e,t)}function eO(n,e){return e?document.createElementNS(Zw,n):document.createElement(n)}function au(n,e,t){n.replaceChild(e,t)}function tO(n,e){n.removeChild(e)}function lu(n){for(var e;(e=n.shift())!==void 0;)e()}var Ra={},Zc={};function fm(n,e,t){var i=Ra[n],r=t.$EV;e?(i||(Zc[n]=sO(n),Ra[n]=0),r||(r=t.$EV={}),r[n]||Ra[n]++,r[n]=e):r&&r[n]&&(Ra[n]--,i===1&&(document.removeEventListener(hm(n),Zc[n]),Zc[n]=null),r[n]=e)}function nO(n){return G(n.composedPath)?n.composedPath()[0]:n.target}function iO(n,e,t,i){for(var r=nO(n);!fe(r);){if(e&&r.disabled)return;var s=r.$EV;if(s){var o=s[t];if(o&&(i.dom=r,o.event?o.event(o.data,n):o(n),n.cancelBubble))return}r=r.parentNode}}function hm(n){return n.substr(2).toLowerCase()}function rO(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function sO(n){var e=function(i){var r=i.type,s=r==="click"||r==="dblclick";if(s&&i.button!==0)return i.stopPropagation(),!1;i.stopPropagation=rO;var o={dom:document};Object.defineProperty(i,"currentTarget",{configurable:!0,get:function(){return o.dom}}),iO(i,s,n,o)};return document.addEventListener(hm(n),e),e}function dm(n,e){var t=document.createElement("i");return t.innerHTML=e,t.innerHTML===n.innerHTML}function oO(n,e){return!!(e&&e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html&&dm(n,e.dangerouslySetInnerHTML.__html))}function im(n,e,t){if(n[e]){var i=n[e];i.event?i.event(i.data,t):i(t)}else{var r=e.toLowerCase();n[r]&&n[r](t)}}function Fs(n,e){var t=function(r){r.stopPropagation();var s=this.$V;if(s){var o=s.props||Me,a=s.dom;if(sr(n))im(o,n,r);else for(var l=0;l<n.length;l++)im(o,n[l],r);if(G(e)){var c=this.$V,u=c.props||Me;e(u,a,!1,c)}}};return Object.defineProperty(t,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),t}function cu(n){return n==="checkbox"||n==="radio"}var aO=Fs("onInput",uu),lO=Fs(["onClick","onChange"],uu);function pm(n){n.stopPropagation()}pm.wrapped=!0;function cO(n,e){cu(e.type)?(n.onchange=lO,n.onclick=pm):n.oninput=aO}function uu(n,e){var t=n.type,i=n.value,r=n.checked,s=n.multiple,o=n.defaultValue,a=!Z(i);t&&t!==e.type&&e.setAttribute("type",t),!Z(s)&&s!==e.multiple&&(e.multiple=s),!Z(o)&&!a&&(e.defaultValue=o+""),cu(t)?(a&&(e.value=i),Z(r)||(e.checked=r)):a&&e.value!==i?(e.defaultValue=i,e.value=i):Z(r)||(e.checked=r)}function rm(n,e){var t=n.type;if(t==="optgroup"){var i=n.children,r=n.childFlags;if(r&12)for(var s=0,o=i.length;s<o;s++)eu(i[s],e);else r===2&&eu(i,e)}else eu(n,e)}function eu(n,e){var t=n.props||Me,i=n.dom;i.value=t.value,Da(e)&&e.indexOf(t.value)!==-1||t.value===e?i.selected=!0:(!Z(e)||!Z(t.selected))&&(i.selected=t.selected||!1)}var uO=Fs("onChange",mm);function fO(n){n.onchange=uO}function mm(n,e,t,i){var r=!!n.multiple;!Z(n.multiple)&&r!==e.multiple&&(e.multiple=r);var s=i.childFlags;if((s&1)===0){var o=i.children,a=n.value;if(t&&Z(a)&&(a=n.defaultValue),s&12)for(var l=0,c=o.length;l<c;l++)rm(o[l],a);else s===2&&rm(o,a)}}var hO=Fs("onInput",gm),dO=Fs("onChange");function pO(n,e){n.oninput=hO,e.onChange&&(n.onchange=dO)}function gm(n,e,t){var i=n.value,r=e.value;if(Z(i)){if(t){var s=n.defaultValue;!Z(s)&&s!==r&&(e.defaultValue=s,e.value=s)}}else r!==i&&(e.defaultValue=i,e.value=i)}function ym(n,e,t,i,r,s){n&64?uu(i,t):n&256?mm(i,t,r,e):n&128&&gm(i,t,r),s&&(t.$V=e)}function mO(n,e,t){n&64?cO(e,t):n&256?fO(e):n&128&&pO(e,t)}function vm(n){return n.type&&cu(n.type)?!Z(n.checked):!Z(n.value)}function kt(n,e){ki(n),e&&n.dom&&(tO(e,n.dom),n.dom=null)}function ki(n){var e=n.flags;if(e&481){var t=n.ref,i=n.props;G(t)&&t(null);var r=n.children,s=n.childFlags;if(s&12?fu(r):s===2&&ki(r),!fe(i))for(var o in i)switch(o){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":fm(o,null,n.dom);break}}else{var a=n.children;if(a)if(e&14){var l=n.ref;e&4?(G(a.componentWillUnmount)&&a.componentWillUnmount(),G(l)&&l(null),a.$UN=!0,a.$LI&&ki(a.$LI)):(!Z(l)&&G(l.onComponentWillUnmount)&&l.onComponentWillUnmount(n.dom,n.props||Me),ki(a))}else e&1024&&kt(a,n.type)}}function fu(n){for(var e=0,t=n.length;e<t;e++)ki(n[e])}function Pa(n,e){fu(e),n.textContent=""}function gO(n,e){return function(t){n(e.data,t)}}function yO(n,e,t){var i=n.toLowerCase();if(!G(e)&&!Z(e)){var r=e.event;r&&G(r)&&(t[i]=gO(r,e))}else{var s=t[i];(!s||!s.wrapped)&&(t[i]=e)}}function sm(n,e){switch(n){case"animationIterationCount":case"borderImageOutset":case"borderImageSlice":case"borderImageWidth":case"boxFlex":case"boxFlexGroup":case"boxOrdinalGroup":case"columnCount":case"fillOpacity":case"flex":case"flexGrow":case"flexNegative":case"flexOrder":case"flexPositive":case"flexShrink":case"floodOpacity":case"fontWeight":case"gridColumn":case"gridRow":case"lineClamp":case"lineHeight":case"opacity":case"order":case"orphans":case"stopOpacity":case"strokeDasharray":case"strokeDashoffset":case"strokeMiterlimit":case"strokeOpacity":case"strokeWidth":case"tabSize":case"widows":case"zIndex":case"zoom":return e;default:return e+"px"}}function vO(n,e,t){var i=t.style,r,s;if(sr(e)){i.cssText=e;return}if(!Z(n)&&!sr(n)){for(r in e)s=e[r],s!==n[r]&&(i[r]=tu(s)?sm(r,s):s);for(r in n)Z(e[r])&&(i[r]="")}else for(r in e)s=e[r],i[r]=tu(s)?sm(r,s):s}function nu(n,e,t,i,r,s,o){switch(n){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":fm(n,t,i);break;case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":break;case"autoFocus":i.autofocus=!!t;break;case"allowfullscreen":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":i[n]=!!t;break;case"defaultChecked":case"value":case"volume":if(s&&n==="value")return;var a=Z(t)?"":t;i[n]!==a&&(i[n]=a);break;case"dangerouslySetInnerHTML":var l=e&&e.__html||"",c=t&&t.__html||"";l!==c&&!Z(c)&&!dm(i,c)&&(fe(o)||(o.childFlags&12?fu(o.children):o.childFlags===2&&ki(o.children),o.children=null,o.childFlags=1),i.innerHTML=c);break;default:n[0]==="o"&&n[1]==="n"?yO(n,t,i):Z(t)?i.removeAttribute(n):n==="style"?vO(e,t,i):r&&nm[n]?i.setAttributeNS(nm[n],n,t):i.setAttribute(n,t);break}}function xm(n,e,t,i,r){var s=!1,o=(e&448)>0;o&&(s=vm(t),s&&mO(e,i,t));for(var a in t)nu(a,null,t[a],i,r,s,null);o&&ym(e,n,i,t,!0,s)}function bm(n,e,t,i){var r=new e(t,i);if(n.children=r,r.$V=n,r.$BS=!1,r.context=i,r.props===Me&&(r.props=t),r.$UN=!1,G(r.componentWillMount)){if(r.$BR=!0,r.componentWillMount(),r.$PSS){var s=r.state,o=r.$PS;if(fe(s))r.state=o;else for(var a in o)s[a]=o[a];r.$PSS=!1,r.$PS=null}r.$BR=!1}G(Ct.beforeRender)&&Ct.beforeRender(r);var l=js(r.render(t,r.state,i),n),c;return G(r.getChildContext)&&(c=r.getChildContext()),Z(c)?r.$CX=i:r.$CX=Ns(i,c),G(Ct.afterRender)&&Ct.afterRender(r),r.$LI=l,r}function js(n,e){return Yn(n)?n=lm():su(n)?n=xe(n,null):(n.dom&&(n=je(n)),n.flags&14&&(n.parentVNode=e)),n}function Ke(n,e,t,i){var r=n.flags;if(r&481)return wm(n,e,t,i);if(r&14)return xO(n,e,t,i,(r&4)>0);if(r&512||r&16)return iu(n,e);if(r&1024)return Ke(n.children,n.type,t,!1),n.dom=iu(lm(),e)}function iu(n,e){var t=n.dom=document.createTextNode(n.children);return fe(e)||Ia(e,t),t}function wm(n,e,t,i){var r=n.flags,s=n.children,o=n.props,a=n.className,l=n.ref,c=n.childFlags;i=i||(r&32)>0;var u=eO(n.type,i);if(n.dom=u,!Z(a)&&a!==""&&(i?u.setAttribute("class",a):u.className=a),fe(e)||Ia(e,u),(c&1)===0){var f=i===!0&&n.type!=="foreignObject";c===2?Ke(s,u,t,f):c&12&&Ls(s,u,t,f)}return fe(o)||xm(n,r,o,u,i),G(l)&&hu(u,l),u}function Ls(n,e,t,i){for(var r=0,s=n.length;r<s;r++){var o=n[r];fe(o.dom)||(n[r]=o=je(o)),Ke(o,e,t,i)}}function xO(n,e,t,i,r){var s,o=n.type,a=n.props||Me,l=n.ref;if(r){var c=bm(n,o,a,t);n.dom=s=Ke(c.$LI,null,c.$CX,i),Om(n,l,c),c.$UPD=!1}else{var u=js(o(a,t),n);n.children=u,n.dom=s=Ke(u,null,t,i),km(a,l,s)}return fe(e)||Ia(e,s),s}function bO(n){return function(){n.$UPD=!0,n.componentDidMount(),n.$UPD=!1}}function Om(n,e,t){G(e)&&e(t),G(t.componentDidMount)&&sn.push(bO(t))}function wO(n,e,t){return function(){return n.onComponentDidMount(e,t)}}function km(n,e,t){Z(e)||(G(e.onComponentWillMount)&&e.onComponentWillMount(n),G(e.onComponentDidMount)&&sn.push(wO(e,t,n)))}function hu(n,e){sn.push(function(){return e(n)})}function OO(n,e,t,i,r){var s=n.type,o=n.ref,a=n.props||Me;if(r){var l=bm(n,s,a,t),c=l.$LI;qs(c,e,l.$CX,i),n.dom=c.dom,Om(n,o,l),l.$UPD=!1}else{var u=js(s(a,t),n);qs(u,e,t,i),n.children=u,n.dom=u.dom,km(a,o,e)}}function kO(n,e,t,i){var r=n.children,s=n.props,o=n.className,a=n.flags,l=n.ref;if(i=i||(a&32)>0,e.nodeType!==1||e.tagName.toLowerCase()!==n.type){var c=wm(n,null,t,i);n.dom=c,au(e.parentNode,c,e)}else{n.dom=e;var u=e.firstChild,f=n.childFlags;if((f&1)===0){for(var h=null;u;)h=u.nextSibling,u.nodeType===8&&(u.data==="!"?e.replaceChild(document.createTextNode(""),u):e.removeChild(u)),u=h;if(u=e.firstChild,f===2)fe(u)?Ke(r,e,t,i):(h=u.nextSibling,qs(r,u,t,i),u=h);else if(f&12)for(var d=0,p=r.length;d<p;d++){var m=r[d];fe(u)?Ke(m,e,t,i):(h=u.nextSibling,qs(m,u,t,i),u=h)}for(;u;)h=u.nextSibling,e.removeChild(u),u=h}else!fe(e.firstChild)&&!oO(e,s)&&(e.textContent="",a&448&&(e.defaultValue=""));fe(s)||xm(n,a,s,e,i),Z(o)?e.className!==""&&e.removeAttribute("class"):i?e.setAttribute("class",o):e.className=o,G(l)&&hu(e,l)}}function CO(n,e){if(e.nodeType!==3){var t=iu(n,null);n.dom=t,au(e.parentNode,t,e)}else{var i=n.children;e.nodeValue!==i&&(e.nodeValue=i),n.dom=e}}function qs(n,e,t,i){var r=n.flags;r&14?OO(n,e,t,i,(r&4)>0):r&481?kO(n,e,t,i):r&16?CO(n,e):r&512?n.dom=e:Jw()}function SO(n,e,t){var i=e.firstChild;if(!fe(i))for(Yn(n)||qs(n,i,Me,!1),i=e.firstChild;i=i.nextSibling;)e.removeChild(i);sn.length>0&&lu(sn),e.$V=n,G(t)&&t()}function du(n,e,t,i,r){ki(n),au(t,Ke(e,null,i,r),n.dom)}function Cn(n,e,t,i,r){var s=e.flags|0;n.flags!==s||s&2048?du(n,e,t,i,r):s&481?_O(n,e,t,i,r,s):s&14?TO(n,e,t,i,r,(s&4)>0):s&16?MO(n,e):s&512?e.dom=n.dom:AO(n,e,i)}function EO(n,e){n.textContent!==e.children&&(n.textContent=e.children)}function AO(n,e,t){var i=n.type,r=e.type,s=e.children;if(Cm(n.childFlags,e.childFlags,n.children,s,i,t,!1),e.dom=n.dom,i!==r&&!Yn(s)){var o=s.dom;i.removeChild(o),r.appendChild(o)}}function _O(n,e,t,i,r,s){var o=e.type;if(n.type!==o)du(n,e,t,i,r);else{var a=n.dom,l=n.props,c=e.props,u=!1,f=!1,h;if(e.dom=a,r=r||(s&32)>0,l!==c){var d=l||Me;if(h=c||Me,h!==Me){u=(s&448)>0,u&&(f=vm(h));for(var p in h){var m=d[p],y=h[p];m!==y&&nu(p,m,y,a,r,f,n)}}if(d!==Me)for(var g in d)!h.hasOwnProperty(g)&&!Z(d[g])&&nu(g,d[g],null,a,r,f,n)}var w=n.children,x=e.children,b=e.ref,C=n.className,k=e.className;s&4096?EO(a,x):Cm(n.childFlags,e.childFlags,w,x,a,i,r&&o!=="foreignObject"),u&&ym(s,e,a,h,!1,f),C!==k&&(Z(k)?a.removeAttribute("class"):r?a.setAttribute("class",k):a.className=k),G(b)&&n.ref!==b&&hu(a,b)}}function Cm(n,e,t,i,r,s,o){switch(n){case 2:switch(e){case 2:Cn(t,i,r,s,o);break;case 1:kt(t,r);break;default:kt(t,r),Ls(i,r,s,o);break}break;case 1:switch(e){case 2:Ke(i,r,s,o);break;case 1:break;default:Ls(i,r,s,o);break}break;default:if(e&12){var a=t.length,l=i.length;a===0?l>0&&Ls(i,r,s,o):l===0?Pa(r,t):e===8&&n===8?PO(t,i,r,s,o,a,l):RO(t,i,r,s,o,a,l)}else e===1?Pa(r,t):e===2&&(Pa(r,t),Ke(i,r,s,o));break}}function Sm(n,e,t,i,r,s,o,a,l){var c=n.state,u=n.props;t.children=n;var f;if(!n.$UN){if(u!==i||i===Me){if(!l&&G(n.componentWillReceiveProps)){if(n.$BR=!0,n.componentWillReceiveProps(i,s),n.$UN)return;n.$BR=!1}n.$PSS&&(e=Ns(e,n.$PS),n.$PSS=!1,n.$PS=null)}var h=!!n.shouldComponentUpdate;if(a||!h||h&&n.shouldComponentUpdate(i,e,s)){G(n.componentWillUpdate)&&(n.$BS=!0,n.componentWillUpdate(i,e,s),n.$BS=!1),n.props=i,n.state=e,n.context=s,G(Ct.beforeRender)&&Ct.beforeRender(n),f=n.render(i,e,s),G(Ct.afterRender)&&Ct.afterRender(n);var d=f!==ru,p;if(G(n.getChildContext)&&(p=n.getChildContext()),Z(p)?p=s:p=Ns(s,p),n.$CX=p,d){var m=n.$LI,y=js(f,t);Cn(m,y,r,p,o),n.$LI=y,G(n.componentDidUpdate)&&n.componentDidUpdate(u,c)}}else n.props=i,n.state=e,n.context=s;t.dom=n.$LI.dom}}function TO(n,e,t,i,r,s){var o=e.type,a=n.key,l=e.key;if(n.type!==o||a!==l)du(n,e,t,i,r);else{var c=e.props||Me;if(s){var u=n.children;u.$UPD=!0,u.$V=e,Sm(u,u.state,e,c,t,i,r,!1,!1),u.$UPD=!1}else{var f=!0,h=n.props,d=e.ref,p=!Z(d),m=n.children;if(e.dom=n.dom,e.children=m,p&&G(d.onComponentShouldUpdate)&&(f=d.onComponentShouldUpdate(h,c)),f!==!1){p&&G(d.onComponentWillUpdate)&&d.onComponentWillUpdate(h,c);var y=o(c,i);y!==ru&&(y=js(y,e),Cn(m,y,t,i,r),e.children=y,e.dom=y.dom,p&&G(d.onComponentDidUpdate)&&d.onComponentDidUpdate(h,c))}else m.flags&14&&(m.parentVNode=e)}}}function MO(n,e){var t=e.children,i=n.dom;t!==n.children&&(i.nodeValue=t),e.dom=i}function RO(n,e,t,i,r,s,o){for(var a=s>o?o:s,l=0,c,u;l<a;l++)c=e[l],u=n[l],c.dom&&(c=e[l]=je(c)),Cn(u,c,t,i,r),n[l]=c;if(s<o)for(l=a;l<o;l++)c=e[l],c.dom&&(c=e[l]=je(c)),Ke(c,t,i,r);else if(s>o)for(l=a;l<s;l++)kt(n[l],t)}function PO(n,e,t,i,r,s,o){var a=s-1,l=o-1,c,u=0,f=n[u],h=e[u],d;e:{for(;f.key===h.key;){if(h.dom&&(e[u]=h=je(h)),Cn(f,h,t,i,r),n[u]=h,u++,u>a||u>l)break e;f=n[u],h=e[u]}for(f=n[a],h=e[l];f.key===h.key;){if(h.dom&&(e[l]=h=je(h)),Cn(f,h,t,i,r),n[a]=h,a--,l--,u>a||u>l)break e;f=n[a],h=e[l]}}if(u>a){if(u<=l){d=l+1;for(var p=d<o?e[d].dom:null;u<=l;)h=e[u],h.dom&&(e[u]=h=je(h)),u++,Ma(t,Ke(h,null,i,r),p)}}else if(u>l)for(;u<=a;)kt(n[u++],t);else{var m=u,y=u,g=a-u+1,w=l-u+1,x=[];for(c=0;c<w;c++)x.push(0);var b=g===s,C=!1,k=0,O=0;if(o<4||(g|w)<32)for(c=m;c<=a;c++)if(f=n[c],O<w){for(u=y;u<=l;u++)if(h=e[u],f.key===h.key){if(x[u-y]=c+1,b)for(b=!1;c>m;)kt(n[m++],t);k>u?C=!0:k=u,h.dom&&(e[u]=h=je(h)),Cn(f,h,t,i,r),O++;break}!b&&u>l&&kt(f,t)}else b||kt(f,t);else{var v={};for(c=y;c<=l;c++)v[e[c].key]=c;for(c=m;c<=a;c++)if(f=n[c],O<w)if(u=v[f.key],u!==void 0){if(b)for(b=!1;c>m;)kt(n[m++],t);h=e[u],x[u-y]=c+1,k>u?C=!0:k=u,h.dom&&(e[u]=h=je(h)),Cn(f,h,t,i,r),O++}else b||kt(f,t);else b||kt(f,t)}if(b)Pa(t,n),Ls(e,t,i,r);else if(C){var A=DO(x);for(u=A.length-1,c=w-1;c>=0;c--)x[c]===0?(k=c+y,h=e[k],h.dom&&(e[k]=h=je(h)),d=k+1,Ma(t,Ke(h,null,i,r),d<o?e[d].dom:null)):u<0||c!==A[u]?(k=c+y,h=e[k],d=k+1,Ma(t,h.dom,d<o?e[d].dom:null)):u--}else if(O!==w)for(c=w-1;c>=0;c--)x[c]===0&&(k=c+y,h=e[k],h.dom&&(e[k]=h=je(h)),d=k+1,Ma(t,Ke(h,null,i,r),d<o?e[d].dom:null))}}function DO(n){var e=n.slice(),t=[0],i,r,s,o,a,l=n.length;for(i=0;i<l;i++){var c=n[i];if(c!==0){if(r=t[t.length-1],n[r]<c){e[i]=r,t.push(i);continue}for(s=0,o=t.length-1;s<o;)a=(s+o)/2|0,n[t[a]]<c?s=a+1:o=a;c<n[t[s]]&&(s>0&&(e[i]=t[s-1]),t[s]=i)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}function or(n,e,t){if(n!==ru){var i=e.$V;if(Z(i)?Yn(n)||(n.dom&&(n=je(n)),fe(e.firstChild)?(Ke(n,e,Me,!1),e.$V=n):SO(n,e),i=n):Z(n)?(kt(i,e),e.$V=null):(n.dom&&(n=je(n)),Cn(i,n,e,Me,!1),i=e.$V=n),sn.length>0&&lu(sn),G(t)&&t(),G(Ct.renderComplete)&&Ct.renderComplete(i),i&&i.flags&14)return i.children}}function Em(n,e){return E(1024,e,null,n,0,null,Yn(n)?null:n.key,null)}var om=typeof Promise=="undefined"?null:Promise.resolve(),BO=typeof requestAnimationFrame=="undefined"?setTimeout:requestAnimationFrame.bind(window);function IO(n){return om?om.then(n):BO(n)}function am(n,e,t,i){G(e)&&(e=e(n.state,n.props,n.context));var r=n.$PS;if(Z(r))n.$PS=e;else for(var s in e)r[s]=e[s];if(!n.$PSS&&!n.$BR)if(!n.$UPD)n.$PSS=!0,n.$UPD=!0,Am(n,i,t),n.$UPD=!1;else{var o=n.$QU;fe(o)&&(o=n.$QU=[],IO($O(n,o))),G(t)&&o.push(t)}else n.$PSS=!0,n.$BR&&G(t)&&sn.push(t.bind(n))}function $O(n,e){return function(){n.$QU=null,n.$UPD=!0,Am(n,!1,function(){for(var t=0,i=e.length;t<i;t++)e[t].call(n)}),n.$UPD=!1}}function Am(n,e,t){if(!n.$UN){if(e||!n.$BR){n.$PSS=!1;var i=n.$PS,r=n.state,s=Ns(r,i),o=n.props,a=n.context;n.$PS=null;var l=n.$V,c=n.$LI,u=c.dom&&c.dom.parentNode;if(Sm(n,s,l,o,u,a,(l.flags&32)>0,e,!0),n.$UN)return;if((n.$LI.flags&1024)===0)for(var f=n.$LI.dom;!fe(l=l.parentVNode);)(l.flags&14)>0&&(l.dom=f);sn.length>0&&lu(sn)}else n.state=n.$PS,n.$PS=null;G(t)&&t.call(n)}}var z=(function(){function n(t,i){this.state=null,this.props=void 0,this.context=void 0,this.refs=void 0,this.$BR=!1,this.$BS=!0,this.$PSS=!1,this.$PS=null,this.$LI=null,this.$V=null,this.$UN=!1,this.$CX=null,this.$UPD=!0,this.$QU=null,this.props=t||Me,this.context=i||Me}var e=n.prototype;return e.forceUpdate=function(i){this.$UN||am(this,{},i,!0)},e.setState=function(i,r){if(!this.$UN)if(!this.$BS)am(this,i,r,!1);else return},e.render=function(i,r,s){},n})();z.defaultProps=void 0;var _m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="#000000" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="#000000" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';function pu(n){var e='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100;">'+_m+"</a>",t=le(e);n.appendChild(t),Oa.bind(t,"click",function(i){jO(),i.preventDefault()})}var Kn=class extends z{constructor(e,t){super(e,t),this.node=null}componentDidMount(){pu(this.node)}render(){return E(1,"div",null,null,1,null,null,e=>this.node=e)}};function mu(n){return n.join(";")}var LO=mu(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"]),NO=mu(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"]),qO=mu(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"]),FO='<div class="bjs-powered-by-lightbox" style="'+LO+'"><div class="backdrop" style="'+NO+'"></div><div class="notice" style="'+qO+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;">'+_m+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',Vs;function jO(){Vs||(Vs=le(FO),On.bind(Vs,".backdrop","click",function(n){document.body.removeChild(Vs)})),document.body.appendChild(Vs)}function VO(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var gu={exports:{}},Tm;function QO(){if(Tm)return gu.exports;Tm=1;var n=gu.exports=function(e,t){if(t||(t=16),e===void 0&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(t),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(t)*r;for(var s=i-Math.floor(i),o="",r=0;r<Math.floor(i);r++){var a=Math.floor(Math.random()*t).toString(t);o=a+o}if(s){var l=Math.pow(t,s),a=Math.floor(Math.random()*l).toString(t);o=a+o}var c=parseInt(o,t);return c!==1/0&&c>=Math.pow(2,e)?n(e,t):o};return n.rack=function(e,t,i){var r=function(o){var a=0;do{if(a++>10)if(i)e+=i;else throw new Error("too many ID collisions, use more bits");var l=n(e,t)}while(Object.hasOwnProperty.call(s,l));return s[l]=o,l},s=r.hats={};return r.get=function(o){return r.hats[o]},r.set=function(o,a){return r.hats[o]=a,r},r.bits=e||128,r.base=t||16,r},gu.exports}var zO=QO(),WO=VO(zO);function an(n){if(!(this instanceof an))return new an(n);n=n||[128,36,1],this._seed=n.length?WO.rack(n[0],n[1],n[2]):n}an.prototype.next=function(n){return this._seed(n||!0)};an.prototype.nextPrefixed=function(n,e){var t;do t=n+this.next(!0);while(this.assigned(t));return this.claim(t,e),t};an.prototype.claim=function(n,e){this._seed.set(n,e||!0)};an.prototype.assigned=function(n){return this._seed.get(n)||!1};an.prototype.unclaim=function(n){delete this._seed.hats[n]};an.prototype.clear=function(){var n=this._seed.hats,e;for(e in n)this.unclaim(e)};var HO=new an,$a="hsl(225, 10%, 15%)";function Qs(n,e,t,i,r,s){it.call(this,e);var o=HO.next(),a=i.computeStyle,l={},c=n&&n.defaultFillColor||"white",u=n&&n.defaultStrokeColor||$a,f=n&&n.defaultLabelColor;function h(O,v,A){var S=O+"-"+Rm(v)+"-"+Rm(A)+"-"+o;return l[S]||p(S,O,v,A),"url(#"+S+")"}function d(O,v){var A=D({strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},v.attrs),S=v.ref||{x:0,y:0},M=v.scale||1;A.strokeDasharray==="none"&&(A.strokeDasharray=[1e4,1]);var _=ie("marker");K(v.element,A),ve(_,v.element),K(_,{id:O,viewBox:"0 0 20 20",refX:S.x,refY:S.y,markerWidth:20*M,markerHeight:20*M,orient:"auto"});var P=jt("defs",s._svg);P||(P=ie("defs"),ve(s._svg,P)),ve(P,_),l[O]=_}function p(O,v,A,S){if(v==="association-start"){var M=ie("path");K(M,{d:"M 11 5 L 1 10 L 11 15"}),d(O,{element:M,attrs:{fill:"none",stroke:S,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}else if(v==="association-end"){var _=ie("path");K(_,{d:"M 1 5 L 11 10 L 1 15"}),d(O,{element:_,attrs:{fill:"none",stroke:S,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}else if(v==="information-requirement-end"){var P=ie("path");K(P,{d:"M 1 5 L 11 10 L 1 15 Z"}),d(O,{element:P,attrs:{fill:S,stroke:"none"},ref:{x:11,y:10},scale:1})}else if(v==="knowledge-requirement-end"){var j=ie("path");K(j,{d:"M 1 3 L 11 10 L 1 17"}),d(O,{element:j,attrs:{fill:"none",stroke:S,strokeWidth:2},ref:{x:11,y:10},scale:.8})}else if(v==="authority-requirement-end"){var oe=ie("circle");K(oe,{cx:3,cy:3,r:3}),d(O,{element:oe,attrs:{fill:S,stroke:"none"},ref:{x:3,y:3},scale:.9})}}function m(O,v,A,S,M,_){dt(M)&&(_=M,M=0),M=M||0,_=a(_,{stroke:$a,strokeWidth:2,fill:"white"});var P=ie("rect");return K(P,{x:M,y:M,width:v-M*2,height:A-M*2,rx:S,ry:S}),K(P,_),ve(O,P),P}function y(O,v,A){var S=r.createText(v||"",A);return tr(S,"class","djs-label"),ve(O,S),S}function g(O,v,A,S){var M=Zp(v);return S=D({box:v,align:A,padding:5,style:{fill:Pm(v,f,u)}},S),y(O,M,S)}function w(O,v,A){A=a(A,["no-fill"],{strokeWidth:2,stroke:$a});var S=ie("path");return K(S,{d:v}),K(S,A),ve(O,S),S}var x={"dmn:Decision":function(O,v){var A=m(O,v.width,v.height,0,{stroke:ln(v,u),fill:Gn(v,c)});return g(O,v,"center-middle"),A},"dmn:KnowledgeSource":function(O,v){var A=t.getScaledPath("KNOWLEDGE_SOURCE",{xScaleFactor:1.021,yScaleFactor:1,containerWidth:v.width,containerHeight:v.height,position:{mx:0,my:.075}}),S=w(O,A,{strokeWidth:2,fill:Gn(v,c),stroke:ln(v,u)});return g(O,v,"center-middle"),S},"dmn:BusinessKnowledgeModel":function(O,v){var A=t.getScaledPath("BUSINESS_KNOWLEDGE_MODEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width,containerHeight:v.height,position:{mx:0,my:.3}}),S=w(O,A,{strokeWidth:2,fill:Gn(v,c),stroke:ln(v,u)});return g(O,v,"center-middle"),S},"dmn:InputData":function(O,v){var A=m(O,v.width,v.height,22,{stroke:ln(v,u),fill:Gn(v,c)});return g(O,v,"center-middle"),A},"dmn:TextAnnotation":function(O,v){var A={fill:"none",stroke:"none"},S=m(O,v.width,v.height,0,0,A),M=t.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width,containerHeight:v.height,position:{mx:0,my:0}});w(O,M,{stroke:ln(v,u)});var _=Mm(v).text||"";return y(O,_,{style:{fill:Pm(v,f,u)},box:v,align:"left-top",padding:5}),S},"dmn:Association":function(O,v){var A=Mm(v),S=Gn(v,c),M=ln(v,u),_={stroke:M,strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};return(A.associationDirection==="One"||A.associationDirection==="Both")&&(_.markerEnd=h("association-end",S,M)),A.associationDirection==="Both"&&(_.markerStart=h("association-start",S,M)),k(O,v.waypoints,_)},"dmn:InformationRequirement":function(O,v){var A=Gn(v,c),S=ln(v,u),M={stroke:S,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:h("information-requirement-end",A,S)};return k(O,v.waypoints,M)},"dmn:KnowledgeRequirement":function(O,v){var A=Gn(v,c),S=ln(v,u),M={stroke:S,strokeWidth:1,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:h("knowledge-requirement-end",A,S)};return k(O,v.waypoints,M)},"dmn:AuthorityRequirement":function(O,v){var A=Gn(v,c),S=ln(v,u),M={stroke:S,strokeWidth:1.5,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:h("authority-requirement-end",A,S)};return k(O,v.waypoints,M)}};function b(O,v){var A=x[v.type];return A?A(O,v):it.prototype.drawShape.apply(this,[O,v])}function C(O,v){var A=v.type,S=x[A];return S?S(O,v):it.prototype.drawConnection.apply(this,[O,v])}function k(O,v,A){A=a(A,["no-fill"],{stroke:$a,strokeWidth:2,fill:"none"});var S=ir(v,A);return ve(O,S),S}this.canRender=function(O){return Q(O,"dmn:DMNElement")||Q(O,"dmn:InformationRequirement")||Q(O,"dmn:KnowledgeRequirement")||Q(O,"dmn:AuthorityRequirement")},this.drawShape=b,this.drawConnection=C}Vt(Qs,it);Qs.$inject=["config.drdRenderer","eventBus","pathMap","styles","textRenderer","canvas"];function Mm(n){return n.businessObject}function Rm(n){return n.replace(/[^0-9a-zA-z]+/g,"_")}function ln(n,e){return e}function Gn(n,e){return e}function Pm(n,e,t){return e||ln(n,t)}var XO=0,UO={width:150,height:50};function YO(n){var e=n.split("-");return{horizontal:e[0]||"center",vertical:e[1]||"top"}}function KO(n){return dt(n)?D({top:0,left:0,right:0,bottom:0},n):{top:n,left:n,right:n,bottom:n}}var yu=null;function GO(){return yu||(yu=document.createElement("canvas").getContext("2d")),yu}function JO(n){var e=[];return n.fontStyle&&e.push(n.fontStyle),n.fontVariant&&e.push(n.fontVariant),n.fontWeight&&e.push(n.fontWeight),n.fontStretch&&e.push(n.fontStretch),e.push(Bm(n.fontSize)||"12px"),e.push(n.fontFamily||"sans-serif"),e.join(" ")}function Bm(n){if(n!=null)return typeof n=="number"||/^-?\d+(\.\d+)?$/.test(n)?n+"px":n}function ZO(n,e){var t=GO();if(!t)return{width:0,height:0};t.font=JO(e),"letterSpacing"in t&&(t.letterSpacing=Bm(e.letterSpacing)||"0px");var i=n==="",r=i?"dummy":n.replace(/\s+$/,""),s=t.measureText(r);return{width:i?0:s.width,height:"fontBoundingBoxAscent"in s?s.fontBoundingBoxAscent+s.fontBoundingBoxDescent:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent}}function ek(n,e,t){for(var i=n.shift(),r=i,s;;){if(s=ZO(r,t),s.width=r?s.width:0,r===" "||r===""||s.width<Math.round(e)||r.length<2)return tk(n,r,i,s);r=ik(r,s.width,e)}}function tk(n,e,t,i){if(e.length<t.length){var r=t.slice(e.length).trim();n.unshift(r)}return{width:i.width,height:i.height,text:e}}var Dm="\xAD";function nk(n,e){var t=n.split(/(\s|-|\u00AD)/g),i,r=[],s=0;if(t.length>1)for(;i=t.shift();)if(i.length+s<e)r.push(i),s+=i.length;else{(i==="-"||i===Dm)&&r.pop();break}var o=r[r.length-1];return o&&o===Dm&&(r[r.length-1]="-"),r.join("")}function ik(n,e,t){var i=Math.max(n.length*(t/e),1),r=nk(n,i);return r||(r=n.slice(0,Math.max(Math.round(i-1),1))),r}function ar(n){this._config=D({},{size:UO,padding:XO,style:{},align:"center-top"},n||{})}ar.prototype.createText=function(n,e){return this.layoutText(n,e).element};ar.prototype.getDimensions=function(n,e){return this.layoutText(n,e).dimensions};ar.prototype.layoutText=function(n,e){for(var t=D({},this._config.size,e.box),i=D({},this._config.style,e.style),r=YO(e.align||this._config.align),s=KO(e.padding!==void 0?e.padding:this._config.padding),o=e.fitBox||!1,a=rk(i),l=n.split(/\u00AD?\r?\n/),c=[],u=t.width-s.left-s.right;l.length;)c.push(ek(l,u,i));r.vertical==="middle"&&(s.top=s.bottom=0);var f=wt(c,function(y,g,w){return y+(a||g.height)},0)+s.top+s.bottom,h=wt(c,function(y,g,w){return g.width>y?g.width:y},0),d=s.top;r.vertical==="middle"&&(d+=(t.height-f)/2),d-=(a||c[0].height)/4;var p=ie("text");K(p,i),B(c,function(y){var g;switch(d+=a||y.height,r.horizontal){case"left":g=s.left;break;case"right":g=(o?h:u)-s.right-y.width;break;default:g=Math.max(((o?h:u)-y.width)/2+s.left,0)}var w=ie("tspan");K(w,{x:g,y:d}),w.textContent=y.text,ve(p,w)});var m={width:h,height:f};return{dimensions:m,element:p}};function rk(n){if("fontSize"in n&&"lineHeight"in n)return n.lineHeight*parseInt(n.fontSize,10)}var sk=12,ok=1.2,ak=30;function La(n){var e=D({fontFamily:"Arial, sans-serif",fontSize:sk,fontWeight:"normal",lineHeight:ok},n&&n.defaultStyle||{}),t=parseInt(e.fontSize,10)-1,i=D({},e,{fontSize:t},n&&n.externalStyle||{}),r=new ar({style:e});this.getExternalLabelBounds=function(s,o){var a=r.getDimensions(o,{box:{width:90,height:30,x:s.width/2+s.x,y:s.height/2+s.y},style:i});return{x:Math.round(s.x+s.width/2-a.width/2),y:Math.round(s.y),width:Math.ceil(a.width),height:Math.ceil(a.height)}},this.getTextAnnotationBounds=function(s,o){var a=r.getDimensions(o,{box:s,style:e,align:"left-top",padding:5});return{x:s.x,y:s.y,width:s.width,height:Math.max(ak,Math.round(a.height))}},this.createText=function(s,o){return r.createText(s,o||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}La.$inject=["config.textRenderer"];function vu(){this.pathMap={KNOWLEDGE_SOURCE:{d:"m {mx},{my} l 0,{e.y0} c {e.x0},{e.y1} {e.x1},-{e.y2} {e.x2},-{e.y3} c {e.x3},-{e.y4} {e.x4},{e.y5} {e.x5},{e.y6} l 0,-{e.y7}z",width:100,height:65,widthElements:[29.8,48.4,67.2,12.2,19.8,30.8],heightElements:[55.3,19.7,4.2,6.7,2.3,1.6,6.2,54.6]},BUSINESS_KNOWLEDGE_MODEL:{d:"m {mx},{my} l {e.x0},-{e.y0} l {e.x1},0 l 0,{e.y1} l -{e.x2},{e.y2} l -{e.x3},0z",width:125,height:45,widthElements:[13.8,109.2,13.8,109.1],heightElements:[13.2,29.8,13.2]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",width:10,height:30,widthElements:[10],heightElements:[30]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var i=this.pathMap[e],r,s;t.abspos?(r=t.abspos.x,s=t.abspos.y):(r=t.containerWidth*t.position.mx,s=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/i.height*t.yScaleFactor,l=t.containerWidth/i.width*t.xScaleFactor,c=0;c<i.heightElements.length;c++)o["y"+c]=i.heightElements[c]*a;for(var u=0;u<i.widthElements.length;u++)o["x"+u]=i.widthElements[u]*l}var f=fk(i.d,{mx:r,my:s,e:o});return f}}var lk=/\{([^{}]+)\}/g,ck=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function uk(n,e,t){var i=t;return e.replace(ck,function(r,s,o,a,l){s=s||a,i&&(s in i&&(i=i[s]),typeof i=="function"&&l&&(i=i()))}),i=(i==null||i==t?n:i)+"",i}function fk(n,e){return String(n).replace(lk,function(t,i){return uk(t,i,e)})}var Im={__init__:["drdRenderer"],drdRenderer:["type",Qs],textRenderer:["type",La],pathMap:["type",vu]};function Sn(n,e,t,i){this._eventBus=n,this._canvas=e,this._elementRegistry=i,this._elementFactory=t}Sn.$inject=["eventBus","canvas","elementFactory","elementRegistry"];Sn.prototype.root=function(n){var e=this._elementFactory.createRoot(xu(n));return this._canvas.setRootElement(e),e};Sn.prototype.add=function(n){var e=this._elementFactory,t=this._canvas,i=this._eventBus,r=n.di,s,o,a,l,c,u;if(r.$instanceOf("dmndi:DMNShape"))u=r.bounds,c=xu(n,{x:Math.round(u.x),y:Math.round(u.y),width:Math.round(u.width),height:Math.round(u.height)}),s=e.createShape(c),t.addShape(s),i.fire("drdElement.added",{element:s,di:r});else if(r.$instanceOf("dmndi:DMNEdge"))o=hk(r),a=this._getSource(n),l=this._getTarget(n),a&&l&&(c=xu(n,{hidden:!1,source:a,target:l,waypoints:o}),s=e.createConnection(c),t.addConnection(s),i.fire("drdElement.added",{element:s,di:r}));else throw new Error("unknown di for element "+n.id);return s};Sn.prototype._getSource=function(n){var e,t;if(Q(n,"dmn:Association")?t=n.sourceRef:Q(n,"dmn:InformationRequirement")?t=n.requiredDecision||n.requiredInput:Q(n,"dmn:KnowledgeRequirement")?t=n.requiredKnowledge:Q(n,"dmn:AuthorityRequirement")&&(t=n.requiredDecision||n.requiredInput||n.requiredAuthority),t&&(e=t.href),e)return this._getShape($m(e))};Sn.prototype._getTarget=function(n){return Q(n,"dmn:Association")?n.targetRef&&this._getShape($m(n.targetRef.href)):this._getShape(n.$parent.id)};Sn.prototype._getShape=function(n){return this._elementRegistry.get(n)};function xu(n,e){return D({id:n.id,type:n.$type,businessObject:n},e)}function hk(n){var e=n.waypoint;if(e)return zd(e,function(t){var i={x:t.x,y:t.y};return D({original:i},i)})}function $m(n){return n.split("#").pop()}var Lm={drdImporter:["type",Sn]};var Nm={__depends__:[Im,Lm]};function bu(n,e){return e=e||{},n.replace(/{([^}]+)}/g,function(t,i){return e[i]||"{"+i+"}"})}var rt={translate:["value",bu]};function wu(n){return n.originalEvent||n.srcEvent}function qm(n,e){return(wu(n)||n).button===e}function lr(n){return qm(n,0)}function Fm(n){return qm(n,1)}function jm(n){var e=wu(n)||n;return lr(n)&&e.shiftKey}function dk(n){return!0}function Na(n){return lr(n)||Fm(n)}var Vm=500;function qa(n,e,t){var i=this;function r(v,A,S){if(!a(v,A)){var M,_,P;S?_=e.getGraphics(S):(M=A.delegateTarget||A.target,M&&(_=M,S=e.get(_))),!(!_||!S)&&(P=n.fire(v,{element:S,gfx:_,originalEvent:A}),P===!1&&(A.stopPropagation(),A.preventDefault()))}}var s={};function o(v){return s[v]}function a(v,A){var S=c[v]||lr;return!S(A)}var l={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":dk,"element.mousedown":Na,"element.mouseup":Na,"element.click":Na,"element.dblclick":Na};function u(v,A,S){var M=l[v];if(!M)throw new Error("unmapped DOM event name <"+v+">");return r(M,A,S)}var f="svg, .djs-element";function h(v,A,S,M){var _=s[S]=function(P){r(S,P)};M&&(c[S]=M),_.$delegate=On.bind(v,f,A,_)}function d(v,A,S){var M=o(S);M&&On.unbind(v,A,M.$delegate)}function p(v){B(l,function(A,S){h(v,S,A)})}function m(v){B(l,function(A,S){d(v,S,A)})}n.on("canvas.destroy",function(v){m(v.svg)}),n.on("canvas.init",function(v){p(v.svg)}),n.on(["shape.added","connection.added"],function(v){var A=v.element,S=v.gfx;n.fire("interactionEvents.createHit",{element:A,gfx:S})}),n.on(["shape.changed","connection.changed"],Vm,function(v){var A=v.element,S=v.gfx;n.fire("interactionEvents.updateHit",{element:A,gfx:S})}),n.on("interactionEvents.createHit",Vm,function(v){var A=v.element,S=v.gfx;i.createDefaultHit(A,S)}),n.on("interactionEvents.updateHit",function(v){var A=v.element,S=v.gfx;i.updateDefaultHit(A,S)});var y=C("djs-hit djs-hit-stroke"),g=C("djs-hit djs-hit-click-stroke"),w=C("djs-hit djs-hit-all"),x=C("djs-hit djs-hit-no-move"),b={all:w,"click-stroke":g,stroke:y,"no-move":x};function C(v,A){return A=D({stroke:"white",strokeWidth:15},A||{}),t.cls(v,["no-fill","no-border"],A)}function k(v,A){var S=b[A];if(!S)throw new Error("invalid hit type <"+A+">");return K(v,S),v}function O(v,A){ve(v,A)}this.removeHits=function(v){var A=gp(".djs-hit",v);B(A,bi)},this.createDefaultHit=function(v,A){var S=v.waypoints,M=v.isFrame,_;return S?this.createWaypointsHit(A,S):(_=M?"stroke":"all",this.createBoxHit(A,_,{width:v.width,height:v.height}))},this.createWaypointsHit=function(v,A){var S=ir(A);return k(S,"stroke"),O(v,S),S},this.createBoxHit=function(v,A,S){S=D({x:0,y:0},S);var M=ie("rect");return k(M,A),K(M,S),O(v,M),M},this.updateDefaultHit=function(v,A){var S=jt(".djs-hit",A);if(S)return v.waypoints?Xc(S,v.waypoints):K(S,{width:v.width,height:v.height}),S},this.fire=r,this.triggerMouseEvent=u,this.mouseHandler=o,this.registerEvent=h,this.unregisterEvent=d}qa.$inject=["eventBus","elementRegistry","styles"];var Qm={__init__:["interactionEvents"],interactionEvents:["type",qa]};function Jn(n,e){this._eventBus=n,this._canvas=e,this._selectedElements=[];var t=this;n.on(["shape.remove","connection.remove"],function(i){var r=i.element;t.deselect(r)}),n.on(["diagram.clear","root.set"],function(i){t.select(null)})}Jn.$inject=["eventBus","canvas"];Jn.prototype.deselect=function(n){var e=this._selectedElements,t=e.indexOf(n);if(t!==-1){var i=e.slice();e.splice(t,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}};Jn.prototype.get=function(){return this._selectedElements};Jn.prototype.isSelected=function(n){return this._selectedElements.indexOf(n)!==-1};Jn.prototype.select=function(n,e){var t=this._selectedElements,i=t.slice();_e(n)||(n=n?[n]:[]);var r=this._canvas,s=r.getRootElement();n=n.filter(function(o){var a=r.findRoot(o);return s===a}),e?B(n,function(o){t.indexOf(o)===-1&&t.push(o)}):this._selectedElements=t=n.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})};var zm="hover",Wm="selected";function Fa(n,e){this._canvas=n;function t(r,s){n.addMarker(r,s)}function i(r,s){n.removeMarker(r,s)}e.on("element.hover",function(r){t(r.element,zm)}),e.on("element.out",function(r){i(r.element,zm)}),e.on("selection.changed",function(r){function s(c){i(c,Wm)}function o(c){t(c,Wm)}var a=r.oldSelection,l=r.newSelection;B(a,function(c){l.indexOf(c)===-1&&s(c)}),B(l,function(c){a.indexOf(c)===-1&&o(c)})})}Fa.$inject=["canvas","eventBus"];function ja(n,e,t,i){n.on("create.end",500,function(r){var s=r.context,o=s.canExecute,a=s.elements,l=s.hints||{},c=l.autoSelect;if(o){if(c===!1)return;_e(c)?e.select(c):e.select(a.filter(pk))}}),n.on("connect.end",500,function(r){var s=r.context,o=s.connection;o&&e.select(o)}),n.on("shape.move.end",500,function(r){var s=r.previousSelection||[],o=i.get(r.context.shape.id),a=we(s,function(l){return o.id===l.id});a||e.select(o)}),n.on("element.click",function(r){if(lr(r)){var s=r.element;s===t.getRootElement()&&(s=null);var o=e.isSelected(s),a=e.get().length>1,l=jm(r);if(o&&a)return l?e.deselect(s):e.select(s);o?e.deselect(s):e.select(s,l)}})}ja.$inject=["eventBus","selection","canvas","elementRegistry"];function pk(n){return!n.hidden}var Hm={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Qm],selection:["type",Jn],selectionVisuals:["type",Fa],selectionBehavior:["type",ja]};function Va(n){this._counter=0,this._prefix=(n?n+"-":"")+Math.floor(Math.random()*1e9)+"-"}Va.prototype.next=function(){return this._prefix+ ++this._counter};var mk=new Va("ov"),gk=500;function ke(n,e,t,i){this._eventBus=e,this._canvas=t,this._elementRegistry=i,this._ids=mk,this._overlayDefaults=D({show:null,scale:!0},n&&n.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=yk(t.getContainer()),this._init()}ke.$inject=["config.overlays","eventBus","canvas","elementRegistry"];ke.prototype.get=function(n){if(tt(n)&&(n={id:n}),tt(n.element)&&(n.element=this._elementRegistry.get(n.element)),n.element){var e=this._getOverlayContainer(n.element,!0);return e?n.type?Qn(e.overlays,Cc({type:n.type})):e.overlays.slice():[]}else return n.type?Qn(this._overlays,Cc({type:n.type})):n.id?this._overlays[n.id]:null};ke.prototype.add=function(n,e,t){if(dt(e)&&(t=e,e=null),n.id||(n=this._elementRegistry.get(n)),!t.position)throw new Error("must specifiy overlay position");if(!t.html)throw new Error("must specifiy overlay html");if(!n)throw new Error("invalid element specified");var i=this._ids.next();return t=D({},this._overlayDefaults,t,{id:i,type:e,element:n,html:t.html}),this._addOverlay(t),i};ke.prototype.remove=function(n){var e=this.get(n)||[];_e(e)||(e=[e]);var t=this;B(e,function(i){var r=t._getOverlayContainer(i.element,!0);if(i&&($e(i.html),$e(i.htmlContainer),delete i.htmlContainer,delete i.element,delete t._overlays[i.id]),r){var s=r.overlays.indexOf(i);s!==-1&&r.overlays.splice(s,1)}})};ke.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};ke.prototype.show=function(){Qa(this._overlayRoot)};ke.prototype.hide=function(){Qa(this._overlayRoot,!1)};ke.prototype.clear=function(){this._overlays={},this._overlayContainers=[],wa(this._overlayRoot)};ke.prototype._updateOverlayContainer=function(n){var e=n.element,t=n.html,i=e.x,r=e.y;if(e.waypoints){var s=wi(e);i=s.x,r=s.y}Xm(t,i,r),tr(n.html,"data-container-id",e.id)};ke.prototype._updateOverlay=function(n){var e=n.position,t=n.htmlContainer,i=n.element,r=e.left,s=e.top;if(e.right!==void 0){var o;i.waypoints?o=wi(i).width:o=i.width,r=e.right*-1+o}if(e.bottom!==void 0){var a;i.waypoints?a=wi(i).height:a=i.height,s=e.bottom*-1+a}Xm(t,r||0,s||0),this._updateOverlayVisibilty(n,this._canvas.viewbox())};ke.prototype._createOverlayContainer=function(n){var e=le('<div class="djs-overlays" />');yi(e,{position:"absolute"}),this._overlayRoot.appendChild(e);var t={html:e,element:n,overlays:[]};return this._updateOverlayContainer(t),this._overlayContainers.push(t),t};ke.prototype._updateRoot=function(n){var e=n.scale||1,t="matrix("+[e,0,0,e,-1*n.x*e,-1*n.y*e].join(",")+")";Um(this._overlayRoot,t)};ke.prototype._getOverlayContainer=function(n,e){var t=we(this._overlayContainers,function(i){return i.element===n});return!t&&!e?this._createOverlayContainer(n):t};ke.prototype._addOverlay=function(n){var e=n.id,t=n.element,i=n.html,r,s;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),tt(i)&&(i=le(i)),s=this._getOverlayContainer(t),r=le('<div class="djs-overlay" data-overlay-id="'+e+'">'),yi(r,{position:"absolute"}),r.appendChild(i),n.type&&vi(r).add("djs-overlay-"+n.type);var o=this._canvas.findRoot(t),a=this._canvas.getRootElement();Qa(r,o===a),n.htmlContainer=r,s.overlays.push(n),s.html.appendChild(r),this._overlays[e]=n,this._updateOverlay(n),this._updateOverlayVisibilty(n,this._canvas.viewbox())};ke.prototype._updateOverlayVisibilty=function(n,e){var t=n.show,i=this._canvas.findRoot(n.element),r=t&&t.minZoom,s=t&&t.maxZoom,o=n.htmlContainer,a=this._canvas.getRootElement(),l=!0;(i!==a||t&&(ht(r)&&r>e.scale||ht(s)&&s<e.scale))&&(l=!1),Qa(o,l),this._updateOverlayScale(n,e)};ke.prototype._updateOverlayScale=function(n,e){var t=n.scale,i,r,s=n.htmlContainer,o,a="";t!==!0&&(t===!1?(i=1,r=1):(i=t.min,r=t.max),ht(i)&&e.scale<i&&(o=(1/e.scale||1)*i),ht(r)&&e.scale>r&&(o=(1/e.scale||1)*r)),ht(o)&&(a="scale("+o+","+o+")"),Um(s,a)};ke.prototype._updateOverlaysVisibilty=function(n){var e=this;B(this._overlays,function(t){e._updateOverlayVisibilty(t,n)})};ke.prototype._init=function(){var n=this._eventBus,e=this;function t(i){e._updateRoot(i),e._updateOverlaysVisibilty(i),e.show()}n.on("canvas.viewbox.changing",function(i){e.hide()}),n.on("canvas.viewbox.changed",function(i){t(i.viewbox)}),n.on(["shape.remove","connection.remove"],function(i){var r=i.element,s=e.get({element:r});B(s,function(l){e.remove(l.id)});var o=e._getOverlayContainer(r);if(o){$e(o.html);var a=e._overlayContainers.indexOf(o);a!==-1&&e._overlayContainers.splice(a,1)}}),n.on("element.changed",gk,function(i){var r=i.element,s=e._getOverlayContainer(r,!0);s&&(B(s.overlays,function(o){e._updateOverlay(o)}),e._updateOverlayContainer(s))}),n.on("element.marker.update",function(i){var r=e._getOverlayContainer(i.element,!0);r&&vi(r.html)[i.add?"add":"remove"](i.marker)}),n.on("root.set",function(){e._updateOverlaysVisibilty(e._canvas.viewbox())}),n.on("diagram.clear",this.clear,this)};function yk(n){var e=le('<div class="djs-overlay-container" />');return yi(e,{position:"absolute",width:0,height:0}),n.insertBefore(e,n.firstChild),e}function Xm(n,e,t){yi(n,{left:e+"px",top:t+"px"})}function Qa(n,e){n.style.display=e===!1?"none":""}function Um(n,e){n.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(t){n.style[t+"transform"]=e})}var za={__init__:["overlays"],overlays:["type",ke]};function cr(n,e,t){this._eventBus=n,this._canvas=e,this._translate=t,n.on("diagram.init",function(){this._init()},this),n.on("import.done",function(i){i.error||this.update()},this),this.HTML_MARKUP='<div class="dmn-definitions"><div class="dmn-definitions-name" title="'+this._translate("Definition name")+'" spellcheck="false"></div><div class="dmn-definitions-id" title="'+this._translate("Definition ID")+'" spellcheck="false"></div></div>'}cr.$inject=["eventBus","canvas","translate"];cr.prototype._init=function(){var n=this._canvas,e=this._eventBus,t=n.getContainer(),i=this._container=le(this.HTML_MARKUP);t.appendChild(i),this.nameElement=jt(".dmn-definitions-name",this._container),this.idElement=jt(".dmn-definitions-id",this._container),On.bind(i,".dmn-definitions-name, .dmn-definitions-id","mousedown",function(r){r.stopPropagation()}),e.fire("definitionIdView.create",{html:i})};cr.prototype.update=function(){var n=this._canvas.getRootElement().businessObject;this.nameElement.textContent=n.name,this.idElement.textContent=n.id};function Wa(n,e){function t(i,r){var s=e.getContainer();vi(s).toggle(i,r)}n.on("palette.create",function(){t("with-palette",!0)}),n.on("palette.changed",function(i){t("with-palette-two-column",i.twoColumn)})}Wa.$inject=["eventBus","canvas"];var Ym={__depends__:[rt],__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",cr],definitionPropertiesPaletteAdapter:["type",Wa]};var Km=[{className:"dmn-icon-decision-table",matches:function(n){var e=Ot(n);return Q(e,"dmn:Decision")&&Q(e.decisionLogic,"dmn:DecisionTable")},title:"Open decision table"},{className:"dmn-icon-literal-expression",matches:function(n){var e=Ta(n);return Q(e,"dmn:LiteralExpression")},title:"Open literal expression"}],ur=class{constructor(e,t,i,r,s){this._injector=e,this._eventBus=t,this._overlays=i,this._translate=s,this._config=r||{enabled:!0},t.on(["shape.added"],({element:o})=>{for(let l=0;l<Km.length;l++){let{matches:c,className:u,title:f}=Km[l];var a=c&&c(o);a&&this.addOverlay(o,u,f)}})}addOverlay(e,t,i){let r=this._config.enabled!==!1,s=this._getOverlayNode(t,i,r),o=this._overlays.add(e,{position:{top:2,left:2},html:s});r&&(vi(s).add("interactive"),this.bindEventListener(e,s,o))}_getOverlayNode(e,t,i){let r=document.createElement("div");if(r.className="drill-down-overlay",!i){let o=document.createElement("span");return o.className=e,r.appendChild(o),r}let s=document.createElement("button");return s.type="button",s.className=e,s.title=this._translate(t),r.appendChild(s),r}bindEventListener(e,t,i){let r=this._overlays,s=this._eventBus,o=r._overlayRoot;On.bind(o,'[data-overlay-id="'+i+'"]',"click",()=>{s.fire("drillDown.click",{element:e})!==!1&&this.drillDown(e)})}drillDown(e){let t=this._injector.get("_parent",!1);if(!t)return!1;let i=t.getView(e.businessObject);return i?(t.open(i),!0):!1}};ur.$inject=["injector","eventBus","overlays","config.drillDown","translate"];var Gm={__depends__:[za,rt],__init__:["drillDown"],drillDown:["type",ur]};function Ve(n){this._container=this._createContainer(),pu(this._container),this._init(this._container,n)}Vt(Ve,kn);Ve.prototype.saveSVG=nr(function(n){var e=this;return new Promise(function(t){var i=e.get("canvas"),r=i.getActiveLayer(),s=jt("defs",i._svg),o=Mp(r),a=s&&s.outerHTML||"",l=r.getBBox(),c=`<?xml version="1.0" encoding="utf-8"?>
/plugin/bpmnio/vendor/bpmn-js/dist/
H A Dbpmn-modeler.production.min.js2 (()=>{var zE=Object.create;var fc=Object.defineProperty;var GE=Object.getOwnPropertyDescriptor;var VE=Object.getOwnPropertyNames;var WE=Object.getPrototypeOf,UE=Object.prototype.hasOwnProperty;var qE=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var dc=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},KE=(e,t)=>{for(var n in t)fc(e,n,{get:t[n],enumerable:!0})},Xd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of VE(t))!UE.call(e,i)&&i!==n&&fc(e,i,{get:()=>t[i],enumerable:!(r=GE(t,i))||r.enumerable});return e};var YE=(e,t,n)=>(n=e!=null?zE(WE(e)):{},Xd(t||!e||!e.__esModule?fc(n,"default",{value:e,enumerable:!0}):n,e)),XE=e=>Xd(fc({},"__esModule",{value:!0}),e);var em={};KE(em,{assign:()=>C,bind:()=>tt,debounce:()=>Ca,ensureArray:()=>Qd,every:()=>ln,filter:()=>Q,find:()=>re,findIndex:()=>Sa,flatten:()=>_i,forEach:()=>E,get:()=>o0,groupBy:()=>Vt,has:()=>dt,isArray:()=>q,isDefined:()=>Ue,isFunction:()=>Le,isNil:()=>Yn,isNumber:()=>ne,isObject:()=>Se,isString:()=>st,isUndefined:()=>wn,keys:()=>bi,map:()=>je,matchPattern:()=>Ct,merge:()=>Jd,omit:()=>Nt,pick:()=>mt,reduce:()=>Ge,set:()=>_l,size:()=>vl,some:()=>Lt,sortBy:()=>At,throttle:()=>i0,unionBy:()=>gl,uniqueBy:()=>mc,values:()=>Sn,without:()=>hl});function _i(e){return Array.prototype.concat.apply([],e)}function wn(e){return e===void 0}function Ue(e){return e!==void 0}function Yn(e){return e==null}function q(e){return wa.call(e)==="[object Array]"}function Se(e){return wa.call(e)==="[object Object]"}function ne(e){return wa.call(e)==="[object Number]"}function Le(e){let t=wa.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function st(e){return wa.call(e)==="[object String]"}function Qd(e){if(!q(e))throw new Error("must supply array")}function dt(e,t){return!Yn(e)&&t0.call(e,t)}function re(e,t){let n=hc(t),r;return E(e,function(i,o){if(n(i,o))return r=i,!1}),r}function Sa(e,t){let n=hc(t),r=q(e)?-1:void 0;return E(e,function(i,o){if(n(i,o))return r=o,!1}),r}function Q(e,t){let n=hc(t),r=[];return E(e,function(i,o){n(i,o)&&r.push(i)}),r}function E(e,t){let n,r;if(wn(e))return;let i=q(e)?r0:n0;for(let o in e)if(dt(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function hl(e,t){if(wn(e))return[];Qd(e);let n=hc(t);return e.filter(function(r,i){return!n(r,i)})}function Ge(e,t,n){return E(e,function(r,i){n=t(n,r,i)}),n}function ln(e,t){return!!Ge(e,function(n,r,i){return n&&t(r,i)},!0)}function Lt(e,t){return!!re(e,t)}function je(e,t){let n=[];return E(e,function(r,i){n.push(t(r,i))}),n}function bi(e){return e&&Object.keys(e)||[]}function vl(e){return bi(e).length}function Sn(e){return je(e,t=>t)}function Vt(e,t,n={}){return t=yl(t),E(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function mc(e,...t){e=yl(e);let n={};return E(t,i=>Vt(i,e,n)),je(n,function(i,o){return i[0]})}function At(e,t){t=yl(t);let n=[];return E(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),je(n,r=>r.v)}function Ct(e){return function(t){return ln(e,function(n,r){return t[r]===n})}}function yl(e){return Le(e)?e:t=>t[e]}function hc(e){return Le(e)?e:t=>t===e}function n0(e){return e}function r0(e){return Number(e)}function Ca(e,t){let n,r,i,o;function a(l){let f=Date.now(),d=l?0:o+t-f;if(d>0)return s(d);e.apply(i,r),c()}function s(l){n=setTimeout(a,l)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function u(){n&&a(!0),c()}function p(...l){o=Date.now(),r=l,i=this,n||s(t)}return p.flush=u,p.cancel=c,p}function i0(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function tt(e,t){return e.bind(t)}function C(e,...t){return Object.assign(e,...t)}function _l(e,t,n){let r=e;return E(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];Ue(a)&&Yn(s)&&(s=r[i]=isNaN(+a)?{}:[]),wn(a)?wn(n)?delete r[i]:r[i]=n:r=s}),e}function o0(e,t,n){let r=e;return E(t,function(i){if(Yn(r))return r=void 0,!1;r=r[i]}),wn(r)?n:r}function mt(e,t){let n={},r=Object(e);return E(t,function(i){i in r&&(n[i]=e[i])}),n}function Nt(e,t){let n={},r=Object(e);return E(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Jd(e,...t){return t.length&&E(t,function(n){!n||!Se(n)||E(n,function(r,i){if(i==="__proto__")return;let o=e[i];Se(r)?(Se(o)||(o={}),e[i]=Jd(o,r)):e[i]=r})}),e}var wa,t0,gl,N=qE(()=>{wa=Object.prototype.toString,t0=Object.prototype.hasOwnProperty;gl=mc});var jx=dc((qee,Lx)=>{function vD(e){return["String","Boolean","Integer","Real"].includes(e)}Lx.exports=function e(t,n){let r=n.enter,i=n.leave,o=r&&r(t),a=t.$descriptor;o!==!1&&!a.isGeneric&&a.properties.filter(c=>!c.isAttr&&!c.isReference&&!vD(c.type)).forEach(c=>{if(c.name in t){let u=t[c.name];c.isMany?u.forEach(p=>{e(p,n)}):e(u,n)}}),i&&i(t)}});var Hx=dc((Kee,Fx)=>{var gD=jx(),{isArray:yD,isObject:_D,isFunction:bD}=(N(),XE(em)),_d=class{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,r){let i={id:t,message:n};r&&yD(r)&&(i={...i,path:r}),r&&_D(r)&&(i={...i,...r}),this.messages.push(i)}};Fx.exports=function({moddleRoot:t,rule:n}){let r=new _d({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:bD(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return gD(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var Gx=dc((Yee,zx)=>{var xD=Hx(),ED=(e,t)=>e,wD={0:"off",1:"warn",2:"error",3:"info"},SD="rule-error";function On(e){let{config:t={},resolver:n,transformRule:r=ED}=e||{};if(typeof n=="undefined")throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}zx.exports=On;On.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return xD({moddleRoot:t,rule:i,config:r}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(s){return console.error("rule <"+a+"> failed with error: ",s),[{message:s.message,category:SD}]}};On.prototype.resolveRule=function(e,t){let{pkg:n,ruleName:r}=this.parseRuleName(e),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then(a=>{if(!a)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(a(t),{pkg:n,ruleName:r})})};On.prototype.resolveConfig=function(e){let{pkg:t,configName:n}=this.parseConfigName(e),r=`${t}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[r]=this.normalizeConfig(o,t)})};On.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{let i=Object.entries(t).map(([o,a])=>{let{category:s,config:c}=this.parseRuleValue(a);return{name:o,category:s,config:c}}).filter(o=>o.category!=="off").map(o=>{let{name:a,config:s}=o;return this.resolveRule(a,s).then(function(c){return{...o,rule:c}})});return Promise.all(i)})};On.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t=="undefined"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(r=>this.resolveConfiguredRules(r)))).then(n=>{let r=this.normalizeConfig(e,"bpmnlint").rules;return[...n,r].reduce((o,a)=>({...o,...a}),{})})};On.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{let r={};return n.forEach(i=>{let{name:o}=i,a=this.applyRule(e,i);a.length&&(r[o]=a)}),r})};On.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=wD[t]||t,{config:n,category:t}};On.prototype.parseRuleName=function(e,t="bpmnlint"){let n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);let[r,i,o,a]=n;return o?{pkg:`${i?i+"/":""}${$x(o)}`,ruleName:a}:{pkg:t,ruleName:a}};On.prototype.parseConfigName=function(e){let t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);let[n,r,i,o]=t;return i?{pkg:`${r?r+"/":""}${$x(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};On.prototype.getSimplePackageName=function(e){let t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);let[n,r,i]=t;return`${r?r+"/":""}${CD(i)}`};On.prototype.normalizeConfig=function(e,t){let n=e.rules||{},r=Object.keys(n).reduce((i,o)=>{let a=n[o],{pkg:s,ruleName:c}=this.parseRuleName(o,t),u=s==="bpmnlint"?c:`${this.getSimplePackageName(s)}/${c}`;return i[u]=a,i},{});return{...e,rules:r}};function $x(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function CD(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Wx=dc((Xee,Vx)=>{var RD=Gx();Vx.exports={Linter:RD}});function B(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function ZE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ml={exports:{}},Zd;function QE(){if(Zd)return ml.exports;Zd=1;var e=ml.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var c=Math.pow(n,o),s=Math.floor(Math.random()*c).toString(n);a=s+a}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},ml.exports}var JE=QE(),e0=ZE(JE);function En(e){if(!(this instanceof En))return new En(e);e=e||[128,36,1],this._seed=e.length?e0.rack(e[0],e[1],e[2]):e}En.prototype.next=function(e){return this._seed(e||!0)};En.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};En.prototype.claim=function(e,t){this._seed.set(e,t||!0)};En.prototype.assigned=function(e){return this._seed.get(e)||!1};En.prototype.unclaim=function(e){delete this._seed.hats[e]};En.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};N();N();var ht={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};ht.td=ht.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];ht.option=ht.optgroup=[1,'<select multiple="multiple">',"</select>"];ht.thead=ht.tbody=ht.colgroup=ht.caption=ht.tfoot=[1,"<table>","</table>"];ht.polyline=ht.ellipse=ht.polygon=ht.circle=ht.text=ht.line=ht.path=ht.rect=ht.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ue(e,t=globalThis.document){var u;if(typeof e!="string")throw new TypeError("String expected");let n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);let r=(u=/<([\w:]+)/.exec(e))==null?void 0:u[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let p=t.createElement("html");p.innerHTML=e;let{lastChild:l}=p;return l.remove(),l}let[i,o,a]=Object.hasOwn(ht,r)?ht[r]:ht._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:p}=s;return p.remove(),p}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function a0(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function vt(e,...t){let n=e.style;return E(t,function(r){r&&E(r,function(i,o){n[o]=i})}),e}function nt(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var s0=Object.prototype.toString;function Ne(e){return new Fr(e)}function Fr(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Fr.prototype.add=function(e){return this.list.add(e),this};Fr.prototype.remove=function(e){return s0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Fr.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};Fr.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};Fr.prototype.array=function(){return Array.from(this.list)};Fr.prototype.has=Fr.prototype.contains=function(e){return this.list.contains(e)};function Hr(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Bn(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest=="function"&&r.closest(t)||null}function c0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vc={},tm;function u0(){if(tm)return vc;tm=1;var e,t,n;function r(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n=e!=="addEventListener"?"on":""}return vc.bind=function(i,o,a,s){return e||r(),i[e](n+o,a,s||!1),a},vc.unbind=function(i,o,a,s){return t||r(),i[t](n+o,a,s||!1),a},vc}var nm=u0(),p0=c0(nm),se=a0({__proto__:null,default:p0},[nm]),rm=["focus","blur"];function l0(e,t,n,r,i){return rm.indexOf(n)!==-1&&(i=!0),se.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Bn(a,t,!0),o.delegateTarget&&r.call(e,o)},i)}function f0(e,t,n,r){return rm.indexOf(t)!==-1&&(r=!0),se.unbind(e,t,n,r)}var bt={bind:l0,unbind:f0};function Ra(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function _e(e,t){return t=t||document,t.querySelector(e)}function xi(e,t){return t=t||document,t.querySelectorAll(e)}function Wt(e){e.parentNode&&e.parentNode.removeChild(e)}function d0(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function sm(e,t){return t.appendChild(d0(e,t))}function J(e,t){return sm(t,e),e}var El=2,cm={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":El,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":El,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function m0(e,t){return cm[t]?e.style[t]:e.getAttributeNS(null,t)}function um(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=cm[r];i?(i===El&&typeof n=="number"&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function h0(e,t){var n=Object.keys(t),r,i;for(r=0,i;i=n[r];r++)um(e,i,t[i])}function $(e,t,n){if(typeof t=="string")if(n!==void 0)um(e,t,n);else return m0(e,t);else h0(e,t);return e}var v0=Object.prototype.toString;function pe(e){return new $r(e)}function $r(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}$r.prototype.add=function(e){return this.list.add(e),this};$r.prototype.remove=function(e){return v0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};$r.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};$r.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};$r.prototype.array=function(){return Array.from(this.list)};$r.prototype.has=$r.prototype.contains=function(e){return this.list.contains(e)};function _r(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Sl(e){return e.cloneNode(!0)}var Cl={svg:"http://www.w3.org/2000/svg"},im='<svg xmlns="'+Cl.svg+'"';function pm(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Cl.svg)===-1&&(e=im+e.substring(4)):(e=im+">"+e+"</svg>",t=!0);var n=g0(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function g0(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function U(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=pm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Cl.svg,e),t&&$(n,t),n}var bl=null;function wl(){return bl===null&&(bl=U("svg")),bl}function om(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function lm(e,t,n,r,i,o){var a=wl().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return om(a,e);case 6:return om(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function so(e){return e?wl().createSVGTransformFromMatrix(e):wl().createSVGTransform()}var am=/([&<>]{1})/g,y0=/([&<>\n\r"]{1})/g,_0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function xl(e,t){function n(r,i){return _0[i]||i}return e.replace(t,n)}function fm(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(xl(e.textContent,am));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',xl(o.value,y0),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,r=a.length;n<r;++n)fm(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",xl(e.nodeValue,am),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function b0(e,t){var n=pm(t);if(_r(e),!!t){E0(n)||(n=n.documentElement);for(var r=w0(n.childNodes),i=0;i<r.length;i++)sm(r[i],e)}}function x0(e){for(var t=e.firstChild,n=[];t;)fm(t,n),t=t.nextSibling;return n.join("")}function E0(e){return e.nodeName==="#document-fragment"}function Rl(e,t){if(t!==void 0){try{b0(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}else return x0(e)}function w0(e){return Array.prototype.slice.call(e)}function Pe(e){var t=e.parentNode;return t&&t.removeChild(e),e}function S0(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function C0(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(S0(e,r))}function Ei(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),C0(n,t)),n.consolidate()}var R0=/^class[ {]/;function P0(e){return R0.test(e.toString())}function Al(e){return Array.isArray(e)}function Pl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function gc(...e){e.length===1&&Al(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var A0=/constructor\s*[^(]*\(\s*([^)]*)\)/m,T0=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,M0=/\/\*([^*]*)\*\//m;function D0(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(P0(e)?A0:T0);if(!t)return[];let n=t[1]||t[2];return n&&n.split(",").map(r=>{let i=r.match(M0);return(i&&i[1]||r).trim()})||[]}function Tl(e,t){let n=t||{get:function(x,b){if(r.push(x),b===!1)return null;throw s(`No provider for "${x}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(x){let b=r.join(" -> ");return r.length=0,new Error(b?`${x} (Resolving: ${b})`:x)};function c(x,b){if(!i[x]&&x.includes(".")){let R=x.split("."),A=c(R.shift());for(;R.length;)A=A[R.shift()];return A}if(Pl(o,x))return o[x];if(Pl(i,x)){if(r.indexOf(x)!==-1)throw r.push(x),s("Cannot resolve circular dependency!");return r.push(x),o[x]=i[x][0](i[x][1]),r.pop(),o[x]}return n.get(x,b)}function u(x,b){if(typeof b=="undefined"&&(b={}),typeof x!="function")if(Al(x))x=gc(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);let A=(x.$inject||D0(x)).map(O=>Pl(b,O)?b[O]:c(O));return{fn:x,dependencies:A}}function p(x){let{fn:b,dependencies:R}=u(x),A=Function.prototype.bind.call(b,null,...R);return new A}function l(x,b,R){let{fn:A,dependencies:O}=u(x,R);return A.apply(b,O)}function f(x){return gc(b=>x.get(b))}function d(x,b){if(b&&b.length){let R=Object.create(null),A=Object.create(null),O=[],T=[],I=[],L,W,z,K;for(let ve in i)L=i[ve],b.indexOf(ve)!==-1&&(L[2]==="private"?(W=O.indexOf(L[3]),W===-1?(z=L[3].createChild([],b),K=f(z),O.push(L[3]),T.push(z),I.push(K),R[ve]=[K,ve,"private",z]):R[ve]=[I[W],ve,"private",T[W]]):R[ve]=[L[2],L[1]],A[ve]=!0),(L[2]==="factory"||L[2]==="type")&&L[1].$scope&&b.forEach(Jt=>{L[1].$scope.indexOf(Jt)!==-1&&(R[ve]=[L[2],L[1]],A[Jt]=!0)});b.forEach(ve=>{if(!A[ve])throw new Error('No provider for "'+ve+'". Cannot use provider from the parent!')}),x.unshift(R)}return new Tl(x,a)}let m={factory:l,type:p,value:function(x){return x}};function g(x,b){let R=x.__init__||[];return function(){R.forEach(A=>{typeof A=="string"?b.get(A):b.invoke(A)})}}function v(x){let b=x.__exports__;if(b){let R=x.__modules__,A=Object.keys(x).reduce((W,z)=>(z!=="__exports__"&&z!=="__modules__"&&z!=="__init__"&&z!=="__depends__"&&(W[z]=x[z]),W),Object.create(null)),O=(R||[]).concat(A),T=d(O),I=gc(function(W){return T.get(W)});b.forEach(function(W){i[W]=[I,W,"private",T]});let L=(x.__init__||[]).slice();return L.unshift(function(){T.init()}),x=Object.assign({},x,{__init__:L}),g(x,T)}return Object.keys(x).forEach(function(R){if(R==="__init__"||R==="__depends__")return;let A=x[R];if(A[2]==="private"){i[R]=A;return}let O=A[0],T=A[1];i[R]=[m[O],k0(O,T),O]}),g(x,a)}function w(x,b){return x.indexOf(b)!==-1||(x=(b.__depends__||[]).reduce(w,x),x.indexOf(b)!==-1)?x:x.concat(b)}function S(x){let b=x.reduce(w,[]).map(v),R=!1;return function(){R||(R=!0,b.forEach(A=>A()))}}this.get=c,this.invoke=l,this.instantiate=p,this.createChild=d,this.init=S(e)}function k0(e,t){return e!=="value"&&Al(t)&&(t=gc(t.slice())),t}var N0=1e3;function Cn(e,t){var n=this;t=t||N0,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}Cn.prototype.canRender=function(e){};Cn.prototype.drawShape=function(e,t){};Cn.prototype.drawConnection=function(e,t){};Cn.prototype.getShapePath=function(e){};Cn.prototype.getConnectionPath=function(e){};N();function br(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function O0(e){return["M",e.x,e.y]}function Ml(e){return["L",e.x,e.y]}function B0(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function I0(e,t){let n=e.length,r=[O0(e[0])];for(let i=1;i<n;i++){let o=e[i-1],a=e[i],s=e[i+1];if(!s||!t){r.push(Ml(a));continue}let c=Math.min(t,Dl(a.x-o.x,a.y-o.y),Dl(s.x-a.x,s.y-a.y));if(!c){r.push(Ml(a));continue}let u=yc(a,o,c),p=yc(a,o,c*.5),l=yc(a,s,c),f=yc(a,s,c*.5);r.push(Ml(u)),r.push(B0(p,f,l))}return r}function yc(e,t,n){let r=t.x-e.x,i=t.y-e.y,o=Dl(r,i),a=n/o;return{x:e.x+r*a,y:e.y+i*a}}function Dl(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function Xn(e,t,n){ne(t)&&(n=t,t=null),t||(t={});let r=U("path",t);return ne(n)&&(r.dataset.cornerRadius=String(n)),Pa(r,e)}function Pa(e,t){let n=parseInt(e.dataset.cornerRadius,10)||0;return $(e,{d:br(I0(t,n))}),e}N();N();function zr(e){return Q(e,function(t){return!re(e,function(n){return n!==t&&mm(t,n)})})}function mm(e,t){if(t){if(e===t)return t;if(e.parent)return mm(e.parent,t)}}function dm(e,t,n){var r=!n||e.indexOf(t)===-1;return r&&e.push(t),r}function In(e,t,n){n=n||0,q(e)||(e=[e]),E(e,function(r,i){var o=t(r,i,n);q(o)&&o.length&&In(o,t,n+1)})}function Ta(e,t,n){var r=[],i=[];return In(e,function(o,a,s){dm(r,o,t);var c=o.children;if((n===-1||s<n)&&c&&dm(i,c,t))return c}),r}function Zn(e,t){return Ta(e,!t,-1)}function hm(e,t,n){wn(t)&&(t=!0),Se(t)&&(n=t,t=!0),n=n||{};var r=Aa(n.allShapes),i=Aa(n.allConnections),o=Aa(n.enclosedElements),a=Aa(n.enclosedConnections),s=Aa(n.topLevel,t&&Vt(e,function(p){return p.id}));function c(p){s[p.source.id]&&s[p.target.id]&&(s[p.id]=[p]),r[p.source.id]&&r[p.target.id]&&(a[p.id]=o[p.id]=p),i[p.id]=p}function u(p){if(o[p.id]=p,p.waypoints)a[p.id]=i[p.id]=p;else return r[p.id]=p,E(p.incoming,c),E(p.outgoing,c),p.children}return In(e,u),{allShapes:r,allConnections:i,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Ce(e,t){t=!!t,q(e)||(e=[e]);var n,r,i,o;return E(e,function(a){var s=a;a.waypoints&&!t&&(s=Ce(a.waypoints,!0));var c=s.x,u=s.y,p=s.height||0,l=s.width||0;(c<n||n===void 0)&&(n=c),(u<r||r===void 0)&&(r=u),(c+l>i||i===void 0)&&(i=c+l),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:r,height:o-r,width:i-n}}function wi(e,t){var n={};return E(e,function(r){var i=r;i.waypoints&&(i=Ce(i)),!ne(t.y)&&i.x>t.x&&(n[r.id]=r),!ne(t.x)&&i.y>t.y&&(n[r.id]=r),i.x>t.x&&i.y>t.y&&(ne(t.width)&&ne(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y||!ne(t.width)||!ne(t.height))&&(n[r.id]=r)}),n}function _c(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function bc(e){return!!(e&&e.isFrame)}function Aa(e,t){return C({},e||{},t||{})}var L0=1;function Qn(e,t){Cn.call(this,e,L0),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}B(Qn,Cn);Qn.prototype.canRender=function(){return!0};Qn.prototype.drawShape=function(t,n,r){var i=U("rect");return $(i,{x:0,y:0,width:n.width||0,height:n.height||0}),bc(n)?$(i,C({},this.FRAME_STYLE,r||{})):$(i,C({},this.SHAPE_STYLE,r||{})),J(t,i),i};Qn.prototype.drawConnection=function(t,n,r){var i=Xn(n.waypoints,C({},this.CONNECTION_STYLE,r||{}));return J(t,i),i};Qn.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,o=t.height,a=[["M",n,r],["l",i,0],["l",0,o],["l",-i,0],["z"]];return br(a)};Qn.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,o=[];for(r=0;i=n[r];r++)i=i.original||i,o.push([r===0?"M":"L",i.x,i.y]);return br(o)};Qn.$inject=["eventBus","styles"];N();function kl(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var o=this.style(r,i);return C(o,{class:n})},this.style=function(n,r){!q(n)&&!r&&(r=n,n=[]);var i=Ge(n,function(o,a){return C(o,e[a]||{})},{});return r?C(i,r):i},this.computeStyle=function(n,r,i){return q(r)||(i=r,r=[]),t.style(r||[],C({},i,n||{}))}}var vm={__init__:["defaultRenderer"],defaultRenderer:["type",Qn],styles:["type",kl]};N();function Oe(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Ae(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function co(e,t){return!e||!t?-1:e.indexOf(t)}N();N();function Gr(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function uo(e,t,n,r){if(typeof r=="undefined"&&(r=5),!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Gr(e,t);return Math.abs(i/o)<=r}var j0=2;function en(e,t){var n=Array.from(arguments).flat();let r={x:"v",y:"h"};for(let[i,o]of Object.entries(r))if(F0(i,n))return o;return!1}function F0(e,t){let n=t[0];return ln(t,function(r){return Math.abs(n[e]-r[e])<=j0})}function Nl(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Ma(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var H0=/,?([a-z]),?/gi,gm=parseFloat,pt=Math,Vr=pt.PI,Jn=pt.min,er=pt.max,ym=pt.pow,Ur=pt.abs,$0=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,z0=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,_m=Array.isArray||function(e){return e instanceof Array};function G0(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function V0(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function W0(e){function t(){var n=Array.prototype.slice.call(arguments,0),r=n.join("\u2400"),i=t.cache=t.cache||{},o=t.count=t.count||[];return G0(i,r)?(V0(o,r),i[r]):(o.length>=1e3&&delete i[o.shift()],o.push(r),i[r]=e(...arguments),i[r])}return t}function U0(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace($0,function(r,i,o){var a=[],s=i.toLowerCase();for(o.replace(z0,function(c,u){u&&a.push(+u)}),s=="m"&&a.length>2&&(n.push([i,...a.splice(0,2)]),s="l",i=i=="m"?"l":"L");a.length>=t[s]&&(n.push([i,...a.splice(0,t[s])]),!!t[s]););}),n.toString=Bl,n}function q0(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(typeof r=="string"&&r!==r.toUpperCase())return!1}return!0}function K0(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(r!=="M"&&r!=="C")return!1}return!0}function Ol(e,t,n,r){return arguments.length===1&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function Bl(){return this.join(",").replace(H0,"$1")}function Y0(e){for(var t=new Array(e.length),n=0,r=e.length;n<r;n++)for(var i=e[n],o=t[n]=new Array(i.length),a=0,s=i.length;a<s;a++)o[a]=i[a];return t.toString=Bl,t}function bm(e,t,n,r,i,o,a,s,c){var u=1-c,p=ym(u,3),l=ym(u,2),f=c*c,d=f*c,m=p*e+l*3*c*n+u*3*c*c*i+d*a,g=p*t+l*3*c*r+u*3*c*c*o+d*s;return{x:Ec(m),y:Ec(g)}}function xm(e){var t=tw(...e);return Ol(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Wr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function X0(e,t){return e=Ol(e),t=Ol(t),Wr(t,e.x,e.y)||Wr(t,e.x2,e.y)||Wr(t,e.x,e.y2)||Wr(t,e.x2,e.y2)||Wr(e,t.x,t.y)||Wr(e,t.x2,t.y)||Wr(e,t.x,t.y2)||Wr(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Em(e,t,n,r,i){var o=-3*t+9*n-9*r+3*i,a=e*o+6*t-12*n+6*r;return e*a-3*t+3*n}function wm(e,t,n,r,i,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var u=c/2,p=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,m=0;m<p;m++){var g=u*l[m]+u,v=Em(g,e,n,i,a),w=Em(g,t,r,o,s),S=v*v+w*w;d+=f[m]*pt.sqrt(S)}return u*d}function Z0(e,t,n,r,i,o,a,s){if(!(er(e,n)<Jn(i,a)||Jn(e,n)>er(i,a)||er(t,r)<Jn(o,s)||Jn(t,r)>er(o,s))){var c=(e*r-t*n)*(i-a)-(e-n)*(i*s-o*a),u=(e*r-t*n)*(o-s)-(t-r)*(i*s-o*a),p=(e-n)*(o-s)-(t-r)*(i-a);if(p){var l=Ec(c/p),f=Ec(u/p),d=+l.toFixed(2),m=+f.toFixed(2);if(!(d<+Jn(e,n).toFixed(2)||d>+er(e,n).toFixed(2)||d<+Jn(i,a).toFixed(2)||d>+er(i,a).toFixed(2)||m<+Jn(t,r).toFixed(2)||m>+er(t,r).toFixed(2)||m<+Jn(o,s).toFixed(2)||m>+er(o,s).toFixed(2)))return{x:l,y:f}}}}function Ec(e){return Math.round(e*1e11)/1e11}function Q0(e,t,n){var r=xm(e),i=xm(t);if(!X0(r,i))return n?0:[];var o=wm(...e),a=wm(...t),s=Sm(e)?1:~~(o/5)||1,c=Sm(t)?1:~~(a/5)||1,u=new Array(s+1),p=new Array(c+1),l={},f=n?0:[],d,m;for(d=0;d<s+1;d++){var g=bm(...e,d/s);u[d]={x:g.x,y:g.y,t:d/s}}for(d=0;d<c+1;d++)g=bm(...t,d/c),p[d]={x:g.x,y:g.y,t:d/c};for(d=0;d<s;d++)for(m=0;m<c;m++){var v=u[d],w=u[d+1],S=p[m],x=p[m+1],b=Ur(w.x-v.x)<.01?"y":"x",R=Ur(x.x-S.x)<.01?"y":"x",A=Z0(v.x,v.y,w.x,w.y,S.x,S.y,x.x,x.y),O;if(A){if(O=A.x.toFixed(9)+"#"+A.y.toFixed(9),l[O])continue;l[O]=!0;var T=v.t+Ur((A[b]-v[b])/(w[b]-v[b]))*(w.t-v.t),I=S.t+Ur((A[R]-S[R])/(x[R]-S[R]))*(x.t-S.t);T>=0&&T<=1&&I>=0&&I<=1&&(n?f++:f.push({x:A.x,y:A.y,t1:T,t2:I}))}}return f}function Da(e,t,n){e=Rm(e),t=Rm(t);for(var r,i,o,a,s,c,u,p,l,f,d=n?0:[],m=0,g=e.length;m<g;m++){var v=e[m];if(v[0]=="M")r=s=v[1],i=c=v[2];else{v[0]=="C"?(l=[r,i,...v.slice(1)],r=l[6],i=l[7]):(l=[r,i,r,i,s,c,s,c],r=s,i=c);for(var w=0,S=t.length;w<S;w++){var x=t[w];if(x[0]=="M")o=u=x[1],a=p=x[2];else{x[0]=="C"?(f=[o,a,...x.slice(1)],o=f[6],a=f[7]):(f=[o,a,o,a,u,p,u,p],o=u,a=p);var b=Q0(l,f,n);if(n)d+=b;else{for(var R=0,A=b.length;R<A;R++)b[R].segment1=m,b[R].segment2=w,b[R].bez1=l,b[R].bez2=f;d=d.concat(b)}}}}}return d}function J0(e){return _m(e)&&_m(e[0])}function ew(e){if(q0(e))return e;var t=new Array(e.length),n=0,r=0,i=0,o=0,a=0,s;e[0][0]=="M"&&(n=+e[0][1],r=+e[0][2],i=n,o=r,a++,t[0]=["M",n,r]);for(var c,u,p=a,l=e.length;p<l;p++){if(u=e[p],s=u[0],t[p]=c=new Array(u.length),s!=s.toUpperCase())switch(c[0]=s.toUpperCase(),c[0]){case"A":c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5],c[6]=+u[6]+n,c[7]=+u[7]+r;break;case"V":c[1]=+u[1]+r;break;case"H":c[1]=+u[1]+n;break;case"M":i=+u[1]+n,o=+u[2]+r;default:for(var f=1,d=u.length;f<d;f++)c[f]=+u[f]+(f%2?n:r)}else for(var m=0,g=u.length;m<g;m++)c[m]=u[m];switch(s=s.toUpperCase(),c[0]){case"Z":n=+i,r=+o;break;case"H":n=c[1];break;case"V":r=c[1];break;case"M":i=c[c.length-2],o=c[c.length-1];default:n=c[c.length-2],r=c[c.length-1]}}return t.toString=Bl,t}function Sm(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function xc(e,t,n,r){return[e,t,n,r,n,r]}function Cm(e,t,n,r,i,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*r,a*i+s*n,a*o+s*r,i,o]}function Pm(e,t,n,r,i,o,a,s,c,u){var p=Vr*120/180,l=Vr/180*(+i||0),f=[],d,m=W0(function(P,_,y){var M=P*pt.cos(y)-_*pt.sin(y),D=P*pt.sin(y)+_*pt.cos(y);return{x:M,y:D}});if(u)O=u[0],T=u[1],R=u[2],A=u[3];else{d=m(e,t,-l),e=d.x,t=d.y,d=m(s,c,-l),s=d.x,c=d.y;var g=(e-s)/2,v=(t-c)/2,w=g*g/(n*n)+v*v/(r*r);w>1&&(w=pt.sqrt(w),n=w*n,r=w*r);var S=n*n,x=r*r,b=(o==a?-1:1)*pt.sqrt(Ur((S*x-S*v*v-x*g*g)/(S*v*v+x*g*g))),R=b*n*v/r+(e+s)/2,A=b*-r*g/n+(t+c)/2,O=pt.asin(((t-A)/r).toFixed(9)),T=pt.asin(((c-A)/r).toFixed(9));O=e<R?Vr-O:O,T=s<R?Vr-T:T,O<0&&(O=Vr*2+O),T<0&&(T=Vr*2+T),a&&O>T&&(O=O-Vr*2),!a&&T>O&&(T=T-Vr*2)}var I=T-O;if(Ur(I)>p){var L=T,W=s,z=c;T=O+p*(a&&T>O?1:-1),s=R+n*pt.cos(T),c=A+r*pt.sin(T),f=Pm(s,c,n,r,i,0,a,W,z,[T,L,R,A])}I=T-O;var K=pt.cos(O),ve=pt.sin(O),Jt=pt.cos(T),ke=pt.sin(T),ye=pt.tan(I/4),he=4/3*n*ye,we=4/3*r*ye,Ie=[e,t],Ze=[e+he*ve,t-we*K],H=[s+he*ke,c-we*Jt],G=[s,c];if(Ze[0]=2*Ie[0]-Ze[0],Ze[1]=2*Ie[1]-Ze[1],u)return[Ze,H,G].concat(f);f=[Ze,H,G].concat(f).join().split(",");for(var oe=[],xe=0,Gt=f.length;xe<Gt;xe++)oe[xe]=xe%2?m(f[xe-1],f[xe],l).y:m(f[xe],f[xe+1],l).x;return oe}function tw(e,t,n,r,i,o,a,s){for(var c=[],u=[[],[]],p,l,f,d,m,g,v,w,S=0;S<2;++S){if(S==0?(l=6*e-12*n+6*i,p=-3*e+9*n-9*i+3*a,f=3*n-3*e):(l=6*t-12*r+6*o,p=-3*t+9*r-9*o+3*s,f=3*r-3*t),Ur(p)<1e-12){if(Ur(l)<1e-12)continue;d=-f/l,0<d&&d<1&&c.push(d);continue}v=l*l-4*f*p,w=pt.sqrt(v),!(v<0)&&(m=(-l+w)/(2*p),0<m&&m<1&&c.push(m),g=(-l-w)/(2*p),0<g&&g<1&&c.push(g))}for(var x=c.length,b=x,R;x--;)d=c[x],R=1-d,u[0][x]=R*R*R*e+3*R*R*d*n+3*R*d*d*i+d*d*d*a,u[1][x]=R*R*R*t+3*R*R*d*r+3*R*d*d*o+d*d*d*s;return u[0][b]=e,u[1][b]=t,u[0][b+1]=a,u[1][b+1]=s,u[0].length=u[1].length=b+2,{x0:Jn(...u[0]),y0:Jn(...u[1]),x1:er(...u[0]),y1:er(...u[1])}}function Rm(e){if(J0(e)||(e=U0(e)),K0(e))return e;for(var t=Y0(ew(e)),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,d,m){var g,v;if(!f)return["C",d.x,d.y,d.x,d.y,d.x,d.y];switch(!(f[0]in{T:1,Q:1})&&(d.qx=d.qy=null),f[0]){case"M":d.X=f[1],d.Y=f[2];break;case"A":f=["C",...Pm(d.x,d.y,...f.slice(1))];break;case"S":m=="C"||m=="S"?(g=d.x*2-d.bx,v=d.y*2-d.by):(g=d.x,v=d.y),f=["C",g,v,...f.slice(1)];break;case"T":m=="Q"||m=="T"?(d.qx=d.x*2-d.qx,d.qy=d.y*2-d.qy):(d.qx=d.x,d.qy=d.y),f=["C",...Cm(d.x,d.y,d.qx,d.qy,f[1],f[2])];break;case"Q":d.qx=f[1],d.qy=f[2],f=["C",...Cm(d.x,d.y,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...xc(d.x,d.y,f[1],f[2])];break;case"H":f=["C",...xc(d.x,d.y,f[1],d.y)];break;case"V":f=["C",...xc(d.x,d.y,d.x,f[1])];break;case"Z":f=["C",...xc(d.x,d.y,d.X,d.Y)];break}return f},i=function(f,d){if(f[d].length>7){f[d].shift();for(var m=f[d];m.length;)o[d]="A",f.splice(d++,0,["C",...m.splice(0,6)]);f.splice(d,1),u=t.length}},o=[],a="",s="",c=0,u=t.length;c<u;c++){t[c]&&(a=t[c][0]),a!="C"&&(o[c]=a,c&&(s=o[c-1])),t[c]=r(t[c],n,s),o[c]!="A"&&a=="C"&&(o[c]="C"),i(t,c);var p=t[c],l=p.length;n.x=p[l-2],n.y=p[l-1],n.bx=gm(p[l-4])||n.x,n.by=gm(p[l-3])||n.y}return t}N();function de(e){return Se(e)&&dt(e,"waypoints")}function ee(e){return Se(e)&&dt(e,"labelTarget")}function wc(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Rn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Z(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Si(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function nw(e){return Rn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function rw(e){for(var t=e.waypoints,n=t.reduce(function(u,p,l){var f=t[l-1];if(f){var d=u[u.length-1],m=d&&d.endLength||0,g=ow(f,p);u.push({start:f,end:p,startLength:m,endLength:m+g,length:g})}return u},[]),r=n.reduce(function(u,p){return u+p.length},0),i=r/2,o=0,a=n[o];a.endLength<i;)a=n[++o];var s=(i-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function X(e){return de(e)?rw(e):nw(e)}function He(e,t,n){n=n||0,Se(n)||(n={x:n,y:n});var r=Z(e),i=Z(t),o=r.bottom+n.y<=i.top,a=r.left-n.x>=i.right,s=r.top-n.y>=i.bottom,c=r.right+n.x<=i.left,u=o?"top":s?"bottom":null,p=c?"left":a?"right":null;return p&&u?u+"-"+p:p||u||"intersect"}function qr(e,t,n){var r=iw(e,t);return r.length===1||r.length===2&&Gr(r[0],r[1])<1?Rn(r[0]):r.length>1?(r=At(r,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),Rn(r[n?0:r.length-1])):null}function iw(e,t){return Da(e,t)}function Am(e){e=e.slice();for(var t=0,n,r,i;e[t];)n=e[t],r=e[t-1],i=e[t+1],Gr(n,i)===0||uo(r,i,n)?e.splice(t,1):t++;return e}function ow(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Sc(e,t){return Math.round(e*t)/t}function Tm(e){return ne(e)?e+"px":e}function aw(e){for(;e.parent;)e=e.parent;return e}function sw(e){e=C({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),vt(n,{position:"relative",overflow:"hidden",width:Tm(e.width),height:Tm(e.height)}),t.appendChild(n),n}function Mm(e,t,n){let r=U("g");pe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var cw="base",Dm=0,uw=1,pw={shape:["x","y","width","height"],connection:["waypoints"]};function le(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}le.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];le.prototype._init=function(e){let t=this._eventBus,n=this._container=sw(e),r=this._svg=U("svg");$(r,{width:"100%",height:"100%"}),nt(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),J(n,r);let i=this._viewport=Mm(r,"viewport");e.deferUpdate&&(this._viewboxChanged=Ca(tt(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};le.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};le.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};le.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=_c(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};le.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};le.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};le.prototype.isFocused=function(){return this._focused};le.prototype.getDefaultLayer=function(){return this.getLayer(cw,Dm)};le.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};le.prototype._getChildIndex=function(e){return Ge(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};le.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=uw);let n=this._getChildIndex(t);return{group:Mm(this._viewport,"layer-"+e,n),index:t,visible:!0}};le.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};le.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(Pe(n),t.visible=!1),n};le.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Pe(t.group))};le.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};le.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(aw(e))||{}).rootElement:void 0};le.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};le.prototype._findPlaneForRoot=function(e){return re(this._planes,function(t){return t.rootElement===e})};le.prototype.getContainer=function(){return this._container};le.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(E([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),pe(i).add(t)):(e.markers.delete(t),pe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};le.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};le.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};le.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};le.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};le.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};le.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,Dm);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};le.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};le.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};le.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};le.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};le.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};le.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=pw[e];if(!ln(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};le.prototype._setParent=function(e,t,n){Ae(t.children,e,n),e.parent=t};le.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};le.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};le.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};le.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Oe(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};le.prototype.removeShape=function(e){return this._removeElement(e,"shape")};le.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};le.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};le.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};le.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};le.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,s,c,u;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let p=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Ei(t,p)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Ei(t),i=a?a.matrix:lm(),s=Sc(i.a,1e3),c=Sc(-i.e||0,1e3),u=Sc(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:u?u/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};le.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=C({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),km(t,n)}),{x:n.e,y:n.f}};le.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Ce(e),o=Z(i),a=this.viewbox(),s=this.zoom(),c,u;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;let p=Z(a);if(!(i.width<a.width&&i.height<a.height))c=i.x-a.x,u=i.y-a.y;else{let f=Math.max(0,o.right-p.right),d=Math.min(0,o.left-p.left),m=Math.max(0,o.bottom-p.bottom),g=Math.min(0,o.top-p.top);c=f||d,u=m||g}this.scroll({dx:-c*s,dy:-u*s})};le.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,r;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),Sc(r.a,1e3)};function km(e,t){let n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}le.prototype._fitViewport=function(e){let t=this.viewbox(),n=t.outer,r=t.inner,i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};le.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,s,c,u,p;c=r.getCTM();let l=c.a;return t?(a=C(o,t),s=a.matrixTransform(c.inverse()),u=i.translate(s.x,s.y).scale(1/l*e).translate(-s.x,-s.y),p=c.multiply(u)):p=i.scale(e),km(this._viewport,p),p};le.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};le.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};le.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var po="data-element-id";function Ut(e){this._elements={},this._eventBus=e}Ut.$inject=["eventBus"];Ut.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),$(t,po,r),n&&$(n,po,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Ut.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&($(r.gfx,po,""),r.secondaryGfx&&$(r.secondaryGfx,po,""),delete t[n])};Ut.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};Ut.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&$(t,po,r),t};Ut.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&$(e,po);var n=this._elements[t];return n&&n.element};Ut.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Ut.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i],a=o.element,s=o.gfx;if(e(a,s))return a}};Ut.prototype.getAll=function(){return this.filter(function(e){return e})};Ut.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})};Ut.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)};Ut.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};N();function lw(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,i,r)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a=="undefined"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function fw(e){return e.__refs_collection===!0}function dw(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Nm(e,t,n){var r=lw(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(i){e.set(i,t.inverse,n)})}function mw(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(o){if(o!==i){var a=i;i=null,a&&e.unset(a,r,n),i=o,e.set(i,r,n)}}})}function fn(e,t){if(!(this instanceof fn))return new fn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}fn.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Nm(this,t,e):mw(this,t,e)};fn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return fw(n)||Nm(this,t,e),n};fn.prototype.ensureBound=function(e,t){dw(e,t)||this.bind(e,t)};fn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};fn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Il=new fn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Bm=new fn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Om=new fn({name:"attachers",collection:!0},{name:"host"}),Im=new fn({name:"outgoing",collection:!0},{name:"source"}),Lm=new fn({name:"incoming",collection:!0},{name:"target"});function lo(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Il.bind(this,"parent"),Bm.bind(this,"labels"),Im.bind(this,"outgoing"),Lm.bind(this,"incoming")}function ka(){lo.call(this),Il.bind(this,"children"),Om.bind(this,"host"),Om.bind(this,"attachers")}B(ka,lo);function jm(){lo.call(this),Il.bind(this,"children")}B(jm,ka);function Fm(){ka.call(this),Bm.bind(this,"labelTarget")}B(Fm,ka);function Hm(){lo.call(this),Im.bind(this,"source"),Lm.bind(this,"target")}B(Hm,lo);var hw={connection:Hm,shape:ka,label:Fm,root:jm};function $m(e,t){var n=hw[e];if(!n)throw new Error("unknown type: <"+e+">");return C(new n,t)}function zm(e){return e instanceof lo}N();function Pn(){this._uid=12}Pn.prototype.createRoot=function(e){return this.create("root",e)};Pn.prototype.createLabel=function(e){return this.create("label",e)};Pn.prototype.createShape=function(e){return this.create("shape",e)};Pn.prototype.createConnection=function(e){return this.create("connection",e)};Pn.prototype.create=function(e,t){return t=C({},t||{}),t.id||(t.id=e+"_"+this._uid++),$m(e,t)};N();var Cc="__fn",Gm=1e3,vw=Array.prototype.slice;function jt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}jt.prototype.on=function(e,t,n,r){if(e=q(e)?e:[e],Le(t)&&(r=n,n=t,t=Gm),!ne(t))throw new Error("priority must be a number");var i=n;r&&(i=tt(n,r),i[Cc]=n[Cc]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};jt.prototype.once=function(e,t,n,r){var i=this;if(Le(t)&&(r=n,n=t,t=Gm),!ne(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[Cc]=n,this.on(e,t,o)};jt.prototype.off=function(e,t){e=q(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};jt.prototype.createEvent=function(e){var t=new Na;return t.init(e),t};jt.prototype.fire=function(e,t){var n,r,i,o;if(o=vw.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof Na?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};jt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};jt.prototype._destroy=function(){this._listeners={}};jt.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};jt.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=gw(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};jt.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t};jt.prototype._getListeners=function(e){return this._listeners[e]};jt.prototype._setListeners=function(e,t){this._listeners[e]=t};jt.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,o;if(!t){this._setListeners(e,null);return}for(;n;)r=n.next,o=n.callback,(o===t||o[Cc]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function Na(){}Na.prototype.stopPropagation=function(){this.cancelBubble=!0};Na.prototype.preventDefault=function(){this.defaultPrevented=!0};Na.prototype.init=function(e){C(this,e||{})};function gw(e,t){return e.apply(null,t)}N();function Ln(e){return e.childNodes[0]}function Vm(e){return e.parentNode.childNodes[1]}function fo(e,t,n,r,i){var o=so();o.setTranslate(t,n);var a=so();a.setRotate(r||0,0,0);var s=so();s.setScale(i||1,i||1),Ei(e,[o,a,s])}function Fe(e,t,n){var r=so();r.setTranslate(t,n),Ei(e,r)}function Rc(e,t){var n=so();n.setRotate(t,0,0),Ei(e,n)}function qt(e,t){this._eventBus=e,this._elementRegistry=t}qt.$inject=["eventBus","elementRegistry"];qt.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Vm(t),n||(n=U("g"),pe(n).add("djs-children"),J(t.parentNode,n))):n=t,n};qt.prototype._clear=function(e){var t=Ln(e);return Hr(t),t};qt.prototype._createContainer=function(e,t,n,r){var i=U("g");pe(i).add("djs-group"),typeof n!="undefined"?Wm(i,t,t.childNodes[n]):J(t,i);var o=U("g");pe(o).add("djs-element"),pe(o).add("djs-"+e),r&&pe(o).add("djs-frame"),J(i,o);var a=U("g");return pe(a).add("djs-visual"),J(o,a),o};qt.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,bc(t))};qt.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,r;r=Ge(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),E(r,function(i){var o=i.children;if(o){var a=t._getChildrenContainer(i);E(o.slice().reverse(),function(s){var c=n.getGraphics(s);Wm(c.parentNode,a)})}})};qt.prototype.drawShape=function(e,t,n={}){var r=this._eventBus;return r.fire("render.shape",{gfx:e,element:t,attrs:n})};qt.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)};qt.prototype.drawConnection=function(e,t,n={}){var r=this._eventBus;return r.fire("render.connection",{gfx:e,element:t,attrs:n})};qt.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)};qt.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e==="shape")this.drawShape(r,t),Fe(n,t.x,t.y);else if(e==="connection")this.drawConnection(r,t);else throw new Error("unknown type: "+e);t.hidden?$(n,"display","none"):$(n,"display","block")}};qt.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Pe(t.parentNode)};function Wm(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}var Um={__depends__:[vm],__init__:["canvas"],canvas:["type",le],elementRegistry:["type",Ut],elementFactory:["type",Pn],eventBus:["type",jt],graphicsFactory:["type",qt]};function yw(e){var t=new Tl(e);return t.init(),t}function _w(e){e=e||{};var t={config:["value",e]},n=[t,Um].concat(e.modules||[]);return yw(n)}function tr(e,t){this._injector=t||_w(e),this.get("eventBus").fire("diagram.init")}tr.prototype.get=function(e,t){return this._injector.get(e,t)};tr.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)};tr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")};tr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};N();N();function Fl(){}Fl.prototype.get=function(e){return this.$model.properties.get(this,e)};Fl.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function Km(e,t){this.model=e,this.properties=t}Km.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(Fl.prototype);E(e.properties,function(a){!a.isMany&&a.default!==void 0&&(r[a.name]=a.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(a){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),E(a,tt(function(s,c){this.set(c,s)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var bw={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ym={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Pc(e,t){var n=Ym[e];return n?n(t):t}function Ll(e){return!!bw[e]}function Hl(e){return!!Ym[e]}function Tt(e,t){var n=e.split(/:/),r,i;if(n.length===1)r=e,i=t;else if(n.length===2)r=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function dn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}dn.prototype.build=function(){return mt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};dn.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};dn.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t};dn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Tt(i[0],r),a=Tt(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};dn.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};dn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};dn.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};dn.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};dn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};dn.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};dn.prototype.hasProperty=function(e){return this.propertiesByName[e]};dn.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(E(e.properties,tt(function(o){o=C({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Kr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,E(e,tt(this.registerPackage,this))}Kr.prototype.getPackage=function(e){return this.packageMap[e]};Kr.prototype.getPackages=function(){return this.packages};Kr.prototype.registerPackage=function(e){e=C({},e);var t=this.packageMap;qm(t,e,"prefix"),qm(t,e,"uri"),E(e.types,tt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Kr.prototype.registerType=function(e,t){e=C({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:C(e.meta||{})});var n=Tt(e.name,t.prefix),r=n.name,i={};E(e.properties,tt(function(o){var a=Tt(o.name,n.prefix),s=a.name;Ll(o.type)||(o.type=Tt(o.type,a.prefix).name),C(o,{ns:a,name:s}),i[s]=o},this)),C(e,{ns:n,name:r,propertiesByName:i}),E(e.extends,tt(function(o){var a=Tt(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Kr.prototype.mapTypes=function(e,t,n){var r=Ll(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,u){var p=Tt(c,Ll(c)?"":e.prefix);i.mapTypes(p,t,u)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");E(r.superClass,n?a:s),t(r,!n),E(r.traits,a)};Kr.prototype.getEffectiveDescriptor=function(e){var t=Tt(e),n=new dn(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Kr.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function qm(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Ci(e){this.model=e}Ci.prototype.set=function(e,t,n){if(!st(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;xw(n)?r?delete e[i]:delete e.$attrs[jl(t)]:r?i in e?e[i]=n:Xm(e,r,n):e.$attrs[jl(t)]=n};Ci.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[jl(t)];var r=n.name;return!e[r]&&n.isMany&&Xm(e,n,[]),e[r]};Ci.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=C({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Ci.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ci.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ci.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function xw(e){return typeof e=="undefined"}function Xm(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function jl(e){return e.replace(/^:/,"")}function tn(e,t={}){this.properties=new Ci(this),this.factory=new Km(this,this.properties),this.registry=new Kr(e,this.properties),this.typeCache={},this.config=t}tn.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};tn.prototype.getType=function(e){var t=this.typeCache,n=st(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};tn.prototype.createAny=function(e,t,n){var r=Tt(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){_l(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),E(n,function(a,s){Se(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};tn.prototype.getPackage=function(e){return this.registry.getPackage(e)};tn.prototype.getPackages=function(){return this.registry.getPackages()};tn.prototype.getElementDescriptor=function(e){return e.$descriptor};tn.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};tn.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};tn.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};N();var Zm=String.fromCharCode,Ew=Object.prototype.hasOwnProperty,ww=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Oa={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Oa).forEach(function(e){Oa[e.toUpperCase()]=Oa[e]});function Sw(e,t,n,r){return r?Ew.call(Oa,r)?Oa[r]:"&"+r+";":Zm(t||parseInt(n,16))}function Ri(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(ww,Sw):e}var Qm="non-whitespace outside of root node";function mo(e){return new Error(e)}function Jm(e){return"missing namespace for prefix <"+e+">"}function Ac(e){return{get:e,enumerable:!0}}function Cw(e){var t={},n;for(n in e)t[n]=e[n];return t}function $l(e){return e+"$uri"}function Rw(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[$l(r)]=n;return t}function eh(){return{line:0,column:0}}function Pw(e){throw e}function zl(e){if(!this)return new zl(e);var t=e&&e.proxy,n,r,i,o,a=Pw,s,c,u,p,l=eh,f=!1,d=!1,m=null,g=!1,v;function w(b){b instanceof Error||(b=mo(b)),m=b,a(b,l)}function S(b){s&&(b instanceof Error||(b=mo(b)),s(b,l))}this.on=function(b,R){if(typeof R!="function")throw mo("required args <name, cb>");switch(b){case"openTag":r=R;break;case"text":n=R;break;case"closeTag":i=R;break;case"error":a=R;break;case"warn":s=R;break;case"cdata":o=R;break;case"attention":p=R;break;case"question":u=R;break;case"comment":c=R;break;default:throw mo("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b=="undefined"&&(b={}),typeof b!="object")throw mo("required args <nsMap={}>");var R={},A;for(A in b)R[A]=b[A];return d=!0,v=R,this},this.parse=function(b){if(typeof b!="string")throw mo("required args <xml=string>");return m=null,x(b),l=eh,g=!1,m},this.stop=function(){g=!0};function x(b){var R=d?[]:null,A=d?Rw(v):null,O,T=[],I=0,L=!1,W=!1,z=0,K=0,ve,Jt,ke,ye,he,we,Ie,Ze,H,G="",oe=0,xe;function Gt(){if(xe!==null)return xe;var _,y,M,D=d&&A.xmlns,F=d&&f?[]:null,V=oe,ae=G,be=ae.length,ft,at,St,xn,Be,yr={},lc={},pn,me,Te;e:for(;V<be;V++)if(pn=!1,me=ae.charCodeAt(V),!(me===32||me<14&&me>8)){for((me<65||me>122||me>90&&me<97)&&me!==95&&me!==58&&(S("illegal first char attribute name"),pn=!0),Te=V+1;Te<be;Te++)if(me=ae.charCodeAt(Te),!(me>96&&me<123||me>64&&me<91||me>47&&me<59||me===46||me===45||me===95)){if(me===32||me<14&&me>8){S("missing attribute value"),V=Te;continue e}if(me===61)break;S("illegal attribute name char"),pn=!0}if(Be=ae.substring(V,Te),Be==="xmlns:xmlns"&&(S("illegal declaration of xmlns"),pn=!0),me=ae.charCodeAt(Te+1),me===34)Te=ae.indexOf('"',V=Te+2),Te===-1&&(Te=ae.indexOf("'",V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else if(me===39)Te=ae.indexOf("'",V=Te+2),Te===-1&&(Te=ae.indexOf('"',V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else for(S("missing attribute value quotes"),pn=!0,Te=Te+1;Te<be&&(me=ae.charCodeAt(Te+1),!(me===32||me<14&&me>8));Te++);for(Te===-1&&(S("missing closing quotes"),Te=be,pn=!0),pn||(St=ae.substring(V,Te)),V=Te;Te+1<be&&(me=ae.charCodeAt(Te+1),!(me===32||me<14&&me>8));Te++)V===Te&&(S("illegal character after attribute end"),pn=!0);if(V=Te+1,pn)continue e;if(Be in lc){S("attribute <"+Be+"> already defined");continue}if(lc[Be]=!0,!d){yr[Be]=St;continue}if(f){if(at=Be==="xmlns"?"xmlns":Be.charCodeAt(0)===120&&Be.substr(0,6)==="xmlns:"?Be.substr(6):null,at!==null){if(_=Ri(St),y=$l(at),xn=v[_],!xn){if(at==="xmlns"||y in A&&A[y]!==_)do xn="ns"+I++;while(typeof A[xn]!="undefined");else xn=at;v[_]=xn}A[at]!==xn&&(ft||(A=Cw(A),ft=!0),A[at]=xn,at==="xmlns"&&(A[$l(xn)]=_,D=xn),A[y]=_),yr[Be]=St;continue}F.push(Be,St);continue}if(me=Be.indexOf(":"),me===-1){yr[Be]=St;continue}if(!(M=A[Be.substring(0,me)])){S(Jm(Be.substring(0,me)));continue}Be=D===M?Be.substr(me+1):M+Be.substr(me),yr[Be]=St}if(f)for(V=0,be=F.length;V<be;V++){if(Be=F[V++],St=F[V],me=Be.indexOf(":"),me!==-1){if(!(M=A[Be.substring(0,me)])){S(Jm(Be.substring(0,me)));continue}Be=D===M?Be.substr(me+1):M+Be.substr(me)}yr[Be]=St}return xe=yr}function P(){for(var _=/(\r\n|\r|\n)/g,y=0,M=0,D=0,F=K,V,ae;z>=D&&(V=_.exec(b),!(!V||(F=V[0].length+V.index,F>z)));)y+=1,D=F;return z==-1?(M=F,ae=b.substring(K)):K===0?ae=b.substring(K,z):(M=z-D,ae=K==-1?b.substring(z):b.substring(z,K+1)),{data:ae,line:y,column:M}}for(l=P,t&&(H=Object.create({},{name:Ac(function(){return Ie}),originalName:Ac(function(){return Ze}),attrs:Ac(Gt),ns:Ac(function(){return A})}));K!==-1;){if(b.charCodeAt(K)===60?z=K:z=b.indexOf("<",K),z===-1){if(T.length)return w("unexpected end of file");if(K===0)return w("missing start tag");K<b.length&&b.substring(K).trim()&&S(Qm);return}if(K!==z){if(T.length){if(n&&(n(b.substring(K,z),Ri,l),g))return}else if(b.substring(K,z).trim()&&(S(Qm),g))return}if(ye=b.charCodeAt(z+1),ye===33){if(ke=b.charCodeAt(z+2),ke===91&&b.substr(z+3,6)==="CDATA["){if(K=b.indexOf("]]>",z),K===-1)return w("unclosed cdata");if(o&&(o(b.substring(z+9,K),l),g))return;K+=3;continue}if(ke===45&&b.charCodeAt(z+3)===45){if(K=b.indexOf("-->",z),K===-1)return w("unclosed comment");if(c&&(c(b.substring(z+4,K),Ri,l),g))return;K+=3;continue}}if(ye===63){if(K=b.indexOf("?>",z),K===-1)return w("unclosed question");if(u&&(u(b.substring(z,K+2),l),g))return;K+=2;continue}for(ve=z+1;;ve++){if(he=b.charCodeAt(ve),isNaN(he))return K=-1,w("unclosed tag");if(he===34)ke=b.indexOf('"',ve+1),ve=ke!==-1?ke:ve;else if(he===39)ke=b.indexOf("'",ve+1),ve=ke!==-1?ke:ve;else if(he===62){K=ve;break}}if(ye===33){if(p&&(p(b.substring(z,K+1),Ri,l),g))return;K+=1;continue}if(xe={},ye===47){if(L=!1,W=!0,!T.length)return w("missing open tag");if(ve=Ie=T.pop(),ke=z+2+ve.length,b.substring(z+2,ke)!==ve)return w("closing tag mismatch");for(;ke<K;ke++)if(ye=b.charCodeAt(ke),!(ye===32||ye>8&&ye<14))return w("close tag")}else{if(b.charCodeAt(K-1)===47?(ve=Ie=b.substring(z+1,K-1),L=!0,W=!0):(ve=Ie=b.substring(z+1,K),L=!0,W=!1),!(ye>96&&ye<123||ye>64&&ye<91||ye===95||ye===58))return w("illegal first char nodeName");for(ke=1,Jt=ve.length;ke<Jt;ke++)if(ye=ve.charCodeAt(ke),!(ye>96&&ye<123||ye>64&&ye<91||ye>47&&ye<59||ye===45||ye===95||ye==46)){if(ye===32||ye<14&&ye>8){Ie=ve.substring(0,ke),xe=null;break}return w("invalid nodeName")}W||T.push(Ie)}if(d){if(O=A,L&&(W||R.push(O),xe===null&&(f=ve.indexOf("xmlns",ke)!==-1)&&(oe=ke,G=ve,Gt(),f=!1)),Ze=Ie,ye=Ie.indexOf(":"),ye!==-1){if(we=A[Ie.substring(0,ye)],!we)return w("missing namespace on <"+Ze+">");Ie=Ie.substr(ye+1)}else we=A.xmlns;we&&(Ie=we+":"+Ie)}if(L&&(oe=ke,G=ve,r&&(t?r(H,Ri,W,l):r(Ie,Gt,Ri,W,l),g)))return;if(W){if(i&&(i(t?H:Ie,Ri,L,l),g))return;d&&(L?A=O:A=R.pop())}K+=1}}}function th(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Gl={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},nh="property";function rh(e){return e.xml&&e.xml.serialize}function Aw(e){let t=rh(e);return t!==nh&&(t||null)}function Tw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ih(e,t){return th(t)?e.prefix+":"+Tw(e.localName):e.name}function Mw(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function Dw(e,t,n){let r=Tt(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Tt(i);var a=n.getPackage(o.prefix);return Mw(o,a)}function Yr(e){return new Error(e)}function xr(e){return e.$descriptor}function kw(e){C(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Yr("expected element");var n=this.elementsById,r=xr(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw Yr("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ba(){}Ba.prototype.handleEnd=function(){};Ba.prototype.handleText=function(){};Ba.prototype.handleNode=function(){};function Vl(){}Vl.prototype=Object.create(Ba.prototype);Vl.prototype.handleNode=function(){return this};function vo(){}vo.prototype=Object.create(Ba.prototype);vo.prototype.handleText=function(e){this.body=(this.body||"")+e};function Ia(e,t){this.property=e,this.context=t}Ia.prototype=Object.create(vo.prototype);Ia.prototype.handleNode=function(e){if(this.element)throw Yr("expected no sub nodes");return this.element=this.createReference(e),this};Ia.prototype.handleEnd=function(){this.element.id=this.body};Ia.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Wl(e,t){this.element=t,this.propertyDesc=e}Wl.prototype=Object.create(vo.prototype);Wl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Pc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function Tc(){}Tc.prototype=Object.create(vo.prototype);Tc.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Ft(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Ft.prototype=Object.create(Tc.prototype);Ft.prototype.addReference=function(e){this.context.addReference(e)};Ft.prototype.handleText=function(e){var t=this.element,n=xr(t),r=n.bodyProperty;if(!r)throw Yr("unexpected body text <"+e+">");vo.prototype.handleText.call(this,e)};Ft.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xr(t),r=n.bodyProperty;r&&e!==void 0&&(e=Pc(r.type,e),t.set(r.name,e))};Ft.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=xr(n),i=this.context,o=new n({}),a=this.model,s;return E(t,function(c,u){var p=r.propertiesByName[u],l;p&&p.isReference?p.isMany?(l=c.split(" "),E(l,function(f){i.addReference({element:o,property:p.ns.name,id:f})})):i.addReference({element:o,property:p.ns.name,id:c}):(p?c=Pc(p.type,c):u==="xmlns"?u=":"+u:(s=Tt(u,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+u+">",element:o,property:u,value:c})),o.set(u,c))}),o};Ft.prototype.getPropertyForNode=function(e){var t=e.name,n=Tt(t),r=this.type,i=this.model,o=xr(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let u=Aw(s);if(u){let p=e.attributes[u];if(p){let l=Dw(p,e.ns,i),f=i.getType(l);return C({},s,{effectiveType:xr(f).name})}}return s}var c=i.getPackage(n.prefix);if(c){let u=ih(n,c),p=i.getType(u);if(s=re(o.properties,function(l){return!l.isVirtual&&!l.isReference&&!l.isAttribute&&p.hasType(l.type)}),s)return C({},s,{effectiveType:xr(p).name})}else if(s=re(o.properties,function(u){return!u.isReference&&!u.isAttribute&&u.type==="Element"}),s)return s;throw Yr("unrecognized element <"+n.name+">")};Ft.prototype.toString=function(){return"ElementDescriptor["+xr(this.type).name+"]"};Ft.prototype.valueHandler=function(e,t){return new Wl(e,t)};Ft.prototype.referenceHandler=function(e){return new Ia(e,this.context)};Ft.prototype.handler=function(e){return e==="Element"?new ho(this.model,e,this.context):new Ft(this.model,e,this.context)};Ft.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Hl(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(C(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Ul(e,t,n){Ft.call(this,e,t,n)}Ul.prototype=Object.create(Ft.prototype);Ul.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&ih(n,o)||t;if(!i.hasType(a))throw Yr("unexpected element <"+e.originalName+">");return Ft.prototype.createElement.call(this,e)};function ho(e,t,n){this.model=e,this.context=n}ho.prototype=Object.create(Tc.prototype);ho.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};ho.prototype.handleChild=function(e){var t=new ho(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};ho.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Mc(e){e instanceof tn&&(e={model:e}),C(this,{lax:!1},e)}Mc.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Ft?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new kw(C({},t,{rootHandler:r})),s=new zl({proxy:!0}),c=Nw();r.context=a,c.push(r);function u(R,A,O){var T=A(),I=T.line,L=T.column,W=T.data;W.charAt(0)==="<"&&W.indexOf(" ")!==-1&&(W=W.slice(0,W.indexOf(" "))+">");var z="unparsable content "+(W?W+" ":"")+`detected
262 </svg>`},Eu=HC;var $C=900;function oi(e,t,n,r){e.registerProvider($C,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=r}oi.$inject=["contextPad","popupMenu","translate","canvas"];oi.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};oi.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")};oi.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${Eu.align}</div>`,action:{click:function(t,n){var r=e._getMenuPosition(n);C(r,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",r)}}}}};oi.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,r=n.getBoundingClientRect(),i={x:r.left,y:r.bottom+t};return i};N();var zC=["left","center","right","top","middle","bottom"];function Oi(e,t,n,r){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",this)}Oi.$inject=["popupMenu","alignElements","translate","rules"];Oi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};Oi.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})};Oi.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,r=this._popupMenu,i={};return E(zC,function(o){i["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Eu[o],action:function(){t.trigger(e,o),r.close()}}}),i};function Ot(e){k.call(this,e),this.init()}Ot.$inject=["eventBus"];B(Ot,k);Ot.prototype.addRule=function(e,t,n){var r=this;typeof e=="string"&&(e=[e]),e.forEach(function(i){r.canExecute(i,t,function(o,a,s){return n(o)},!0)})};Ot.prototype.init=function(){};N();function ko(e){Ot.call(this,e)}ko.$inject=["eventBus"];B(ko,Ot);ko.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=Q(t,function(r){return!(r.waypoints||r.host||r.labelTarget)});return n=zr(n),n.length<2?!1:n})};var Yv={__depends__:[uv,su,Do],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",oi],alignElementsMenuProvider:["type",Oi],bpmnAlignElements:["type",ko]};N();var GC=10,Pf=50,VC=250;function wu(e,t,n,r){for(var i;i=WC(e,n,t);)n=r(t,n,i);return n}function Su(e){return function(t,n,r){var i={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s=o==="x"?"width":"height",c=a.margin,u=a.minDistance;c<0?i[o]=Math.min(r[o]+c-t[s]/2,n[o]-u+c):i[o]=Math.max(r[o]+r[s]+c+t[s]/2,n[o]+u+c)}}),i}}function WC(e,t,n){var r={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},i=UC(e);return re(i,function(o){if(o===n)return!1;var a=He(o,r,GC);return a==="intersect"})}function Xv(e,t){t||(t={});function n(m){return m.source===e?1:-1}var r=t.defaultDistance||Pf,i=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||VC,c=t.reference||"start";o||(o=YC);function u(m,g){return i==="n"?c==="start"?Z(m).top-Z(g).bottom:c==="center"?Z(m).top-X(g).y:Z(m).top-Z(g).top:i==="w"?c==="start"?Z(m).left-Z(g).right:c==="center"?Z(m).left-X(g).x:Z(m).left-Z(g).left:i==="s"?c==="start"?Z(g).top-Z(m).bottom:c==="center"?X(g).y-Z(m).bottom:Z(g).bottom-Z(m).bottom:c==="start"?Z(g).left-Z(m).right:c==="center"?X(g).x-Z(m).right:Z(g).right-Z(m).right}var p=e.incoming.filter(o).map(function(m){var g=a(m),v=g<0?u(m.source,e):u(e,m.source);return{id:m.source.id,distance:v,weight:g}}),l=e.outgoing.filter(o).map(function(m){var g=a(m),v=g>0?u(e,m.target):u(m.target,e);return{id:m.target.id,distance:v,weight:g}}),f=p.concat(l).reduce(function(m,g){return m[g.id+"__weight_"+g.weight]=g,m},{}),d=Ge(f,function(m,g){var v=g.distance,w=g.weight;return v<0||v>s||(m[String(v)]||(m[String(v)]=0),m[String(v)]+=1*w,(!m.distance||m[m.distance]<m[String(v)])&&(m.distance=v)),m},{});return d.distance||r}function UC(e){var t=Rf(e);return e.host&&(t=t.concat(Rf(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce(function(n,r){return n.concat(Rf(r))},[]))),t}function Rf(e){return KC(e).concat(qC(e))}function qC(e){return e.incoming.map(function(t){return t.source})}function KC(e){return e.outgoing.map(function(t){return t.target})}function YC(){return!0}var XC=100;function Cu(e,t,n){e.on("autoPlace",XC,function(r){var i=r.shape,o=r.source;return ZC(o,i)}),e.on("autoPlace.end",function(r){n.scrollToElement(r.shape)}),this.append=function(r,i,o){e.fire("autoPlace.start",{source:r,shape:i});var a=e.fire("autoPlace",{source:r,shape:i}),s=t.appendShape(r,i,a,r.parent,o);return e.fire("autoPlace.end",{source:r,shape:s}),s}}Cu.$inject=["eventBus","modeling","canvas"];function ZC(e,t,n){n||(n={});var r=n.defaultDistance||Pf,i=X(e),o=Z(e);return{x:o.right+r+t.width/2,y:i.y}}function Ru(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Ru.$inject=["eventBus","selection"];var Zv={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Cu],autoPlaceSelectionBehavior:["type",Ru]};N();function kr(e,t){for(st(t)&&(t=[t]);e=e.parent;)if(te(e,t))return e;return null}function Pu(e,t){var n=kr(e,"bpmn:Process");if(n)return!0;var r=["bpmn:Participant","bpmn:Lane"];if(n=kr(e,r),n)return Me(n);if(te(e,r))return Me(e);var i;for(i=j(e);i&&!h(i,"bpmn:Process");i=i.$parent);if(!t)return!0;var o=t.find(function(a){var s=j(a);return s&&s.get("processRef")===i});return o?Me(o):!0}function Au(e,t,n){var r=Pu(e,n);if(h(t,"bpmn:TextAnnotation"))return JC(e,t,r);if(te(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"]))return eR(e,t,r);if(h(t,"bpmn:FlowNode"))return QC(e,t,r)}function QC(e,t,n){var r=Z(e),i=X(e),o=n?{directionHint:"e",minDistance:80,baseOrientation:"left",boundaryOrientation:"top",start:"top",end:"bottom"}:{directionHint:"s",minDistance:90,baseOrientation:"top",boundaryOrientation:"left",start:"left",end:"right"},a=Xv(e,{filter:function(d){return h(d,"bpmn:SequenceFlow")},direction:o.directionHint}),s=30,c=o.minDistance,u=o.baseOrientation;h(e,"bpmn:BoundaryEvent")&&(u=He(e,e.host,-25),u.indexOf(o.boundaryOrientation)!==-1&&(s*=-1));var p=n?{x:r.right+a+t.width/2,y:i.y+Qv(u,c,o)}:{x:i.x+Qv(u,c,o),y:r.bottom+a+t.height/2},l={margin:s,minDistance:c},f=n?{y:l}:{x:l};return wu(e,t,p,Su(f))}function Qv(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function JC(e,t,n){var r=Z(e),i=n?{x:r.right+t.width/2,y:r.top-50-t.height/2}:{x:r.right+50+t.width/2,y:r.bottom+t.height/2};de(e)&&(i=X(e),n?(i.x+=100,i.y-=50):(i.x+=100,i.y+=50));var o={margin:n?-30:30,minDistance:20},a=n?{y:o}:{x:o};return wu(e,t,i,Su(a))}function eR(e,t,n){var r=Z(e),i=n?{x:r.right-10+t.width/2,y:r.bottom+40+t.width/2}:{x:r.left-40-t.width/2,y:r.bottom-10+t.height/2},o={margin:30,minDistance:30},a=n?{x:o}:{y:o};return wu(e,t,i,Su(a))}function Tu(e,t){e.on("autoPlace",function(n){var r=n.shape,i=n.source;return Au(i,r,t)})}Tu.$inject=["eventBus","elementRegistry"];var No={__depends__:[Zv],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Tu]};N();function $n(e,t,n,r){k.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=r;var i=this;this.postExecuted(["shape.create"],function(o){var a=o.context,s=a.hints||{},c=a.shape,u=a.parent||a.newParent;s.autoResize!==!1&&i._expand([c],u)}),this.postExecuted(["elements.move"],function(o){var a=o.context,s=_i(Sn(a.closure.topLevel)),c=a.hints,u=c?c.autoResize:!0;if(u!==!1){var p=Vt(s,function(l){return l.parent.id});E(p,function(l,f){q(u)&&(l=l.filter(function(d){return re(u,Ct({id:d.id}))})),i._expand(l,f)})}}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,s=a.hints,c=a.shape;s&&s.autoResize===!1||c.collapsed||i._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,s=a.hints,c=a.shape,u=c.parent;s&&s.autoResize===!1||u&&i._expand([c],u)})}$n.$inject=["eventBus","elementRegistry","modeling","rules"];B($n,k);$n.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),r=this.getPadding(t),i=Z(Ce(e)),o=Z(t),a={};return i.top-o.top<r.top&&(a.top=i.top-n.top),i.left-o.left<r.left&&(a.left=i.left-n.left),o.right-i.right<r.right&&(a.right=i.right+n.right),o.bottom-i.bottom<r.bottom&&(a.bottom=i.bottom+n.bottom),Si(C({},o,a))};$n.prototype._expand=function(e,t){typeof t=="string"&&(t=this._elementRegistry.get(t));var n=this._rules.allowed("element.autoResize",{elements:e,target:t});if(n){var r=this._getOptimalBounds(e,t);if(tR(r,t)){var i=nR(mt(t,["x","y","width","height"]),r);this.resize(t,r,{autoResize:i});var o=t.parent;o&&this._expand([t],o)}}};$n.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}};$n.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}};$n.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)};function tR(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function nR(e,t){var n="";return e=Z(e),t=Z(t),e.top>t.top&&(n=n.concat("n")),e.right<t.right&&(n=n.concat("w")),e.bottom<t.bottom&&(n=n.concat("s")),e.left>t.left&&(n=n.concat("e")),n}function Oo(e){e.invoke($n,this)}Oo.$inject=["injector"];B(Oo,$n);Oo.prototype.resize=function(e,t,n){h(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};N();function Bi(e){Ot.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}Bi.$inject=["eventBus"];B(Bi,Ot);Bi.prototype.canResize=function(e,t){return!1};function Bo(e,t){Bi.call(this,e),this._modeling=t}B(Bo,Bi);Bo.$inject=["eventBus","modeling"];Bo.prototype.canResize=function(e,t){if(h(t.di,"bpmndi:BPMNPlane")||!h(t,"bpmn:Participant")&&!h(t,"bpmn:Lane")&&!h(t,"bpmn:SubProcess"))return!1;var n=!0;return E(e,function(r){if(h(r,"bpmn:Lane")||ee(r)){n=!1;return}}),n};var Jv={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Oo],bpmnAutoResizeProvider:["type",Bo]};var eg=1500;function Mu(e,t,n){var r=this,i=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=r._findTargetGfx(s),u=c&&e.get(c);c&&u&&(a.stopPropagation(),i.hover({element:u,gfx:c}),i.move(s))}}i&&t.on("drag.start",function(a){t.once("drag.move",eg,function(s){o(s)})}),(function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",eg,function(c){s&&t.fire("element.out",{element:s,gfx:a})}),t.on("element.out",function(){a=null,s=null})})(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=An(a),c=document.elementFromPoint(s.x,s.y),rR(c)}}Mu.$inject=["elementRegistry","eventBus","injector"];function rR(e){return Bn(e,"svg, .djs-element",!0)}var tg={__init__:["hoverFix"],hoverFix:["type",Mu]};N();var Io=Math.round,ng="djs-drag-active";function Ii(e){e.preventDefault()}function iR(e){return typeof TouchEvent!="undefined"&&e instanceof TouchEvent}function oR(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Du(e,t,n,r){var i={threshold:5,trapClick:!0},o;function a(x){var b=t.viewbox(),R=t._container.getBoundingClientRect();return{x:b.x+(x.x-R.left)/b.scale,y:b.y+(x.y-R.top)/b.scale}}function s(x,b){b=b||o;var R=e.createEvent(C({},b.payload,b.data,{isTouch:b.isTouch}));return e.fire("drag."+x,R)===!1?!1:e.fire(b.prefix+"."+x,R)}function c(x){var b=x.filter(function(R){return r.get(R.id)});b.length&&n.select(b)}function u(x,b){var R=o.payload,A=o.displacement,O=o.globalStart,T=An(x),I=Dt(T,O),L=o.localStart,W=a(T),z=Dt(W,L);if(!o.active&&(b||oR(I)>o.threshold)){if(C(R,{x:Io(L.x+A.x),y:Io(L.y+A.y),dx:0,dy:0},{originalEvent:x}),s("start")===!1)return v();o.active=!0,o.keepSelection||(R.previousSelection=n.get(),n.select(null)),o.cursor&&Di(o.cursor),t.addMarker(t.getRootElement(),ng)}Wc(x),o.active&&(C(R,{x:Io(W.x+A.x),y:Io(W.y+A.y),dx:Io(z.x),dy:Io(z.y)},{originalEvent:x}),s("move"))}function p(x){var b,R=!0;o.active&&(x&&(o.payload.originalEvent=x,Wc(x)),R=s("end")),R===!1&&s("rejected"),b=w(R!==!0),s("ended",b)}function l(x){Ke("Escape",x)&&(Ii(x),v())}function f(x){var b;o.active&&(b=nu(e),setTimeout(b,400),Ii(x)),p(x)}function d(x){u(x)}function m(x){var b=o.payload;b.hoverGfx=x.gfx,b.hover=x.element,s("hover")}function g(x){s("out");var b=o.payload;b.hoverGfx=null,b.hover=null}function v(x){var b;if(o){var R=o.active;R&&s("cancel"),b=w(x),R&&s("canceled",b)}}function w(x){var b,R;s("cleanup"),tu(),o.trapClick?R=f:R=p,se.unbind(document,"mousemove",u),se.unbind(document,"dragstart",Ii),se.unbind(document,"selectstart",Ii),se.unbind(document,"mousedown",R,!0),se.unbind(document,"mouseup",R,!0),se.unbind(document,"keyup",l),se.unbind(document,"touchstart",d,!0),se.unbind(document,"touchcancel",v,!0),se.unbind(document,"touchmove",u,!0),se.unbind(document,"touchend",p,!0),e.off("element.hover",m),e.off("element.out",g),t.removeMarker(t.getRootElement(),ng);var A=o.payload.previousSelection;return x!==!1&&A&&!n.get().length&&c(A),b=o,o=null,b}function S(x,b,R,A){o&&v(!1),typeof b=="string"&&(A=R,R=b,b=null),A=C({},i,A||{});var O=A.data||{},T,I,L,W,z;if(A.trapClick?W=f:W=p,x?(T=Ar(x)||x,I=An(x),Wc(x),T.type==="dragstart"&&Ii(T)):(T=null,I={x:0,y:0}),L=a(I),b||(b=L),z=iR(T),o=C({prefix:R,data:O,payload:{},globalStart:I,displacement:Dt(b,L),localStart:L,isTouch:z},A),A.manual||(z?(se.bind(document,"touchstart",d,!0),se.bind(document,"touchcancel",v,!0),se.bind(document,"touchmove",u,!0),se.bind(document,"touchend",p,!0)):(se.bind(document,"mousemove",u),se.bind(document,"dragstart",Ii),se.bind(document,"selectstart",Ii),se.bind(document,"mousedown",W,!0),se.bind(document,"mouseup",W,!0)),se.bind(document,"keyup",l),e.on("element.hover",m),e.on("element.out",g)),s("init")===!1)return v(),!1;A.autoActivate&&u(x,!0)}e.on("diagram.destroy",v),this.init=S,this.move=u,this.hover=m,this.out=g,this.end=p,this.cancel=v,this.context=function(){return o},this.setOptions=function(x){C(i,x)}}Du.$inject=["eventBus","canvas","selection","elementRegistry"];var kt={__depends__:[tg,rt],dragging:["type",Du]};N();function ai(e,t,n){this._canvas=n,this._opts=C({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var r=this;t.on("drag.move",function(i){var o=r._toBorderPoint(i);r.startScroll(o)}),t.on(["drag.cleanup"],function(){r.stopScroll()})}ai.$inject=["config.autoScroll","eventBus","canvas"];ai.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,r=this,i=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,i.width-e.x,i.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)aR(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){r.startScroll(e)},n.scrollRepeatTimeout))};function aR(e,t,n){return t<e&&e<n}ai.prototype.stopScroll=function(){clearTimeout(this._scrolling)};ai.prototype.setOptions=function(e){this._opts=C({},this._opts,e)};ai.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=An(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};var rg={__depends__:[kt],__init__:["autoScroll"],autoScroll:["type",ai]};function Wa(e){this._commandStack=e.get("commandStack",!1)}Wa.$inject=["injector"];Wa.prototype.allowed=function(e,t){var n=!0,r=this._commandStack;return r&&(n=r.canExecute(e,t)),n===void 0?!0:n};var Et={__init__:["rules"],rules:["type",Wa]};N();var ku=Math.round,sR=Math.max;function cR(e,t){var n=e.x,r=e.y;return[["M",n,r],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function uR(e){var t=[];return e.forEach(function(n,r){t.push([r===0?"M":"L",n.x,n.y])}),t}var ig=10;function pR(e,t){var n,r;for(n=0;r=e[n];n++)if(Gr(r,t)<=ig)return{point:e[n],bendpoint:!0,index:n};return null}function lR(e,t){var n=Da(cR(t,ig),uR(e)),r=n[0],i=n[n.length-1],o;return r?r!==i?r.segment2!==i.segment2?(o=sR(r.segment2,i.segment2)-1,{point:e[o],bendpoint:!0,index:o}):{point:{x:ku(r.x+i.x)/2,y:ku(r.y+i.y)/2},index:r.segment2}:{point:{x:ku(r.x),y:ku(r.y)},index:r.segment2}:null}function Ua(e,t){return pR(e,t)||lR(e,t)}function og(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Af(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function ag(e,t){return t?{x:Math.cos(t)*e.x-Math.sin(t)*e.y,y:Math.sin(t)*e.x+Math.cos(t)*e.y}:e}function fR(e,t,n){var r=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],i=r[0].n*t[0]+r[1].n*t[1],o=r[0].lambda*t[0]+r[1].lambda*t[1];return-i/o}function qa(e,t){var n=t[0],r=t[1],i={x:r.x-n.x,y:r.y-n.y},o=fR([n.x,n.y],[i.x,i.y],[e.x,e.y]);return{x:n.x+o*i.x,y:n.y+o*i.y}}function Nu(e,t){var n=qa(e,t),r={x:n.x-e.x,y:n.y-e.y};return og(r)}function Li(e,t){return og({x:e.x-t.x,y:e.y-t.y})}var Tf="djs-bendpoint",Mf="djs-segment-dragger";function dR(e,t){var n=An(t),r=e._container.getBoundingClientRect(),i;i={x:r.left,y:r.top};var o=e.viewbox();return{x:o.x+(n.x-i.x)/o.scale,y:o.y+(n.y-i.y)/o.scale}}function Ka(e,t,n){var r=dR(e,n),i=Ua(t,r);return i}function Ya(e,t){var n=U("g");pe(n).add(Tf),J(e,n);var r=U("circle");$(r,{cx:0,cy:0,r:4}),pe(r).add("djs-visual"),J(n,r);var i=U("circle");return $(i,{cx:0,cy:0,r:10}),pe(i).add("djs-hit"),J(n,i),t&&pe(n).add(t),n}function mR(e,t,n,r){var i=U("g");J(e,i);var o=18,a=6,s=11,c=hR(t,n,r),u=a+s,p=U("rect");$(p,{x:-o/2,y:-a/2,width:o,height:a}),pe(p).add("djs-visual"),J(i,p);var l=U("rect");return $(l,{x:-c/2,y:-u/2,width:c,height:u}),pe(l).add("djs-hit"),J(i,l),Rc(i,r==="v"?90:0,0,0),i}function Bu(e,t,n){var r=U("g"),i=Ma(t,n),o=en(t,n);return J(e,r),mR(r,t,n,o),pe(r).add(Mf),pe(r).add(o==="h"?"horizontal":"vertical"),Fe(r,i.x,i.y),r}function Ou(e){return Math.abs(Math.round(e*2/3))}function sg(e,t){var n=vR(e,t);return qa(e,n)}function hR(e,t,n){var r=t.x-e.x,i=t.y-e.y;return Ou(n==="h"?r:i)}function vR(e,t){for(var n=t.waypoints,r=1/0,i,o=0;o<n.length-1;o++){var a=n[o],s=n[o+1],c=Nu(e,[a,s]);c<r&&(r=c,i=o)}return[n[i],n[i+1]]}function Iu(e,t,n,r,i){function o(x,b,R){var A=x.index,O=x.point,T,I,L,W,z,K;return A<=0||x.bendpoint?!1:(T=b[A-1],I=b[A],L=Ma(T,I),W=en(T,I),z=Math.abs(O.x-L.x),K=Math.abs(O.y-L.y),W&&z<=R&&K<=R)}function a(x,b){var R=x.waypoints,A,O,T,I;return b.index<=0||b.bendpoint||(A={start:R[b.index-1],end:R[b.index]},O=en(A.start,A.end),!O)?null:(O==="h"?T=A.end.x-A.start.x:T=A.end.y-A.start.y,I=Ou(T)/2,I)}function s(x,b){var R=b.waypoints,A=Ka(t,R,x),O;if(A){O=a(b,A);var T;if(o(A,R,O)?T=i.start(x,b,A.index):T=r.start(x,b,A.index,!A.bendpoint),T!==!1)return!0}}function c(x,b,R){se.bind(x,b,function(A){n.triggerMouseEvent(b,A,R),A.stopPropagation()})}function u(x,b){var R=t.getLayer("overlays"),A=_e('.djs-bendpoints[data-element-id="'+Rr(x.id)+'"]',R);return!A&&b&&(A=U("g"),$(A,{"data-element-id":x.id}),pe(A).add("djs-bendpoints"),J(R,A),c(A,"mousedown",x),c(A,"click",x),c(A,"dblclick",x)),A}function p(x,b){return _e('.djs-segment-dragger[data-segment-idx="'+x+'"]',b)}function l(x,b){b.waypoints.forEach(function(R,A){var O=Ya(x);J(x,O),Fe(O,R.x,R.y)}),Ya(x,"floating")}function f(x,b){for(var R=b.waypoints,A,O,T,I=1;I<R.length;I++)A=R[I-1],O=R[I],en(A,O)&&(T=Bu(x,A,O),$(T,{"data-segment-idx":I}),c(T,"mousemove",b))}function d(x){E(xi("."+Tf,x),function(b){Pe(b)})}function m(x){E(xi("."+Mf,x),function(b){Pe(b)})}function g(x){var b=u(x);return b||(b=u(x,!0),l(b,x),f(b,x)),b}function v(x){var b=u(x);b&&(m(b),d(b),f(b,x),l(b,x))}function w(x,b){var R=_e(".floating",x),A=b.point;R&&Fe(R,A.x,A.y)}function S(x,b,R){var A=p(b.index,x),O=R[b.index-1],T=R[b.index],I=b.point,L=Ma(O,T),W=en(O,T),z,K;A&&(z=gR(A),K={x:I.x-L.x,y:I.y-L.y},W==="v"&&(K={x:K.y,y:K.x}),Fe(z,K.x,K.y))}e.on("connection.changed",function(x){v(x.element)}),e.on("connection.remove",function(x){var b=u(x.element);b&&Pe(b)}),e.on("element.marker.update",function(x){var b=x.element,R;b.waypoints&&(R=g(b),x.add?pe(R).add(x.marker):pe(R).remove(x.marker))}),e.on("element.mousemove",function(x){var b=x.element,R=b.waypoints,A,O;if(R){if(A=u(b,!0),O=Ka(t,R,x.originalEvent),!O)return;w(A,O),O.bendpoint||S(A,O,R)}}),e.on("element.mousedown",function(x){if(gn(x)){var b=x.originalEvent,R=x.element;if(R.waypoints)return s(b,R)}}),e.on("selection.changed",function(x){var b=x.newSelection,R=b[0];R&&R.waypoints&&g(R)}),e.on("element.hover",function(x){var b=x.element;b.waypoints&&g(b)}),e.on("element.updateId",function(x){var b=x.element,R=x.newId;if(b.waypoints){var A=u(b);A&&$(A,{"data-element-id":R})}}),this.addHandles=g,this.updateHandles=v,this.getBendpointsContainer=u,this.getSegmentDragger=p}Iu.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function gR(e){return _e(".djs-visual",e)}var cg=Math.round,ji="reconnectStart",Fi="reconnectEnd",Xa="updateWaypoints";function Qa(e,t,n,r,i,o){this._injector=e,this.start=function(a,s,c,u){var p=n.getGraphics(s),l=s.source,f=s.target,d=s.waypoints,m;!u&&c===0?m=ji:!u&&c===d.length-1?m=Fi:m=Xa;var g=m===Xa?"connection.updateWaypoints":"connection.reconnect",v=i.allowed(g,{connection:s,source:l,target:f});if(v===!1&&(v=i.allowed(g,{connection:s,source:f,target:l})),v!==!1)return r.init(a,"bendpoint.move",{data:{connection:s,connectionGfx:p,context:{allowed:v,bendpointIndex:c,connection:s,source:l,target:f,insert:u,type:m}}})},t.on("bendpoint.move.hover",function(a){var s=a.context,c=s.connection,u=c.source,p=c.target,l=a.hover,f=s.type;s.hover=l;var d;if(l){var m=f===Xa?"connection.updateWaypoints":"connection.reconnect";if(d=s.allowed=i.allowed(m,{connection:c,source:f===ji?l:u,target:f===Fi?l:p}),d){s.source=f===ji?l:u,s.target=f===Fi?l:p;return}d===!1&&(d=s.allowed=i.allowed(m,{connection:c,source:f===Fi?l:p,target:f===ji?l:u})),d&&(s.source=f===Fi?l:p,s.target=f===ji?l:u)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var s=a.context,c=s.type;s.hover=null,s.source=null,s.target=null,c!==Xa&&(s.allowed=!1)}),t.on("bendpoint.move.end",function(a){var s=a.context,c=s.allowed,u=s.bendpointIndex,p=s.connection,l=s.insert,f=p.waypoints.slice(),d=s.source,m=s.target,g=s.type,v=s.hints||{},w={x:cg(a.x),y:cg(a.y)};if(!c)return!1;g===Xa?(l?f.splice(u,0,w):f[u]=w,v.bendpointMove={insert:l,bendpointIndex:u},f=this.cropWaypoints(p,f),o.updateWaypoints(p,Am(f),v)):(g===ji?(v.docking="source",Za(s)&&(v.docking="target",v.newWaypoints=f.reverse())):g===Fi&&(v.docking="target",Za(s)&&(v.docking="source",v.newWaypoints=f.reverse())),o.reconnect(p,d,m,w,v))},this)}Qa.$inject=["injector","eventBus","canvas","dragging","rules","modeling"];Qa.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var r=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=r,t};function Za(e){var t=e.hover,n=e.source,r=e.target,i=e.type;if(i===ji)return t&&r&&t===r&&n!==r;if(i===Fi)return t&&n&&t===n&&n!==r}var yR="reconnectStart",_R="reconnectEnd",ug="updateWaypoints",Ja="connect-ok",Lu="connect-not-ok",pg="connect-hover",lg="djs-updating",fg="djs-dragging",dg=1100;function ju(e,t,n,r){this._injector=t;var i=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,s=a.bendpointIndex,c=a.connection,u=a.insert,p=c.waypoints,l=p.slice();a.waypoints=p,u&&l.splice(s,0,{x:o.x,y:o.y}),c.waypoints=l;var f=a.draggerGfx=Ya(r.getLayer("overlays"));pe(f).add("djs-dragging"),r.addMarker(c,fg),r.addMarker(c,lg)}),n.on("bendpoint.move.hover",function(o){var a=o.context,s=a.allowed,c=a.hover,u=a.type;if(c){if(r.addMarker(c,pg),u===ug)return;s?(r.removeMarker(c,Lu),r.addMarker(c,Ja)):s===!1&&(r.removeMarker(c,Ja),r.addMarker(c,Lu))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],dg,function(o){var a=o.context,s=a.hover,c=a.target;s&&(r.removeMarker(s,pg),r.removeMarker(s,c?Ja:Lu))}),n.on("bendpoint.move.move",function(o){var a=o.context,s=a.allowed,c=a.bendpointIndex,u=a.draggerGfx,p=a.hover,l=a.type,f=a.connection,d=f.source,m=f.target,g=f.waypoints.slice(),v={x:o.x,y:o.y},w=a.hints||{},S={};i&&(w.connectionStart&&(S.connectionStart=w.connectionStart),w.connectionEnd&&(S.connectionEnd=w.connectionEnd),l===yR?Za(a)?(S.connectionEnd=S.connectionEnd||v,S.source=m,S.target=p||d,g=g.reverse()):(S.connectionStart=S.connectionStart||v,S.source=p||d,S.target=m):l===_R?Za(a)?(S.connectionStart=S.connectionStart||v,S.source=p||m,S.target=d,g=g.reverse()):(S.connectionEnd=S.connectionEnd||v,S.source=d,S.target=p||m):(S.noCropping=!0,S.noLayout=!0,g[c]=v),l===ug&&(g=e.cropWaypoints(f,g)),S.waypoints=g,i.drawPreview(a,s,S)),Fe(u,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],dg,function(o){var a=o.context,s=a.connection,c=a.draggerGfx,u=a.hover,p=a.target,l=a.waypoints;s.waypoints=l,Pe(c),r.removeMarker(s,lg),r.removeMarker(s,fg),u&&(r.removeMarker(u,Ja),r.removeMarker(u,p?Ja:Lu)),i&&i.cleanUp(a)})}ju.$inject=["bendpointMove","injector","eventBus","canvas"];var mg="connect-hover",hg="djs-updating";function vg(e,t,n){return Df(e,t,e[t]+n)}function Df(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function bR(e,t,n,r){var i=Math.max(t[r],n[r]),o=Math.min(t[r],n[r]),a=20,s=Math.min(Math.max(o+a,e[r]),i-a);return Df(t,r,s)}function yg(e){return e==="x"?"y":"x"}function gg(e,t,n){var r,i;return e.original?e.original:(r=X(t),i=yg(n),Df(e,i,r[i]))}function Fu(e,t,n,r,i,o){var a=e.get("connectionDocking",!1);this.start=function(l,f,d){var m,g=n.getGraphics(f),v=d-1,w=d,S=f.waypoints,x=S[v],b=S[w],R=Ka(n,S,l),A,O,T;if(A=en(x,b),!!A)return O=A==="v"?"x":"y",v===0&&(x=gg(x,f.source,O)),w===S.length-1&&(b=gg(b,f.target,O)),R?T=R.point:T={x:(x.x+b.x)/2,y:(x.y+b.y)/2},m={connection:f,segmentStartIndex:v,segmentEndIndex:w,segmentStart:x,segmentEnd:b,axis:O,dragPosition:T},r.init(l,T,"connectionSegment.move",{cursor:O==="x"?"resize-ew":"resize-ns",data:{connection:f,connectionGfx:g,context:m}})};function s(l,f){if(!a)return f;var d=l.waypoints,m;return l.waypoints=f,m=a.getCroppedWaypoints(l),l.waypoints=d,m}function c(l){i.update("connection",l.connection,l.connectionGfx)}function u(l,f,d){var m=l.newWaypoints,g=l.segmentStartIndex+f,v=m[g],w=l.segmentEndIndex+f,S=m[w],x=yg(l.axis),b=bR(d,v,S,x);Fe(l.draggerGfx,b.x,b.y)}function p(l,f){var d=0,m=l.filter(function(g,v){return uo(l[v-1],l[v+1],g)?(d=v<=f?d-1:d,!1):!0});return{waypoints:m,segmentOffset:d}}t.on("connectionSegment.move.start",function(l){var f=l.context,d=l.connection,m=n.getLayer("overlays");f.originalWaypoints=d.waypoints.slice(),f.draggerGfx=Bu(m,f.segmentStart,f.segmentEnd),pe(f.draggerGfx).add("djs-dragging"),n.addMarker(d,hg)}),t.on("connectionSegment.move.move",function(l){var f=l.context,d=f.connection,m=f.segmentStartIndex,g=f.segmentEndIndex,v=f.segmentStart,w=f.segmentEnd,S=f.axis,x=f.originalWaypoints.slice(),b=vg(v,S,l["d"+S]),R=vg(w,S,l["d"+S]),A=x.length,O=0;x[m]=b,x[g]=R;var T,I;m<2&&(T=He(d.source,b),m===1?T==="intersect"&&(x.shift(),x[0]=b,O--):T!=="intersect"&&(x.unshift(v),O++)),g>A-3&&(I=He(d.target,R),g===A-2?I==="intersect"&&(x.pop(),x[x.length-1]=R):I!=="intersect"&&x.push(w)),f.newWaypoints=d.waypoints=s(d,x),u(f,O,l),f.newSegmentStartIndex=m+O,c(l)}),t.on("connectionSegment.move.hover",function(l){l.context.hover=l.hover,n.addMarker(l.hover,mg)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(l){var f=l.context.hover;f&&n.removeMarker(f,mg)}),t.on("connectionSegment.move.cleanup",function(l){var f=l.context,d=f.connection;f.draggerGfx&&Pe(f.draggerGfx),n.removeMarker(d,hg)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(l){var f=l.context,d=f.connection;d.waypoints=f.originalWaypoints,c(l)}),t.on("connectionSegment.move.end",function(l){var f=l.context,d=f.connection,m=f.newWaypoints,g=f.newSegmentStartIndex;m=m.map(function(R){return{original:R.original,x:Math.round(R.x),y:Math.round(R.y)}});var v=p(m,g),w=v.waypoints,S=s(d,w),x=v.segmentOffset,b={segmentMove:{segmentStartIndex:f.segmentStartIndex,newSegmentStartIndex:g+x}};o.updateWaypoints(d,S,b)})}Fu.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];N();var xR=Math.abs,_g=Math.round;function bg(e,t,n){n=n===void 0?10:n;var r,i;for(r=0;r<t.length;r++)if(i=t[r],xR(i-e)<=n)return i}function Hu(e){return{x:e.x,y:e.y}}function $u(e){return{x:e.x+e.width,y:e.y+e.height}}function rn(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:_g(e.x+e.width/2),y:_g(e.y+e.height/2)}}function zn(e,t){var n=e.snapped;return n?typeof t=="string"?n[t]:n.x&&n.y:!1}function ze(e,t,n){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var r,i=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,r=n-i,e[t]+=r,e["d"+t]+=r),i}function zu(e){return e.children||[]}var ER=Math.abs,xg=Math.round,kf=10;function Gu(e){function t(o,a){if(q(o)){for(var s=o.length;s--;)if(ER(o[s]-a)<=kf)return o[s]}else{o=+o;var c=a%o;if(c<kf)return a-c;if(c>o-kf)return a-c+o}return a}function n(o,a){if(o.waypoints)return sg(a,o);if(o.width)return{x:xg(o.width/2+o.x),y:xg(o.height/2+o.y)}}function r(o){var a=o.context,s=a.snapPoints,c=a.connection,u=c.waypoints,p=a.segmentStart,l=a.segmentStartIndex,f=a.segmentEnd,d=a.segmentEndIndex,m=a.axis;if(s)return s;var g=[u[l-1],p,f,u[d+1]];return l<2&&g.unshift(n(c.source,o)),d>u.length-3&&g.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},E(g,function(v){v&&(v=v.original||v,m==="y"&&s.horizontal.push(v.y),m==="x"&&s.vertical.push(v.x))}),s}e.on("connectionSegment.move.move",1500,function(o){var a=r(o),s=o.x,c=o.y,u,p;if(a){u=t(a.vertical,s),p=t(a.horizontal,c);var l=s-u,f=c-p;C(o,{dx:o.dx-l,dy:o.dy-f,x:u,y:p}),(l||a.vertical.indexOf(s)!==-1)&&ze(o,"x",u),(f||a.horizontal.indexOf(c)!==-1)&&ze(o,"y",p)}});function i(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var u=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},E(u,function(p){p&&(p=p.original||p,a.horizontal.push(p.y),a.vertical.push(p.x))}),a}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!de(s)||!c||!c.x||!c.y||(ze(o,"x",c.x),ze(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=i(a),c=a.hover,u=c&&n(c,o),p=o.x,l=o.y,f,d;if(s){f=t(u?s.vertical.concat([u.x]):s.vertical,p),d=t(u?s.horizontal.concat([u.y]):s.horizontal,l);var m=p-f,g=l-d;C(o,{dx:o.dx-m,dy:o.dy-g,x:o.x-m,y:o.y-g}),(m||s.vertical.indexOf(p)!==-1)&&ze(o,"x",f),(g||s.horizontal.indexOf(l)!==-1)&&ze(o,"y",d)}})}Gu.$inject=["eventBus"];var Eg={__depends__:[kt,Et],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Iu],bendpointMove:["type",Qa],bendpointMovePreview:["type",ju],connectionSegmentMove:["type",Fu],bendpointSnapping:["type",Gu]};N();function Wu(e,t,n,r){function i(a,s){return r.allowed("connection.create",{source:a,target:s})}function o(a,s){return i(s,a)}e.on("connect.hover",function(a){var s=a.context,c=s.start,u=a.hover,p;if(s.hover=u,p=s.canExecute=i(c,u),!Yn(p)){if(p!==!1){s.source=c,s.target=u;return}p=s.canExecute=o(c,u),!Yn(p)&&p!==!1&&(s.source=u,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(a){var s=a.context,c=s.canExecute,u=s.connectionStart,p={x:a.x,y:a.y},l=s.source,f=s.target;if(!c)return!1;var d=null,m={connectionStart:Vu(s)?p:u,connectionEnd:Vu(s)?u:p};Se(c)&&(d=c),s.connection=n.connect(l,f,d,m)}),this.start=function(a,s,c,u){Se(c)||(u=c,c=X(s)),t.init(a,"connect",{autoActivate:u,data:{shape:s,context:{start:s,connectionStart:c}}})}}Wu.$inject=["eventBus","dragging","modeling","rules"];function Vu(e){var t=e.hover,n=e.source,r=e.target;return t&&n&&t===n&&n!==r}var wR=1100,SR=900,wg="connect-ok",Sg="connect-not-ok";function Uu(e,t,n){var r=e.get("connectionPreview",!1);r&&t.on("connect.move",function(i){var o=i.context,a=o.canExecute,s=o.hover,c=o.source,u=o.start,p=o.startPosition,l=o.target,f=o.connectionStart||p,d=o.connectionEnd||{x:i.x,y:i.y},m=f,g=d;Vu(o)&&(m=d,g=f),r.drawPreview(o,a,{source:c||u,target:l||s,connectionStart:m,connectionEnd:g})}),t.on("connect.hover",SR,function(i){var o=i.context,a=i.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?wg:Sg)}),t.on(["connect.out","connect.cleanup"],wR,function(i){var o=i.hover;o&&(n.removeMarker(o,wg),n.removeMarker(o,Sg))}),r&&t.on("connect.cleanup",function(i){r.cleanUp(i.context)})}Uu.$inject=["injector","eventBus","canvas"];var Lo={__depends__:[rt,Et,kt],__init__:["connectPreview"],connect:["type",Wu],connectPreview:["type",Uu]};N();var CR="djs-dragger";function Gn(e,t,n,r){this._canvas=t,this._graphicsFactory=n,this._elementFactory=r,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Gn.$inject=["injector","canvas","graphicsFactory","elementFactory"];Gn.prototype.drawPreview=function(e,t,n){n=n||{};var r=e.connectionPreviewGfx,i=e.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,u=n.connectionEnd,p=n.noLayout,l=n.noCropping,f=n.noNoop,d,m=this;if(r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),_r(r),i||(i=e.getConnection=RR(function(g,v,w){return m.getConnection(g,v,w)})),t&&(d=i(t,o,a)),!d){!f&&this.drawNoopPreview(r,n);return}d.waypoints=s||[],this._layouter&&!p&&(d.waypoints=this._layouter.layoutConnection(d,{source:o,target:a,connectionStart:c,connectionEnd:u,waypoints:n.waypoints||d.waypoints})),(!d.waypoints||!d.waypoints.length)&&(d.waypoints=[o?X(o):c,a?X(a):u]),this._connectionDocking&&(o||a)&&!l&&(d.waypoints=this._connectionDocking.getCroppedWaypoints(d,o,a)),this._graphicsFactory.drawConnection(r,d,{stroke:"var(--element-dragger-color)"})};Gn.prototype.drawNoopPreview=function(e,t){var n=t.source,r=t.target,i=t.connectionStart||X(n),o=t.connectionEnd||X(r),a=this.cropWaypoints(i,o,n,r),s=this.createNoopConnection(a[0],a[1]);J(e,s)};Gn.prototype.cropWaypoints=function(e,t,n,r){var i=this._graphicsFactory,o=n&&i.getShapePath(n),a=r&&i.getShapePath(r),s=i.getConnectionPath({waypoints:[e,t]});return e=n&&qr(o,s,!0)||e,t=r&&qr(a,s,!1)||t,[e,t]};Gn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Pe(e.connectionPreviewGfx)};Gn.prototype.getConnection=function(e){var t=PR(e);return this._elementFactory.createConnection(t)};Gn.prototype.createConnectionPreviewGfx=function(){var e=U("g");return $(e,{pointerEvents:"none"}),pe(e).add(CR),J(this._canvas.getActiveLayer(),e),e};Gn.prototype.createNoopConnection=function(e,t){return Xn([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function RR(e){var t={};return function(n){var r=JSON.stringify(n),i=t[r];return i||(i=t[r]=e.apply(null,arguments)),i}}function PR(e){return Se(e)?e:{}}var Cg={__init__:["connectionPreview"],connectionPreview:["type",Gn]};var AR=new or("ps"),TR=["marker-start","marker-mid","marker-end"],MR=["circle","ellipse","line","path","polygon","polyline","path","rect"];function cr(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._styles=r}cr.$inject=["elementRegistry","eventBus","canvas","styles"];cr.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")};cr.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)};cr.prototype.addDragger=function(e,t,n,r="djs-dragger"){n=n||this.getGfx(e);var i=Sl(n),o=n.getBoundingClientRect();return this._cloneMarkers(Ln(i),r),$(i,this._styles.cls(r,[],{x:o.top,y:o.left})),J(t,i),$(i,"data-preview-support-element-id",e.id),i};cr.prototype.addFrame=function(e,t){var n=U("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return J(t,n),$(n,"data-preview-support-element-id",e.id),n};cr.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var r=this;e.childNodes&&e.childNodes.forEach(i=>{r._cloneMarkers(i,t,n)}),OR(e)&&TR.forEach(function(i){if($(e,i)){var o=DR(e,i,r._canvas.getContainer());o&&r._cloneMarker(n,e,o,i,t)}})};cr.prototype._cloneMarker=function(e,t,n,r,i="djs-dragger"){var o=[n.id,i,AR.next()].join("-"),a=_e("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||Sl(n);s.id=o,pe(s).add(i);var c=_e(":scope > defs",e);c||(c=U("defs"),J(e,c)),J(c,s);var u=NR(s.id);$(t,r,u)};function DR(e,t,n){var r=kR($(e,t));return _e("marker#"+r,n||document)}function kR(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function NR(e){return"url(#"+e+")"}function OR(e){return MR.indexOf(e.nodeName)!==-1}var Dn={__init__:["previewSupport"],previewSupport:["type",cr]};var qu="complex-preview",jo=class{constructor(t,n,r){this._canvas=t,this._graphicsFactory=n,this._previewSupport=r,this._markers=[]}create(t){this.cleanUp();let{created:n=[],moved:r=[],removed:i=[],resized:o=[]}=t,a=this._canvas.getLayer(qu);n.filter(s=>!BR(s)).forEach(s=>{let c;de(s)?(c=this._graphicsFactory._createContainer("connection",U("g")),this._graphicsFactory.drawConnection(Ln(c),s)):(c=this._graphicsFactory._createContainer("shape",U("g")),this._graphicsFactory.drawShape(Ln(c),s),Fe(c,s.x,s.y)),this._previewSupport.addDragger(s,a,c)}),r.forEach(({element:s,delta:c})=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"]);let u=this._previewSupport.addDragger(s,a);de(s)?Fe(u,c.x,c.y):Fe(u,s.x+c.x,s.y+c.y)}),i.forEach(s=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"])}),o.forEach(({shape:s,bounds:c})=>{this._canvas.addMarker(s,"djs-hidden"),this._markers.push([s,"djs-hidden"]),this._previewSupport.addDragger(s,a,void 0,"djs-dragging");let u=this._graphicsFactory._createContainer("shape",U("g"));this._graphicsFactory.drawShape(Ln(u),s,{width:c.width,height:c.height}),Fe(u,c.x,c.y),this._previewSupport.addDragger(s,a,u)})}cleanUp(){_r(this._canvas.getLayer(qu)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(qu)}hide(){this._canvas.hideLayer(qu)}};jo.$inject=["canvas","graphicsFactory","previewSupport"];function BR(e){return e.hidden}var Rg={__depends__:[Dn],__init__:["complexPreview"],complexPreview:["type",jo]};var Nf=["top","bottom","left","right"],Ku=10;function es(e,t){k.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var o=i.context,a=o.connection,s=a.source,c=a.target,u=o.hints||{};u.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(i){var o=i.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(i){var o=i.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(i){if(Xr(i)&&!de(i)){var o=jR(i);o&&r(i,o)}}function r(i,o){var a=X(i),s=i.label,c=X(s);if(s.parent){var u=Z(i),p;switch(o){case"top":p={x:a.x,y:u.top-Ku-s.height/2};break;case"left":p={x:u.left-Ku-s.width/2,y:a.y};break;case"bottom":p={x:a.x,y:u.bottom+Ku+s.height/2};break;case"right":p={x:u.right+Ku+s.width/2,y:a.y};break}var l=Dt(p,c);t.moveShape(s,l)}}}B(es,k);es.$inject=["eventBus","modeling"];function IR(e){var t=e.host,n=X(e),r=He(n,t),i;r.indexOf("-")>=0?i=r.split("-"):i=[r];var o=Nf.filter(function(a){return i.indexOf(a)===-1});return o}function LR(e){var t=X(e),n=[].concat(e.incoming.map(function(r){return r.waypoints[r.waypoints.length-2]}),e.outgoing.map(function(r){return r.waypoints[1]})).map(function(r){return Pg(t,r)});return n}function jR(e){var t=X(e.label),n=X(e),r=Pg(n,t);if(FR(r)){var i=LR(e);if(e.host){var o=IR(e);i=i.concat(o)}var a=Nf.filter(function(s){return i.indexOf(s)===-1});return a.indexOf(r)!==-1?He(e.label,e)!=="intersect"?void 0:r:a[0]}}function Pg(e,t){return He(t,e,5)}function FR(e){return Nf.indexOf(e)!==-1}function ts(e){k.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,r=t.shape;t.position||(h(r,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-r.height/2}:t.position={x:n.x+n.width+80+r.width/2,y:n.y+n.height/2})},!0)}B(ts,k);ts.$inject=["eventBus"];N();var HR=1500;function ns(e,t,n){e.invoke(k,this),this.preExecute("elements.delete",HR,function(i){var o=i.context,a=o.elements,s=r(a);s.length&&(o.elements=a.concat(s))}),t.on("shape.move.start",function(i){var o=i.context.shapes,a=r(o);a.length&&(i.context.shapes=o.concat(a))});function r(i){var o=Q(i,u=>h(u,"bpmn:Participant")||h(u,"bpmn:SubProcess"));if(!o.length)return[];var a=n.getRootElement(),s=new Set(a.children.filter(u=>h(u,"bpmn:Artifact"))),c=new Set;return E(o,u=>{let p=new Set(Sn(wi(Array.from(s),Ce(u))));c=c.union(p),s=s.difference(p)}),Array.from(c)}}B(ns,k);ns.$inject=["injector","eventBus","canvas"];N();function rs(e,t){e.invoke(k,this),this.postExecute("shape.move",function(n){var r=n.newParent,i=n.shape,o=Q(i.incoming.concat(i.outgoing),function(a){return h(a,"bpmn:Association")});E(o,function(a){t.moveConnection(a,{x:0,y:0},r)})},!0)}B(rs,k);rs.$inject=["injector","modeling"];var Ag=500;function Fo(e,t){t.invoke(k,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Ag,function(r){var i=r.elements;i=i.filter(function(o){var a=o.host;return Tg(o,a)}),i.length===1&&i.map(function(o){return i.indexOf(o)}).forEach(function(o){var a=i[o];r.elements[o]=n._replaceShape(i[o],a)})},!0),this.preExecute("elements.move",Ag,function(r){var i=r.shapes,o=r.newHost;if(i.length===1){var a=i[0];Tg(a,o)&&(r.shapes=[n._replaceShape(a,o)])}},!0)}Fo.$inject=["bpmnReplace","injector"];B(Fo,k);Fo.prototype._replaceShape=function(e,t){var n=$R(e),r={type:"bpmn:BoundaryEvent",host:t};return n&&(r.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function $R(e){var t=j(e),n=t.eventDefinitions;return n&&n[0]}function Tg(e,t){return!ee(e)&&te(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}N();function is(e,t){k.call(this,e);function n(r){return Q(r.attachers,function(i){return h(i,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(r){var i=r.context.source,o=r.context.target,a=n(o);h(i,"bpmn:EventBasedGateway")&&h(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(r){var i=r.context.oldSource,o=r.context.newSource;h(i,"bpmn:Gateway")&&h(o,"bpmn:EventBasedGateway")&&E(o.outgoing,function(a){var s=a.target,c=n(s);h(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}is.$inject=["eventBus","modeling"];B(is,k);function as(e,t,n){k.call(this,e),this.preExecute("shape.replace",s,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",i,!0),this.postExecuted("connection.delete",r,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",a,!0);function r(v){let w=v.source,S=v.target;Ho(w)&&os(S)&&p(S)}function i(v){let w=v.connection,S=v.source,x=v.target;Ho(S)&&Yu(x)&&(u(x),f(S,[w]))}function o(v){let w=v.newTarget,S=v.oldSource,x=v.oldTarget;if(x!==w){let b=S;os(x)&&p(x),Ho(b)&&Yu(w)&&u(w)}}function a(v){let{element:w}=v;os(w)?(l(w),d(w)):Yu(w)&&m(w)}function s(v){let{newData:w,oldShape:S}=v;if(Ho(v.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){let x=S.outgoing.find(({target:b})=>os(b));x&&x.target&&(v._connectionTarget=x.target)}else if(!Ho(v.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){let x=S.outgoing.find(({target:b})=>Yu(b));x&&x.target&&(v._connectionTarget=x.target),g(S)}}function c(v){let{_connectionTarget:w,newShape:S}=v;w&&t.connect(S,w)}function u(v){t.updateProperties(v,{isForCompensation:!0})}function p(v){t.updateProperties(v,{isForCompensation:void 0})}function l(v){for(let w of v.incoming)n.canConnect(w.source,v)||t.removeConnection(w);for(let w of v.outgoing)n.canConnect(v,w.target)||t.removeConnection(w)}function f(v,w){v.outgoing.filter(b=>h(b,"bpmn:Association")).filter(b=>os(b.target)&&!w.includes(b)).forEach(b=>t.removeConnection(b))}function d(v){let w=v.attachers.slice();w.length&&t.removeElements(w)}function m(v){let w=v.incoming.filter(S=>Ho(S.source));t.removeElements(w)}function g(v){let w=v.outgoing.filter(S=>h(S,"bpmn:SequenceFlow"));t.removeElements(w)}}B(as,k);as.$inject=["eventBus","modeling","bpmnRules"];function os(e){let t=j(e);return t&&t.get("isForCompensation")}function Ho(e){return e&&h(e,"bpmn:BoundaryEvent")&&Er(e,"bpmn:CompensateEventDefinition")}function Yu(e){return e&&h(e,"bpmn:Activity")&&!Qe(e)}function ss(e){e.invoke(k,this),this.preExecute("shape.create",1500,function(t){var n=t.context,r=n.parent,i=n.shape;h(r,"bpmn:Lane")&&!h(i,"bpmn:Lane")&&(n.parent=kr(r,"bpmn:Participant"))})}ss.$inject=["injector"];B(ss,k);function cs(e,t){k.call(this,e),this.preExecute("shape.create",function(n){var a;var r=n.context,i=r.shape;if(h(i,"bpmn:DataObjectReference")&&i.type!=="label"){var o=t.create("bpmn:DataObject");o.isCollection=((a=i.businessObject.dataObjectRef)==null?void 0:a.isCollection)||!1,i.businessObject.dataObjectRef=o}})}cs.$inject=["eventBus","bpmnFactory"];B(cs,k);N();var Of=20,Bf=20,Mg=30,Xu=2e3;function us(e,t,n){k.call(this,t),t.on(["create.start","shape.move.start"],Xu,function(i){var o=i.context,a=o.shape,s=e.getRootElement();if(!(!h(a,"bpmn:Participant")||!h(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(l){return!h(l,"bpmn:Group")&&!ee(l)&&!de(l)});if(c.length){var u=Ce(c),p=zR(a,u);C(a,p),o.createConstraints=GR(a,u)}}}),t.on("create.start",Xu,function(i){var o=i.context,a=o.shape,s=e.getRootElement(),c=e.getGraphics(s);function u(p){p.element=s,p.gfx=c}h(a,"bpmn:Participant")&&h(s,"bpmn:Process")&&(t.on("element.hover",Xu,u),t.once("create.cleanup",function(){t.off("element.hover",u)}))});function r(){var i=e.getRootElement();return h(i,"bpmn:Collaboration")?i:n.makeCollaboration()}this.preExecute("elements.create",Xu,function(i){var o=i.elements,a=i.parent,s=VR(o),c;s&&h(a,"bpmn:Process")&&(i.parent=r(),c=i.hints=i.hints||{},c.participant=s,c.process=a,c.processRef=j(s).get("processRef"))},!0),this.preExecute("shape.create",function(i){var o=i.parent,a=i.shape;h(a,"bpmn:Participant")&&h(o,"bpmn:Process")&&(i.parent=r(),i.process=o,i.processRef=j(a).get("processRef"))},!0),this.execute("shape.create",function(i){var o=i.hints||{},a=i.process||o.process,s=i.shape,c=o.participant;a&&(!c||s===c)&&j(s).set("processRef",j(a))},!0),this.revert("shape.create",function(i){var o=i.hints||{},a=i.process||o.process,s=i.processRef||o.processRef,c=i.shape,u=o.participant;a&&(!u||c===u)&&j(c).set("processRef",s)},!0),this.postExecute("shape.create",function(i){var o=i.hints||{},a=i.process||i.hints.process,s=i.shape,c=o.participant;if(a){var u=a.children.slice();c?s===c&&n.moveElements(u,{x:0,y:0},c):n.moveElements(u,{x:0,y:0},s)}},!0)}us.$inject=["canvas","eventBus","modeling"];B(us,k);function zR(e,t){t={width:t.width+Of*2+Mg,height:t.height+Bf*2};var n=Math.max(e.width,t.width),r=Math.max(e.height,t.height);return{x:-n/2,y:-r/2,width:n,height:r}}function GR(e,t){return t=Z(t),{bottom:t.top+e.height/2-Bf,left:t.right-e.width/2+Of,top:t.bottom-e.height/2+Bf,right:t.left+e.width/2-Of-Mg}}function VR(e){return re(e,function(t){return h(t,"bpmn:Participant")})}N();var Dg="__targetRef_placeholder";function ps(e,t){k.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],kg(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],kg(o));function n(a,s,c){var u=a.get("dataInputAssociations");return re(u,function(p){return p!==c&&p.targetRef===s})}function r(a,s){var c=a.get("properties"),u=re(c,function(p){return p.name===Dg});return!u&&s&&(u=t.create("bpmn:Property",{name:Dg}),Ae(c,u)),u}function i(a,s){var c=r(a);c&&(n(a,c,s)||Oe(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,u=c.businessObject,p=c.target,l=p&&p.businessObject,f=s.newTarget,d=f&&f.businessObject,m=s.oldTarget||s.target,g=m&&m.businessObject,v=c.businessObject,w;g&&g!==l&&i(g,u),d&&d!==l&&i(d,u),l?(w=r(l,!0),v.targetRef=w):v.targetRef=null}}ps.$inject=["eventBus","bpmnFactory"];B(ps,k);function kg(e){return function(t){var n=t.context,r=n.connection;if(h(r,"bpmn:DataInputAssociation"))return e(t)}}function $o(e){this._bpmnUpdater=e}$o.$inject=["bpmnUpdater"];$o.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,r=e.newSemanticParent,i=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,r),this._bpmnUpdater.updateDiParent(n,i),[]};$o.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,r=e.oldSemanticParent,i=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,r),this._bpmnUpdater.updateDiParent(n,i),[]};function ls(e,t,n,r){k.call(this,r),t.registerHandler("dataStore.updateContainment",$o);function i(){return n.filter(function(s){return h(s,"bpmn:Participant")&&j(s).processRef})[0]}function o(s){return s.children.filter(function(c){return h(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var u=s.businessObject||s;if(c=c||i(),c){var p=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:u,dataStoreDi:ce(s),newSemanticParent:p.processRef||p,newDiParent:ce(c)})}}this.preExecute("shape.create",function(s){var c=s.context,u=c.shape;h(u,"bpmn:DataStoreReference")&&u.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,u=c.shapes,p=u.filter(function(l){return h(l,"bpmn:DataStoreReference")});p.length&&(c.hints||(c.hints={}),c.hints.autoResize=u.filter(function(l){return!h(l,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,u=c.shape,p=u.parent;h(u,"bpmn:DataStoreReference")&&u.type!=="label"&&h(p,"bpmn:Collaboration")&&a(u)}),this.postExecute("shape.move",function(s){var c=s.context,u=c.shape,p=c.oldParent,l=u.parent;if(!h(p,"bpmn:Collaboration")&&h(u,"bpmn:DataStoreReference")&&u.type!=="label"&&h(l,"bpmn:Collaboration")){var f=h(p,"bpmn:Participant")?p:UR(p,"bpmn:Participant");a(u,f)}}),this.postExecute("shape.delete",function(s){var c=s.context,u=c.shape,p=e.getRootElement();te(u,["bpmn:Participant","bpmn:SubProcess"])&&h(p,"bpmn:Collaboration")&&o(p).filter(function(l){return WR(l,u)}).forEach(function(l){a(l)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,u=c.oldRoot,p=c.newRoot,l=o(u);l.forEach(function(f){h(p,"bpmn:Process")&&a(f,p)})})}ls.$inject=["canvas","commandStack","elementRegistry","eventBus"];B(ls,k);function WR(e,t){for(var n=e.businessObject||e,r=t.businessObject||t;n.$parent;){if(n.$parent===r.processRef||r)return!0;n=n.$parent}return!1}function UR(e,t){for(;e.parent;){if(h(e.parent,t))return e.parent;e=e.parent}}N();var Qu=Math.max,Ju=Math.min,qR=20;function ep(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function Ng(e,t,n){var r=n.x,i=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(o.y=e.y+i,o.height=e.height-i):t.indexOf("s")!==-1&&(o.height=e.height+i),t.indexOf("e")!==-1?o.width=e.width+r:t.indexOf("w")!==-1&&(o.x=e.x+r,o.width=e.width-r),o}function Og(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function Zu(e,t,n){var r=t[e],i=n.min&&n.min[e],o=n.max&&n.max[e];return ne(i)&&(r=(/top|left/.test(e)?Ju:Qu)(r,i)),ne(o)&&(r=(/top|left/.test(e)?Qu:Ju)(r,o)),r}function Bg(e,t){if(!t)return e;var n=Z(e);return Si({top:Zu("top",n,t),right:Zu("right",n,t),bottom:Zu("bottom",n,t),left:Zu("left",n,t)})}function Ig(e,t,n,r){var i=Z(t),o={top:/n/.test(e)?i.bottom-n.height:i.top,left:/w/.test(e)?i.right-n.width:i.left,bottom:/s/.test(e)?i.top+n.height:i.bottom,right:/e/.test(e)?i.left+n.width:i.right},a=r?Z(r):o,s={top:Ju(o.top,a.top),left:Ju(o.left,a.left),bottom:Qu(o.bottom,a.bottom),right:Qu(o.right,a.right)};return Si(s)}function fs(e,t){return typeof e!="undefined"?e:qR}function KR(e,t){var n,r,i,o;return typeof t=="object"?(n=fs(t.left),r=fs(t.right),i=fs(t.top),o=fs(t.bottom)):n=r=i=o=fs(t),{x:e.x-n,y:e.y-i,width:e.width+n+r,height:e.height+i+o}}function YR(e){return!(e.waypoints||e.type==="label")}function tp(e,t){var n;if(e.length===void 0?n=Q(e.children,YR):n=e,n.length)return KR(Ce(n),t)}var si=Math.abs;function XR(e,t){return ep(Z(t),Z(e))}var ZR=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],on=30;function zo(e,t){return t=t||[],e.children.filter(function(n){h(n,"bpmn:Lane")&&(zo(n,t),t.push(n))}),t}function yn(e){return e.children.filter(function(t){return h(t,"bpmn:Lane")})}function Bt(e){return kr(e,ZR)||e}function Lg(e,t){var n=Bt(e),r=h(n,"bpmn:Process")?[]:[n],i=zo(n,r),o=Z(e),a=Z(t),s=XR(e,t),c=[],u=Me(e);return i.forEach(function(p){if(p!==e){var l=u?0:s.top,f=u?s.right:0,d=u?0:s.bottom,m=u?s.left:0,g=Z(p);s.top&&(si(g.bottom-o.top)<10&&(d=a.top-g.bottom),si(g.top-o.top)<5&&(l=a.top-g.top)),s.left&&(si(g.right-o.left)<10&&(f=a.left-g.right),si(g.left-o.left)<5&&(m=a.left-g.left)),s.bottom&&(si(g.top-o.bottom)<10&&(l=a.bottom-g.top),si(g.bottom-o.bottom)<5&&(d=a.bottom-g.bottom)),s.right&&(si(g.left-o.right)<10&&(m=a.right-g.left),si(g.right-o.right)<5&&(f=a.right-g.right)),(l||f||d||m)&&c.push({shape:p,newBounds:Og(p,{top:l,right:f,bottom:d,left:m})})}}),c}var QR=500;function ds(e,t){k.call(this,e);function n(r,i){var o=Me(r),a=yn(i),s=[],c=[],u=[],p=[];if(In(a,function(v){return o?v.y>r.y?c.push(v):s.push(v):v.x>r.x?p.push(v):u.push(v),v.children}),!!a.length){var l;o?c.length&&s.length?l=r.height/2:l=r.height:p.length&&u.length?l=r.width/2:l=r.width;var f,d,m,g;s.length&&(f=t.calculateAdjustments(s,"y",l,r.y-10),t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:l},"s")),c.length&&(d=t.calculateAdjustments(c,"y",-l,r.y+r.height+10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:-l},"n")),u.length&&(m=t.calculateAdjustments(u,"x",l,r.x-10),t.makeSpace(m.movingShapes,m.resizingShapes,{x:l,y:0},"e")),p.length&&(g=t.calculateAdjustments(p,"x",-l,r.x+r.width+10),t.makeSpace(g.movingShapes,g.resizingShapes,{x:-l,y:0},"w"))}}this.postExecuted("shape.delete",QR,function(r){var i=r.context,o=i.hints,a=i.shape,s=i.oldParent;h(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}ds.$inject=["eventBus","spaceTool"];B(ds,k);var jg=500;function Go(e,t){t.invoke(k,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",jg,function(r){var i=r.elements;i.filter(function(o){var a=o.host;return Fg(o,a)}).map(function(o){return i.indexOf(o)}).forEach(function(o){r.elements[o]=n._replaceShape(i[o])})},!0),this.preExecute("elements.move",jg,function(r){var i=r.shapes,o=r.newHost;i.forEach(function(a,s){var c=a.host;Fg(a,eP(i,c)?c:o)&&(i[s]=n._replaceShape(a))})},!0)}Go.$inject=["bpmnReplace","injector"];B(Go,k);Go.prototype._replaceShape=function(e){var t=JR(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function JR(e){var t=j(e),n=t.eventDefinitions;return n&&n[0]}function Fg(e,t){return!ee(e)&&h(e,"bpmn:BoundaryEvent")&&!t}function eP(e,t){return e.indexOf(t)!==-1}N();function ms(e,t,n){k.call(this,e);function r(i,o,a){var s=o.waypoints,c,u,p,l,f,d,m,g=i.outgoing.slice(),v=i.incoming.slice(),w;ne(a.width)?w=X(a):w=a;var S=Ua(s,w);if(S){if(c=s.slice(0,S.index),u=s.slice(S.index+(S.bendpoint?1:0)),!c.length||!u.length)return;p=S.bendpoint?s[S.index]:w,(c.length===1||!Hg(i,c[c.length-1]))&&c.push($g(p)),(u.length===1||!Hg(i,u[0]))&&u.unshift($g(p))}l=o.source,f=o.target,t.canConnect(l,i,o)&&(n.reconnectEnd(o,i,c||w),d=o),t.canConnect(i,f,o)&&(d?m=n.connect(i,f,{type:o.type,waypoints:u}):(n.reconnectStart(o,i,u||w),m=o));var x=[].concat(d&&Q(v,function(b){return b.source===d.source})||[],m&&Q(g,function(b){return b.target===m.target})||[]);x.length&&n.removeElements(x)}this.preExecute("elements.move",function(i){var o=i.newParent,a=i.shapes,s=i.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(i.newParent=o=o.parent);var u=X(c),p={x:u.x+s.x,y:u.y+s.y},l=re(o.children,function(f){var d=t.canInsert(a,f);return d&&Ua(f.waypoints,p)});l&&(i.targetFlow=l,i.position=p)}},!0),this.postExecuted("elements.move",function(i){var o=i.shapes,a=i.targetFlow,s=i.position;a&&r(o[0],a,s)},!0),this.preExecute("shape.create",function(i){var o=i.parent,a=i.shape;t.canInsert(a,o)&&(i.targetFlow=o,i.parent=o.parent)},!0),this.postExecuted("shape.create",function(i){var o=i.shape,a=i.targetFlow,s=i.position;a&&r(o,a,s)},!0)}B(ms,k);ms.$inject=["eventBus","bpmnRules","modeling"];function Hg(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 $g(e){return C({},e)}function hs(e,t){k.call(this,e),this.preExecuted("connection.create",function(n){var r=n.context,i=r.connection,o=r.source,a=r.target,s=r.hints;if(!(s&&s.createElementsBehavior===!1)&&Vo(i)){var c=[];h(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(u=>u!==i&&Vo(u)):c=a.incoming.filter(u=>u!==i&&Vo(u)&&h(u.source,"bpmn:EventBasedGateway")),c.forEach(function(u){t.removeConnection(u)})}}),this.preExecuted("shape.replace",function(n){var r=n.context,i=r.newShape;if(h(i,"bpmn:EventBasedGateway")){var o=i.outgoing.filter(Vo).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(Vo).forEach(function(s){let c=a.incoming.filter(Vo).filter(function(u){return u.source===i});(s.source!==i||c.length>1)&&t.removeConnection(s)})})}})}hs.$inject=["eventBus","modeling"];B(hs,k);function Vo(e){return h(e,"bpmn:SequenceFlow")}var np=1500,zg=2e3;function rp(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],np,function(r){var i=r.context,o=i.shape||r.shape,a=r.hover;h(a,"bpmn:Lane")&&!te(o,["bpmn:Lane","bpmn:Participant"])&&(r.hover=Bt(a),r.hoverGfx=e.getGraphics(r.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||te(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(r.hover=s,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],np,function(r){var i=r.hover;h(i,"bpmn:Lane")&&(r.hover=Bt(i)||i,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["bendpoint.move.hover"],np,function(r){var i=r.context,o=r.hover,a=i.type;h(o,"bpmn:Lane")&&/reconnect/.test(a)&&(r.hover=Bt(o)||o,r.hoverGfx=e.getGraphics(r.hover))}),t.on(["connect.start"],np,function(r){var i=r.context,o=i.start;h(o,"bpmn:Lane")&&(i.start=Bt(o)||o)}),t.on("shape.move.start",zg,function(r){var i=r.shape;h(i,"bpmn:Lane")&&(r.shape=Bt(i)||i)}),t.on("spaceTool.move",zg,function(r){var i=r.hover;i&&h(i,"bpmn:Lane")&&(r.hover=Bt(i))})}rp.$inject=["elementRegistry","eventBus","canvas"];function Gg(e){return e.create("bpmn:Category")}function Vg(e){return e.create("bpmn:CategoryValue")}function Wg(e,t,n){return Ae(t.get("categoryValue"),e),e.$parent=t,Ae(n.get("rootElements"),t),t.$parent=n,e}function Ug(e){var t=e.$parent;return t&&(Oe(t.get("categoryValue"),e),e.$parent=null),e}function qg(e){var t=e.$parent;return t&&(Oe(t.get("rootElements"),e),e.$parent=null),e}var Kg=770;function vs(e,t,n,r,i,o){i.invoke(k,this);function a(){return n.filter(function(m){return h(m,"bpmn:Group")})}function s(m,g){return m.some(function(v){var w=j(v),S=w.categoryValueRef&&w.categoryValueRef.$parent;return S===g})}function c(m,g){return m.some(function(v){var w=j(v);return w.categoryValueRef===g})}function u(m,g,v){var w=a().filter(function(S){return S.businessObject!==v});g&&!s(w,g)&&qg(g),m&&!c(w,m)&&Ug(m)}function p(m,g){return Wg(m,g,t.getDefinitions())}function l(m,g){var v=j(m),w=v.categoryValueRef;w||(w=v.categoryValueRef=g.categoryValue=g.categoryValue||Vg(e));var S=w.$parent;S||(S=w.$parent=g.category=g.category||Gg(e)),p(w,S,t.getDefinitions())}function f(m,g){var v=g.category,w=g.categoryValue,S=j(m);w?(S.categoryValueRef=null,u(w,v,S)):u(null,S.categoryValueRef.$parent,S)}this.execute("label.create",function(m){var g=m.context,v=g.labelTarget;h(v,"bpmn:Group")&&l(v,g)}),this.revert("label.create",function(m){var g=m.context,v=g.labelTarget;h(v,"bpmn:Group")&&f(v,g)}),this.execute("shape.delete",function(m){var g=m.context,v=g.shape,w=j(v);if(!(!h(v,"bpmn:Group")||v.labelTarget)){var S=g.categoryValue=w.categoryValueRef,x;S&&(x=g.category=S.$parent,u(S,x,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(m){var g=m.context,v=g.shape;if(!(!h(v,"bpmn:Group")||v.labelTarget)){var w=g.category,S=g.categoryValue,x=j(v);S&&(x.categoryValueRef=S,p(S,w))}}),this.execute("shape.create",function(m){var g=m.context,v=g.shape;!h(v,"bpmn:Group")||v.labelTarget||j(v).categoryValueRef&&l(v,g)}),this.reverted("shape.create",function(m){var g=m.context,v=g.shape;!h(v,"bpmn:Group")||v.labelTarget||j(v).categoryValueRef&&f(v,g)});function d(m,g){var v=e.create(m.$type);return o.copyElement(m,v,null,g)}r.on("copyPaste.copyElement",Kg,function(m){var g=m.descriptor,v=m.element;if(!(!h(v,"bpmn:Group")||v.labelTarget)){var w=j(v);if(w.categoryValueRef){var S=w.categoryValueRef;g.categoryValue=d(S,!0),S.$parent&&(g.category=d(S.$parent,!0))}}}),r.on("copyPaste.pasteElement",Kg,function(m){var g=m.descriptor,v=g.businessObject,w=g.categoryValue,S=g.category;w&&(w=v.categoryValueRef=d(w)),S&&(w.$parent=d(S)),delete g.category,delete g.categoryValue})}vs.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"];B(vs,k);function Wo(e,t,n,r){var i,o,a,s,c;return i=(r.y-n.y)*(t.x-e.x)-(r.x-n.x)*(t.y-e.y),i==0?null:(o=e.y-n.y,a=e.x-n.x,c=(r.x-n.x)*o-(r.y-n.y)*a,s=c/i,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function ip(e){function t(r,i,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=Wo(r,i,o,a),u=Wo(r,i,o,s),p;c&&u?Yg(c,o)>Yg(u,o)?p=u:p=c:p=c||u,r.original=p}function n(r){var i=r.waypoints;t(i[0],i[1],X(r.source)),t(i[i.length-1],i[i.length-2],X(r.target))}e.on("bpmnElement.added",function(r){var i=r.element;i.waypoints&&n(i)})}ip.$inject=["eventBus"];function Yg(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gs(e){k.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var r=n.context.shape,i=j(r),o=ce(r);if(te(i,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}gs.$inject=["eventBus"];B(gs,k);N();var ey=Math.sqrt,ty=Math.min,tP=Math.max,Xg=Math.abs;function Zg(e){return Math.pow(e,2)}function ys(e,t){return ey(Zg(e.x-t.x)+Zg(e.y-t.y))}function ny(e,t){var n=0,r,i,o,a,s,c,u,p,l,f,d;for(n=0;n<t.length-1;n++){if(r=t[n],i=t[n+1],Jg(r,i)?u=[r]:(o=ys(e,r),a=ys(e,i),c=ty(o,a),u=nP(r,i,e,c)),u.length<1)throw new Error("expected between [1, 2] circle -> line intersections");u.length===1&&(p={type:"bendpoint",position:u[0],segmentIndex:n,bendpointIndex:Jg(r,u[0])?n:n+1}),u.length===2&&(s=iP(u[0],u[1]),p={type:"segment",position:s,segmentIndex:n,relativeLocation:ys(r,s)/ys(r,i)}),l=ys(p.position,e),(!d||f>l)&&(d=p,f=l)}return d}function nP(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=i*i+o*o,u=i*a+o*s,p=a*a+s*s-r*r,l=u/c,f=p/c,d=l*l-f;if(d<0&&d>-1e-6&&(d=0),d<0)return[];var m=ey(d),g=-l+m,v=-l-m,w={x:e.x-i*g,y:e.y-o*g};if(d===0)return[w];var S={x:e.x-i*v,y:e.y-o*v};return[w,S].filter(function(x){return rP(x,e,t)})}function rP(e,t,n){return Qg(e.x,t.x,n.x)&&Qg(e.y,t.y,n.y)}function Qg(e,t,n){return e>=ty(t,n)-op&&e<=tP(t,n)+op}function iP(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var op=.1;function Jg(e,t){return Xg(e.x-t.x)<=op&&Xg(e.y-t.y)<=op}function iy(e,t,n,r){var i=n.segmentIndex,o=t.length-e.length;if(r.segmentMove){var a=r.segmentMove.segmentStartIndex,s=r.segmentMove.newSegmentStartIndex;return i===a?s:i>=s?i+o<s?s:i+o:i}if(r.bendpointMove){var c=r.bendpointMove.insert,u=r.bendpointMove.bendpointIndex,p;if(o===0)return i;if(i>=u&&(p=c?i+1:i-1),i<u&&(p=i,c&&n.type!=="bendpoint"&&u-1===i)){var l=oy(t,u);l<n.relativeLocation&&p++}return p}return o===0?i:r.connectionStart&&i===0?0:r.connectionEnd&&i===e.length-2?t.length-2:Math.floor((t.length-2)/2)}function ap(e,t,n,r){var i=0,o=0,a={point:e,delta:{x:0,y:0}},s=ny(e,n),c=s.segmentIndex,u=iy(n,t,s,r);if(u<0||u>t.length-2||u===null)return a;var p=ry(n,c),l=ry(t,u),f=s.position,d=aP(p,f),m=oP(p,l);if(s.type==="bendpoint"){var g=t.length-n.length,v=s.bendpointIndex,w=n[v];if(t.indexOf(w)!==-1)return a;if(g===0){var S=t[v];return i=S.x-s.position.x,o=S.y-s.position.y,{delta:{x:i,y:o},point:{x:e.x+i,y:e.y+o}}}g<0&&v!==0&&v<n.length-1&&(d=oy(n,v))}var x={x:(l[1].x-l[0].x)*d+l[0].x,y:(l[1].y-l[0].y)*d+l[0].y},b=ag({x:e.x-f.x,y:e.y-f.y},m);return i=x.x+b.x-e.x,o=x.y+b.y-e.y,{point:Rn(x),delta:Rn({x:i,y:o})}}function oy(e,t){var n=Li(e[t-1],e[t]),r=Li(e[t],e[t+1]),i=n/(n+r);return i}function oP(e,t){var n=Af(e),r=Af(t);return r-n}function ry(e,t){return[e[t],e[t+1]]}function aP(e,t){var n=Li(e[0],e[1]),r=Li(e[0],t);return n===0?0:r/n}function ay(e,t,n,r){var i=X(e);return ap(i,t,n,r).delta}function Hi(e,t,n){var r=So(t),i=So(n),o=Dt(e,r),a={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return Rn({x:i.x+a.x,y:i.y+a.y})}function If(e,t,n){var r=So(e),i=So(t),o=So(n),a=Dt(e,r),s=Dt(r,i),c=sP(r,t,n);if(c)return c;var u={x:s.x*(n.width/t.width),y:s.y*(n.height/t.height)},p={x:o.x+u.x,y:o.y+u.y};return Rn({x:p.x+a.x-e.x,y:p.y+a.y-e.y})}function sP(e,t,n){var r=Z(t),i=Z(n);if(cP(r,i))return null;var o=He(t,e),a,s,c;if(o==="top")a={x:0,y:i.bottom-r.bottom};else if(o==="bottom")a={x:0,y:i.top-r.top};else if(o==="right")a={x:i.left-r.left,y:0};else if(o==="left")a={x:i.right-r.right,y:0};else return null;return s={x:e.x+a.x,y:e.y+a.y},c=He(n,s),c!==o?null:a}function cP(e,t){return uP(e,t)||pP(e,t)}function uP(e,t){return e.right!==t.right&&e.left!==t.left}function pP(e,t){return e.top!==t.top&&e.bottom!==t.bottom}N();var sy="name",cy="text";function _s(e,t,n,r){k.call(this,e),this.postExecute("element.updateProperties",i),this.postExecute("element.updateModdleProperties",a=>{j(a.context.element)===a.context.moddleElement&&i(a)});function i(a){var s=a.context,c=s.element,u=s.properties;if(sy in u&&t.updateLabel(c,u[sy]),cy in u&&h(c,"bpmn:TextAnnotation")){var p=r.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},u[cy]||"");t.updateLabel(c,u.text,p)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var u=s.shape||s.connection;ee(u)||!mn(u)||gt(u)&&t.updateLabel(u,gt(u))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,u=s.hints||{};c&&u.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,u=c.label,p=C({},s.hints),l=s.newWaypoints||c.waypoints,f=s.oldWaypoints;return typeof p.startChanged=="undefined"&&(p.startChanged=!!p.connectionStart),typeof p.endChanged=="undefined"&&(p.endChanged=!!p.connectionEnd),ay(u,l,f,p)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var u=s.connection,p=u.label,l;!p||!p.parent||(l=o(a),t.moveShape(p,l))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,u=s.oldShape,p=j(c);p&&mn(p)&&u.label&&c.label&&(c.label.x=u.label.x,c.label.y=u.label.y)}),this.preExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.hints||{};if(!(!ee(c)||u.autoResize)){var p=s.newBounds,l=r.getDimensions(gt(c)||"",{box:p,style:r.getExternalStyle()}),f=Math.ceil(l.height),d=p.y!==c.y,m=c.y+c.height;s.newBounds={width:p.width,height:f,x:p.x,y:d?m-f:p.y}}}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.newBounds,p=s.oldBounds;if(Xr(c)){var l=c.label,f=X(l),d=dP(p),m=fP(f,d),g=lP(m,p,u);t.moveShape(l,g)}})}B(_s,k);_s.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function lP(e,t,n){var r=Hi(e,t,n);return Rn(Dt(r,e))}function fP(e,t){if(t.length){var n=mP(e,t);return qa(e,n)}}function dP(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function mP(e,t){var n=t.map(function(i){return{line:i,distance:Nu(e,i)}}),r=At(n,"distance");return r[0].line}N();function uy(e,t,n,r){return ap(e,t,n,r).point}function bs(e,t){k.call(this,e);function n(r,i){var o=r.context,a=o.connection,s=C({},o.hints),c=o.newWaypoints||a.waypoints,u=o.oldWaypoints;return typeof s.startChanged=="undefined"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged=="undefined"&&(s.endChanged=!!s.connectionEnd),uy(i,c,u,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(r){var i=r.context,o=i.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var u=c.waypoints[c.waypoints.length-1],p=n(r,u),l=[].concat(c.waypoints.slice(0,-1),[p]);t.updateWaypoints(c,l)}),a.forEach(function(c){var u=c.waypoints[0],p=n(r,u),l=[].concat([p],c.waypoints.slice(1));t.updateWaypoints(c,l)})}),this.postExecute(["connection.move"],function(r){var i=r.context,o=i.connection,a=o.outgoing,s=o.incoming,c=i.delta;s.forEach(function(u){var p=u.waypoints[u.waypoints.length-1],l={x:p.x+c.x,y:p.y+c.y},f=[].concat(u.waypoints.slice(0,-1),[l]);t.updateWaypoints(u,f)}),a.forEach(function(u){var p=u.waypoints[0],l={x:p.x+c.x,y:p.y+c.y},f=[].concat([l],u.waypoints.slice(1));t.updateWaypoints(u,f)})})}B(bs,k);bs.$inject=["eventBus","modeling"];N();function ci(e,t,n){var r=sp(e),i=ly(r,t),o=r[0];return i.length?i[i.length-1]:Hi(o.original||o,n,t)}function ui(e,t,n){var r=sp(e),i=ly(r,t),o=r[r.length-1];return i.length?i[0]:Hi(o.original||o,n,t)}function Uo(e,t,n){var r=sp(e),i=py(t,n),o=r[0];return Hi(o.original||o,i,t)}function qo(e,t,n){var r=sp(e),i=py(t,n),o=r[r.length-1];return Hi(o.original||o,i,t)}function py(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function sp(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function ly(e,t){var n=je(e,vP);return Q(n,function(r){return hP(r,t)})}function hP(e,t){return He(t,e,1)==="intersect"}function vP(e){return e.original||e}function xs(e,t){k.call(this,e),this.postExecute("shape.replace",function(n){var r=n.oldShape,i=n.newShape;if(gP(r,i)){var o=yP(r);o.incoming.forEach(function(a){var s=ui(a,i,r);t.reconnectEnd(a,i,s)}),o.outgoing.forEach(function(a){var s=ci(a,i,r);t.reconnectStart(a,i,s)})}},!0)}xs.$inject=["eventBus","modeling"];B(xs,k);function gP(e,t){return h(e,"bpmn:Participant")&&ie(e)&&h(t,"bpmn:Participant")&&!ie(t)}function yP(e){var t=Zn([e],!1),n=[],r=[];return t.forEach(function(i){i!==e&&(i.incoming.forEach(function(o){h(o,"bpmn:MessageFlow")&&n.push(o)}),i.outgoing.forEach(function(o){h(o,"bpmn:MessageFlow")&&r.push(o)}))},[]),{incoming:n,outgoing:r}}var _P=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function cp(e){let t=j(e);if(!h(t,"bpmn:BoundaryEvent")&&!(h(t,"bpmn:StartEvent")&&Qe(t.$parent)))return!1;let n=t.get("eventDefinitions");return!n||!n.length?!1:_P.some(r=>h(n[0],r))}function up(e){return h(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function Es(e,t){e.invoke(k,this),this.postExecuted("shape.replace",function(n){let r=n.context.oldShape,i=n.context.newShape,o=n.context.hints;if(!cp(i))return;let a=up(i);if(o.targetElement&&o.targetElement[a]!==void 0)return;let c=j(r).get(a),u=j(i).get(a);c!==u&&t.updateProperties(i,{[a]:c})})}Es.$inject=["injector","modeling"];B(Es,k);function ws(e,t){k.call(this,e),this.preExecute("shape.resize",function(n){var r=n.shape,i=ce(r),o=i&&i.get("label"),a=o&&o.get("bounds");a&&t.updateModdleProperties(r,o,{bounds:void 0})},!0)}B(ws,k);ws.$inject=["eventBus","modeling"];function Ss(e,t,n){k.call(this,e),this.preExecute("shape.delete",function(r){var i=r.context.shape;if(!(i.incoming.length!==1||i.outgoing.length!==1)){var o=i.incoming[0],a=i.outgoing[0];if(!(!h(o,"bpmn:SequenceFlow")||!h(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=bP(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}B(Ss,k);Ss.$inject=["eventBus","bpmnRules","modeling"];function Ko(e){return e.original||e}function bP(e,t){var n=Wo(Ko(e[e.length-2]),Ko(e[e.length-1]),Ko(t[1]),Ko(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Ko(e[0]),Ko(t[t.length-1])]}function Cs(e,t){k.call(this,e),this.preExecute("shape.delete",function(n){var r=n.shape,i=r.parent;h(r,"bpmn:Participant")&&(n.collaborationRoot=i)},!0),this.postExecute("shape.delete",function(n){var r=n.collaborationRoot;if(r&&!r.businessObject.participants.length){var i=t.makeProcess(),o=r.children.slice();t.moveElements(o,{x:0,y:0},i)}},!0)}Cs.$inject=["eventBus","modeling"];B(Cs,k);N();function Rs(e,t,n,r){k.call(this,e);var i=r.get("dragging",!1);function o(c){var u=c.source,p=c.target,l=c.parent;if(l){var f,d;h(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(d=!0),n.canConnectMessageFlow(u,p)&&(f="bpmn:MessageFlow")),h(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(d=!0),n.canConnectSequenceFlow(u,p)&&(f="bpmn:SequenceFlow")),d&&t.removeConnection(c),f&&t.connect(u,p,{type:f,waypoints:c.waypoints.slice()})}}function a(c){var u=c.context,p=u.connection,l=u.newSource||p.source,f=u.newTarget||p.target,d,m;d=n.canConnect(l,f),!(!d||d.type===p.type)&&(m=t.connect(l,f,{type:d.type,associationDirection:d.associationDirection,waypoints:p.waypoints.slice()}),p.parent&&t.removeConnection(p),u.connection=m,i&&s(p,m))}function s(c,u){var p=i.context(),l=p&&p.payload.previousSelection,f;!l||!l.length||(f=l.indexOf(c),f!==-1&&l.splice(f,1,u))}this.postExecuted("elements.move",function(c){var u=c.closure,p=u.allConnections;E(p,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var u=c.context,p=u.properties,l=u.element,f=l.businessObject,d;p.default&&(d=re(l.outgoing,Ct({id:l.businessObject.default.id})),d&&t.updateProperties(d,{conditionExpression:void 0})),p.conditionExpression&&f.sourceRef.default===f&&t.updateProperties(l.source,{default:void 0})})}B(Rs,k);Rs.$inject=["eventBus","modeling","bpmnRules","injector"];N();function Yo(e,t,n,r,i,o){r.invoke(k,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,u=s.elements,p=Ge(u,function(l,f){var d=t.canReplace([f],f.host||f.parent||c);return d?l.concat(d.replacements):l},[]);p.length&&this._replaceElements(u,p)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,u=s.newHost,p=[];E(s.closure.topLevel,function(f){Qe(f)?p=p.concat(f.children):p=p.concat(f)}),p.length===1&&u&&(c=u);var l=t.canReplace(p,c);l&&this._replaceElements(p,l.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,u=s.newShape,p=c.attachers,l;p&&p.length&&(l=t.canReplace(p,u),this._replaceElements(p,l.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,u=s.newShape;i.unclaimId(c.businessObject.id,c.businessObject),i.updateProperties(u,{id:c.id})})}B(Yo,k);Yo.prototype._replaceElements=function(e,t){var n=this._elementRegistry,r=this._bpmnReplace,i=this._selection;E(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=r.replaceElement(s,a,{select:!1})}),t&&i.select(e)};Yo.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var xP=1500,fy={width:140,height:120},pp={width:300,height:60},lp={width:60,height:300},Ps={width:300,height:150},As={width:150,height:300},Lf={width:140,height:120},jf={width:100,height:40};function fp(e){e.on("resize.start",xP,function(t){var n=t.context,r=n.shape,i=n.direction,o=n.balanced;(h(r,"bpmn:Lane")||h(r,"bpmn:Participant"))&&(n.resizeConstraints=RP(r,i,o)),h(r,"bpmn:SubProcess")&&ie(r)&&(n.minDimensions=Lf),h(r,"bpmn:TextAnnotation")&&(n.minDimensions=jf)})}fp.$inject=["eventBus"];var pi=Math.abs,EP=Math.min,wP=Math.max;function dy(e,t,n,r){var i=e[t];e[t]=i===void 0?n:r(n,i)}function Xo(e,t,n){return dy(e,t,n,EP)}function Zo(e,t,n){return dy(e,t,n,wP)}var SP={top:20,left:50,right:20,bottom:20},CP={top:50,left:20,right:20,bottom:20};function RP(e,t,n){var r=Bt(e),i=!0,o=!0,a=zo(r,[r]),s=Z(e),c={},u={},p=Me(e),l=p?pp:lp;/n/.test(t)?u.top=s.bottom-l.height:/e/.test(t)?u.right=s.left+l.width:/s/.test(t)?u.bottom=s.top+l.height:/w/.test(t)&&(u.left=s.right-l.width),a.forEach(function(m){var g=Z(m);p?(g.top<s.top-10&&(i=!1),g.bottom>s.bottom+10&&(o=!1)):(g.left<s.left-10&&(i=!1),g.right>s.right+10&&(o=!1)),/n/.test(t)&&(n&&pi(s.top-g.bottom)<10&&Zo(c,"top",g.top+l.height),pi(s.top-g.top)<5&&Xo(u,"top",g.bottom-l.height)),/e/.test(t)&&(n&&pi(s.right-g.left)<10&&Xo(c,"right",g.right-l.width),pi(s.right-g.right)<5&&Zo(u,"right",g.left+l.width)),/s/.test(t)&&(n&&pi(s.bottom-g.top)<10&&Xo(c,"bottom",g.bottom-l.height),pi(s.bottom-g.bottom)<5&&Zo(u,"bottom",g.top+l.height)),/w/.test(t)&&(n&&pi(s.left-g.right)<10&&Zo(c,"left",g.left+l.width),pi(s.left-g.left)<5&&Xo(u,"left",g.right-l.width))});var f=r.children.filter(function(m){return!m.hidden&&!m.waypoints&&(h(m,"bpmn:FlowElement")||h(m,"bpmn:Artifact"))}),d=p?SP:CP;return f.forEach(function(m){var g=Z(m);/n/.test(t)&&(!p||i)&&Xo(u,"top",g.top-d.top),/e/.test(t)&&(p||o)&&Zo(u,"right",g.right+d.right),/s/.test(t)&&(!p||o)&&Zo(u,"bottom",g.bottom+d.bottom),/w/.test(t)&&(p||i)&&Xo(u,"left",g.left-d.left)}),{min:u,max:c}}var my=1001;function dp(e,t){e.on("resize.start",my+500,function(n){var r=n.context,i=r.shape;(h(i,"bpmn:Lane")||h(i,"bpmn:Participant"))&&(r.balanced=!Tr(n))}),e.on("resize.end",my,function(n){var r=n.context,i=r.shape,o=r.canExecute,a=r.newBounds;if(h(i,"bpmn:Lane")||h(i,"bpmn:Participant"))return o&&(a=wc(a),t.resizeLane(i,a,r.balanced)),!1})}dp.$inject=["eventBus","modeling"];N();var PP=500;function Ts(e,t,n,r,i){n.invoke(k,this);function o(p){return te(p,["bpmn:ReceiveTask","bpmn:SendTask"])||AP(p,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(p){var l=e.getDefinitions(),f=l.get("rootElements");return!!re(f,Ct({id:p.id}))}function s(p){if(h(p,"bpmn:ErrorEventDefinition"))return"errorRef";if(h(p,"bpmn:EscalationEventDefinition"))return"escalationRef";if(h(p,"bpmn:MessageEventDefinition"))return"messageRef";if(h(p,"bpmn:SignalEventDefinition"))return"signalRef"}function c(p){if(te(p,["bpmn:ReceiveTask","bpmn:SendTask"]))return p.get("messageRef");var l=p.get("eventDefinitions"),f=l[0];return f.get(s(f))}function u(p,l){if(te(p,["bpmn:ReceiveTask","bpmn:SendTask"]))return p.set("messageRef",l);var f=p.get("eventDefinitions"),d=f[0];return d.set(s(d),l)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(p){var l=p.shape||p.element;if(o(l)){var f=j(l),d=c(f),m;d&&!a(d)&&(m=e.getDefinitions().get("rootElements"),Ae(m,d),p.addedRootElement=d)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(p){var l=p.addedRootElement;if(l){var f=e.getDefinitions().get("rootElements");Oe(f,l)}},!0),t.on("copyPaste.copyElement",function(p){var l=p.descriptor,f=p.element;if(!(f.labelTarget||!o(f))){var d=j(f),m=c(d);m&&(l.referencedRootElement=m)}}),t.on("copyPaste.pasteElement",PP,function(p){var l=p.descriptor,f=l.businessObject,d=l.referencedRootElement;d&&(a(d)||(d=r.copyElement(d,i.create(d.$type))),u(f,d),delete l.referencedRootElement)})}Ts.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"];B(Ts,k);function AP(e,t){return q(t)||(t=[t]),Lt(t,function(n){return Er(e,n)})}N();var hy=Math.max;function mp(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,r=t.axis,i=t.start,o={};return E(n,function(a){var s=a.id;h(a,"bpmn:Participant")&&(o[s]=MP(a,r,i)),h(a,"bpmn:Lane")&&(o[s]=Me(a)?pp:lp),h(a,"bpmn:SubProcess")&&ie(a)&&(o[s]=Lf),h(a,"bpmn:TextAnnotation")&&(o[s]=jf),h(a,"bpmn:Group")&&(o[s]=fy)}),o})}mp.$inject=["eventBus"];function TP(e){return e==="x"}function MP(e,t,n){var r=Me(e);if(!NP(e))return r?Ps:As;var i=TP(t),o={};return i?r?o=Ps:o={width:kP(e,n,i),height:As.height}:r?o={width:Ps.width,height:DP(e,n,i)}:o=As,o}function DP(e,t,n){var r;return r=OP(e,t,n),hy(Ps.height,r)}function kP(e,t,n){var r;return r=BP(e,t,n),hy(As.width,r)}function NP(e){return!!yn(e).length}function OP(e,t,n){var r=yn(e),i;return i=Ff(r,t,n),e.height-i.height+pp.height}function BP(e,t,n){var r=yn(e),i;return i=Ff(r,t,n),e.width-i.width+lp.width}function Ff(e,t,n){var r,i,o;for(r=0;r<e.length;r++)if(i=e[r],!n&&t>=i.y&&t<=i.y+i.height||n&&t>=i.x&&t<=i.x+i.width)return o=yn(i),o.length?Ff(o,t,n):i}N();var vy=400,IP=600,gy={x:180,y:160};function Vn(e,t,n,r,i,o,a){k.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=r,this._bpmnFactory=i,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(l){return h(l,"bpmn:SubProcess")&&!ie(l)}function u(l){var f=l.shape,d=l.newRootElement,m=j(f);d=s._addDiagram(d||m),l.newRootElement=e.addRootElement(d)}function p(l){var f=l.shape,d=j(f);s._removeDiagram(d);var m=l.newRootElement=a.get(vn(d));e.removeRootElement(m)}this.executed("shape.create",function(l){var f=l.shape;c(f)&&u(l)},!0),this.postExecuted("elements.create",function(l){var f=l.elements;E(f,function(d){if(c(d)){var m=a.get(vn(d));if(!(!m||!d.children||!d.children.length)){var g=yy(d);s._showRecursively(g),s._moveChildrenToShape(g,m)}}})},!0),this.reverted("shape.create",function(l){var f=l.shape;c(f)&&p(l)},!0),this.preExecute("shape.delete",function(l){var f=l.shape;!h(f,"bpmn:SubProcess")||!ie(f)||E(Ti([f]),d=>{n.removeShape(d.annotation)})},!0),this.preExecuted("shape.delete",function(l){var f=l.shape;if(c(f)){var d=a.get(vn(f));d&&n.removeElements(d.children.slice())}},!0),this.executed("shape.delete",function(l){var f=l.shape;c(f)&&p(l)},!0),this.reverted("shape.delete",function(l){var f=l.shape;c(f)&&u(l)},!0),this.preExecuted("shape.replace",function(l){var f=l.oldShape,d=l.newShape;!c(f)||!c(d)||(l.oldRoot=e.removeRootElement(vn(f)))},!0),this.postExecuted("shape.replace",function(l){var f=l.newShape,d=l.oldRoot,m=e.findRoot(vn(f));if(!(!d||!m)){var g=d.children;n.moveElements(g,{x:0,y:0},m)}},!0),this.executed("element.updateProperties",function(l){var f=l.element;if(h(f,"bpmn:SubProcess")){var d=l.properties,m=l.oldProperties,g=m.id,v=d.id;if(g!==v){if(Eo(f)){a.updateId(f,Jr(v)),a.updateId(g,v);return}var w=a.get(Jr(g));w&&a.updateId(Jr(g),Jr(v))}}},!0),this.reverted("element.updateProperties",function(l){var f=l.element;if(h(f,"bpmn:SubProcess")){var d=l.properties,m=l.oldProperties,g=m.id,v=d.id;if(g!==v){if(Eo(f)){a.updateId(f,Jr(g)),a.updateId(v,g);return}var w=a.get(Jr(v));w&&a.updateId(w,Jr(g))}}},!0),t.on("element.changed",function(l){var f=l.element;if(Eo(f)){var d=f,m=a.get(rf(d));!m||m===d||t.fire("element.changed",{element:m})}}),this.executed("shape.toggleCollapse",vy,function(l){var f=l.shape;h(f,"bpmn:SubProcess")&&(ie(f)?p(l):(u(l),s._showRecursively(f.children)))},!0),this.reverted("shape.toggleCollapse",vy,function(l){var f=l.shape;h(f,"bpmn:SubProcess")&&(ie(f)?p(l):(u(l),s._showRecursively(f.children)))},!0),this.postExecuted("shape.toggleCollapse",IP,function(l){var f=l.shape;if(h(f,"bpmn:SubProcess")){var d=l.newRootElement;if(d)if(ie(f))s._moveChildrenToShape(d.children.slice(),f),E(Ti(f.children),g=>{n.moveShape(g.annotation,{x:0,y:0},f.parent),E(g.associations,v=>{n.moveConnection(v,{x:0,y:0},f.parent)})});else{s._disconnectSharedAnnotations(f);var m=yy(f);s._moveChildrenToShape(m,d)}}},!0),t.on("copyPaste.createTree",function(l){var f=l.element,d=l.children;if(c(f)){var m=vn(f),g=a.get(m);g&&d.push.apply(d,g.children)}}),t.on("copyPaste.copyElement",function(l){var f=l.descriptor,d=l.element,m=l.elements,g=d.parent,v=h(ce(g),"bpmndi:BPMNPlane");if(v){var w=rf(g),S=re(m,function(x){return x.id===w});S&&(f.parent=S.id)}}),t.on("copyPaste.pasteElement",function(l){var f=l.descriptor;f.parent&&(c(f.parent)||f.parent.hidden)&&(f.hidden=!0)})}B(Vn,k);Vn.prototype._moveChildrenToShape=function(e,t){var n=this._modeling;if(e.length){var r=e.filter(function(c){return!c.hidden});if(!r.length){n.moveElements(e,{x:0,y:0},t,{autoResize:!1});return}var i=Ce(r),o;if(!t.x)o={x:gy.x-i.x,y:gy.y-i.y};else{var a=X(t),s=X(i);o={x:a.x-s.x,y:a.y-s.y}}n.moveElements(e,o,t,{autoResize:!1})}};Vn.prototype._disconnectSharedAnnotations=function(e){var t=this._modeling,n=new Set(Jl(e).map(r=>r.annotation));n.size&&E(Ti(e.children),r=>{n.has(r.annotation)&&E(r.associations,i=>{t.removeConnection(i)})})};Vn.prototype._showRecursively=function(e,t){var n=this,r=[];return e.forEach(function(i){i.hidden=!!t,r=r.concat(i),i.children&&(r=r.concat(n._showRecursively(i.children,i.collapsed||t)))}),r};Vn.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e};Vn.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,r=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),i=t.create("bpmndi:BPMNDiagram",{plane:r});r.$parent=i;var o=n.createRoot({id:vn(e),type:e.$type,di:r,businessObject:e,collapsed:!0});return o};Vn.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,r=re(n,function(i){return i.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(r),1),r};Vn.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function LP(e){var t=[];return E(Ti(e),n=>{t.push(n.annotation),t.push.apply(t,n.associations)}),t}function yy(e){return e.children.slice().concat(LP(e.children)).concat(jP(e))}function jP(e){return Ta(e.children||[],!0,-1).reduce(function(t,n){return n.label&&n.label.parent!==e&&t.push(n.label),t},[])}function Ms(e,t){e.invoke(k,this),this.postExecuted("shape.replace",function(n){var r=n.context.oldShape,i=n.context.newShape;if(!(!h(i,"bpmn:SubProcess")||h(i,"bpmn:AdHocSubProcess")||!(h(r,"bpmn:Task")||h(r,"bpmn:CallActivity"))||!ie(i))){var o=FP(i);t.createShape({type:"bpmn:StartEvent"},o,i)}})}Ms.$inject=["injector","modeling"];B(Ms,k);function FP(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function Ds(e,t){k.call(this,e),this.preExecute("connection.create",function(n){let{target:r}=n;h(r,"bpmn:TextAnnotation")&&(n.parent=r.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(n){let r=n.shapes||[n.shape];r.length===1&&h(r[0],"bpmn:TextAnnotation")&&(n.hints=n.hints||{},n.hints.autoResize=!1)},!0),this.preExecute("shape.resize",function(n){var r=n.context,i=r.shape,o=r.hints||{};if(!(!h(i,"bpmn:TextAnnotation")||o.autoResize)){var a=r.newBounds,s=t.getTextAnnotationBounds(a,gt(i)||""),c=a.y!==i.y&&Math.abs(a.y+a.height-(i.y+i.height))<=1,u=i.y+i.height;r.newBounds={width:a.width,height:s.height,x:a.x,y:c?u-s.height:a.y}}})}B(Ds,k);Ds.$inject=["eventBus","textRenderer"];N();function ks(e,t){k.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var r=n.shape;if(ie(r))return;var i=Zn(r);i.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();E(s,function(u){o(u,!0)}),E(c,function(u){o(u,!1)})});function o(a,s){i.indexOf(a.source)!==-1&&i.indexOf(a.target)!==-1||h(a,"bpmn:Association")&&(h(a.source,"bpmn:TextAnnotation")||h(a.target,"bpmn:TextAnnotation"))||(s?t.reconnectEnd(a,r,X(r)):t.reconnectStart(a,r,X(r)))}},!0)}B(ks,k);ks.$inject=["eventBus","modeling"];var Hf=500;function Ns(e,t,n){k.call(this,e);function r(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function i(a,s){var c=a.children,u=s,p,l;return p=HP(c).concat([a]),l=tp(p),l?(u.width=Math.max(l.width,u.width),u.height=Math.max(l.height,u.height),u.x=l.x+(l.width-u.width)/2,u.y=l.y+(l.height-u.height)/2):(u.x=a.x+(a.width-u.width)/2,u.y=a.y+(a.height-u.height)/2),u}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],Hf,function(a){var s=a.context,c=s.shape;h(c,"bpmn:SubProcess")&&(c.collapsed?ce(c).isExpanded=!1:(r(c.children),ce(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],Hf,function(a){var s=a.context,c=s.shape;c.collapsed?ce(c).isExpanded=!1:ce(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],Hf,function(a){var s=a.context.shape,c=t.getDefaultSize(s),u;s.collapsed?u=o(s,c):u=i(s,c),n.resizeShape(s,u,null,{autoResize:s.collapsed?!1:"nwse"})})}B(Ns,k);Ns.$inject=["eventBus","elementFactory","modeling"];function HP(e){return e.filter(function(t){return!t.hidden})}function Os(e,t,n,r){t.invoke(k,this),this.preExecute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.businessObject;ee(a)||(h(a,"bpmn:Participant")&&ie(a)&&n.ids.unclaim(s.processRef.id),r.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(i){var o=i.context,a=o.connection,s=a.businessObject;r.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var i=e.getRootElement(),o=i.businessObject;h(i,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}B(Os,k);Os.$inject=["canvas","injector","moddle","modeling"];function Bs(e,t){k.call(this,e),this.preExecute("connection.delete",function(n){var r=n.context,i=r.connection,o=i.source;$P(i,o)&&t.updateProperties(o,{default:null})})}B(Bs,k);Bs.$inject=["eventBus","modeling"];function $P(e,t){if(!h(e,"bpmn:SequenceFlow"))return!1;var n=j(t),r=j(e);return n.get("default")===r}var zP=500,GP=5e3;function Is(e,t){k.call(this,e);var n;function r(){return n=n||new VP,n.enter(),n}function i(){if(!n)throw new Error("out of bounds release");return n}function o(){if(!n)throw new Error("out of bounds release");var s=n.leave();return s&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),s}var a=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(a,GP,function(s){r()}),this.postExecuted(a,zP,function(s){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(s){var c=s.context,u=c.shape,p=i();u.labelTarget||(h(u,"bpmn:Lane")&&p.addLane(u),h(u,"bpmn:FlowNode")&&p.addFlowNode(u))})}Is.$inject=["eventBus","modeling"];B(Is,k);function VP(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function Ls(e,t){k.call(this,e),this.postExecuted("elements.create",function(n){let r=n.context,i=r.elements;for(let o of i)WP(o)&&!qP(o)&&t.updateProperties(o,{isForCompensation:void 0})})}B(Ls,k);Ls.$inject=["eventBus","modeling"];function WP(e){let t=j(e);return t&&t.isForCompensation}function UP(e){return e&&h(e,"bpmn:BoundaryEvent")&&Er(e,"bpmn:CompensateEventDefinition")}function qP(e){return e.incoming.filter(n=>UP(n.source)).length>0}var _y={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","artifactBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",es],appendBehavior:["type",ts],associationBehavior:["type",rs],attachEventBehavior:["type",Fo],artifactBehavior:["type",ns],boundaryEventBehavior:["type",is],compensateBoundaryEventBehaviour:["type",as],createBehavior:["type",ss],createDataObjectBehavior:["type",cs],createParticipantBehavior:["type",us],dataInputAssociationBehavior:["type",ps],dataStoreBehavior:["type",ls],deleteLaneBehavior:["type",ds],detachEventBehavior:["type",Go],dropOnFlowBehavior:["type",ms],eventBasedGatewayBehavior:["type",hs],fixHoverBehavior:["type",rp],groupBehavior:["type",vs],importDockingFix:["type",ip],isHorizontalFix:["type",gs],labelBehavior:["type",_s],layoutConnectionBehavior:["type",bs],messageFlowBehavior:["type",xs],nonInterruptingBehavior:["type",Es],removeElementBehavior:["type",Ss],removeEmbeddedLabelBoundsBehavior:["type",ws],removeParticipantBehavior:["type",Cs],replaceConnectionBehavior:["type",Rs],replaceElementBehaviour:["type",Yo],resizeBehavior:["type",fp],resizeLaneBehavior:["type",dp],rootElementReferenceBehavior:["type",Ts],spaceToolBehavior:["type",mp],subProcessPlaneBehavior:["type",Vn],subProcessStartEventBehavior:["type",Ms],textAnnotationBehavior:["type",Ds],toggleCollapseConnectionBehaviour:["type",ks],toggleElementCollapseBehaviour:["type",Ns],unclaimIdBehavior:["type",Os],unsetDefaultFlowBehavior:["type",Bs],updateFlowNodeRefsBehavior:["type",Is],setCompensationActivityAfterPasteBehavior:["type",Ls]};N();function hp(e,t){var n=He(e,t,-15);return n!=="intersect"?n:null}function wt(e){Ot.call(this,e)}B(wt,Ot);wt.$inject=["eventBus"];wt.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return KP(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,r=e.hints||{},i=r.targetParent,o=r.targetAttach;if(o)return!1;i&&(n.parent=i);try{return vp(t,n)}finally{i&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,r=e.target;return vp(n,r,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds,r=e.direction;return Ny(t,n,r)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,r=e.target;return de(r)&&!gp(t,r,n)?!1:ln(t,function(i){return de(i)?vp(i.source,i.target,i):i.host?js(i,i.host,null,n):Gf(i,r,null,n)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,r=e.position,i=e.hints;return i!=null&&i.keyboardMove&&n.some(function(a){return Py(a)&&!n.includes(a.host)})?!1:js(n,t,null,r)||Dy(n,t,r)||ky(n,t,r)||gp(n,t,r)}),this.addRule("shape.create",function(e){return Gf(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return js(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return jy(n,t)})};wt.prototype.canConnectMessageFlow=Iy;wt.prototype.canConnectSequenceFlow=Ly;wt.prototype.canConnectDataAssociation=Wf;wt.prototype.canConnectAssociation=Oy;wt.prototype.canConnectCompensationAssociation=By;wt.prototype.canMove=ky;wt.prototype.canAttach=js;wt.prototype.canReplace=Dy;wt.prototype.canDrop=Qo;wt.prototype.canInsert=gp;wt.prototype.canCreate=Gf;wt.prototype.canConnect=vp;wt.prototype.canResize=Ny;wt.prototype.canCopy=jy;function KP(e){return $f(e)?null:te(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function $f(e){return!e||ee(e)}function by(e){do{if(h(e,"bpmn:Process"))return j(e);if(h(e,"bpmn:Participant"))return j(e).processRef||j(e)}while(e=e.parent)}function zf(e){return h(e,"bpmn:TextAnnotation")}function Vf(e){return h(e,"bpmn:Group")&&!e.labelTarget}function Sy(e){return h(e,"bpmn:BoundaryEvent")&&ur(e,"bpmn:CompensateEventDefinition")}function yp(e){return j(e).isForCompensation}function YP(e,t){var n=by(e),r=by(t);return n===r}function XP(e){return h(e,"bpmn:InteractionNode")&&!h(e,"bpmn:BoundaryEvent")&&(!h(e,"bpmn:Event")||h(e,"bpmn:ThrowEvent")&&Ry(e,"bpmn:MessageEventDefinition"))}function ZP(e){return h(e,"bpmn:InteractionNode")&&!yp(e)&&(!h(e,"bpmn:Event")||h(e,"bpmn:CatchEvent")&&Ry(e,"bpmn:MessageEventDefinition"))&&!(h(e,"bpmn:BoundaryEvent")&&!ur(e,"bpmn:MessageEventDefinition"))}function xy(e){for(var t=e;t=t.parent;){if(h(t,"bpmn:FlowElementsContainer"))return j(t);if(h(t,"bpmn:Participant"))return j(t).processRef}return null}function Cy(e,t){var n=xy(e),r=xy(t);return n===r}function ur(e,t){var n=j(e);return!!re(n.eventDefinitions||[],function(r){return h(r,t)})}function Ry(e,t){var n=j(e);return(n.eventDefinitions||[]).every(function(r){return h(r,t)})}function QP(e){return h(e,"bpmn:FlowNode")&&!h(e,"bpmn:EndEvent")&&!Qe(e)&&!(h(e,"bpmn:IntermediateThrowEvent")&&ur(e,"bpmn:LinkEventDefinition"))&&!Sy(e)&&!yp(e)}function JP(e){return h(e,"bpmn:FlowNode")&&!h(e,"bpmn:StartEvent")&&!h(e,"bpmn:BoundaryEvent")&&!Qe(e)&&!(h(e,"bpmn:IntermediateCatchEvent")&&ur(e,"bpmn:LinkEventDefinition"))&&!yp(e)}function eA(e){return h(e,"bpmn:ReceiveTask")||h(e,"bpmn:IntermediateCatchEvent")&&(ur(e,"bpmn:MessageEventDefinition")||ur(e,"bpmn:TimerEventDefinition")||ur(e,"bpmn:ConditionalEventDefinition")||ur(e,"bpmn:SignalEventDefinition"))}function tA(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function Ey(e,t){var n=tA(t);return n.indexOf(e)!==-1}function vp(e,t,n){if($f(e)||$f(t))return null;if(!h(n,"bpmn:DataAssociation")){if(Iy(e,t))return{type:"bpmn:MessageFlow"};if(Ly(e,t))return{type:"bpmn:SequenceFlow"}}var r=Wf(e,t);return r||(By(e,t)?{type:"bpmn:Association",associationDirection:"One"}:Oy(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function Qo(e,t){return ee(e)||Vf(e)?!0:h(t,"bpmn:Participant")&&!ie(t)?!1:h(e,"bpmn:Participant")?h(t,"bpmn:Process")||h(t,"bpmn:Collaboration"):te(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:h(e,"bpmn:Lane")?h(t,"bpmn:Participant")||h(t,"bpmn:Lane"):h(e,"bpmn:BoundaryEvent")&&!nA(e)?!1:h(e,"bpmn:FlowElement")&&!h(e,"bpmn:DataStoreReference")?h(t,"bpmn:FlowElementsContainer")?ie(t):te(t,["bpmn:Participant","bpmn:Lane"]):h(e,"bpmn:DataStoreReference")&&h(t,"bpmn:Collaboration")?Lt(j(t).get("participants"),function(n){return!!n.get("processRef")}):te(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?te(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):h(e,"bpmn:MessageFlow")?h(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function nA(e){return j(e).cancelActivity&&(Ay(e)||Ty(e))}function Py(e){return!ee(e)&&h(e,"bpmn:BoundaryEvent")}function rA(e){return h(e,"bpmn:Lane")}function iA(e){return Py(e)||h(e,"bpmn:IntermediateThrowEvent")&&Ay(e)?!0:h(e,"bpmn:IntermediateCatchEvent")&&Ty(e)}function Ay(e){var t=j(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Ty(e){return My(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function My(e,t){return t.some(function(n){return ur(e,n)})}function oA(e){return h(e,"bpmn:ReceiveTask")&&re(e.incoming,function(t){return h(t.source,"bpmn:EventBasedGateway")})}function js(e,t,n,r){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var i=e[0];return ee(i)||!iA(i)||Qe(t)||!h(t,"bpmn:Activity")||yp(t)||r&&!hp(r,t)||oA(t)?!1:"attach"}function Dy(e,t,n){if(!t)return!1;var r={replacements:[]};return E(e,function(i){Qe(t)||h(i,"bpmn:StartEvent")&&i.type!=="label"&&Qo(i,t)&&(hh(i)||r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),(vh(i)||gh(i)||yh(i))&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),My(i,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&h(t,"bpmn:SubProcess")&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"})),h(t,"bpmn:Transaction")||ur(i,"bpmn:CancelEventDefinition")&&i.type!=="label"&&(h(i,"bpmn:EndEvent")&&Qo(i,t)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:EndEvent"}),h(i,"bpmn:BoundaryEvent")&&js(i,t,null,n)&&r.replacements.push({oldElementId:i.id,newElementType:"bpmn:BoundaryEvent"}))}),r.replacements.length?r:!1}function ky(e,t){return Lt(e,rA)?!1:t?e.every(function(n){return Qo(n,t)}):!0}function Gf(e,t,n,r){return t?ee(e)||Vf(e)?!0:Qo(e,t,r)||gp(e,t,r):!1}function Ny(e,t,n){return h(e,"bpmn:SubProcess")?ie(e)&&(!t||t.width>=100&&t.height>=80):h(e,"bpmn:Lane")||h(e,"bpmn:Participant")?!0:zf(e)?n?n==="e"||n==="w":!0:Vf(e)?!0:ee(e)?n?n==="e"||n==="w":!0:!1}function aA(e,t){var n=zf(e),r=zf(t);return(n||r)&&n!==r}function Oy(e,t){return Ey(t,e)||Ey(e,t)?!1:aA(e,t)?!0:!!Wf(e,t)}function By(e,t){return Cy(e,t)&&Sy(e)&&h(t,"bpmn:Activity")&&!cA(t,e)&&!Qe(t)}function Iy(e,t){return wy(e)&&!wy(t)?!1:XP(e)&&ZP(t)&&!YP(e,t)}function Ly(e,t){return QP(e)&&JP(t)&&Cy(e,t)&&!(h(e,"bpmn:EventBasedGateway")&&!eA(t))}function Wf(e,t){return te(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&te(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:te(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&te(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function gp(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source===e||t.target===e?!1:te(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ee(t)&&h(e,"bpmn:FlowNode")&&!h(e,"bpmn:BoundaryEvent")&&Qo(e,t.parent,n)}function sA(e,t){return e&&t&&e.indexOf(t)!==-1}function jy(e,t){return ee(t)?!0:!(h(t,"bpmn:Lane")&&!sA(e,t.parent))}function wy(e){return kr(e,"bpmn:Process")||kr(e,"bpmn:Collaboration")}function cA(e,t){return e.attachers.includes(t)}var Fy={__depends__:[Et],__init__:["bpmnRules"],bpmnRules:["type",wt]};N();var uA=2e3;function _p(e,t){e.on("saveXML.start",uA,n);function n(){var r=t.getRootElements();E(r,function(i){var o=ce(i),a,s;a=Zn([i],!1),a=Q(a,function(c){return c!==i&&!c.labelTarget}),s=je(a,ce),o.set("planeElement",s)})}}_p.$inject=["eventBus","canvas"];var Hy={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",_p]};function Jo(e){k.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var r=n.context,i=r.shape||r.connection,o=r.parent,a=t.getOrdering(i,o);a&&(a.parent!==void 0&&(r.parent=a.parent),r.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var r=n.context,i=r.shape||r.connection,o=r.newParent||i.parent,a=t.getOrdering(i,o);a&&(a.parent!==void 0&&(r.newParent=a.parent),r.newParentIndex=a.index)})}Jo.prototype.getOrdering=function(e,t){return null};B(Jo,k);N();function Fs(e,t){Jo.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(a){if(a.labelTarget)return{level:10};var s=re(n,function(c){return te(a,[c.type])});return s&&s.order||{level:1}}function i(a){var s=a.order;if(s||(a.order=s=r(a)),!s)throw new Error(`no order for <${a.id}>`);return s}function o(a,s,c){for(var u=s;u&&!te(u,c);)u=u.parent;if(!u)throw new Error(`no parent for <${a.id}> in <${s&&s.id}>`);return u}this.getOrdering=function(a,s){if(a.labelTarget||h(a,"bpmn:TextAnnotation"))return{parent:t.findRoot(s)||t.getRootElement(),index:-1};var c=i(a);c.containers&&(s=o(a,s,c.containers));var u=s.children.indexOf(a),p=Sa(s.children,function(l){return!a.labelTarget&&l.labelTarget?!1:c.level<i(l).level});return p!==-1&&u!==-1&&u<p&&(p-=1),{index:p,parent:s}}}Fs.$inject=["eventBus","canvas"];B(Fs,Jo);var $y={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Fs]};function $i(){}$i.prototype.get=function(){return this._data};$i.prototype.set=function(e){this._data=e};$i.prototype.clear=function(){var e=this._data;return delete this._data,e};$i.prototype.isEmpty=function(){return!this._data};var zy={clipboard:["type",$i]};N();var pA="drop-ok",Gy="drop-not-ok",Vy="attach-ok",Wy="new-parent",Uy="create",lA=2e3;function bp(e,t,n,r,i){function o(c,u,p,l,f){if(!u)return!1;c=Q(c,function(S){var x=S.labelTarget;return!S.parent&&!(ee(S)&&c.indexOf(x)!==-1)});var d=re(c,function(S){return!de(S)}),m=!1,g=!1,v=!1;Ky(c)&&(m=i.allowed("shape.attach",{position:p,shape:d,target:u})),m||(Ky(c)?v=i.allowed("shape.create",{position:p,shape:d,source:l,target:u}):v=i.allowed("elements.create",{elements:c,position:p,target:u}));var w=f.connectionTarget;return v||m?(d&&l&&(g=i.allowed("connection.create",{source:w===l?d:l,target:w===l?l:d,hints:{targetParent:u,targetAttach:m}})),{attach:m,connect:g}):v===null||m===null?null:!1}function a(c,u){[Vy,pA,Gy,Wy].forEach(function(p){p===u?e.addMarker(c,p):e.removeMarker(c,p)})}n.on(["create.move","create.hover"],function(c){var u=c.context,p=u.elements,l=c.hover,f=u.source,d=u.hints||{};if(!l){u.canExecute=!1,u.target=null;return}qy(c);var m={x:c.x,y:c.y},g=u.canExecute=l&&o(p,l,m,f,d);l&&g!==null&&(u.target=l,g&&g.attach?a(l,Vy):a(l,g?Wy:Gy))}),n.on(["create.end","create.out","create.cleanup"],function(c){var u=c.hover;u&&a(u,null)}),n.on("create.end",function(c){var u=c.context,p=u.source,l=u.shape,f=u.elements,d=u.target,m=u.canExecute,g=m&&m.attach,v=m&&m.connect,w=u.hints||{};if(m===!1||!d)return!1;qy(c);var S={x:c.x,y:c.y};v?l=r.appendShape(p,l,S,d,{attach:g,connection:v===!0?{}:v,connectionTarget:w.connectionTarget}):(f=r.createElements(f,S,d,C({},w,{attach:g})),l=re(f,function(x){return!de(x)})),C(u,{elements:f,shape:l}),C(c,{elements:f,shape:l})});function s(){var c=t.context();c&&c.prefix===Uy&&t.cancel()}n.on("create.init",function(){n.on("elements.changed",s),n.once(["create.cancel","create.end"],lA,function(){n.off("elements.changed",s)})}),this.start=function(c,u,p){q(u)||(u=[u]);var l=re(u,function(m){return!de(m)});if(l){p=C({elements:u,hints:{},shape:l},p||{}),E(u,function(m){ne(m.x)||(m.x=0),ne(m.y)||(m.y=0)});var f=Q(u,function(m){return!m.hidden}),d=Ce(f);E(u,function(m){de(m)&&(m.waypoints=je(m.waypoints,function(g){return{x:g.x-d.x-d.width/2,y:g.y-d.y-d.height/2}})),C(m,{x:m.x-d.x-d.width/2,y:m.y-d.y-d.height/2})}),t.init(c,Uy,{cursor:"grabbing",autoActivate:!0,data:{shape:l,elements:u,context:p}})}}}bp.$inject=["canvas","dragging","eventBus","modeling","rules"];function qy(e){var t=e.context,n=t.createConstraints;n&&(n.left&&(e.x=Math.max(e.x,n.left)),n.right&&(e.x=Math.min(e.x,n.right)),n.top&&(e.y=Math.max(e.y,n.top)),n.bottom&&(e.y=Math.min(e.y,n.bottom)))}function Ky(e){return e&&e.length===1&&!de(e[0])}var fA=750;function xp(e,t,n,r,i){function o(a){var s=U("g");$(s,i.cls("djs-drag-group",["no-events"]));var c=U("g");return a.forEach(function(u){var p;u.hidden||(u.waypoints?(p=n._createContainer("connection",c),n.drawConnection(Ln(p),u)):(p=n._createContainer("shape",c),n.drawShape(Ln(p),u),Fe(p,u.x,u.y)),r.addDragger(u,s,p))}),s}t.on("create.move",fA,function(a){var s=a.hover,c=a.context,u=c.elements,p=c.dragGroup;p||(p=c.dragGroup=o(u));var l;s?(p.parentNode||(l=e.getActiveLayer(),J(l,p)),Fe(p,a.x,a.y)):Pe(p)}),t.on("create.cleanup",function(a){var s=a.context,c=s.dragGroup;c&&Pe(c)})}xp.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var li={__depends__:[kt,Dn,Et,rt],__init__:["create","createPreview"],create:["type",bp],createPreview:["type",xp]};function Hs(e){var t=this;this._lastMoveEvent=null;function n(r){t._lastMoveEvent=r}e.on("canvas.init",function(r){var i=t._svg=r.svg;i.addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Hs.$inject=["eventBus"];Hs.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||dA(0,0)};function dA(e,t){var n=document.createEvent("MouseEvent"),r=e,i=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,r,i,o,a,!1,!1,!1,!1,0,null),n}var pr={__init__:["mouse"],mouse:["type",Hs]};N();var Yy=2e3;function Ht(e,t,n,r,i,o,a,s){this._canvas=e,this._create=t,this._elementFactory=r,this._eventBus=i,this._modeling=o,this._mouse=a,this._rules=s,i.on("copyPaste.copyElement",function(c){var u=c.descriptor,p=c.element,l=c.elements;u.priority=1,u.id=p.id;var f=re(l,function(d){return d===p.parent});f&&(u.parent=p.parent.id),mA(p)&&(u.priority=2,u.host=p.host.id),de(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=hA(p)),ee(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),E(["x","y","width","height"],function(d){ne(p[d])&&(u[d]=p[d])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),i.on("copyPaste.elementsCopied",Yy,function(c){var u;((u=c.hints)==null?void 0:u.clip)!==!1&&n.set(c.tree)}),i.on("copyPaste.pasteElements",Yy,function(c){c.tree||(c.tree=n.get())}),i.on("copyPaste.pasteElements",function(c){var u=c.hints;C(u,{createElementsBehavior:!1})})}Ht.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"];Ht.prototype.copy=function(e,t={}){var n,r;return q(e)||(e=e?[e]:[]),n=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),n===!1?r={}:r=this.createTree(q(n)?n:e),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:r,hints:t}),r};Ht.prototype.paste=function(e={}){var t=this._eventBus.createEvent({type:"copyPaste.pasteElements",hints:{},...e}),n=this._eventBus.fire(t);if(n!==!1){var r=t.tree;if(r){var i=t.hints,o=this._createElements(r);if(t.element&&t.point)return this._paste(o,t.element,t.point,i);this._create.start(this._mouse.getLastMoveEvent(),o,{hints:i})}}};Ht.prototype.duplicate=function(e,t={}){var n=this.copy(e,{clip:!1});return this.paste({...t,tree:n})};Ht.prototype.cut=function(e){var t=this.copy(e),n=this._getElementIdsFromTree(t),r=e.filter(function(i){return n[i.id]});return r.length>0&&this._modeling.removeElements(r),t};Ht.prototype._getElementIdsFromTree=function(e){var t={};return E(e,function(n){E(n,function(r){r.id&&(t[r.id]=!0)})}),t};Ht.prototype._paste=function(e,t,n,r){E(e,function(o){ne(o.x)||(o.x=0),ne(o.y)||(o.y=0)});var i=Ce(e);return E(e,function(o){de(o)&&(o.waypoints=je(o.waypoints,function(a){return{x:a.x-i.x-i.width/2,y:a.y-i.y-i.height/2}})),C(o,{x:o.x-i.x-i.width/2,y:o.y-i.y-i.height/2})}),this._modeling.createElements(e,n,t,C({},r))};Ht.prototype._createElements=function(e){var t=this,n=this._eventBus,r={},i=[];return E(e,function(o,a){a=parseInt(a,10),o=At(o,"priority"),E(o,function(s){var c=C({},Nt(s,["priority"]));r[s.parent]?c.parent=r[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:r,descriptor:c});var u;if(de(c)){c.source=r[s.source],c.target=r[s.target],u=r[s.id]=t.createConnection(c),i.push(u);return}if(ee(c)){c.labelTarget=r[c.labelTarget],u=r[s.id]=t.createLabel(c),i.push(u);return}c.host&&(c.host=r[c.host]),u=r[s.id]=t.createShape(c),i.push(u)})}),i};Ht.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(Nt(e,["id"]));return t};Ht.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(Nt(e,["id"]));return t};Ht.prototype.createShape=function(e){var t=this._elementFactory.createShape(Nt(e,["id"]));return t};Ht.prototype.hasRelations=function(e,t){var n,r,i;return!(de(e)&&(r=re(t,Ct({id:e.source.id})),i=re(t,Ct({id:e.target.id})),!r||!i)||ee(e)&&(n=re(t,Ct({id:e.labelTarget.id})),!n))};Ht.prototype.createTree=function(e){var t=this._rules,n=this,r={},i=[],o=zr(e);function a(u,p){return t.allowed("element.copy",{element:u,elements:p})}function s(u,p){var l=re(i,function(f){return u===f.element});if(!l){i.push({element:u,depth:p});return}l.depth<p&&(i=c(l,i),i.push({element:l.element,depth:p}))}function c(u,p){var l=p.indexOf(u);return l!==-1&&p.splice(l,1),p}return In(o,function(u,p,l){if(ee(u))return;E(u.labels,function(m){s(m,l)});function f(m){m&&m.length&&E(m,function(g){E(g.labels,function(v){s(v,l)}),s(g,l)})}E([u.attachers,u.incoming,u.outgoing],f),s(u,l);var d=[];return u.children&&(d=u.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:u,children:d}),d}),e=je(i,function(u){return u.element}),i=je(i,function(u){return u.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:u.descriptor,element:u.element,elements:e}),u}),i=At(i,function(u){return u.descriptor.priority}),e=je(i,function(u){return u.element}),E(i,function(u){var p=u.depth;if(!n.hasRelations(u.element,e)){Zy(u.element,e);return}if(!a(u.element,e)){Zy(u.element,e);return}r[p]||(r[p]=[]),r[p].push(u.descriptor)}),r};function mA(e){return!!e.host}function hA(e){return je(e.waypoints,function(t){return t=Xy(t),t.original&&(t.original=Xy(t.original)),t})}function Xy(e){return C({},e)}function Zy(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}var Qy={__depends__:[zy,li,pr,Et],__init__:["copyPaste"],copyPaste:["type",Ht]};N();function Uf(e,t,n){q(n)||(n=[n]),E(n,function(r){wn(e[r])||(t[r]=e[r])})}var qf=750;function Ep(e,t,n){function r(c,u){var p=e.create(c.$type);return n.copyElement(c,p,null,u)}t.on("copyPaste.copyElement",qf,function(c){var u=c.descriptor,p=c.element,l=j(p);if(ee(p))return u;var f=u.businessObject=r(l,!0),d=u.di=r(ce(p),!0);d.bpmnElement=f,Uf(f,u,"name"),Uf(d,u,"isExpanded"),l.default&&(u.default=l.default.id)});var i="-bpmn-js-refs";function o(c){return c[i]=c[i]||{}}function a(c,u){c[i]=u}function s(c,u,p){var l=j(c);return c.default&&(p[c.default]={element:l,property:"default"}),c.host&&(j(c).attachedToRef=j(u[c.host])),Nt(p,Ge(p,function(f,d,m){var g=d.element,v=d.property;return m===c.id&&(g.set(v,l),f.push(c.id)),f},[]))}t.on("copyPaste.pasteElement",function(c){var u=c.cache,p=c.descriptor,l=p.businessObject,f=p.di;if(ee(p)){p.businessObject=j(u[p.labelTarget]),p.di=ce(u[p.labelTarget]);return}l=p.businessObject=r(l),f=p.di=r(f),f.bpmnElement=l,Uf(p,l,["isExpanded","name"]),p.type=l.$type}),t.on("copyPaste.copyElement",qf,function(c){var u=c.descriptor,p=c.element;if(h(p,"bpmn:Participant")){var l=j(p);l.processRef&&(u.processRef=r(l.processRef,!0))}}),t.on("copyPaste.pasteElement",function(c){var u=c.descriptor,p=u.processRef;p&&(u.processRef=r(p))}),t.on("copyPaste.createTree",function(c){var u=c.element,p=c.children;h(u,"bpmn:SubProcess")&&E(Ti(p),l=>{p.push(l.annotation)})}),t.on("copyPaste.pasteElement",qf,function(c){var u=c.cache,p=c.descriptor;a(u,s(p,u,o(u)))})}Ep.$inject=["bpmnFactory","eventBus","moddleCopy"];N();var vA=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],gA=["errorRef","escalationRef","messageRef","signalRef","dataObjectRef"];function zi(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",r=>{let{propertyNames:i}=r;if(!(!i||!i.length))return At(i,o=>o==="extensionElements")}),e.on("moddleCopy.canCopyProperty",r=>{let{parent:i,property:o,propertyName:a}=r,s=Se(i)&&i.$descriptor;if(a&&gA.includes(a))return o;if(a&&vA.includes(a)||a&&s&&!re(s.properties,Ct({name:a})))return!1}),e.on("moddleCopy.canSetCopiedProperty",r=>{let{property:i}=r;if(h(i,"bpmn:ExtensionElements")&&(!i.values||!i.values.length))return!1})}zi.$inject=["eventBus","bpmnFactory","moddle"];zi.prototype.copyElement=function(e,t,n,r=!1){n&&!q(n)&&(n=[n]),n=n||wp(e.$descriptor);let i=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:r});return i===!1||(q(i)&&(n=i),E(n,o=>{let a;dt(e,o)&&(a=e.get(o));let s=this.copyProperty(a,t,o,r);!Ue(s)||this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:s,propertyName:o})===!1||t.set(o,s)})),t};zi.prototype.copyProperty=function(e,t,n,r=!1){let i=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:r});if(i===!1)return;if(i)return Se(i)&&i.$type&&!i.$parent&&(i.$parent=t),i;let o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference)return o.isId?e&&this._copyId(e,t,r):q(e)?Ge(e,(a,s)=>{let c=this.copyProperty(s,t,n,r);return c?a.concat(c):a},[]):Se(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:(i=this._bpmnFactory.create(e.$type),i.$parent=t,i=this.copyElement(e,i,null,r),i):e};zi.prototype._copyId=function(e,t,n=!1){if(n)return e;if(!this._moddle.ids.assigned(e))return this._moddle.ids.claim(e,t),e};function wp(e,t){return Ge(e.properties,(n,r)=>t&&r.default?n:n.concat(r.name),[])}var Sp={__depends__:[Qy],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",Ep],moddleCopy:["type",zi]};N();var Jy=Math.round;function $s(e,t){this._modeling=e,this._eventBus=t}$s.$inject=["modeling","eventBus"];$s.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var r=this._modeling,i=this._eventBus;i.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,u=Jy(s+o/2),p=Jy(c+a/2),l=r.replaceShape(e,C({},t,{x:u,y:p,width:o,height:a}),n);return i.fire("replace.end",{element:e,newElement:l,hints:n}),l};function Cp(e,t){t.on("replace.end",500,function(n){let{newElement:r,hints:i={}}=n;i.select!==!1&&e.select(r)})}Cp.$inject=["selection","eventBus"];var e_={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",Cp],replace:["type",$s]};N();function yA(e,t,n){q(n)||(n=[n]),E(n,function(r){wn(e[r])||(t[r]=e[r])})}var _A=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function bA(e,t){var n=e&&dt(e,"collapsed")?e.collapsed:!ie(e),r;return t&&(dt(t,"collapsed")||dt(t,"isExpanded"))?r=dt(t,"collapsed")?t.collapsed:!t.isExpanded:r=n,n!==r}function Pp(e,t,n,r,i,o){function a(s,c,u){u=u||{};var p=c.type,l=s.businessObject;if(Rp(l)&&(p==="bpmn:SubProcess"||p==="bpmn:AdHocSubProcess")&&bA(s,c))return r.toggleCollapse(s),s;var f=e.create(p),d={type:p,businessObject:f};d.di={},p==="bpmn:ExclusiveGateway"&&(d.di.isMarkerVisible=!0),yA(s.di,d.di,["fill","stroke","background-color","border-color","color"]);var m=wp(l.$descriptor),g=wp(f.$descriptor,!0),v=xA(m,g);C(f,mt(c,_A));var w=Q(v,function(b){return b==="eventDefinitions"?t_(s,c.eventDefinitionType):b==="loopCharacteristics"?!Qe(f):dt(f,b)||b==="processRef"&&c.isExpanded===!1||b==="triggeredByEvent"?!1:b==="isForCompensation"?!Qe(f):!0});if(f=n.copyElement(l,f,w),c.eventDefinitionType&&(t_(f,c.eventDefinitionType)||(d.eventDefinitionType=c.eventDefinitionType,d.eventDefinitionAttrs=c.eventDefinitionAttrs)),h(l,"bpmn:Activity")){if(Rp(l))d.isExpanded=ie(s);else if(c&&dt(c,"isExpanded")){d.isExpanded=c.isExpanded;var S=t.getDefaultSize(f,{isExpanded:d.isExpanded});d.width=S.width,d.height=S.height,d.x=s.x-(d.width-s.width)/2,d.y=s.y-(d.height-s.height)/2}ie(s)&&!h(l,"bpmn:Task")&&d.isExpanded&&(d.width=s.width,d.height=s.height)}if(Rp(l)&&!Rp(f)&&(u.moveChildren=!1),h(l,"bpmn:Participant")){c.isExpanded===!0?f.processRef=e.create("bpmn:Process"):u.moveChildren=!1;var x=Me(s);ce(s).isHorizontal||(ce(d).isHorizontal=x),d.width=x?s.width:t.getDefaultSize(d).width,d.height=x?t.getDefaultSize(d).height:s.height}return o.allowed("shape.resize",{shape:f})||(d.height=t.getDefaultSize(d).height,d.width=t.getDefaultSize(d).width),f.name=l.name,te(l,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&te(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=l.default),c.host&&!h(l,"bpmn:BoundaryEvent")&&h(f,"bpmn:BoundaryEvent")&&(d.host=c.host),(d.type==="bpmn:DataStoreReference"||d.type==="bpmn:DataObjectReference")&&(d.x=s.x+(s.width-d.width)/2),i.replaceElement(s,d,{...u,targetElement:c})}this.replaceElement=a}Pp.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function Rp(e){return h(e,"bpmn:SubProcess")}function t_(e,t){var n=j(e);return t&&n.get("eventDefinitions").some(function(r){return h(r,t)})}function xA(e,t){return e.filter(function(n){return t.includes(n)})}var Ap={__depends__:[Sp,e_,rt],bpmnReplace:["type",Pp]};N();var EA=250;function Nr(e){this._eventBus=e,this._tools=[],this._active=null}Nr.$inject=["eventBus"];Nr.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)};Nr.prototype.isActive=function(e){return e&&this._active===e};Nr.prototype.length=function(e){return this._tools.length};Nr.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))};Nr.prototype.bindEvents=function(e,t){var n=this._eventBus,r=[];n.on(t.tool+".init",function(i){var o=i.context;if(!o.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),E(t,function(i){r.push(i+".ended"),r.push(i+".canceled")}),n.on(r,EA,function(i){this._active&&(wA(i)||this.setActive(null))},this)};function wA(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Bn(t,'.group[data-group="tools"]')}var fi={__depends__:[kt],__init__:["toolManager"],toolManager:["type",Nr]};N();N();function n_(e,t){if(e==="x"){if(t>0)return"e";if(t<0)return"w"}if(e==="y"){if(t>0)return"s";if(t<0)return"n"}return null}function r_(e,t){var n=[];return E(e.concat(t),function(r){var i=r.incoming,o=r.outgoing;E(i.concat(o),function(a){var s=a.source,c=a.target;(zs(e,s)||zs(e,c)||zs(t,s)||zs(t,c))&&(zs(n,a)||n.push(a))})}),n}function zs(e,t){return e.indexOf(t)!==-1}function i_(e,t,n){var r=e.x,i=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:r,y:i+c,width:o,height:a-c};case"s":return{x:r,y:i,width:o,height:a+c};case"w":return{x:r+s,y:i,width:o-s,height:a};case"e":return{x:r,y:i,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var Kf=Math.abs,SA=Math.round,Or={x:"width",y:"height"},s_="crosshair",di={n:"top",w:"left",s:"bottom",e:"right"},CA=1500,Tp={n:"s",w:"e",s:"n",e:"w"},Mp=20;function Xt(e,t,n,r,i,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=r,this._rules=i,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",CA,function(c){var u=c.context,p=u.initialized;p||(p=u.initialized=s.init(c,u)),p&&a_(c)}),n.on("spaceTool.end",function(c){var u=c.context,p=u.axis,l=u.direction,f=u.movingShapes,d=u.resizingShapes,m=u.start;if(u.initialized){a_(c);var g={x:0,y:0};g[p]=SA(c["d"+p]),s.makeSpace(f,d,g,l,m),n.once("spaceTool.ended",function(v){s.activateSelection(v.originalEvent,!0,!0)})}})}Xt.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"];Xt.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:s_,data:{context:{reactivate:n}},trapClick:!1})};Xt.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:s_,data:{context:{}}})};Xt.prototype.makeSpace=function(e,t,n,r,i){return this._modeling.createSpace(e,t,n,r,i)};Xt.prototype.init=function(e,t){var n=Kf(e.dx)>Kf(e.dy)?"x":"y",r=e["d"+n],i=e[n]-r;if(Kf(r)<5)return!1;r<0&&(r*=-1),Tr(e)&&(r*=-1);var o=n_(n,r),a=this._canvas.getRootElement();!Mi(e)&&e.hover&&(a=e.hover);var s=[...Zn(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,r,i),u=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:i}),p=RA(c,n,o,i,u);return C(t,c,{axis:n,direction:o,spaceToolConstraints:p,start:i}),Di("resize-"+(n==="x"?"ew":"ns")),!0};Xt.prototype.calculateAdjustments=function(e,t,n,r){var i=this._rules,o=[],a=[],s=[],c=[];function u(f){o.includes(f)||o.push(f);var d=f.label;d&&!o.includes(d)&&o.push(d)}function p(f){a.includes(f)||a.push(f)}E(e,function(f){if(!(!f.parent||ee(f))){if(de(f)){c.push(f);return}var d=f[t],m=d+f[Or[t]];if(PA(f)&&(n>0&&X(f)[t]>r||n<0&&X(f)[t]<r)){s.push(f);return}if(n>0&&d>r||n<0&&m<r){u(f);return}if(d<r&&m>r&&i.allowed("shape.resize",{shape:f})){p(f);return}}}),E(o,function(f){var d=f.attachers;d&&E(d,function(m){u(m)})});var l=o.concat(a);return E(s,function(f){var d=f.host;Gi(l,d)&&u(f)}),l=o.concat(a),E(c,function(f){var d=f.source,m=f.target,g=f.label;Gi(l,d)&&Gi(l,m)&&g&&u(g)}),{movingShapes:o,resizingShapes:a}};Xt.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};Xt.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function o_(e){return{top:e.top-Mp,right:e.right+Mp,bottom:e.bottom+Mp,left:e.left-Mp}}function a_(e){var t=e.context,n=t.spaceToolConstraints;if(n){var r,i;ne(n.left)&&(r=Math.max(e.x,n.left),e.dx=e.dx+r-e.x,e.x=r),ne(n.right)&&(r=Math.min(e.x,n.right),e.dx=e.dx+r-e.x,e.x=r),ne(n.top)&&(i=Math.max(e.y,n.top),e.dy=e.dy+i-e.y,e.y=i),ne(n.bottom)&&(i=Math.min(e.y,n.bottom),e.dy=e.dy+i-e.y,e.y=i)}}function RA(e,t,n,r,i){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s={},c,u;return E(a,function(p){var l=p.attachers,f=p.children,d=Z(p),m=Q(f,function(L){return!de(L)&&!ee(L)&&!Gi(o,L)&&!Gi(a,L)}),g=Q(f,function(L){return!de(L)&&!ee(L)&&Gi(o,L)}),v,w,S,x=[],b=[],R,A,O,T;m.length&&(w=o_(Z(Ce(m))),v=r-d[di[n]]+w[di[n]],n==="n"?s.bottom=u=ne(u)?Math.min(u,v):v:n==="w"?s.right=u=ne(u)?Math.min(u,v):v:n==="s"?s.top=c=ne(c)?Math.max(c,v):v:n==="e"&&(s.left=c=ne(c)?Math.max(c,v):v)),g.length&&(S=o_(Z(Ce(g))),v=r-S[di[Tp[n]]]+d[di[Tp[n]]],n==="n"?s.bottom=u=ne(u)?Math.min(u,v):v:n==="w"?s.right=u=ne(u)?Math.min(u,v):v:n==="s"?s.top=c=ne(c)?Math.max(c,v):v:n==="e"&&(s.left=c=ne(c)?Math.max(c,v):v)),l&&l.length&&(l.forEach(function(L){Gi(o,L)?x.push(L):b.push(L)}),x.length&&(R=Z(Ce(x.map(X))),A=d[di[Tp[n]]]-(R[di[Tp[n]]]-r)),b.length&&(O=Z(Ce(b.map(X))),T=O[di[n]]-(d[di[n]]-r)),n==="n"?(v=Math.min(A||1/0,T||1/0),s.bottom=u=ne(u)?Math.min(u,v):v):n==="w"?(v=Math.min(A||1/0,T||1/0),s.right=u=ne(u)?Math.min(u,v):v):n==="s"?(v=Math.max(A||-1/0,T||-1/0),s.top=c=ne(c)?Math.max(c,v):v):n==="e"&&(v=Math.max(A||-1/0,T||-1/0),s.left=c=ne(c)?Math.max(c,v):v));var I=i&&i[p.id];I&&(n==="n"?(v=r+p[Or[t]]-I[Or[t]],s.bottom=u=ne(u)?Math.min(u,v):v):n==="w"?(v=r+p[Or[t]]-I[Or[t]],s.right=u=ne(u)?Math.min(u,v):v):n==="s"?(v=r-p[Or[t]]+I[Or[t]],s.top=c=ne(c)?Math.max(c,v):v):n==="e"&&(v=r-p[Or[t]]+I[Or[t]],s.left=c=ne(c)?Math.max(c,v):v))}),s}}function Gi(e,t){return e.indexOf(t)!==-1}function PA(e){return!!e.host}N();var Yf="djs-dragging",c_="djs-resizing",AA=250,Dp=Math.max;function kp(e,t,n,r,i){function o(a,s){E(a,function(c){i.addDragger(c,s),n.addMarker(c,Yf)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,u={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},p=U("g");$(p,r.cls("djs-crosshair-group",["no-events"])),J(s,p);var l=U("path");$(l,"d",u.x),pe(l).add("djs-crosshair"),J(p,l);var f=U("path");$(f,"d",u.y),pe(f).add("djs-crosshair"),J(p,f),c.crosshairGroup=p}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;Fe(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&Pe(c)}),e.on("spaceTool.move",AA,function(a){var s=a.context,c=s.line,u=s.axis,p=s.movingShapes,l=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var f=n.getLayer("space");c=U("path"),$(c,"d","M0,0 L0,0"),pe(c).add("djs-crosshair"),J(f,c),s.line=c;var d=U("g");$(d,r.cls("djs-drag-group",["no-events"])),J(n.getActiveLayer(),d),o(p,d);var m=s.movingConnections=t.filter(function(b){var R=!1;E(p,function(I){E(I.outgoing,function(L){b===L&&(R=!0)})});var A=!1;E(p,function(I){E(I.incoming,function(L){b===L&&(A=!0)})});var O=!1;E(l,function(I){E(I.outgoing,function(L){b===L&&(O=!0)})});var T=!1;return E(l,function(I){E(I.incoming,function(L){b===L&&(T=!0)})}),de(b)&&(R||O)&&(A||T)});o(m,d),s.dragGroup=d}if(!s.frameGroup){var g=U("g");$(g,r.cls("djs-frame-group",["no-events"])),J(n.getActiveLayer(),g);var v=[];E(l,function(b){var R=i.addFrame(b,g),A=R.getBBox();v.push({element:R,initialBounds:A}),n.addMarker(b,c_)}),s.frameGroup=g,s.frames=v}var w={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};$(c,{d:w[u]});var S={x:"y",y:"x"},x={x:a.dx,y:a.dy};x[S[s.axis]]=0,Fe(s.dragGroup,x.x,x.y),E(s.frames,function(b){var R=b.element,A=b.initialBounds,O,T;s.direction==="e"?$(R,{width:Dp(A.width+x.x,5)}):(O=Dp(A.width-x.x,5),$(R,{width:O,x:A.x+A.width-O})),s.direction==="s"?$(R,{height:Dp(A.height+x.y,5)}):(T=Dp(A.height-x.y,5),$(R,{height:T,y:A.y+A.height-T}))})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,u=s.movingConnections,p=s.resizingShapes,l=s.line,f=s.dragGroup,d=s.frameGroup;E(c,function(m){n.removeMarker(m,Yf)}),E(u,function(m){n.removeMarker(m,Yf)}),f&&(Pe(l),Pe(f)),E(p,function(m){n.removeMarker(m,c_)}),d&&Pe(d)})}kp.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var u_={__init__:["spaceToolPreview"],__depends__:[kt,Et,fi,Dn,pr],spaceTool:["type",Xt],spaceToolPreview:["type",kp]};N();function ea(e,t){e.invoke(Xt,this),this._canvas=t}ea.$inject=["injector","canvas"];B(ea,Xt);ea.prototype.calculateAdjustments=function(e,t,n,r){var i=this._canvas.getRootElement(),o=e[0]===i?null:e[0],a=[];o&&(a=Sn(wi(i.children.filter(u=>h(u,"bpmn:Artifact")),Ce(o))));let s=[...e,...a];var c=Xt.prototype.calculateAdjustments.call(this,s,t,n,r);return c.resizingShapes=c.resizingShapes.filter(function(u){return!(h(u,"bpmn:TextAnnotation")||TA(u)&&(t==="y"&&Me(u)||t==="x"&&!Me(u)))}),c};function TA(e){return h(e,"bpmn:Participant")&&!j(e).processRef}var Np={__depends__:[u_],spaceTool:["type",ea]};N();function We(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}We.$inject=["eventBus","injector"];We.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";let n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()};We.prototype.canExecute=function(e,t){let n={command:e,context:t},r=this._getHandler(e),i=this._fire(e,"canExecute",n);if(i===void 0){if(!r)return!1;r.canExecute&&(i=r.canExecute(t))}return i};We.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})};We.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}};We.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}};We.prototype.register=function(e,t){this._setHandler(e,t)};We.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");let n=this._injector.instantiate(t);this.register(e,n)};We.prototype.canUndo=function(){return!!this._getUndoAction()};We.prototype.canRedo=function(){return!!this._getRedoAction()};We.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]};We.prototype._getUndoAction=function(){return this._stack[this._stackIdx]};We.prototype._internalUndo=function(e){let t=e.command,n=e.context,r=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),r.revert&&this._markDirty(r.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})};We.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);let r=t?[e+"."+t,t]:[e],i;n=this._eventBus.createEvent(n);for(let o of r)if(i=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return i};We.prototype._createId=function(){return this._uid++};We.prototype._atomicDo=function(e){let t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}};We.prototype._internalExecute=function(e,t){let n=e.command,r=e.context,i=this._getHandler(n);if(!i)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),i.preExecute&&i.preExecute(r),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),i.execute&&this._markDirty(i.execute(r)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),i.postExecute&&i.postExecute(r),this._fire(n,"postExecuted",e)),this._popAction()};We.prototype._pushAction=function(e){let t=this._currentExecution,n=t.actions,r=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=r&&r.id||this._createId()),n.push(e)};We.prototype._popAction=function(){let e=this._currentExecution,t=e.trigger,n=e.actions,r=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:mc("id",r.reverse())}),r.length=0,this._fire("changed",{trigger:t}),e.trigger=null)};We.prototype._markDirty=function(e){let t=this._currentExecution;e&&(e=q(e)?e:[e],t.dirty=t.dirty.concat(e))};We.prototype._executedAction=function(e,t){let n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)};We.prototype._revertedAction=function(e){this._stackIdx--};We.prototype._getHandler=function(e){return this._handlerMap[e]};We.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var p_={commandStack:["type",We]};N();function kn(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(!e)return[];for(var n;n=e[0];)t(n);return e}var MA=250,l_=1400;function Gs(e,t,n){k.call(this,t);var r=e.get("movePreview",!1);t.on("shape.move.start",l_,function(i){var o=i.context,a=o.shapes,s=o.validatedShapes;o.shapes=f_(a),o.validatedShapes=f_(s)}),r&&t.on("shape.move.start",MA,function(i){var o=i.context,a=o.shapes,s=[];E(a,function(c){E(c.labels,function(u){!u.hidden&&o.shapes.indexOf(u)===-1&&s.push(u),c.labelTarget&&s.push(c)})}),E(s,function(c){r.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",l_,function(i){var o=i.context,a=o.closure,s=a.enclosedElements,c=[];E(s,function(u){E(u.labels,function(p){s[p.id]||c.push(p)})}),a.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(i){var o=i.context,a=o.connection||o.shape;kn(a.labels,function(s){n.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(i){var o=i.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=co(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(i){var o=i.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(Ae(s.labels,a,c),a.labelTarget=s)})}B(Gs,k);Gs.$inject=["injector","eventBus","modeling"];function f_(e){return Q(e,function(t){return e.indexOf(t.labelTarget)===-1})}var d_={__init__:["labelSupport"],labelSupport:["type",Gs]};N();var DA=251,m_=1401,h_="attach-ok";function Vs(e,t,n,r,i){k.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",m_,function(a){var s=a.context,c=s.shapes,u=s.validatedShapes;s.shapes=kA(c),s.validatedShapes=NA(u)}),o&&t.on("shape.move.start",DA,function(a){var s=a.context,c=s.shapes,u=Xf(c);E(u,function(p){o.makeDraggable(s,p,!0),E(p.labels,function(l){o.makeDraggable(s,l,!0)})})}),o&&t.on("shape.move.start",function(a){var s=a.context,c=s.shapes;if(c.length===1){var u=c[0],p=u.host;p&&(n.addMarker(p,h_),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(p,h_)}))}}),this.preExecuted("elements.move",m_,function(a){var s=a.context,c=s.closure,u=s.shapes,p=Xf(u);E(p,function(l){c.add(l,c.topLevel[l.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,u=s.newHost,p;u&&c.length!==1||(u?p=c:p=Q(c,function(l){var f=l.host;return OA(l)&&!BA(c,f)}),E(p,function(l){i.updateAttachment(l,u)}))}),this.postExecuted("elements.move",function(a){var s=a.context.shapes;E(s,function(c){E(c.attachers,function(u){E(u.outgoing.slice(),function(p){var l=r.allowed("connection.reconnect",{connection:p,source:p.source,target:p.target});l||i.removeConnection(p)}),E(u.incoming.slice(),function(p){var l=r.allowed("connection.reconnect",{connection:p,source:p.source,target:p.target});l||i.removeConnection(p)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,u=s.host;u&&i.updateAttachment(c,u)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,u=s.newShape;kn(c.attachers,function(p){var l=r.allowed("elements.move",{target:u,shapes:[p]});l==="attach"?i.updateAttachment(p,u):i.removeShape(p)}),u.attachers.length&&E(u.attachers,function(p){var l=If(p,c,u);i.moveShape(p,l,p.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.oldBounds,p=s.newBounds,l=c.attachers,f=s.hints||{};f.attachSupport!==!1&&E(l,function(d){var m=If(d,u,p);i.moveShape(d,m,d.parent),E(d.labels,function(g){i.moveShape(g,m,g.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;kn(s.attachers,function(c){i.removeShape(c)}),s.host&&i.updateAttachment(s,null)})}B(Vs,k);Vs.$inject=["injector","eventBus","canvas","rules","modeling"];function Xf(e){return _i(je(e,function(t){return t.attachers||[]}))}function kA(e){var t=Xf(e);return gl("id",e,t)}function NA(e){var t=Vt(e,"id");return Q(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function OA(e){return!!e.host}function BA(e,t){return e.indexOf(t)!==-1}var v_={__depends__:[Et],__init__:["attachSupport"],attachSupport:["type",Vs]};N();function an(e){this._model=e}an.$inject=["moddle"];an.prototype._needsId=function(e){return te(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])};an.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;h(e,"bpmn:Activity")?t="Activity":h(e,"bpmn:Event")?t="Event":h(e,"bpmn:Gateway")?t="Gateway":te(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?t="Flow":t=(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))};an.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n};an.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})};an.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",C({bpmnElement:e,bounds:this.createDiBounds()},t))};an.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)};an.prototype.createDiWaypoints=function(e){var t=this;return je(e,function(n){return t.createDiWaypoint(n)})};an.prototype.createDiWaypoint=function(e){return this.create("dc:Point",mt(e,["x","y"]))};an.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",C({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))};an.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",C({bpmnElement:e},t))};N();function $t(e,t,n){k.call(this,e),this._bpmnFactory=t;var r=this;function i(d){var m=d.context,g=m.hints||{},v;!m.cropped&&g.createElementsBehavior!==!1&&(v=m.connection,v.waypoints=n.getCroppedWaypoints(v),m.cropped=!0)}this.executed(["connection.layout","connection.create"],i),this.reverted(["connection.layout"],function(d){delete d.context.cropped});function o(d){var m=d.context;r.updateParent(m.shape||m.connection,m.oldParent)}function a(d){var m=d.context,g=m.shape||m.connection,v=m.parent||m.newParent;r.updateParent(g,v)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(a));function s(d){var m=d.context,g=m.oldRoot,v=g.children;E(v,function(w){h(w,"bpmn:BaseElement")&&r.updateParent(w)})}this.executed(["canvas.updateRoot"],s),this.reverted(["canvas.updateRoot"],s);function c(d){var m=d.context.shape;h(m,"bpmn:BaseElement")&&r.updateBounds(m)}this.executed(["shape.move","shape.create","shape.resize"],sn(function(d){d.context.shape.type!=="label"&&c(d)})),this.reverted(["shape.move","shape.create","shape.resize"],sn(function(d){d.context.shape.type!=="label"&&c(d)})),e.on("shape.changed",function(d){d.element.type==="label"&&c({context:{shape:d.element}})});function u(d){r.updateConnection(d.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],sn(u)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],sn(u));function p(d){r.updateConnectionWaypoints(d.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],sn(p)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],sn(p)),this.executed("connection.reconnect",sn(function(d){var m=d.context,g=m.connection,v=m.oldSource,w=m.newSource,S=j(g),x=j(v),b=j(w);S.conditionExpression&&!te(b,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(m.oldConditionExpression=S.conditionExpression,delete S.conditionExpression),v!==w&&x.default===S&&(m.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",sn(function(d){var m=d.context,g=m.connection,v=m.oldSource,w=m.newSource,S=j(g),x=j(v),b=j(w);m.oldConditionExpression&&(S.conditionExpression=m.oldConditionExpression),m.oldDefault&&(x.default=m.oldDefault,delete b.default)}));function l(d){r.updateAttachment(d.context)}this.executed(["element.updateAttachment"],sn(l)),this.reverted(["element.updateAttachment"],sn(l)),this.executed("element.updateLabel",sn(f)),this.reverted("element.updateLabel",sn(f));function f(d){let{element:m}=d.context,g=gt(m),v=ce(m),w=v&&v.get("label");mn(m)||Eo(m)||(g&&!w?v.set("label",t.create("bpmndi:BPMNLabel")):!g&&w&&v.set("label",void 0))}}B($t,k);$t.$inject=["eventBus","bpmnFactory","connectionDocking"];$t.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,r=t.host;n.attachedToRef=r&&r.businessObject};$t.prototype.updateParent=function(e,t){if(!ee(e)&&!(h(e,"bpmn:DataStoreReference")&&e.parent&&h(e.parent,"bpmn:Collaboration"))){var n=e.parent,r=e.businessObject,i=ce(e),o=n&&n.businessObject,a=ce(n);h(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(r,o,t&&t.businessObject),h(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),h(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(r,o),h(e,"bpmn:DataObjectReference")&&r.dataObjectRef&&this.updateSemanticParent(r.dataObjectRef,o),this.updateDiParent(i,a)}};$t.prototype.updateBounds=function(e){var t=ce(e),n=LA(e);if(n){var r=Dt(n,t.get("bounds"));C(n,{x:e.x+r.x,y:e.y+r.y})}var i=ee(e)?this._getLabel(t):t,o=i.bounds;o||(o=this._bpmnFactory.createDiBounds(),i.set("bounds",o)),C(o,{x:e.x,y:e.y,width:e.width,height:e.height})};$t.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var r,i;h(n,"bpmn:Lane")&&(r=n.get("flowNodeRef"),Oe(r,e)),h(t,"bpmn:Lane")&&(i=t.get("flowNodeRef"),Ae(i,e))}};$t.prototype.updateDiConnection=function(e,t,n){var r=ce(e),i=ce(t),o=ce(n);r.sourceElement&&r.sourceElement.bpmnElement!==j(t)&&(r.sourceElement=t&&i),r.targetElement&&r.targetElement.bpmnElement!==j(n)&&(r.targetElement=n&&o)};$t.prototype.updateDiParent=function(e,t){if(t&&!h(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Oe(n,e),e.$parent=null)}};function IA(e){for(;e&&!h(e,"bpmn:Definitions");)e=e.$parent;return e}$t.prototype.getLaneSet=function(e){var t,n;return h(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(h(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),t=n[0],t||(t=this._bpmnFactory.create("bpmn:LaneSet"),t.$parent=e,n.push(t)),t)};$t.prototype.updateSemanticParent=function(e,t,n){var r;if(e.$parent!==t&&!((h(e,"bpmn:DataInput")||h(e,"bpmn:DataOutput"))&&(h(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(h(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),r="lanes";else if(h(e,"bpmn:FlowElement")){if(t){if(h(t,"bpmn:Participant"))t=t.processRef;else if(h(t,"bpmn:Lane"))do t=t.$parent.$parent;while(h(t,"bpmn:Lane"))}r="flowElements"}else if(h(e,"bpmn:Artifact")){for(;t&&!h(t,"bpmn:Process")&&!h(t,"bpmn:SubProcess")&&!h(t,"bpmn:Collaboration");)if(h(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;r="artifacts"}else if(h(e,"bpmn:MessageFlow"))r="messageFlows";else if(h(e,"bpmn:Participant")){r="participants";var i=e.processRef,o;i&&(o=IA(e.$parent||t),e.$parent&&(Oe(o.get("rootElements"),i),i.$parent=null),t&&(Ae(o.get("rootElements"),i),i.$parent=o))}else h(e,"bpmn:DataOutputAssociation")?r="dataOutputAssociations":h(e,"bpmn:DataInputAssociation")&&(r="dataInputAssociations");if(!r)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&(a=e.$parent.get(r),Oe(a,e)),t?(a=t.get(r),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(r);Oe(a,e),t&&(s||(s=[],t.set(r,s)),s.push(e))}}};$t.prototype.updateConnectionWaypoints=function(e){var t=ce(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))};$t.prototype.updateConnection=function(e){var t=e.connection,n=j(t),r=t.source,i=j(r),o=t.target,a=j(t.target),s;if(h(n,"bpmn:DataAssociation"))h(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=i,s=e.parent||e.newParent||a,this.updateSemanticParent(n,a,s)):h(n,"bpmn:DataOutputAssociation")&&(s=e.parent||e.newParent||i,this.updateSemanticParent(n,i,s),n.targetRef=a);else{var c=h(n,"bpmn:SequenceFlow");n.sourceRef!==i&&(c&&(Oe(n.sourceRef&&n.sourceRef.get("outgoing"),n),i&&i.get("outgoing")&&i.get("outgoing").push(n)),n.sourceRef=i),n.targetRef!==a&&(c&&(Oe(n.targetRef&&n.targetRef.get("incoming"),n),a&&a.get("incoming")&&a.get("incoming").push(n)),n.targetRef=a)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,r,o)};$t.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function sn(e){return function(t){var n=t.context,r=n.shape||n.connection||n.element;h(r,"bpmn:BaseElement")&&e(t)}}function LA(e){if(h(e,"bpmn:Activity")){var t=ce(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}N();function lr(e,t){Pn.call(this),this._bpmnFactory=e,this._moddle=t}B(lr,Pn);lr.$inject=["bpmnFactory","moddle"];lr.prototype._baseCreate=Pn.prototype.create;lr.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,C({type:"label",di:n},ir,t))}return this.createElement(e,t)};lr.prototype.createElement=function(e,t){t=C({},t||{});var n,r=t.businessObject,i=t.di;if(!r){if(!t.type)throw new Error("no shape type specified");r=this._bpmnFactory.create(t.type)}if(!FA(i)){var o=C({},i||{},{id:r.id+"_di"});e==="root"?i=this._bpmnFactory.createDiPlane(r,o):e==="connection"?i=this._bpmnFactory.createDiEdge(r,o):i=this._bpmnFactory.createDiShape(r,o)}h(r,"bpmn:Group")&&(t=C({isFrame:!0},t)),t=jA(r,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=Zf(i,t,"isExpanded")),te(r,["bpmn:Lane","bpmn:Participant"])&&(t=Zf(i,t,"isHorizontal")),h(r,"bpmn:SubProcess")&&(t.collapsed=!ie(r,i)),h(r,"bpmn:ExclusiveGateway")&&(dt(i,"isMarkerVisible")?i.isMarkerVisible===void 0&&(i.isMarkerVisible=!1):i.isMarkerVisible=!0),Ue(t.triggeredByEvent)&&(r.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),Ue(t.cancelActivity)&&(r.cancelActivity=t.cancelActivity,delete t.cancelActivity);var a,s;return t.eventDefinitionType&&(a=r.get("eventDefinitions")||[],s=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(s.condition=this._bpmnFactory.create("bpmn:FormalExpression")),a.push(s),s.$parent=r,r.eventDefinitions=a,delete t.eventDefinitionType),n=this.getDefaultSize(r,i),t=C({id:r.id},n,t,{businessObject:r,di:i}),this._baseCreate(e,t)};lr.prototype.getDefaultSize=function(e,t){var n=j(e);if(t=t||ce(e),h(n,"bpmn:SubProcess"))return ie(n,t)?{width:350,height:200}:{width:100,height:80};if(h(n,"bpmn:Task"))return{width:100,height:80};if(h(n,"bpmn:Gateway"))return{width:50,height:50};if(h(n,"bpmn:Event"))return{width:36,height:36};if(h(n,"bpmn:Participant")){var r=t.isHorizontal===void 0||t.isHorizontal===!0;return ie(n,t)?r?{width:600,height:250}:{width:250,height:600}:r?{width:400,height:60}:{width:60,height:400}}return h(n,"bpmn:Lane")?{width:400,height:100}:h(n,"bpmn:DataObjectReference")?{width:36,height:50}:h(n,"bpmn:DataStoreReference")?{width:50,height:50}:h(n,"bpmn:TextAnnotation")?{width:100,height:40}:h(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}};lr.prototype.createParticipantShape=function(e){return Se(e)||(e={isExpanded:e}),e=C({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function jA(e,t,n){return E(n,function(r){t=Zf(e,t,r)}),t}function Zf(e,t,n){return t[n]===void 0?t:(e[n]=t[n],Nt(t,[n]))}function FA(e){return te(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}N();N();function ta(e,t){this._modeling=e,this._canvas=t}ta.$inject=["modeling","canvas"];ta.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,r=e.alignment;E(n,function(i){var o={x:0,y:0};Ue(r.left)?o.x=r.left-i.x:Ue(r.right)?o.x=r.right-i.width-i.x:Ue(r.center)?o.x=r.center-Math.round(i.width/2)-i.x:Ue(r.top)?o.y=r.top-i.y:Ue(r.bottom)?o.y=r.bottom-i.height-i.y:Ue(r.middle)&&(o.y=r.middle-Math.round(i.height/2)-i.y),t.moveElements([i],o,i.parent)})};ta.prototype.postExecute=function(e){};N();function na(e){this._modeling=e}na.$inject=["modeling"];na.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,r=e.shape,i=e.hints||{};r=e.shape=this._modeling.createShape(r,e.position,n,{attach:i.attach}),e.shape=r};na.prototype.postExecute=function(e){var t=e.hints||{};HA(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function HA(e,t){return Lt(e.outgoing,function(n){return n.target===t})}function ra(e,t){this._canvas=e,this._layouter=t}ra.$inject=["canvas","layouter"];ra.prototype.execute=function(e){var t=e.connection,n=e.source,r=e.target,i=e.parent,o=e.parentIndex,a=e.hints;if(!n||!r)throw new Error("source and target required");if(!i)throw new Error("parent required");return t.source=n,t.target=r,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,i,o),t};ra.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};N();var Op=Math.round;function Ws(e){this._modeling=e}Ws.$inject=["modeling"];Ws.prototype.preExecute=function(e){var t=e.elements,n=e.parent,r=e.parentIndex,i=e.position,o=e.hints,a=this._modeling;E(t,function(l){ne(l.x)||(l.x=0),ne(l.y)||(l.y=0)});var s=Q(t,function(l){return!l.hidden}),c=Ce(s);E(t,function(l){de(l)&&(l.waypoints=je(l.waypoints,function(f){return{x:Op(f.x-c.x-c.width/2+i.x),y:Op(f.y-c.y-c.height/2+i.y)}})),C(l,{x:Op(l.x-c.x-c.width/2+i.x),y:Op(l.y-c.y-c.height/2+i.y)})});var u=zr(t),p={};E(t,function(l){if(de(l)){p[l.id]=ne(r)?a.createConnection(p[l.source.id],p[l.target.id],r,l,l.parent||n,o):a.createConnection(p[l.source.id],p[l.target.id],l,l.parent||n,o);return}var f=C({},o);u.indexOf(l)===-1&&(f.autoResize=!1),ee(l)&&(f=Nt(f,["attach"])),p[l.id]=ne(r)?a.createShape(l,mt(l,["x","y","width","height"]),l.parent||n,r,f):a.createShape(l,mt(l,["x","y","width","height"]),l.parent||n,f)}),e.elements=Sn(p)};N();var g_=Math.round;function Wn(e){this._canvas=e}Wn.$inject=["canvas"];Wn.prototype.execute=function(e){var t=e.shape,n=e.position,r=e.parent,i=e.parentIndex;if(!r)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?C(t,n):C(t,{x:n.x-g_(t.width/2),y:n.y-g_(t.height/2)}),this._canvas.addShape(t,r,i),t};Wn.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Vi(e){Wn.call(this,e)}B(Vi,Wn);Vi.$inject=["canvas"];var $A=Wn.prototype.execute;Vi.prototype.execute=function(e){var t=e.shape;return GA(t),t.labelTarget=e.labelTarget,$A.call(this,e)};var zA=Wn.prototype.revert;Vi.prototype.revert=function(e){return e.shape.labelTarget=null,zA.call(this,e)};function GA(e){["width","height"].forEach(function(t){typeof e[t]=="undefined"&&(e[t]=0)})}function Wi(e,t){this._canvas=e,this._modeling=t}Wi.$inject=["canvas","modeling"];Wi.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;kn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),kn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})})};Wi.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=co(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t};Wi.prototype.revert=function(e){var t=e.connection,n=e.parent,r=e.parentIndex;return t.source=e.source,t.target=e.target,Ae(n.children,t,r),this._canvas.addConnection(t,n),t};N();function Us(e,t){this._modeling=e,this._elementRegistry=t}Us.$inject=["modeling","elementRegistry"];Us.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,r=e.elements;E(r,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})};function Ui(e,t){this._canvas=e,this._modeling=t}Ui.$inject=["canvas","modeling"];Ui.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;kn(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),kn(n.outgoing,function(r){t.removeConnection(r,{nested:!0})}),kn(n.children,function(r){de(r)?t.removeConnection(r,{nested:!0}):t.removeShape(r,{nested:!0})})};Ui.prototype.execute=function(e){var t=this._canvas,n=e.shape,r=n.parent;return e.oldParent=r,e.oldParentIndex=co(r.children,n),t.removeShape(n),n};Ui.prototype.revert=function(e){var t=this._canvas,n=e.shape,r=e.oldParent,i=e.oldParentIndex;return Ae(r.children,n,i),t.addShape(n,r),n};N();function ia(e){this._modeling=e}ia.$inject=["modeling"];var y_={x:"y",y:"x"};ia.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,r=e.axis,i=e.dimension;function o(v,w){v.range.min=Math.min(w[r],v.range.min),v.range.max=Math.max(w[r]+w[i],v.range.max)}function a(v){return v[r]+v[i]/2}function s(v){return v.length-1}function c(v){return v.max-v.min}function u(v,w){var S={y:0};S[r]=v-a(w),S[r]&&(S[y_[r]]=0,t.moveElements([w],S,w.parent))}var p=n[0],l=s(n),f=n[l],d,m,g=0;E(n,function(v,w){var S,x,b;if(v.elements.length<2){w&&w!==n.length-1&&(o(v,v.elements[0]),g+=c(v.range));return}S=At(v.elements,r),x=S[0],w===l&&(x=S[s(S)]),b=a(x),v.range=null,E(S,function(R){if(u(b,R),v.range===null){v.range={min:R[r],max:R[r]+R[i]};return}o(v,R)}),w&&w!==n.length-1&&(g+=c(v.range))}),m=Math.abs(f.range.min-p.range.max),d=Math.round((m-g)/(n.length-1)),!(d<n.length-1)&&E(n,function(v,w){var S={},x;v===p||v===f||(x=n[w-1],v.range.max=0,E(v.elements,function(b,R){S[y_[r]]=0,S[r]=x.range.max-b[r]+d,v.range.min!==b[r]&&(S[r]+=b[r]-v.range.min),S[r]&&t.moveElements([b],S,b.parent),v.range.max=Math.max(b[r]+b[i],R?v.range.max:0)}))})};ia.prototype.postExecute=function(e){};N();function oa(e,t){this._layouter=e,this._canvas=t}oa.$inject=["layouter","canvas"];oa.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return C(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t};oa.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};N();function qs(){}qs.prototype.execute=function(e){var t=e.connection,n=e.delta,r=e.newParent||t.parent,i=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=Oe(o.children,t),Ae(r.children,t,i),t.parent=r,E(t.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),t};qs.prototype.revert=function(e){var t=e.connection,n=t.parent,r=e.oldParent,i=e.oldParentIndex,o=e.delta;return Oe(n.children,t),Ae(r.children,t,i),t.parent=r,E(t.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),t};N();N();function Ks(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}Ks.prototype.add=function(e,t){return this.addAll([e],t)};Ks.prototype.addAll=function(e,t){var n=hm(e,!!t,this);return C(this,n),this};function mi(e){this._modeling=e}mi.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]};mi.prototype.moveClosure=function(e,t,n,r,i){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,u=e.topLevel,p=!1;i&&i.parent===n&&(p=!0),E(a,function(l){o.moveShape(l,t,u[l.id]&&!p&&n,{recurse:!1,layout:!1})}),E(s,function(l){var f=!!a[l.source.id],d=!!a[l.target.id];c[l.id]&&f&&d?o.moveConnection(l,t,u[l.id]&&!p&&n):o.layoutConnection(l,{connectionStart:f&&Uo(l,l.source,t),connectionEnd:d&&qo(l,l.target,t)})})};mi.prototype.getClosure=function(e){return new Ks().addAll(e,!0)};function aa(e){this._helper=new mi(e)}aa.$inject=["modeling"];aa.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)};aa.prototype.postExecute=function(e){var t=e.hints,n;t&&t.primaryShape&&(n=t.primaryShape,t.oldParent=n.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,n)};N();function Br(e){this._modeling=e,this._helper=new mi(e)}Br.$inject=["modeling"];Br.prototype.execute=function(e){var t=e.shape,n=e.delta,r=e.newParent||t.parent,i=e.newParentIndex,o=t.parent;return e.oldBounds=mt(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=Oe(o.children,t),Ae(r.children,t,i),C(t,{parent:r,x:t.x+n.x,y:t.y+n.y}),t};Br.prototype.postExecute=function(e){var t=e.shape,n=e.delta,r=e.hints,i=this._modeling;r.layout!==!1&&(E(t.incoming,function(o){i.layoutConnection(o,{connectionEnd:qo(o,t,n)})}),E(t.outgoing,function(o){i.layoutConnection(o,{connectionStart:Uo(o,t,n)})})),r.recurse!==!1&&this.moveChildren(e)};Br.prototype.revert=function(e){var t=e.shape,n=e.oldParent,r=e.oldParentIndex,i=e.delta;return Ae(n.children,t,r),C(t,{parent:n,x:t.x-i.x,y:t.y-i.y}),t};Br.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)};Br.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};N();function qi(e){this._modeling=e}qi.$inject=["modeling"];qi.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,r=e.connection,i=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return q(i)&&(e.oldWaypoints=r.waypoints,r.waypoints=i),t&&(e.oldSource=r.source,r.source=t),n&&(e.oldTarget=r.target,r.target=n),r};qi.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,r=e.newTarget,i=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(n&&(!r||o.docking==="source")&&(a.connectionStart=a.connectionStart||__(q(i)?i[0]:i)),r&&(!n||o.docking==="target")&&(a.connectionEnd=a.connectionEnd||__(q(i)?i[i.length-1]:i)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))};qi.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,r=e.oldWaypoints,i=e.connection;return t&&(i.source=t),n&&(i.target=n),r&&(i.waypoints=r),i};function __(e){return e.original||e}N();function Un(e,t){this._modeling=e,this._rules=t}Un.$inject=["modeling","rules"];Un.prototype.preExecute=function(e){var t=this,n=this._modeling,r=this._rules,i=e.oldShape,o=e.newData,a=e.hints||{},s;function c(m,g,v){return r.allowed("connection.reconnect",{connection:v,source:m,target:g})}var u={x:o.x,y:o.y},p={x:i.x,y:i.y,width:i.width,height:i.height};s=e.newShape=e.newShape||t.createShape(o,u,i.parent,a),i.host&&n.updateAttachment(s,i.host);var l;a.moveChildren!==!1&&(l=i.children.slice(),n.moveElements(l,{x:0,y:0},s,a));var f=i.incoming.slice(),d=i.outgoing.slice();E(f,function(m){var g=m.source,v=c(g,s,m);v&&t.reconnectEnd(m,s,ui(m,s,p),a)}),E(d,function(m){var g=m.target,v=c(s,g,m);v&&t.reconnectStart(m,s,ci(m,s,p),a)})};Un.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)};Un.prototype.execute=function(e){};Un.prototype.revert=function(e){};Un.prototype.createShape=function(e,t,n,r){return this._modeling.createShape(e,t,n,r)};Un.prototype.reconnectStart=function(e,t,n,r){this._modeling.reconnectStart(e,t,n,r)};Un.prototype.reconnectEnd=function(e,t,n,r){this._modeling.reconnectEnd(e,t,n,r)};N();function Ki(e){this._modeling=e}Ki.$inject=["modeling"];Ki.prototype.execute=function(e){var t=e.shape,n=e.newBounds,r=e.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(r&&(n.width<r.width||n.height<r.height))throw new Error("width and height cannot be less than minimum height and width");if(!r&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},C(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};Ki.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,r=e.oldBounds,i=e.hints||{};i.layout!==!1&&(E(n.incoming,function(o){t.layoutConnection(o,{connectionEnd:ui(o,n,r)})}),E(n.outgoing,function(o){t.layoutConnection(o,{connectionStart:ci(o,n,r)})}))};Ki.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return C(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};N();function fr(e){this._modeling=e}fr.$inject=["modeling"];fr.prototype.preExecute=function(e){var t=e.delta,n=e.direction,r=e.movingShapes,i=e.resizingShapes,o=e.start,a={};this.moveShapes(r,t),E(i,function(s){a[s.id]=WA(s)}),this.resizeShapes(i,t,n),this.updateConnectionWaypoints(r_(r,i),t,n,o,r,i,a)};fr.prototype.execute=function(){};fr.prototype.revert=function(){};fr.prototype.moveShapes=function(e,t){var n=this;E(e,function(r){n._modeling.moveShape(r,t,null,{autoResize:!1,layout:!1,recurse:!1})})};fr.prototype.resizeShapes=function(e,t,n){var r=this;E(e,function(i){var o=i_(i,n,t);r._modeling.resizeShape(i,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})};fr.prototype.updateConnectionWaypoints=function(e,t,n,r,i,o,a){var s=this,c=i.concat(o);E(e,function(u){var p=u.source,l=u.target,f=VA(u),d=E_(n),m={};hi(c,p)&&hi(c,l)?(f=je(f,function(g){return x_(g,r,n)&&(g[d]=g[d]+t[d]),g.original&&x_(g.original,r,n)&&(g.original[d]=g.original[d]+t[d]),g}),s._modeling.updateWaypoints(u,f,{labelBehavior:!1})):(hi(c,p)||hi(c,l))&&(hi(i,p)?m.connectionStart=Uo(u,p,t):hi(i,l)?m.connectionEnd=qo(u,l,t):hi(o,p)?m.connectionStart=ci(u,p,a[p.id]):hi(o,l)&&(m.connectionEnd=ui(u,l,a[l.id])),s._modeling.layoutConnection(u,m))})};function b_(e){return C({},e)}function VA(e){return je(e.waypoints,function(t){return t=b_(t),t.original&&(t.original=b_(t.original)),t})}function E_(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function x_(e,t,n){var r=E_(n);if(/e|s/.test(n))return e[r]>t;if(/n|w/.test(n))return e[r]<t}function hi(e,t){return e.indexOf(t)!==-1}function WA(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}N();function sa(e){this._modeling=e}sa.$inject=["modeling"];sa.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=w_(n),t.collapsed=!t.collapsed;var r=S_(n,t.collapsed);return[t].concat(r)};sa.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,r=t.children,i=C_(r,n);return t.collapsed=!t.collapsed,[t].concat(i)};function w_(e){var t={};return E(e,function(n){t[n.id]=n.hidden,n.children&&(t=C({},t,w_(n.children)))}),t}function S_(e,t){var n=[];return E(e,function(r){r.hidden=t,n=n.concat(r),r.children&&(n=n.concat(S_(r.children,r.collapsed||t)))}),n}function C_(e,t){var n=[];return E(e,function(r){r.hidden=t[r.id],n=n.concat(r),r.children&&(n=n.concat(C_(r.children,t)))}),n}function ca(e){this._modeling=e}ca.$inject=["modeling"];ca.prototype.execute=function(e){var t=e.shape,n=e.newHost,r=t.host;return e.oldHost=r,e.attacherIdx=R_(r,t),P_(n,t),t.host=n,t};ca.prototype.revert=function(e){var t=e.shape,n=e.newHost,r=e.oldHost,i=e.attacherIdx;return t.host=r,R_(n,t),P_(r,t,i),t};function R_(e,t){return Oe(e&&e.attachers,t)}function P_(e,t,n){if(e){var r=e.attachers;r||(e.attachers=r=[]),Ae(r,t,n)}}function Ys(){}Ys.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t};Ys.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t};function De(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var r=this;e.on("diagram.init",function(){r.registerHandlers(n)})}De.$inject=["eventBus","elementFactory","commandStack"];De.prototype.getHandlers=function(){return{"shape.append":na,"shape.create":Wn,"shape.delete":Ui,"shape.move":Br,"shape.resize":Ki,"shape.replace":Un,"shape.toggleCollapse":sa,spaceTool:fr,"label.create":Vi,"connection.create":ra,"connection.delete":Wi,"connection.move":qs,"connection.layout":oa,"connection.updateWaypoints":Ys,"connection.reconnect":qi,"elements.create":Ws,"elements.move":aa,"elements.delete":Us,"elements.distribute":ia,"elements.align":ta,"element.updateAttachment":ca}};De.prototype.registerHandlers=function(e){E(this.getHandlers(),function(t,n){e.registerHandler(n,t)})};De.prototype.moveShape=function(e,t,n,r,i){typeof r=="object"&&(i=r,r=null);var o={shape:e,delta:t,newParent:n,newParentIndex:r,hints:i||{}};this._commandStack.execute("shape.move",o)};De.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)};De.prototype.moveElements=function(e,t,n,r){r=r||{};var i=r.attach,o=n,a;i===!0?(a=n,o=n.parent):i===!1&&(a=null);var s={shapes:e,delta:t,newParent:o,newHost:a,hints:r};this._commandStack.execute("elements.move",s)};De.prototype.moveConnection=function(e,t,n,r,i){typeof r=="object"&&(i=r,r=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:r,hints:i||{}};this._commandStack.execute("connection.move",o)};De.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)};De.prototype.createConnection=function(e,t,n,r,i,o){typeof n=="object"&&(o=i,i=r,r=n,n=void 0),r=this._create("connection",r);var a={source:e,target:t,parent:i,parentIndex:n,connection:r,hints:o};return this._commandStack.execute("connection.create",a),a.connection};De.prototype.createShape=function(e,t,n,r,i){typeof r!="number"&&(i=r,r=void 0),i=i||{};var o=i.attach,a,s;e=this._create("shape",e),o?(a=n.parent,s=n):a=n;var c={position:t,shape:e,parent:a,parentIndex:r,host:s,hints:i};return this._commandStack.execute("shape.create",c),c.shape};De.prototype.createElements=function(e,t,n,r,i){q(e)||(e=[e]),typeof r!="number"&&(i=r,r=void 0),i=i||{};var o={position:t,elements:e,parent:n,parentIndex:r,hints:i};return this._commandStack.execute("elements.create",o),o.elements};De.prototype.createLabel=function(e,t,n,r){n=this._create("label",n);var i={labelTarget:e,position:t,parent:r||e.parent,shape:n};return this._commandStack.execute("label.create",i),i.shape};De.prototype.appendShape=function(e,t,n,r,i){i=i||{},t=this._create("shape",t);var o={source:e,position:n,target:r,shape:t,connection:i.connection,connectionParent:i.connectionParent,hints:i};return this._commandStack.execute("shape.append",o),o.shape};De.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)};De.prototype.distributeElements=function(e,t,n){var r={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",r)};De.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)};De.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)};De.prototype.replaceShape=function(e,t,n){var r={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",r),r.newShape};De.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)};De.prototype.resizeShape=function(e,t,n,r){var i={shape:e,newBounds:t,minBounds:n,hints:r};this._commandStack.execute("shape.resize",i)};De.prototype.createSpace=function(e,t,n,r,i){var o={delta:n,direction:r,movingShapes:e,resizingShapes:t,start:i};this._commandStack.execute("spaceTool",o)};De.prototype.updateWaypoints=function(e,t,n){var r={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",r)};De.prototype.reconnect=function(e,t,n,r,i){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:r,hints:i||{}};this._commandStack.execute("connection.reconnect",o)};De.prototype.reconnectStart=function(e,t,n,r){r||(r={}),this.reconnect(e,t,e.target,n,C(r,{docking:"source"}))};De.prototype.reconnectEnd=function(e,t,n,r){r||(r={}),this.reconnect(e,e.source,t,n,C(r,{docking:"target"}))};De.prototype.connect=function(e,t,n,r){return this.createConnection(e,t,n||{},e.parent,r)};De.prototype._create=function(e,t){return zm(t)?t:this._elementFactory.create(e,t)};De.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};N();function Yi(e){this._elementRegistry=e}Yi.$inject=["elementRegistry"];Yi.prototype.execute=function(e){var t=e.element,n=e.moddleElement,r=e.properties;if(!n)throw new Error("<moddleElement> required");var i=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||UA(n,bi(r));return A_(n,r),e.oldProperties=o,e.changed=i,i};Yi.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,r=e.changed;return A_(n,t),r};Yi.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return h(e,"bpmn:DataObject")?qA(e,t):[]};function UA(e,t){return Ge(t,function(n,r){return n[r]=e.get(r),n},{})}function A_(e,t){E(t,function(n,r){e.set(r,n)})}function qA(e,t){return t.filter(function(n){return h(n,"bpmn:DataObjectReference")&&j(n).dataObjectRef===e})}N();var Xs="default",Ir="id",T_="di",KA={width:0,height:0};function Xi(e,t,n,r){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=r}Xi.$inject=["elementRegistry","moddle","modeling","textRenderer"];Xi.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var r=this._elementRegistry,i=this._moddle.ids,o=t.businessObject,a=JA(e.properties),s=e.oldProperties||YA(t,a);return M_(a,o)&&(i.unclaim(o[Ir]),r.updateId(t,a[Ir]),i.claim(a[Ir],o)),Xs in a&&(a[Xs]&&n.push(r.get(a[Xs].id)),o[Xs]&&n.push(r.get(o[Xs].id))),D_(t,a),e.oldProperties=s,e.changed=n,n};Xi.prototype.postExecute=function(e){var t=e.element,n=t.label,r=n&&j(n).name;if(r){var i=this._textRenderer.getExternalLabelBounds(n,r);this._modeling.resizeShape(n,i,KA)}};Xi.prototype.revert=function(e){var t=e.element,n=e.properties,r=e.oldProperties,i=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return D_(t,r),M_(n,i)&&(a.unclaim(n[Ir]),o.updateId(t,r[Ir]),a.claim(r[Ir],i)),e.changed};function M_(e,t){return Ir in e&&e[Ir]!==t[Ir]}function YA(e,t){var n=bi(t),r=e.businessObject,i=ce(e);return Ge(n,function(o,a){return a!==T_?o[a]=r.get(a):o[a]=XA(i,bi(t.di)),o},{})}function XA(e,t){return Ge(t,function(n,r){return n[r]=e&&e.get(r),n},{})}function D_(e,t){var n=e.businessObject,r=ce(e);E(t,function(i,o){o!==T_?n.set(o,i):r&&ZA(r,i)})}function ZA(e,t){E(t,function(n,r){e.set(r,n)})}var QA=["default"];function JA(e){var t=C({},e);return QA.forEach(function(n){n in e&&(t[n]=j(t[n]))}),t}function ua(e,t){this._canvas=e,this._modeling=t}ua.$inject=["canvas","modeling"];ua.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,r=n.businessObject,i=t.getRootElement(),o=i.businessObject,a=o.$parent,s=ce(i);return t.setRootElement(n),t.removeRootElement(i),Ae(a.rootElements,r),r.$parent=a,Oe(a.rootElements,o),o.$parent=null,i.di=null,s.bpmnElement=r,n.di=s,e.oldRoot=i,[]};ua.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,r=n.businessObject,i=e.oldRoot,o=i.businessObject,a=r.$parent,s=ce(n);return t.setRootElement(i),t.removeRootElement(n),Oe(a.rootElements,r),r.$parent=null,Ae(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,i.di=s,[]};N();function Zs(e,t){this._modeling=e,this._spaceTool=t}Zs.$inject=["modeling","spaceTool"];Zs.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,r=e.shape,i=e.location,o=Bt(r),a=o===r,s=a?r:r.parent,c=yn(s),u=Me(r);if(u?i==="left"?i="top":i==="right"&&(i="bottom"):i==="top"?i="left":i==="bottom"&&(i="right"),!c.length){var p=u?{x:r.x+on,y:r.y,width:r.width-on,height:r.height}:{x:r.x,y:r.y+on,width:r.width,height:r.height-on};n.createShape({type:"bpmn:Lane",isHorizontal:u},p,s)}var l=[];In(o,function(b){return l.push(b),b.label&&l.push(b.label),b===r?[]:Q(b.children,function(R){return R!==r})});var f,d,m,g,v;i==="top"?(f=-120,d=r.y,m=d+10,g="n",v="y"):i==="left"?(f=-120,d=r.x,m=d+10,g="w",v="x"):i==="bottom"?(f=120,d=r.y+r.height,m=d-10,g="s",v="y"):i==="right"&&(f=120,d=r.x+r.width,m=d-10,g="e",v="x");var w=t.calculateAdjustments(l,v,f,m),S=u?{x:0,y:f}:{x:f,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,S,g,m);var x=u?{x:r.x+(a?on:0),y:d-(i==="top"?120:0),width:r.width-(a?on:0),height:120}:{x:d-(i==="left"?120:0),y:r.y+(a?on:0),width:120,height:r.height-(a?on:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:u},x,s)};function Qs(e){this._modeling=e}Qs.$inject=["modeling"];Qs.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,r=e.count,i=yn(n),o=i.length;if(o>r)throw new Error(`more than <${r}> child lanes`);var a=Me(n),s=a?n.height:n.width,c=Math.round(s/r),u,p,l,f;for(f=0;f<r;f++)f===r-1?u=s-c*f:u=c,p=a?{x:n.x+on,y:n.y+f*c,width:n.width-on,height:u}:{x:n.x+f*c,y:n.y+on,width:u,height:n.height-on},f<o?t.resizeShape(i[f],p):(l={type:"bpmn:Lane",isHorizontal:a},t.createShape(l,p,n))};function Zi(e,t){this._modeling=e,this._spaceTool=t}Zi.$inject=["modeling","spaceTool"];Zi.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds,r=e.balanced;r!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)};Zi.prototype.resizeBalanced=function(e,t){var n=this._modeling,r=Lg(e,t);n.resizeShape(e,t),r.forEach(function(i){n.resizeShape(i.shape,i.newBounds)})};Zi.prototype.resizeSpace=function(e,t){var n=this._spaceTool,r=Z(e),i=Z(t),o=ep(i,r),a=Bt(e),s=[],c=[];In(a,function(m){return s.push(m),(h(m,"bpmn:Lane")||h(m,"bpmn:Participant"))&&c.push(m),m.children});var u,p,l,f,d;(o.bottom||o.top)&&(u=o.bottom||o.top,p=e.y+(o.bottom?e.height:0)+(o.bottom?-10:10),l=o.bottom?"s":"n",f=o.top>0||o.bottom<0?-u:u,d=n.calculateAdjustments(s,"y",f,p),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:u},l)),(o.left||o.right)&&(u=o.right||o.left,p=e.x+(o.right?e.width:0)+(o.right?-10:100),l=o.right?"e":"w",f=o.left>0||o.right<0?-u:u,d=n.calculateAdjustments(c,"x",f,p),n.makeSpace(d.movingShapes,d.resizingShapes,{x:u,y:0},l))};var Js="flowNodeRef",Qf="lanes";function Qi(e){this._elementRegistry=e}Qi.$inject=["elementRegistry"];Qi.prototype._computeUpdates=function(e,t){var n=[],r=[],i={},o=[];function a(p,l){var f=Z(l),d={x:p.x+p.width/2,y:p.y+p.height/2};return d.x>f.left&&d.x<f.right&&d.y>f.top&&d.y<f.bottom}function s(p){n.indexOf(p)===-1&&(o.push(p),n.push(p))}function c(p){var l=Bt(p);return i[l.id]||(i[l.id]=zo(l)),i[l.id]}function u(p){if(!p.parent)return[];var l=c(p);return l.filter(function(f){return a(p,f)}).map(function(f){return f.businessObject})}return t.forEach(function(p){var l=Bt(p);if(!(!l||n.indexOf(l)!==-1)){var f=l.children.filter(function(d){return h(d,"bpmn:FlowNode")});f.forEach(s),n.push(l)}}),e.forEach(s),o.forEach(function(p){var l=p.businessObject,f=l.get(Qf),d=f.slice(),m=u(p);r.push({flowNode:l,remove:d,add:m})}),t.forEach(function(p){var l=p.businessObject;p.parent||l.get(Js).forEach(function(f){r.push({flowNode:f,remove:[l],add:[]})})}),r};Qi.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var r=n.flowNode,i=r.get(Qf);n.remove.forEach(function(o){Oe(i,o),Oe(o.get(Js),r)}),n.add.forEach(function(o){Ae(i,o),Ae(o.get(Js),r)})}),[]};Qi.prototype.revert=function(e){var t=e.updates;return t.forEach(function(n){var r=n.flowNode,i=r.get(Qf);n.add.forEach(function(o){Oe(i,o),Oe(o.get(Js),r)}),n.remove.forEach(function(o){Ae(i,o),Ae(o.get(Js),r)})}),[]};function pa(e){this._moddle=e}pa.$inject=["moddle"];pa.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,r=e.element,i=e.claiming;return i?t.claim(n,r):t.unclaim(n),[]};pa.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,r=e.element,i=e.claiming;return i?t.unclaim(n):t.claim(n,r),[]};N();var eT={fill:void 0,stroke:void 0};function ec(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(st(t)){var n=tT(t);if(n)return n}throw new Error(`invalid color value: ${t}`)}}}ec.$inject=["commandStack"];ec.prototype.postExecute=function(e){var t=e.elements,n=e.colors||eT,r=this,i={};"fill"in n&&C(i,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&C(i,{"border-color":this._normalizeColor(n.stroke)}),E(t,function(o){var a=de(o)?mt(i,["border-color"]):i,s=ce(o);if(nT(a),ee(o)){if(!s||!h(s.label,"bpmndi:BPMNLabel"))return;r._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:s.label,properties:{color:i["border-color"]}})}else{if(!te(s,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;r._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})}})};function tT(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}function nT(e){"border-color"in e&&(e.stroke=e["border-color"]),"background-color"in e&&(e.fill=e["background-color"])}var rT={width:0,height:0};function Bp(e,t,n){function r(c,u){var p=c.label||c,l=c.labelTarget||c;return Eh(p,u,l!==p),[p,l]}function i(c){var u=c.element,p=u.businessObject,l=c.newLabel;if(!ee(u)&&mn(u)&&!Xr(u)&&!k_(l)){var f=7,d=La(u);d={x:d.x,y:d.y+f},e.createLabel(u,d,{id:p.id+"_label",businessObject:p,di:u.di})}}function o(c){return c.oldLabel=gt(c.element),r(c.element,c.newLabel)}function a(c){return r(c.element,c.oldLabel)}function s(c){var u=c.element,p=u.label||u,l=c.newLabel,f=c.newBounds,d=c.hints||{};if(!(!ee(p)&&!h(p,"bpmn:TextAnnotation"))){if(ee(p)&&k_(l)){d.removeShape!==!1&&e.removeShape(p,{unsetLabel:!1});return}var m=gt(u);typeof f=="undefined"&&(f=t.getExternalLabelBounds(p,m)),f&&e.resizeShape(p,f,rT)}}this.preExecute=i,this.execute=o,this.revert=a,this.postExecute=s}Bp.$inject=["modeling","textRenderer","bpmnFactory"];function k_(e){return!e||!e.trim()}function Pt(e,t,n,r){De.call(this,e,t,n),this._bpmnRules=r}B(Pt,De);Pt.$inject=["eventBus","elementFactory","commandStack","bpmnRules"];Pt.prototype.getHandlers=function(){var e=De.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Yi,e["element.updateProperties"]=Xi,e["canvas.updateRoot"]=ua,e["lane.add"]=Zs,e["lane.resize"]=Zi,e["lane.split"]=Qs,e["lane.updateRefs"]=Qi,e["id.updateClaim"]=pa,e["element.setColor"]=ec,e["element.updateLabel"]=Bp,e};Pt.prototype.updateLabel=function(e,t,n,r){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:r||{}})};Pt.prototype.connect=function(e,t,n,r){var i=this._bpmnRules;if(n||(n=i.canConnect(e,t)),!!n)return this.createConnection(e,t,n,e.parent,r)};Pt.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})};Pt.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})};Pt.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})};Pt.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane};Pt.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})};Pt.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e};Pt.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e};Pt.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})};Pt.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})};Pt.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})};Pt.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};N();function Ip(){}Ip.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||X(t.source||e.source),t.connectionEnd||X(t.target||e.target)]};N();var Lp=20,iT=5,jp=Math.round,N_=20,oT={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function aT(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function sT(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function L_(e,t,n){var r=He(t,e,iT),i=n.split(":")[0],o=jp((t.x-e.x)/2+e.x),a=jp((t.y-e.y)/2+e.y),s,c,u=sT(i,r),p=/h|r|l/.test(i),l=!1,f=!1;return u?(s=p?{x:o,y:e.y}:{x:e.x,y:a},c=p?"h:h":"v:v"):(l=aT(r,i),c=p?"h:v":"v:h",l?p?(f=a===e.y,s={x:e.x+Lp*(/l/.test(i)?-1:1),y:f?a+Lp:a}):(f=o===e.x,s={x:f?o+Lp:o,y:e.y+Lp*(/t/.test(i)?-1:1)}):s={x:o,y:a}),{waypoints:Jf(e,s,c).concat(s),directions:c,turnNextDirections:f}}function cT(e,t,n){return L_(e,t,n)}function uT(e,t,n){var r=L_(t,e,O_(n));return{waypoints:r.waypoints.slice().reverse(),directions:O_(r.directions),turnNextDirections:r.turnNextDirections}}function pT(e,t){var n=e.directions.split(":")[1],r=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(r=r=="h"?"v":"h");var i=n+":"+r,o=Jf(e.waypoints[e.waypoints.length-1],t.waypoints[0],i);return{waypoints:o,directions:i}}function O_(e){return e.split(":").reverse().join(":")}function lT(e,t,n){var r=jp((t.x-e.x)/2+e.x),i=jp((t.y-e.y)/2+e.y);if(n==="h:v")return[{x:t.x,y:e.y}];if(n==="v:h")return[{x:e.x,y:t.y}];if(n==="h:h")return[{x:r,y:e.y},{x:r,y:t.y}];if(n==="v:v")return[{x:e.x,y:i},{x:t.x,y:i}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function Jf(e,t,n){if(n=n||"h:h",!_T(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(F_(n)){var r=cT(e,t,n),i=uT(e,t,n),o=pT(r,i);return[].concat(r.waypoints,o.waypoints,i.waypoints)}return lT(e,t,n)}function fT(e,t,n){var r=Jf(e,t,n);return r.unshift(e),r.push(t),td(r)}function dT(e,t,n,r,i){var o=i&&i.preferredLayouts||[],a=hl(o,"straight")[0]||"h:h",s=oT[a]||0,c=He(e,t,s),u=yT(c,a);n=n||X(e),r=r||X(t);var p=u.split(":"),l=I_(n,e,p[0],bT(c)),f=I_(r,t,p[1],c);return fT(l,f,u)}function j_(e,t,n,r,i,o){q(n)&&(i=n,o=r,n=X(e),r=X(t)),o=C({preferredLayouts:[]},o),i=i||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&hT(e,t,n,r,o),c||(c=o.connectionEnd&&gT(t,e,r,i),c)||(c=o.connectionStart&&vT(e,t,n,i),c)?c:!o.connectionStart&&!o.connectionEnd&&i&&i.length?i:dT(e,t,n,r,o)}function mT(e,t,n){return e>=t&&e<=n}function B_(e,t,n){var r={x:"width",y:"height"};return mT(t[e],n[e],n[e]+n[r[e]])}function hT(e,t,n,r,i){var o={},a,s;return s=He(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),i.preserveDocking==="target"?B_(a,r,e)?(o[a]=r[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:r.x,y:r.y}]):null:B_(a,n,t)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:r.x,y:o.y!==void 0?o.y:r.y,original:{x:o.x!==void 0?o.x:r.x,y:o.y!==void 0?o.y:r.y}}]):null):null}function vT(e,t,n,r){return ed(e,t,n,r)}function gT(e,t,n,r){var i=r.slice().reverse();return i=ed(e,t,n,i),i?i.reverse():null}function ed(e,t,n,r){function i(p){return p.length<3?!0:p.length>4?!1:!!re(p,function(l,f){var d=p[f-1];return d&&Gr(l,d)<3})}function o(p,l,f){var d=en(l,p);switch(d){case"v":return{x:f.x,y:p.y};case"h":return{x:p.x,y:f.y}}return{x:p.x,y:p.y}}function a(p,l,f){var d;for(d=p.length-2;d!==0;d--)if(Nl(p[d],l,N_)||Nl(p[d],f,N_))return p.slice(d);return p}if(i(r))return null;var s=r[0],c=r.slice(),u;return c[0]=n,c[1]=o(c[1],s,n),u=a(c,e,t),u!==c&&(c=ed(e,t,n,u)),c&&en(c)?null:c}function yT(e,t){if(F_(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function _T(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function F_(e){return e&&/t|r|b|l/.test(e)}function bT(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function I_(e,t,n,r){if(n==="h"&&(n=/left/.test(r)?"l":"r"),n==="v"&&(n=/top/.test(r)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function td(e){return e.reduce(function(t,n,r){var i=t[t.length-1],o=e[r+1];return uo(i,o,n,0)||t.push(n),t},[])}var xT=-10,ET=40,wT={default:["h:h"],fromGateway:["v:h"],toGateway:["h:v"],loop:{fromTop:["t:r"],fromRight:["r:b"],fromLeft:["l:t"],fromBottom:["b:l"]},boundaryLoop:{alternateHorizontalSide:"b",alternateVerticalSide:"l",default:"v"},messageFlow:["straight","v:v"],subProcess:["straight","h:h"],isHorizontal:!0},ST={default:["v:v"],fromGateway:["h:v"],toGateway:["v:h"],loop:{fromTop:["t:l"],fromRight:["r:t"],fromLeft:["l:b"],fromBottom:["b:r"]},boundaryLoop:{alternateHorizontalSide:"t",alternateVerticalSide:"r",default:"h"},messageFlow:["straight","h:h"],subProcess:["straight","v:v"],isHorizontal:!1},rd={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},tc={top:"t",right:"r",bottom:"b",left:"l"};function da(e){this._elementRegistry=e}B(da,Ip);da.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,r=t.target||e.target,i=t.waypoints||e.waypoints,o=t.connectionStart,a=t.connectionEnd,s=this._elementRegistry,c,u;if(o||(o=H_(i&&i[0],n)),a||(a=H_(i&&i[i.length-1],r)),(h(e,"bpmn:Association")||h(e,"bpmn:DataAssociation"))&&i&&!$_(n,r))return[].concat([o],i.slice(1,-1),[a]);var p=Pu(n,s)?wT:ST;return h(e,"bpmn:MessageFlow")?c=RT(n,r,p):(h(e,"bpmn:SequenceFlow")||$_(n,r))&&(n===r?c={preferredLayouts:kT(n,e,p)}:h(n,"bpmn:BoundaryEvent")?c={preferredLayouts:NT(n,r,a,p)}:nc(n)||nc(r)?c={preferredLayouts:p.subProcess,preserveDocking:AT(n)}:h(n,"bpmn:Gateway")?c={preferredLayouts:p.fromGateway}:h(r,"bpmn:Gateway")?c={preferredLayouts:p.toGateway}:c={preferredLayouts:p.default}),c&&(c=C(c,t),u=td(j_(n,r,o,a,i,c))),u||[o,a]};function CT(e){var t=e.host;return He(X(e),t,xT)}function RT(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:PT(e,t)}}function PT(e,t){return h(t,"bpmn:Participant")?"source":h(e,"bpmn:Participant")?"target":nc(t)?"source":nc(e)||h(t,"bpmn:Event")?"target":h(e,"bpmn:Event")?"source":null}function AT(e){return nc(e)?"target":"source"}function H_(e,t){return e?e.original||e:X(t)}function $_(e,t){return h(t,"bpmn:Activity")&&h(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function nc(e){return h(e,"bpmn:SubProcess")&&ie(e)}function Ji(e,t){return e===t}function TT(e,t){return t.indexOf(e)!==-1}function la(e){var t=/right|left/.exec(e);return t&&t[0]}function fa(e){var t=/top|bottom/.exec(e);return t&&t[0]}function z_(e,t){return rd[e]===t}function MT(e,t){var n=la(e),r=rd[n];return t.indexOf(r)!==-1}function DT(e,t){var n=fa(e),r=rd[n];return t.indexOf(r)!==-1}function V_(e){return e==="right"||e==="left"}function kT(e,t,n){var r=t.waypoints,i=r&&r.length&&He(r[0],e);return i==="top"?n.loop.fromTop:i==="right"?n.loop.fromRight:i==="left"?n.loop.fromLeft:n.loop.fromBottom}function NT(e,t,n,r){var i=X(e),o=X(t),a=CT(e),s,c,u=Ji(e.host,t),p=TT(a,["top","right","bottom","left"]),l=He(o,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return u?OT(a,p,e,t,n,r):(s=BT(a,l,p,r.isHorizontal),c=IT(a,l,p,r.isHorizontal),[s+":"+c])}function OT(e,t,n,r,i,o){var a=t?e:o.isHorizontal?fa(e):la(e),s=tc[a],c;return t?V_(e)?c=G_("y",n,r,i)?"h":o.boundaryLoop.alternateHorizontalSide:c=G_("x",n,r,i)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function G_(e,t,n,r){var i=ET;return!(nd(e,r,n,i)||nd(e,r,{x:n.x+n.width,y:n.y+n.height},i)||nd(e,r,X(t),i))}function nd(e,t,n,r){return Math.abs(t[e]-n[e])<r}function BT(e,t,n,r){if(n)return tc[e];var i=fa(e),o=la(e),a=fa(t),s=la(t);if(r){if(Ji(i,a)||z_(o,s))return tc[i]}else if(Ji(o,s)||z_(i,a))return tc[o];return tc[r?o:i]}function IT(e,t,n,r){if(n)return V_(e)?MT(e,t)||Ji(e,t)?"h":"v":DT(e,t)||Ji(e,t)?"v":"h";var i=fa(e),o=la(e),a=fa(t),s=la(t);return a&&!s?"v":s&&!a?"h":r?Ji(i,a)?"h":"v":Ji(o,s)?"v":"h"}da.$inject=["elementRegistry"];N();function W_(e){return C({original:e.point.original||e.point},e.actual)}function dr(e,t){this._elementRegistry=e,this._graphicsFactory=t}dr.$inject=["elementRegistry","graphicsFactory"];dr.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var r=this.getDockingPoint(e,t,!0),i=this.getDockingPoint(e,n),o=e.waypoints.slice(r.idx+1,i.idx);return o.unshift(W_(r)),o.push(W_(i)),o};dr.prototype.getDockingPoint=function(e,t,n){var r=e.waypoints,i,o,a;return i=n?0:r.length-1,o=r[i],a=this._getIntersection(t,e,n),{point:o,actual:a||o,idx:i}};dr.prototype._getIntersection=function(e,t,n){var r=this._getShapePath(e),i=this._getConnectionPath(t);return qr(r,i,n)};dr.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)};dr.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)};dr.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var Fp={__init__:["modeling","bpmnUpdater"],__depends__:[_y,Fy,Hy,$y,Ap,p_,d_,v_,rt,xo,Np],bpmnFactory:["type",an],bpmnUpdater:["type",$t],elementFactory:["type",lr],modeling:["type",Pt],layouter:["type",da],connectionDocking:["type",dr]};N();var U_=Math.round;function ma(e,t,n,r,i,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=r,this._layouter=i,this._rules=o}ma.prototype.create=function(e,t,n){let r=this._complexPreview,i=this._connectionDocking,o=this._elementFactory,a=this._eventBus,s=this._layouter,c=this._rules,u=o.createShape(C({type:t},n)),p=a.fire("autoPlace",{source:e,shape:u});if(!p)return;C(u,{x:p.x-U_(u.width/2),y:p.y-U_(u.height/2)});let l=c.allowed("connection.create",{source:e,target:u,hints:{targetParent:e.parent}}),f=null;l&&(f=o.createConnection(l),f.waypoints=s.layoutConnection(f,{source:e,target:u}),f.waypoints=i.getCroppedWaypoints(f,e,u)),r.create({created:[u,f].filter(d=>!Yn(d))})};ma.prototype.cleanUp=function(){this._complexPreview.cleanUp()};ma.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];var q_={__depends__:[No,Rg,Fp],__init__:["appendPreview"],appendPreview:["type",ma]};N();N();var K_=Math.min,Y_=Math.max;function id(e){e.preventDefault()}function rc(e){e.stopPropagation()}function LT(e){return e.nodeType===Node.TEXT_NODE}function jT(e){return[].slice.call(e)}function _n(e){this.container=e.container,this.parent=ue('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=_e("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=tt(this.autoResize,this),this.handlePaste=tt(this.handlePaste,this)}_n.prototype.create=function(e,t,n,r){var i=this,o=this.parent,a=this.content,s=this.container;r=this.options=r||{},t=this.style=t||{};var c=mt(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);C(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var u=mt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return C(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},u),r.centerVertically&&C(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},u),a.innerText=n,se.bind(a,"keydown",this.keyHandler),se.bind(a,"mousedown",rc),se.bind(a,"paste",i.handlePaste),r.autoResize&&se.bind(a,"input",this.autoResize),r.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o};_n.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var r;if(e.clipboardData?r=e.clipboardData.getData("text/plain"):r=window.clipboardData.getData("Text"),this.insertText(r),t.autoResize){var i=this.autoResize(n);i&&this.resizeHandler(i)}};_n.prototype.insertText=function(e){e=FT(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)};_n.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,r=t.endContainer,i=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=jT(a.childNodes),c,u;if(LT(a)){var p=n.textContent;n.textContent=p.substring(0,i)+e+p.substring(o),c=n,u=i+e.length}else if(n===this.content&&r===this.content){var l=document.createTextNode(e);this.content.insertBefore(l,s[i]),c=l,u=l.textContent.length}else{var f=s.indexOf(n),d=s.indexOf(r);s.forEach(function(m,g){g===f?m.textContent=n.textContent.substring(0,i)+e+r.textContent.substring(o):g>f&&g<=d&&Wt(m)}),c=n,u=i+e.length}c&&u!==void 0&&setTimeout(function(){self.setSelection(c,u)})};_n.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var r=e.getBoundingClientRect(),i=t.scrollHeight;e.style.height=i+"px",this.resizeHandler({width:r.width,height:r.height,dx:0,dy:i-r.height})}};_n.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,r=parseInt(this.style.minWidth)||0,i=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=ue('<div class="djs-direct-editing-resize-handle"></div>');var s,c,u,p,l=function(m){id(m),rc(m),s=m.clientX,c=m.clientY;var g=t.getBoundingClientRect();u=g.width,p=g.height,se.bind(document,"mousemove",f),se.bind(document,"mouseup",d)},f=function(m){id(m),rc(m);var g=K_(Y_(u+m.clientX-s,r),o),v=K_(Y_(p+m.clientY-c,i),a);t.style.width=g+"px",t.style.height=v+"px",e.resizeHandler({width:u,height:p,dx:m.clientX-s,dy:m.clientY-c})},d=function(m){id(m),rc(m),se.unbind(document,"mousemove",f,!1),se.unbind(document,"mouseup",d,!1)};se.bind(n,"mousedown",l)}C(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)};_n.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),se.unbind(t,"keydown",this.keyHandler),se.unbind(t,"mousedown",rc),se.unbind(t,"input",this.autoResize),se.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Wt(n)),Wt(e)};_n.prototype.getValue=function(){return this.content.innerText.trim()};_n.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t};_n.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var r=window.getSelection();r.removeAllRanges(),r.addRange(n)};function FT(e){return e.replace(/\r\n|\r|\n/g,`
282 </svg>`},cd=zT;N();var GT=900;function to(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",GT,this)}to.$inject=["popupMenu","distributeElements","translate","rules"];to.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};to.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})};to.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,r=this._popupMenu,i={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:cd.horizontal,action:function(o,a){t.trigger(e,"horizontal"),r.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:cd.vertical,action:function(o,a){t.trigger(e,"vertical"),r.close()}}};return i};var gb={__depends__:[Do,vb],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",ha],distributeElementsMenuProvider:["type",to]};N();var yb="is not a registered action",VT="is already registered";function Zt(e,t){this._eventBus=e,this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Zt.$inject=["eventBus","injector"];Zt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),r=e.get("selection",!1),i=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&r&&this.register("copy",function(){var p=r.get();if(p.length)return o.copy(p)}),o&&r&&this.register("duplicate",function(){var p=r.get();if(p.length)return o.duplicate(p)}),o&&this.register("paste",function(){o.paste()}),o&&r&&s&&this.register("cut",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p});if(l!==!1){var f=q(l)?l:p;return o.cut(f.slice())}}}),i&&this.register("stepZoom",function(p){i.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&r&&s&&this.register("removeSelection",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p}),f;l!==!1&&(q(l)?f=l:f=p,f.length&&n.removeElements(f.slice()))}}),c&&this.register("moveCanvas",function(p){c.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})};Zt.prototype.trigger=function(e,t){if(!this._actions[e])throw ud(e,yb);var n=this._eventBus.fire("editorActions.allowed",{action:e,opts:t});if(n!==!1)return this._actions[e](t)};Zt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);E(e,function(r,i){n._registerAction(i,r)})};Zt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw ud(e,VT);this._actions[e]=t};Zt.prototype.unregister=function(e){if(!this.isRegistered(e))throw ud(e,yb);this._actions[e]=void 0};Zt.prototype.getActions=function(){return Object.keys(this._actions)};Zt.prototype.isRegistered=function(e){return!!this._actions[e]};function ud(e,t){return new Error(e+" "+t)}var _b={__init__:["editorActions"],editorActions:["type",Zt]};N();function va(e){e.invoke(Zt,this)}B(va,Zt);va.$inject=["injector"];va.prototype._registerDefaultActions=function(e){Zt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),r=e.get("selection",!1),i=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),u=e.get("alignElements",!1),p=e.get("directEditing",!1),l=e.get("searchPad",!1),f=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&r&&this._registerAction("selectElements",function(){var m=t.getRootElement(),g=n.filter(function(v){return v!==m});return r.select(g),g}),i&&this._registerAction("spaceTool",function(){i.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),r&&c&&this._registerAction("distributeElements",function(m){var g=r.get(),v=m.type;g.length&&c.trigger(g,v)}),r&&u&&this._registerAction("alignElements",function(m){var g=r.get(),v=[],w=m.type;g.length&&(v=Q(g,function(S){return!h(S,"bpmn:Lane")}),u.trigger(v,w))}),r&&f&&this._registerAction("setColor",function(m){var g=r.get();g.length&&f.setColor(g,m)}),r&&p&&this._registerAction("directEditing",function(){var m=r.get();m.length&&p.activate(m[0])}),l&&this._registerAction("find",function(){l.toggle()}),t&&f&&this._registerAction("moveToOrigin",function(){var m=t.getRootElement(),g,v;h(m,"bpmn:Collaboration")?v=n.filter(function(w){return h(w.parent,"bpmn:Collaboration")}):v=n.filter(function(w){return w!==m&&!h(w.parent,"bpmn:SubProcess")}),g=Ce(v),f.moveElements(v,{x:-g.x,y:-g.y},m)}),r&&d&&this._registerAction("replaceElement",function(m){d.triggerEntry("replace","click",m)})};var bb={__depends__:[_b],editorActions:["type",va]};function $p(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,r=t.shape;te(r,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}$p.$inject=["eventBus"];N();function Lr(e,t){k.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(r){var i=r.context,o=i.hints||{},a=o.autoResize;if(a){var s=i.shape,c=i.newBounds;st(a)?i.newBounds=n.snapComplex(c,a):i.newBounds=n.snapSimple(s,c)}})}Lr.$inject=["eventBus","gridSnapping","modeling"];B(Lr,k);Lr.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t};Lr.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e};Lr.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,r=/w/.test(t),i=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),i&&(r?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),C(e,o),e};Lr.prototype.snapVertically=function(e,t){var n=this._gridSnapping,r=/n/.test(t),i=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),r&&(i?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),C(e,o),e};var WT=2e3;function zp(e,t){e.on(["spaceTool.move","spaceTool.end"],WT,function(n){var r=n.context;if(r.initialized){var i=r.axis,o;i==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}zp.$inject=["eventBus","gridSnapping"];var xb={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Lr],gridSnappingSpaceToolBehavior:["type",zp]};N();var ic=10;function Gp(e,t,n){return n||(n="round"),Math[n](e/t)*t}var UT=1200,qT=800;function mr(e,t,n){var r=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",qT,function(){i.setActive(r)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],UT,function(o){var a=o.originalEvent;if(!(!i.active||a&&xt(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},l=YT(o,u,e);l&&(p.offset=l);var f=KT(o,u);f&&C(p,f),zn(o,u)||i.snapEvent(o,u,p)})}})}mr.prototype.snapEvent=function(e,t,n){var r=this.snapValue(e[t],n);ze(e,t,r)};mr.prototype.getGridSpacing=function(){return ic};mr.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=Gp(e,ic);var r,i;return t&&t.min&&(r=t.min,ne(r)&&(r=Gp(r+n,ic,"ceil"),e=Math.max(e,r))),t&&t.max&&(i=t.max,ne(i)&&(i=Gp(i+n,ic,"floor"),e=Math.min(e,i))),e-=n,e};mr.prototype.isActive=function(){return this.active};mr.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})};mr.prototype.toggleActive=function(){this.setActive(!this.active)};mr.$inject=["elementRegistry","eventBus","config.gridSnapping"];function KT(e,t){var n=e.context,r=n.createConstraints,i=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;r&&(Vp(t)?(a.x.min=r.left,a.x.max=r.right):(a.y.min=r.top,a.y.max=r.bottom));var c=i.min,u=i.max;return c&&(Vp(t)?wb(s)?a.x.max=c.left:a.x.min=c.right:Eb(s)?a.y.max=c.top:a.y.min=c.bottom),u&&(Vp(t)?wb(s)?a.x.min=u.left:a.x.max=u.right:Eb(s)?a.y.min=u.top:a.y.max=u.bottom),a[t]}function YT(e,t,n){var r=e.context,i=e.shape,o=r.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ne(s[t])||(s||(s=o.snapOffset={}),ne(s[t])||(s[t]=0),!i)||(n.get(i.id)||(Vp(t)?s[t]+=i[t]+i.width/2:s[t]+=i[t]+i.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=i.width/2:/right/.test(a)&&(s[t]+=i.width/2):/top/.test(a)?s[t]-=i.height/2:/bottom/.test(a)&&(s[t]+=i.height/2)),s[t]}function Vp(e){return e==="x"}function Eb(e){return e.indexOf("n")!==-1}function wb(e){return e.indexOf("w")!==-1}var Sb={__depends__:[xb],__init__:["gridSnapping"],gridSnapping:["type",mr]};var XT=2e3;function Wp(e,t,n){e.on("autoPlace",XT,function(r){var i=r.source,o=X(i),a=r.shape,s=Au(i,a,n);return["x","y"].forEach(function(c){var u={};s[c]!==o[c]&&(s[c]>o[c]?u.min=s[c]:u.max=s[c],h(a,"bpmn:TextAnnotation")&&(ZT(c)?u.offset=-a.width/2:u.offset=-a.height/2),s[c]=t.snapValue(s[c],u))}),s})}Wp.$inject=["eventBus","gridSnapping","elementRegistry"];function ZT(e){return e==="x"}var QT=1750;function Up(e,t,n){t.on(["create.start","shape.move.start"],QT,function(r){var i=r.context,o=i.shape,a=e.getRootElement();if(!(!h(o,"bpmn:Participant")||!h(a,"bpmn:Process")||!a.children.length)){var s=i.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}Up.$inject=["canvas","eventBus","gridSnapping"];N();var JT=3e3;function ga(e,t,n){k.call(this,e),this._gridSnapping=t;var r=this;this.postExecuted(["connection.create","connection.layout"],JT,function(i){var o=i.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||eM(c)&&n.updateWaypoints(a,r.snapMiddleSegments(c))})}ga.$inject=["eventBus","gridSnapping","modeling"];B(ga,k);ga.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var r=1;r<e.length-2;r++)n=rM(t,e[r],e[r+1]),e[r]=n[0],e[r+1]=n[1];return e};function eM(e){return e.length>3}function tM(e){return e==="h"}function nM(e){return e==="v"}function rM(e,t,n){var r=en(t,n),i={};return tM(r)&&(i.y=e.snapValue(t.y)),nM(r)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=C({},t,i),n=C({},n,i)),[t,n]}var Cb={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Wp],gridSnappingParticipantBehavior:["type",Up],gridSnappingLayoutConnectionBehavior:["type",ga]};var Rb={__depends__:[Sb,Cb],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",$p]};var iM=30,Pb=30;function no(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(r){var i=r.element,o=r.gfx;if(h(i,"bpmn:Lane"))return n._createParticipantHit(i,o);if(h(i,"bpmn:Participant"))return ie(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(h(i,"bpmn:SubProcess"))return ie(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}no.$inject=["eventBus","interactionEvents"];no.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0};no.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Me(e)?{width:iM,height:e.height}:{width:e.width,height:Pb};return this._interactionEvents.createBoxHit(t,"all",n),!0};no.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:Pb}),!0};var Ab={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",no]};function ya(e){e.invoke(Mr,this)}B(ya,Mr);ya.$inject=["injector"];ya.prototype.registerBindings=function(e,t){Mr.prototype.registerBindings.call(this,e,t);function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("selectElements",function(r){var i=r.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0}),n("find",function(r){var i=r.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}),n("spaceTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["s","S"],i))return t.trigger("spaceTool"),!0}),n("lassoTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["l","L"],i))return t.trigger("lassoTool"),!0}),n("handTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["h","H"],i))return t.trigger("handTool"),!0}),n("globalConnectTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["c","C"],i))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["e","E"],i))return t.trigger("directEditing"),!0}),n("replaceElement",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["r","R"],i))return t.trigger("replaceElement",i),!0})};var Tb={__depends__:[wo],__init__:["keyboardBindings"],keyboardBindings:["type",ya]};N();var oM={moveSpeed:1,moveSpeedAccelerated:10},aM=1500,Mb="left",Db="up",kb="right",Nb="down",sM={ArrowLeft:Mb,Left:Mb,ArrowUp:Db,Up:Db,ArrowRight:kb,Right:kb,ArrowDown:Nb,Down:Nb},cM={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function qp(e,t,n,r,i){var o=this;this._config=C({},oM,e||{}),t.addListener(aM,function(a){var s=a.keyEvent,c=sM[s.key];if(c&&!t.isCmd(s)){var u=t.isShift(s);return o.moveSelection(c,u),!0}}),this.moveSelection=function(a,s){var c=i.get();if(c.length){var u=this._config[s?"moveSpeedAccelerated":"moveSpeed"],p=cM[a](u),l=r.allowed("elements.move",{shapes:c,hints:{keyboardMove:!0}});l&&n.moveElements(c,p)}}}qp.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var Ob={__depends__:[wo,rt],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",qp]};N();var Bb=10;function ro(e,t,n,r){this._dragging=r,this._rules=t;var i=this;function o(c,u){var p=c.shape,l=c.direction,f=c.resizeConstraints,d;c.delta=u,d=Ng(p,l,u),c.newBounds=Bg(d,f),c.canExecute=i.canResize(c)}function a(c){var u=c.resizeConstraints,p=c.minBounds;u===void 0&&(p===void 0&&(p=i.computeMinResizeBox(c)),c.resizeConstraints={min:Z(p)})}function s(c){var u=c.shape,p=c.canExecute,l=c.newBounds;if(p){if(l=wc(l),!uM(u,l))return;n.resizeShape(u,l)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var u={x:c.dx,y:c.dy};o(c.context,u)}),e.on("resize.end",function(c){s(c.context)})}ro.prototype.canResize=function(e){var t=this._rules,n=mt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)};ro.prototype.activate=function(e,t,n){var r=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=C({shape:t},n),o=i.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");r.init(e,pd(t,o),"resize",{autoActivate:!0,cursor:pM(o),data:{shape:t,context:i}})};ro.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r,i;return r=e.minDimensions||{width:Bb,height:Bb},i=tp(t,e.childrenBoxPadding),Ig(n,t,r,i)};ro.$inject=["eventBus","rules","modeling","dragging"];function uM(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function pd(e,t){var n=X(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function pM(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var Ib="djs-resizing",Lb="resize-not-ok",lM=500;function Kp(e,t,n){function r(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,Ib)),s.width>5&&$(c,{x:s.x,width:s.width}),s.height>5&&$(c,{y:s.y,height:s.height}),o.canExecute?pe(c).remove(Lb):pe(c).add(Lb)}function i(o){var a=o.shape,s=o.frame;s&&Pe(o.frame),t.removeMarker(a,Ib)}e.on("resize.move",lM,function(o){r(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}Kp.$inject=["eventBus","canvas","previewSupport"];N();var Yp=-6,Xp=8,Zp=20,oc="djs-resizer",fM=["n","w","s","e","nw","ne","se","sw"];function hr(e,t,n,r){this._resize=r,this._canvas=t;var i=this;e.on("selection.changed",function(o){var a=o.newSelection;i.removeResizers(),a.length===1&&E(a,tt(i.addResizer,i))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(i.removeResizers(),i.addResizer(a))})}hr.prototype.makeDraggable=function(e,t,n){var r=this._resize;function i(o){gn(o)&&r.activate(o,e,n)}se.bind(t,"mousedown",i),se.bind(t,"touchstart",i)};hr.prototype._createResizer=function(e,t,n,r){var i=this._getResizersParent(),o=dM(r),a=U("g");pe(a).add(oc),pe(a).add(oc+"-"+e.id),pe(a).add(oc+"-"+r),J(i,a);var s=U("rect");$(s,{x:-Xp/2+o.x,y:-Xp/2+o.y,width:Xp,height:Xp}),pe(s).add(oc+"-visual"),J(a,s);var c=U("rect");return $(c,{x:-Zp/2+o.x,y:-Zp/2+o.y,width:Zp,height:Zp}),pe(c).add(oc+"-hit"),J(a,c),fo(a,t,n),a};hr.prototype.createResizer=function(e,t){var n=pd(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)};hr.prototype.addResizer=function(e){var t=this;de(e)||E(fM,function(n){t._resize.canResize({shape:e,direction:n})&&t.createResizer(e,n)})};hr.prototype.removeResizers=function(){var e=this._getResizersParent();_r(e)};hr.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};hr.$inject=["eventBus","canvas","selection","resize"];function dM(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Yp:e.indexOf("w")!==-1&&(t.x=Yp),e.indexOf("s")!==-1?t.y=-Yp:e.indexOf("n")!==-1&&(t.y=Yp),t}var Qp={__depends__:[Et,kt,Dn],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ro],resizePreview:["type",Kp],resizeHandles:["type",hr]};N();var mM=2e3;function io(e,t,n,r,i,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=i,this._textRenderer=a,r.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){r.isActive()&&r.complete()}),e.on(["shape.remove","connection.remove"],mM,function(c){r.isActive(c.element)&&r.cancel()}),e.on(["commandStack.changed"],function(c){r.isActive()&&r.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var u=c.context,p=u.shape,l=c.context.canExecute,f=c.isTouch;f||l&&(u.hints&&u.hints.createElementsBehavior===!1||s(p))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,u){(u||te(c,["bpmn:Activity","bpmn:Event","bpmn:TextAnnotation","bpmn:Participant"]))&&r.activate(c)}}io.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"];io.prototype.activate=function(e){var t=gt(e);if(t!==void 0){var n={text:t},r=this.getEditingBBox(e);C(n,r);var i={},o=n.style||{};return C(o,{backgroundColor:null,border:null}),(te(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||jb(e))&&C(i,{centerVertically:!0}),mn(e)&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),h(e,"bpmn:TextAnnotation")&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),C(n,{options:i,style:o}),n}};io.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,r=t.getAbsoluteBBox(n),i={x:r.x+r.width/2,y:r.y+r.height/2},o={x:r.x,y:r.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),u=c.fontSize*a,p=c.lineHeight,l=s.fontSize*a,f=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(h(e,"bpmn:Lane")||gM(e)){var m=Me(e),g=m?{width:r.height,height:30*a,x:r.x-r.height/2+15*a,y:i.y-30*a/2}:{width:r.width,height:30*a};C(o,g),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:m?"rotate(-90deg)":null})}if(vM(e)){var v=Me(e),w=v?{width:r.width,height:r.height}:{width:r.height,height:r.width,x:i.x-r.height/2,y:i.y-r.width/2};C(o,w),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:v?null:"rotate(-90deg)"})}(te(e,["bpmn:Task","bpmn:CallActivity"])||jb(e))&&(C(o,{width:r.width,height:r.height}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),hM(e)&&(C(o,{width:r.width,x:r.x}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var S=1,x=r.width+2*S;if(n.labelTarget&&(C(o,{width:x,height:r.height+2*S,x:r.x-S,y:r.y-S}),C(d,{fontSize:u+"px",lineHeight:p})),mn(n)&&!Xr(n)&&!ee(n)){var b=La(e),R=t.getAbsoluteBBox({x:b.x,y:b.y,width:0,height:0}),A=u,O=ir.width*a+2*S;C(o,{width:O,height:A+2*S,x:R.x-O/2,y:R.y-A/2-S}),C(d,{fontSize:u+"px",lineHeight:p})}return h(e,"bpmn:TextAnnotation")&&(C(o,{width:r.width+2*S,height:r.height+2*S,x:r.x-S,y:r.y-S,minWidth:30*a,minHeight:10*a}),C(d,{textAlign:"left",paddingTop:wr*a+"px",paddingBottom:wr*a+"px",paddingLeft:wr*a+"px",paddingRight:wr*a+"px",fontSize:l+"px",lineHeight:f})),{bounds:o,style:d}};io.prototype.update=function(e,t,n,r){var i,o;h(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),i={x:e.x,y:e.y,width:e.width/o.width*r.width,height:e.height/o.height*r.height}),yM(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function jb(e){return h(e,"bpmn:SubProcess")&&!ie(e)}function hM(e){return h(e,"bpmn:SubProcess")&&ie(e)}function vM(e){return h(e,"bpmn:Participant")&&!ie(e)}function gM(e){return h(e,"bpmn:Participant")&&ie(e)}function yM(e){return!e||!e.trim()}var Fb="djs-element-hidden",Hb="djs-label-hidden";function Jp(e,t,n){var r=this,i=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var u=c.active;if(o=u.element.label||u.element,h(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=U("g");var p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),l=r.path=U("path");$(l,{d:p,strokeWidth:2,stroke:_M(o)}),J(s,l),J(i,s),Fe(s,o.x,o.y)}h(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Fb):(h(o,"bpmn:Task")||h(o,"bpmn:CallActivity")||h(o,"bpmn:SubProcess")||h(o,"bpmn:Participant")||h(o,"bpmn:Lane"))&&t.addMarker(o,Hb)}),e.on("directEditing.resize",function(c){if(h(o,"bpmn:TextAnnotation")){var u=c.height,p=c.dy,l=Math.max(o.height/a.height*(u+p),0),f=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:l,position:{mx:0,my:0}});$(r.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var u=c.active;u&&(t.removeMarker(u.element.label||u.element,Fb),t.removeMarker(o,Hb)),o=void 0,a=void 0,s&&(Pe(s),s=void 0)})}Jp.$inject=["eventBus","canvas","pathMap"];function _M(e,t){var n=ce(e);return n.get("stroke")||t||"black"}var $b={__depends__:[xo,Qp,Hp],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",io],labelEditingPreview:["type",Jp]};N();var bM=500,xM=1e3;function jr(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(o){var a=U("rect");return $(a,C({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],bM,function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=r.getOutline(a)||i(s),J(s,c)),r.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=i(s),J(s,c)),r.updateConnectionOutline(c,a)})}jr.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&E(r,function(i){n=n||i.updateOutline(t,e)}),n||$(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};jr.prototype.updateConnectionOutline=function(e,t){var n=Ce(t);$(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};jr.prototype.registerProvider=function(e,t){t||(t=e,e=xM),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};jr.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};jr.prototype.getOutline=function(e){var t,n=this._getProviders();return E(n,function(r){Le(r.getOutline)&&(t=t||r.getOutline(e))}),t};jr.$inject=["eventBus","styles","elementRegistry"];N();var el=6;function ac(e,t,n){this._canvas=t;var r=this;e.on("element.changed",function(i){n.isSelected(i.element)&&r._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(i){var o=i.newSelection;r._updateMultiSelectionOutline(o)})}ac.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");_r(t);var n=e.length>1,r=this._canvas.getContainer();if(pe(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=EM(Ce(e)),o=U("rect");$(o,C({rx:3},i)),pe(o).add("djs-selection-outline"),J(t,o)}};ac.$inject=["eventBus","canvas","selection"];function EM(e){return{x:e.x-el,y:e.y-el,width:e.width+el*2,height:e.height+el*2}}var _a={__depends__:[rt],__init__:["outline","multiSelectionOutline"],outline:["type",jr],multiSelectionOutline:["type",ac]};var zb=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],Gb={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"},wM=15,tl=2;function nl(e,t,n,r,i){let o=t.getLayer("overlays");e.on(["selection.changed","shape.changed"],function(){s()}),e.on("selection.changed",function({newSelection:l}){var d;let f=l.filter(m=>te(m,zb));if(f.length===1){let m=f[0];ee(m)?a(m,m.labelTarget,l):(d=m.labels)!=null&&d.length&&a(m.labels[0],m,l)}if(f.length===2){let m=f.find(ee),g=f.find(v=>{var w;return(w=v.labels)==null?void 0:w.includes(m)});m&&g&&a(m,g,l)}}),e.on("shape.changed",function({element:l}){var f;!te(l,zb)||!p(l)||(ee(l)?a(l,l.labelTarget,i.get()):(f=l.labels)!=null&&f.length&&a(l.labels[0],l,i.get()))});function a(l,f,d=[]){let m=Xn([X(f),X(l)],Gb),g=m.getAttribute("d"),w=d.includes(l)?c(l):u(l),S=qr(w,g);if(!S)return;let b=d.includes(f)?c(f):u(f),R=qr(b,g)||X(f);Li(R,S)<wM||(Pa(m,[R,S]),J(o,m))}function s(){xi(`.${Gb.class}`,o).forEach(Pe)}function c(l){let f=r.getOutline(l),d=r.offset;if(!f)return u(l);if(f.x){let m={x:l.x+oo(f,"x")-tl,y:l.y+oo(f,"y")-tl,width:oo(f,"width")+tl*2,height:oo(f,"height")+tl*2};return ja(m,oo(f,"rx"))}if(f.cx){let m={x:l.x-d,y:l.y-d,width:oo(f,"r")*2,height:oo(f,"r")*2};return Bc(m)}}function u(l){return n.getShapePath(l)}function p(l){return i.get().includes(l)}}nl.$inject=["eventBus","canvas","graphicsFactory","outline","selection"];function oo(e,t){return parseFloat($(e,t)||0)}var Vb={__depends__:[rt,_a],__init__:["labelLink"],labelLink:["type",nl]};N();var SM=new or("tt");function CM(e){var t=ue('<div class="djs-tooltip-container" />');return vt(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function RM(e,t,n){vt(e,{left:t+"px",top:n+"px"})}function fd(e,t){e.style.display=t===!1?"none":""}var Wb="djs-tooltip",ld="."+Wb;function It(e,t){this._eventBus=e,this._canvas=t,this._ids=SM,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=CM(t.getContainer());var n=this;bt.bind(this._tooltipRoot,ld,"mousedown",function(r){r.stopPropagation()}),bt.bind(this._tooltipRoot,ld,"mouseover",function(r){n.trigger("mouseover",r)}),bt.bind(this._tooltipRoot,ld,"mouseout",function(r){n.trigger("mouseout",r)}),this._init()}It.$inject=["eventBus","canvas"];It.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=C({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t};It.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,r=this.get(nt(n,"data-tooltip-id"));r&&(e==="mouseover"&&r.timeout&&this.clearTimeout(r),e==="mouseout"&&r.timeout&&(r.timeout=1e3,this.setTimeout(r)))};It.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]};It.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}};It.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}};It.prototype.remove=function(e){var t=this.get(e);t&&(Wt(t.html),Wt(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])};It.prototype.show=function(){fd(this._tooltipRoot)};It.prototype.hide=function(){fd(this._tooltipRoot,!1)};It.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,r="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=r,this._tooltipRoot.style["-ms-transform"]=r};It.prototype._addTooltip=function(e){var t=e.id,n=e.html,r,i=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),st(n)&&(n=ue(n)),r=ue('<div data-tooltip-id="'+t+'" class="'+Wb+'">'),vt(r,{position:"absolute"}),r.appendChild(n),e.type&&Ne(r).add("djs-tooltip-"+e.type),e.className&&Ne(r).add(e.className),e.htmlContainer=r,i.appendChild(r),this._tooltips[t]=e,this._updateTooltip(e)};It.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;RM(n,t.x,t.y)};It.prototype._updateTooltipVisibilty=function(e){E(this._tooltips,function(t){var n=t.show,r=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(i=!1),fd(r,i))})};It.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};var Ub={__init__:["tooltips"],tooltips:["type",It]};var PM="flow elements must be children of pools/participants",AM="Data object must be placed within a pool/participant.";function rl(e,t,n){function r(i,o,a){t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:a||2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(i){var o=i.context,a=o.shape,s=o.target;h(s,"bpmn:Collaboration")&&(h(a,"bpmn:FlowNode")?r(i,n(PM)):h(a,"bpmn:DataObjectReference")&&r(i,n(AM)))})}rl.$inject=["eventBus","tooltips","translate"];var qb={__depends__:[Ub],__init__:["modelingFeedback"],modelingFeedback:["type",rl]};N();var TM=500,MM=1250,DM=1500,il=Math.round;function kM(e){return{x:e.x+il(e.width/2),y:e.y+il(e.height/2)}}function ol(e,t,n,r,i){function o(s,c,u,p){return i.allowed("elements.move",{shapes:s,delta:c,position:u,target:p})}e.on("shape.move.start",DM,function(s){var c=s.context,u=s.shape,p=r.get().slice();p.indexOf(u)===-1&&(p=[u]),p=NM(p),C(c,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",MM,function(s){var c=s.context,u=c.validatedShapes,p;if(p=c.canExecute=o(u),!p)return!1}),e.on("shape.move.move",TM,function(s){var c=s.context,u=c.validatedShapes,p=s.hover,l={x:s.dx,y:s.dy},f={x:s.x,y:s.y},d;if(d=o(u,l,f,p),c.delta=l,c.canExecute=d,d===null){c.target=null;return}c.target=p}),e.on("shape.move.end",function(s){var c=s.context,u=c.delta,p=c.canExecute,l=p==="attach",f=c.shapes;if(p===!1)return!1;u.x=il(u.x),u.y=il(u.y),!(u.x===0&&u.y===0)&&n.moveElements(f,u,c.target,{primaryShape:c.shape,attach:l})}),e.on("element.mousedown",function(s){if(gn(s)){var c=Ar(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,u,p){if(Se(u)&&(p=u,u=!1),!(c.waypoints||!c.parent)&&!pe(s.target).has("djs-hit-no-move")){var l=kM(c),f=t.init(s,l,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:c,context:p||{}}});if(f!==!1)return!0}}this.start=a}ol.$inject=["eventBus","dragging","modeling","selection","rules"];function NM(e){var t=Vt(e,"id");return Q(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}N();var Kb=499,dd="djs-dragging",Yb="drop-ok",Xb="drop-not-ok",Zb="new-parent",Qb="attach-ok";function al(e,t,n,r){function i(c){var u=o(c),p=OM(u);return p}function o(c){var u=Zn(c,!0),p=u.flatMap(d=>(d.incoming||[]).concat(d.outgoing||[])),l=u.concat(p),f=[...new Set(l)];return f}function a(c,u){[Qb,Yb,Xb,Zb].forEach(function(p){p===u?t.addMarker(c,p):t.removeMarker(c,p)})}function s(c,u,p){r.addDragger(u,c.dragGroup),p&&t.addMarker(u,dd),c.allDraggedElements?c.allDraggedElements.push(u):c.allDraggedElements=[u]}e.on("shape.move.start",Kb,function(c){var u=c.context,p=u.shapes,l=u.allDraggedElements,f=i(p);if(!u.dragGroup){var d=U("g");$(d,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();J(m,d),u.dragGroup=d}f.forEach(function(g){r.addDragger(g,u.dragGroup)}),l?l=_i([l,o(p)]):l=o(p),E(l,function(g){t.addMarker(g,dd)}),u.allDraggedElements=l,u.differentParents=BM(p)}),e.on("shape.move.move",Kb,function(c){var u=c.context,p=u.dragGroup,l=u.target,f=u.shape.parent,d=u.canExecute;l&&(d==="attach"?a(l,Qb):u.canExecute&&f&&l.id!==f.id?a(l,Zb):a(l,u.canExecute?Yb:Xb)),Fe(p,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var u=c.context,p=u.target;p&&a(p,null)}),e.on("shape.move.cleanup",function(c){var u=c.context,p=u.allDraggedElements,l=u.dragGroup;E(p,function(f){t.removeMarker(f,dd)}),l&&Pe(l)}),this.makeDraggable=s}al.$inject=["eventBus","canvas","styles","previewSupport"];function OM(e){var t=Q(e,function(n){return de(n)?re(e,Ct({id:n.source.id}))&&re(e,Ct({id:n.target.id})):!0});return t}function BM(e){return vl(Vt(e,function(t){return t.parent&&t.parent.id}))!==1}var Jb={__depends__:[ei,rt,_a,Et,kt,Dn],__init__:["move","movePreview"],move:["type",ol],movePreview:["type",al]};N();var tx=".djs-palette-toggle",nx=".entry",IM=tx+", "+nx,md="djs-palette-",LM="shown",hd="open",ex="two-column",jM=1e3;function ot(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(r){var i=r.tool;n.updateToolHighlight(i)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}ot.$inject=["eventBus","canvas"];ot.prototype.registerProvider=function(e,t){t||(t=e,e=jM),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()};ot.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(HM,{})};ot.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}};ot.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=ue(ot.HTML_MARKUP);n.appendChild(r),Ne(n).add(md+LM),bt.bind(r,IM,"click",function(i){var o=i.delegateTarget;if(Ra(o,tx))return e.toggle();e.trigger("click",i)}),se.bind(r,"mousedown",function(i){i.stopPropagation()}),bt.bind(r,nx,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})};ot.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers};ot.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,i,o=Ne(n),a=Ne(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(ex,i),a.toggle(md+ex,i),"open"in e&&(o.toggle(hd,e.open),a.toggle(md+hd,e.open)),r.fire("palette.changed",{twoColumn:i,open:this.isOpen()})};ot.prototype._update=function(){var e=_e(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Hr(e),E(t,function(n,r){var i=n.group||"default",o=_e("[data-group="+Rr(i)+"]",e);o||(o=ue('<div class="group"></div>'),nt(o,"data-group",i),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=ue(a);if(o.appendChild(s),!n.separator&&(nt(s,"data-action",r),n.title&&nt(s,"title",n.title),n.className&&FM(s,n.className),n.imageUrl)){var c=ue("<img>");nt(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()};ot.prototype.trigger=function(e,t,n){var r,i,o=t.delegateTarget||t.target;return o?(r=nt(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(r,e,i,n)):t.preventDefault()};ot.prototype.triggerEntry=function(e,t,n,r){var i=this._entries,o,a;if(o=i[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(Le(a)){if(t==="click")return a(n,r)}else if(a[t])return a[t](n,r);n.preventDefault()}};ot.prototype._layoutChanged=function(){this._toggleState({})};ot.prototype._needsCollapse=function(e,t){var n=50,r=Object.keys(t).length*46;return e<r+n};ot.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})};ot.prototype.open=function(){this._toggleState({open:!0})};ot.prototype.toggle=function(){this.isOpen()?this.close():this.open()};ot.prototype.isActiveTool=function(e){return e&&this._activeTool===e};ot.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=_e(".djs-palette-entries",this._container),this._toolsContainer=_e("[data-group=tools]",t)),n=this._toolsContainer,E(n.children,function(r){var i=r.getAttribute("data-action");if(i){var o=Ne(r);i=i.replace("-tool",""),o.contains("entry")&&i===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})};ot.prototype.isOpen=function(){return Ne(this._container).has(hd)};ot.prototype._getParentContainer=function(){return this._canvas.getContainer()};ot.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function FM(e,t){var n=Ne(e),r=q(t)?t:t.split(/\s+/g);r.forEach(function(i){n.add(i)})}function HM(e,t){var n=t.getPaletteEntries();return Le(n)?n(e):(E(n,function(r,i){e[i]=r}),e)}var rx={__init__:["palette"],palette:["type",ot]};N();var ax="crosshair",ix="selected",$M="djs-dragging-active-lasso";function vr(e,t,n,r,i,o,a){this._selection=i,this._dragging=n,this._mouse=a;var s=this,c={create:function(l){var f=t.getActiveLayer(),d=l.frame=U("rect");$(d,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),J(f,d),u(!0),this.update(l)},update:function(l){var f=l.frame,d=l.bbox;f&&d&&$(f,{x:d.x,y:d.y,width:d.width,height:d.height});var m=l.marked,g=l.lastMarked;if(m&&g){for(let v of g)m.has(v)||t.removeMarker(v,ix);for(let v of m)g.has(v)||t.addMarker(v,ix)}},remove:function(l){this.update(l),l.frame&&Pe(l.frame),u(!1)}};function u(l){pe(t.getContainer()).toggle($M,l)}function p(l){var f=r.getAll();return new Set(Sn(wi(f,l)))}o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var f=l.originalEvent.target;!l.hover&&!(f instanceof SVGElement)||e.once("lasso.selection.ended",function(){s.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var f=l.context;s._select(Array.from(f.marked))}),e.on("lasso.start",function(l){var f=l.context;f.bbox=ox(l),f.add=Mi(l),f.lastMarked=new Set(i.get()),f.add?f.marked=f.lastMarked:f.marked=new Set,f.initialMarked=f.marked,c.create(f)}),e.on("lasso.move",function(l){var f=l.context,d=f.bbox=ox(l),m=p(d),g=f.initialMarked.union(m);f.lastMarked=f.marked,f.marked=g,c.update(f)}),e.on("lasso.cleanup",function(l){var f=l.context;f.lastMarked=f.marked,f.marked=new Set(i.get()),c.remove(l.context)}),e.on("element.mousedown",1500,function(l){if(Mi(l))return s.activateLasso(l.originalEvent),!0})}vr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"];vr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:ax,data:{context:{}},keepSelection:!0})};vr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:ax,data:{context:{}},keepSelection:!0})};vr.prototype._select=function(e){this._selection.select(e)};vr.prototype.select=function(e,t,n=[]){var r=Sn(wi(e,t));this._select([...n,...r])};vr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};vr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function ox(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},r;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?r={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?r={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?r={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?r={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:r={x:n.x,y:n.y,width:0,height:0},r}var sx={__depends__:[fi,pr],__init__:["lassoTool"],lassoTool:["type",vr]};var vd=1500,ux="grab";function vi(e,t,n,r,i,o){this._dragging=n,this._mouse=o;var a=this,s=r.get("keyboard",!1);i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",vd,function(c){if(Tr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(vd,function(c){if(!(!cx(c.keyEvent)||a.isActive())){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),s&&s.addListener(vd,function(c){!cx(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var u=c.originalEvent.target;if(!c.hover&&!(u instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var u=t.viewbox().scale;t.scroll({dx:c.dx*u,dy:c.dy*u})}),e.on("hand.move.end",function(c){var u=c.context,p=u.reactivate;return!Tr(c)&&p&&e.once("hand.move.ended",function(l){a.activateHand(l.originalEvent,!0,!0)}),!1})}vi.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];vi.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:ux,data:{context:n||{}}})};vi.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:ux,data:{context:{reactivate:n}}})};vi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)};vi.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function cx(e){return Ke("Space",e)}var px={__depends__:[fi,pr],__init__:["handTool"],handTool:["type",vi]};var lx="connect-ok",fx="connect-not-ok";function gi(e,t,n,r,i,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,i.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var u=c.context,p=c.hover,l=u.canStartConnect=s.canStartConnect(p);l!==null&&(u.startTarget=p,r.addMarker(p,l?lx:fx))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var u=c.context.startTarget,p=c.context.canStartConnect;u&&r.removeMarker(u,p?lx:fx)}),e.on(["global-connect.ended"],function(c){var u=c.context,p=u.startTarget,l={x:c.x,y:c.y},f=s.canStartConnect(p);if(f)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,p,l)}),!1})}gi.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"];gi.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})};gi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)};gi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)};gi.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var dx={__depends__:[Lo,Et,kt,fi,pr],globalConnect:["type",gi]};N();function sc(e,t,n,r,i,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=r,this._lassoTool=i,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}sc.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];sc.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,r=this._spaceTool,i=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(l,f,d,m,g){function v(w){var S=n.createShape(C({type:l},g));t.start(w,S)}return{group:f,className:d,title:m,action:{dragstart:v,click:v}}}function u(l){var f=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});t.start(l,[f,d],{hints:{autoSelect:[f]}})}function p(l){t.start(l,n.createParticipantShape())}return C(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(l){o.activateHand(l)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(l){i.activateSelection(l)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(l){r.activateSelection(l)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(l){a.start(l)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:u,click:u}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:p,click:p}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};var mx={__depends__:[rx,li,Np,sx,px,dx,Zr],__init__:["paletteProvider"],paletteProvider:["type",sc]};N();var zM=250;function cc(e,t,n,r,i){k.call(this,e);function o(s){var c=s.canExecute.replacements;E(c,function(u){var p=u.oldElementId,l={type:u.newElementType};if(!s.visualReplacements[p]){var f=t.get(p);C(l,{x:f.x,y:f.y});var d=n.createShape(l);r.addShape(d,f.parent);var m=_e('[data-element-id="'+Rr(f.id)+'"]',s.dragGroup);m&&$(m,{display:"none"});var g=i.addDragger(d,s.dragGroup);s.visualReplacements[p]=g,r.removeShape(d)}})}function a(s){var c=s.visualReplacements;E(c,function(u,p){var l=_e('[data-element-id="'+Rr(p)+'"]',s.dragGroup);l&&$(l,{display:"inline"}),u.remove(),c[p]&&delete c[p]})}e.on("shape.move.move",zM,function(s){var c=s.context,u=c.canExecute;c.visualReplacements||(c.visualReplacements={}),u&&u.replacements?o(c):a(c)})}cc.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"];B(cc,k);var hx={__depends__:[Dn],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",cc]};N();var GM=1250,gd=40,VM=20,WM=10,vx=20,yx=["x","y"],UM=Math.abs;function sl(e){e.on(["connect.hover","connect.move","connect.end"],GM,function(t){var n=t.context,r=n.canExecute,i=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&xt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),r&&o&&qM(t,o,ZM(o)),o&&XM(r,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=rn(i),te(o,["bpmn:Event","bpmn:Gateway"])&&gx(t,rn(o)),te(o,["bpmn:Task","bpmn:SubProcess"])&&KM(t,o),h(a,"bpmn:BoundaryEvent")&&s===a.host&&YM(t)):_x(r,"bpmn:MessageFlow")?(h(i,"bpmn:Event")&&(n.connectionStart=rn(i)),h(o,"bpmn:Event")&&gx(t,rn(o))):n.connectionStart=n.initialConnectionStart)})}sl.$inject=["eventBus"];function qM(e,t,n){yx.forEach(function(r){var i=bx(r,t);e[r]<t[r]+n?ze(e,r,t[r]+n):e[r]>t[r]+i-n&&ze(e,r,t[r]+i-n)})}function KM(e,t){var n=rn(t);yx.forEach(function(r){QM(e,t,r)&&ze(e,r,n[r])})}function YM(e){var t=e.context,n=t.source,r=t.target;if(!JM(t)){var i=rn(n),o=He(i,r,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],u;UM(c-i[s])<gd&&(c>i[s]?u=i[s]+gd:u=i[s]-gd,ze(e,s,u))})}}function gx(e,t){ze(e,"x",t.x),ze(e,"y",t.y)}function _x(e,t){return e&&e.type===t}function XM(e,t){return Lt(t,function(n){return _x(e,n)})}function bx(e,t){return e==="x"?t.width:t.height}function ZM(e){return h(e,"bpmn:Task")?WM:VM}function QM(e,t,n){return e[n]>t[n]+vx&&e[n]<t[n]+bx(n,t)-vx}function JM(e){var t=e.hover,n=e.source;return t&&n&&t===n}N();function Kn(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}Kn.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]};Kn.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)};Kn.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)};Kn.prototype.getSnapLocations=function(){return this._snapLocations};Kn.prototype.setSnapLocations=function(e){this._snapLocations=e};Kn.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new cl,n.initDefaults(this._defaultSnaps)),n};function cl(){this._snapValues={}}cl.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)};cl.prototype.snap=function(e,t,n,r){var i=this._snapValues[t];return i&&bg(e[n],i[n],r)};cl.prototype.initDefaults=function(e){var t=this;E(e||{},function(n,r){E(n,function(i){t.add(r,i)})})};N();var eD=1250;function bn(e,t,n){var r=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(i){r.initSnap(i)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],eD,function(i){var o=i.context,a=o.shape,s=o.snapContext,c=o.target;if(!(i.originalEvent&&xt(i.originalEvent))&&!(zn(i)||!c)){var u=s.pointsForTarget(c);u.initialized||(u=r.addSnapTargetPoints(u,a,c),u.initialized=!0),n.snap(i,u)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}bn.$inject=["elementRegistry","eventBus","snapping"];bn.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,r=n.shape,i=n.snapContext;i||(i=n.snapContext=new Kn);var o;t.get(r.id)?o=rn(r,e):o={x:e.x+rn(r).x,y:e.y+rn(r).y};var a={x:o.x-r.width/2,y:o.y-r.height/2},s={x:o.x+r.width/2,y:o.y+r.height/2};return i.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),ee(r)||(i.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),i.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),i};bn.prototype.addSnapTargetPoints=function(e,t,n){var r=this.getSnapTargets(t,n);return E(r,function(i){if(ee(i)){ee(t)&&e.add("mid",rn(i));return}if(de(i)){if(i.waypoints.length<3)return;var o=i.waypoints.slice(1,-1);E(o,function(a){e.add("mid",a)});return}e.add("mid",rn(i))}),!ne(t.x)||!ne(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",rn(t)),e};bn.prototype.getSnapTargets=function(e,t){return zu(t).filter(function(n){return!tD(n)})};function tD(e){return!!e.hidden}N();var xx=1500;function yi(e,t){t.invoke(bn,this),e.on(["create.move","create.end"],xx,oD),e.on(["create.move","create.end","shape.move.move","shape.move.end"],xx,function(n){var r=n.context,i=r.canExecute,o=r.target,a=i&&(i==="attach"||i.attach);a&&!zn(n)&&nD(n,o)})}B(yi,bn);yi.$inject=["eventBus","injector"];yi.prototype.initSnap=function(e){var t=bn.prototype.initSnap.call(this,e),n=e.shape,r=!!this._elementRegistry.get(n.id);return E(n.outgoing,function(i){var o=i.waypoints[0];o=o.original||o,t.setSnapOrigin(i.id+"-docking",wx(o,r,e))}),E(n.incoming,function(i){var o=i.waypoints[i.waypoints.length-1];o=o.original||o,t.setSnapOrigin(i.id+"-docking",wx(o,r,e))}),h(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t};yi.prototype.addSnapTargetPoints=function(e,t,n){bn.prototype.addSnapTargetPoints.call(this,e,t,n);var r=this.getSnapTargets(t,n);E(r,function(o){(iD(o)||rD([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",Hu(o)),e.add("bottom-right",$u(o)))});var i=this._elementRegistry;return E(t.incoming,function(o){if(i.get(t.id)){Ex(r,o.source)||e.add("mid",X(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),E(t.outgoing,function(o){if(i.get(t.id)){Ex(r,o.target)||e.add("mid",X(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),h(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e};yi.prototype.getSnapTargets=function(e,t){return bn.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!h(n,"bpmn:Lane")})};function nD(e,t){var n=Z(t),r=hp(e,t),i=e.context,o=i.shape,a;o.parent?a={x:0,y:0}:a=X(o),/top/.test(r)?ze(e,"y",n.top-a.y):/bottom/.test(r)&&ze(e,"y",n.bottom-a.y),/left/.test(r)?ze(e,"x",n.left-a.x):/right/.test(r)&&ze(e,"x",n.right-a.x)}function rD(e,t){return e.every(function(n){return h(n,t)})}function iD(e){return h(e,"bpmn:SubProcess")&&ie(e)?!0:h(e,"bpmn:Participant")}function oD(e){var t=e.context,n=t.createConstraints;if(n){var r=n.top,i=n.right,o=n.bottom,a=n.left;(a&&a>=e.x||i&&i<=e.x)&&ze(e,"x",e.x),(r&&r>=e.y||o&&o<=e.y)&&ze(e,"y",e.y)}}function Ex(e,t){return e.indexOf(t)!==-1}function wx(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}N();var aD=1250;function ao(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],aD,function(r){var i=r.context,o=i.shape,a=o.parent,s=i.direction,c=i.snapContext;if(!(r.originalEvent&&xt(r.originalEvent))&&!zn(r)){var u=c.pointsForTarget(a);u.initialized||(u=n.addSnapTargetPoints(u,o,a,s),u.initialized=!0),uD(s)&&ze(r,"x",r.x),pD(s)&&ze(r,"y",r.y),t.snap(r,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}ao.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,i=t.snapContext;i||(i=t.snapContext=new Kn);var o=Sx(n,r);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i};ao.prototype.addSnapTargetPoints=function(e,t,n,r){var i=this.getSnapTargets(t,n);return E(i,function(o){e.add("corner",$u(o)),e.add("corner",Hu(o))}),e.add("corner",Sx(t,r)),e};ao.$inject=["eventBus","snapping"];ao.prototype.getSnapTargets=function(e,t){return zu(t).filter(function(n){return!sD(n,e)&&!de(n)&&!cD(n)&&!ee(n)})};function Sx(e,t){var n=X(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function sD(e,t){return e.host===t}function cD(e){return!!e.hidden}function uD(e){return e==="n"||e==="s"}function pD(e){return e==="e"||e==="w"}N();var lD=7,fD=1e3;function gr(e){this._canvas=e,this._asyncHide=Ca(tt(this.hide,this),fD)}gr.$inject=["canvas"];gr.prototype.snap=function(e,t){var n=e.context,r=n.snapContext,i=r.getSnapLocations(),o={x:zn(e,"x"),y:zn(e,"y")};E(i,function(a){var s=r.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(E(["x","y"],function(u){var p;o[u]||(p=t.snap(c,a,u,lD),p!==void 0&&(o[u]={value:p,originValue:p-s[u]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),E(["x","y"],function(a){var s=o[a];Se(s)&&ze(e,a,s.originValue)})};gr.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=U("path");return $(n,{d:"M0,0 L0,0"}),pe(n).add("djs-snap-line"),J(t,n),{update:function(r){ne(r)?e==="horizontal"?$(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):$(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):$(n,{display:"none"})}}};gr.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};gr.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()};gr.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]};gr.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var Cx={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",bn],resizeSnapping:["type",ao],snapping:["type",gr]};var Rx={__depends__:[Cx],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",sl],createMoveSnapping:["type",yi]};var Ax=300;function fe(e,t,n,r){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=r,this._container=this._getBoxHtml(),this._searchInput=_e(fe.INPUT_SELECTOR,this._container),this._resultsContainer=_e(fe.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}fe.$inject=["canvas","eventBus","selection","translate"];fe.prototype._bindEvents=function(){var e=this;function t(n,r,i,o){e._eventMaps.push({el:n,type:i,listener:bt.bind(n,r,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,fe.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,fe.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,fe.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,fe.INPUT_SELECTOR,"keydown",function(n){Ke("ArrowUp",n)&&n.preventDefault(),Ke("ArrowDown",n)&&n.preventDefault()}),t(this._container,fe.INPUT_SELECTOR,"keyup",function(n){if(Ke("Escape",n))return e.close();if(Ke("Enter",n)){var r=e._getCurrentResult();return r?e._select(r):e.close(!1)}if(Ke("ArrowUp",n))return e._scrollToDirection(!0);if(Ke("ArrowDown",n))return e._scrollToDirection();Ke(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})};fe.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){bt.unbind(e.el,e.type,e.listener)})};fe.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(i){return!t._canvas.getRootElements().includes(i.element)}),!n.length){this._selection.select(null);return}n.forEach(function(i){var o=i.element.id,a=t._createResultNode(i,o);t._results[o]={element:i.element,node:a}});var r=_e(fe.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(r),this._preselect(r)}};fe.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}};fe.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,r=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<r&&(this._resultsContainer.scrollTop=r)}};fe.prototype._clearResults=function(){Hr(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")};fe.prototype._getCurrentResult=function(){return _e(fe.RESULT_SELECTED_SELECTOR,this._resultsContainer)};fe.prototype._createResultNode=function(e,t){var n=ue(fe.RESULT_HTML);return e.primaryTokens.length>0&&Px(n,e.primaryTokens,fe.RESULT_PRIMARY_HTML),Px(n,e.secondaryTokens,fe.RESULT_SECONDARY_HTML),nt(n,fe.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n};fe.prototype.registerProvider=function(e){this._searchProvider=e};fe.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Ne(this._canvas.getContainer()).add("djs-search-open"),Ne(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};fe.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Ne(this._canvas.getContainer()).remove("djs-search-open"),Ne(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};fe.prototype.toggle=function(){this.isOpen()?this.close():this.open()};fe.prototype.isOpen=function(){return this._open};fe.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Ne(t).remove(fe.RESULT_SELECTED_CLASS);var n=nt(e,fe.RESULT_ID_ATTRIBUTE),r=this._results[n].element;Ne(e).add(fe.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(r,{top:Ax}),this._selection.select(r),this._eventBus.fire("searchPad.preselected",r)}};fe.prototype._select=function(e){var t=nt(e,fe.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:Ax}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)};fe.prototype._getBoxHtml=function(){let e=ue(fe.BOX_HTML),t=_e(fe.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function Px(e,t,n){var r=dD(t),i=ue(n);i.innerHTML=r,e.appendChild(i)}function dD(e){var t="";return e.forEach(function(n){var r=Hn(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+='<b class="'+fe.RESULT_HIGHLIGHT_CLASS+'">'+r+"</b>":t+=r}),t!==""?t:null}fe.CONTAINER_SELECTOR=".djs-search-container";fe.INPUT_SELECTOR=".djs-search-input input";fe.RESULTS_CONTAINER_SELECTOR=".djs-search-results";fe.RESULT_SELECTOR=".djs-search-result";fe.RESULT_SELECTED_CLASS="djs-search-result-selected";fe.RESULT_SELECTED_SELECTOR="."+fe.RESULT_SELECTED_CLASS;fe.RESULT_ID_ATTRIBUTE="data-result-id";fe.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";fe.BOX_HTML=`<div class="djs-search-container djs-scrollable">
H A Dbpmn-viewer.production.min.js2 (()=>{var Ps=Object.create;var vn=Object.defineProperty;var ks=Object.getOwnPropertyDescriptor;var Ts=Object.getOwnPropertyNames;var Ms=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ns=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var En=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Bs=(e,t)=>{for(var n in t)vn(e,n,{get:t[n],enumerable:!0})},Ni=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ts(t))!Ds.call(e,i)&&i!==n&&vn(e,i,{get:()=>t[i],enumerable:!(r=ks(t,i))||r.enumerable});return e};var Os=(e,t,n)=>(n=e!=null?Ps(Ms(e)):{},Ni(t||!e||!e.__esModule?vn(n,"default",{value:e,enumerable:!0}):n,e)),Ls=e=>Ni(vn({},"__esModule",{value:!0}),e);var Fi={};Bs(Fi,{assign:()=>M,bind:()=>Ye,debounce:()=>dr,ensureArray:()=>Bi,every:()=>bn,filter:()=>nt,find:()=>ve,findIndex:()=>hr,flatten:()=>Is,forEach:()=>P,get:()=>Gs,groupBy:()=>Ft,has:()=>at,isArray:()=>xe,isDefined:()=>wt,isFunction:()=>tt,isNil:()=>nn,isNumber:()=>Me,isObject:()=>_e,isString:()=>De,isUndefined:()=>Tt,keys:()=>Oi,map:()=>_t,matchPattern:()=>xn,merge:()=>Ii,omit:()=>vr,pick:()=>gr,reduce:()=>Ve,set:()=>yr,size:()=>$s,some:()=>rn,sortBy:()=>Ws,throttle:()=>Us,unionBy:()=>qs,uniqueBy:()=>Li,values:()=>Vs,without:()=>js});function Is(e){return Array.prototype.concat.apply([],e)}function Tt(e){return e===void 0}function wt(e){return e!==void 0}function nn(e){return e==null}function xe(e){return tn.call(e)==="[object Array]"}function _e(e){return tn.call(e)==="[object Object]"}function Me(e){return tn.call(e)==="[object Number]"}function tt(e){let t=tn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function De(e){return tn.call(e)==="[object String]"}function Bi(e){if(!xe(e))throw new Error("must supply array")}function at(e,t){return!nn(e)&&Fs.call(e,t)}function ve(e,t){let n=wn(t),r;return P(e,function(i,o){if(n(i,o))return r=i,!1}),r}function hr(e,t){let n=wn(t),r=xe(e)?-1:void 0;return P(e,function(i,o){if(n(i,o))return r=o,!1}),r}function nt(e,t){let n=wn(t),r=[];return P(e,function(i,o){n(i,o)&&r.push(i)}),r}function P(e,t){let n,r;if(Tt(e))return;let i=xe(e)?zs:Hs;for(let o in e)if(at(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function js(e,t){if(Tt(e))return[];Bi(e);let n=wn(t);return e.filter(function(r,i){return!n(r,i)})}function Ve(e,t,n){return P(e,function(r,i){n=t(n,r,i)}),n}function bn(e,t){return!!Ve(e,function(n,r,i){return n&&t(r,i)},!0)}function rn(e,t){return!!ve(e,t)}function _t(e,t){let n=[];return P(e,function(r,i){n.push(t(r,i))}),n}function Oi(e){return e&&Object.keys(e)||[]}function $s(e){return Oi(e).length}function Vs(e){return _t(e,t=>t)}function Ft(e,t,n={}){return t=mr(t),P(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function Li(e,...t){e=mr(e);let n={};return P(t,i=>Ft(i,e,n)),_t(n,function(i,o){return i[0]})}function Ws(e,t){t=mr(t);let n=[];return P(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),_t(n,r=>r.v)}function xn(e){return function(t){return bn(e,function(n,r){return t[r]===n})}}function mr(e){return tt(e)?e:t=>t[e]}function wn(e){return tt(e)?e:t=>t===e}function Hs(e){return e}function zs(e){return Number(e)}function dr(e,t){let n,r,i,o;function a(y){let v=Date.now(),A=y?0:o+t-v;if(A>0)return s(A);e.apply(i,r),c()}function s(y){n=setTimeout(a,y)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function f(){n&&a(!0),c()}function h(...y){o=Date.now(),r=y,i=this,n||s(t)}return h.flush=f,h.cancel=c,h}function Us(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function Ye(e,t){return e.bind(t)}function M(e,...t){return Object.assign(e,...t)}function yr(e,t,n){let r=e;return P(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];wt(a)&&nn(s)&&(s=r[i]=isNaN(+a)?{}:[]),Tt(a)?Tt(n)?delete r[i]:r[i]=n:r=s}),e}function Gs(e,t,n){let r=e;return P(t,function(i){if(nn(r))return r=void 0,!1;r=r[i]}),Tt(r)?n:r}function gr(e,t){let n={},r=Object(e);return P(t,function(i){i in r&&(n[i]=e[i])}),n}function vr(e,t){let n={},r=Object(e);return P(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Ii(e,...t){return t.length&&P(t,function(n){!n||!_e(n)||P(n,function(r,i){if(i==="__proto__")return;let o=e[i];_e(r)?(_e(o)||(o={}),e[i]=Ii(o,r)):e[i]=r})}),e}var tn,Fs,qs,Q=Ns(()=>{tn=Object.prototype.toString,Fs=Object.prototype.hasOwnProperty;qs=Li});var Sa=En((fv,_a)=>{function Cf(e){return["String","Boolean","Integer","Real"].includes(e)}_a.exports=function e(t,n){let r=n.enter,i=n.leave,o=r&&r(t),a=t.$descriptor;o!==!1&&!a.isGeneric&&a.properties.filter(c=>!c.isAttr&&!c.isReference&&!Cf(c.type)).forEach(c=>{if(c.name in t){let f=t[c.name];c.isMany?f.forEach(h=>{e(h,n)}):e(f,n)}}),i&&i(t)}});var Ra=En((pv,Aa)=>{var Pf=Sa(),{isArray:kf,isObject:Tf,isFunction:Mf}=(Q(),Ls(Fi)),ri=class{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,r){let i={id:t,message:n};r&&kf(r)&&(i={...i,path:r}),r&&Tf(r)&&(i={...i,...r}),this.messages.push(i)}};Aa.exports=function({moddleRoot:t,rule:n}){let r=new ri({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:Mf(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return Pf(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var ka=En((hv,Pa)=>{var Df=Ra(),Nf=(e,t)=>e,Bf={0:"off",1:"warn",2:"error",3:"info"},Of="rule-error";function Qe(e){let{config:t={},resolver:n,transformRule:r=Nf}=e||{};if(typeof n=="undefined")throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}Pa.exports=Qe;Qe.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return Df({moddleRoot:t,rule:i,config:r}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(s){return console.error("rule <"+a+"> failed with error: ",s),[{message:s.message,category:Of}]}};Qe.prototype.resolveRule=function(e,t){let{pkg:n,ruleName:r}=this.parseRuleName(e),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then(a=>{if(!a)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(a(t),{pkg:n,ruleName:r})})};Qe.prototype.resolveConfig=function(e){let{pkg:t,configName:n}=this.parseConfigName(e),r=`${t}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[r]=this.normalizeConfig(o,t)})};Qe.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{let i=Object.entries(t).map(([o,a])=>{let{category:s,config:c}=this.parseRuleValue(a);return{name:o,category:s,config:c}}).filter(o=>o.category!=="off").map(o=>{let{name:a,config:s}=o;return this.resolveRule(a,s).then(function(c){return{...o,rule:c}})});return Promise.all(i)})};Qe.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t=="undefined"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(r=>this.resolveConfiguredRules(r)))).then(n=>{let r=this.normalizeConfig(e,"bpmnlint").rules;return[...n,r].reduce((o,a)=>({...o,...a}),{})})};Qe.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{let r={};return n.forEach(i=>{let{name:o}=i,a=this.applyRule(e,i);a.length&&(r[o]=a)}),r})};Qe.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=Bf[t]||t,{config:n,category:t}};Qe.prototype.parseRuleName=function(e,t="bpmnlint"){let n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);let[r,i,o,a]=n;return o?{pkg:`${i?i+"/":""}${Ca(o)}`,ruleName:a}:{pkg:t,ruleName:a}};Qe.prototype.parseConfigName=function(e){let t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);let[n,r,i,o]=t;return i?{pkg:`${r?r+"/":""}${Ca(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};Qe.prototype.getSimplePackageName=function(e){let t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);let[n,r,i]=t;return`${r?r+"/":""}${Lf(i)}`};Qe.prototype.normalizeConfig=function(e,t){let n=e.rules||{},r=Object.keys(n).reduce((i,o)=>{let a=n[o],{pkg:s,ruleName:c}=this.parseRuleName(o,t),f=s==="bpmnlint"?c:`${this.getSimplePackageName(s)}/${c}`;return i[f]=a,i},{});return{...e,rules:r}};function Ca(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function Lf(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Ma=En((mv,Ta)=>{var If=ka();Ta.exports={Linter:If}});function Ce(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}Q();var Ks=1e3;function Xe(e,t){var n=this;t=t||Ks,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}Xe.prototype.canRender=function(e){};Xe.prototype.drawShape=function(e,t){};Xe.prototype.drawConnection=function(e,t){};Xe.prototype.getShapePath=function(e){};Xe.prototype.getConnectionPath=function(e){};Q();function N(e,t){var n=oe(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function ji(e,t){return rn(t,function(n){return N(e,n)})}function oe(e){return e&&e.businessObject||e}function Ze(e){return e&&e.di}function dt(e,t){return N(e,"bpmn:CallActivity")?!1:N(e,"bpmn:SubProcess")?(t=t||Ze(e),t&&N(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):N(e,"bpmn:Participant")?!!oe(e).processRef:!0}function Er(e){if(!(!N(e,"bpmn:Participant")&&!N(e,"bpmn:Lane"))){var t=Ze(e).isHorizontal;return t===void 0?!0:t}}function $i(e){return e&&!!oe(e).triggeredByEvent}Q();Q();function Vi(e){return _e(e)&&at(e,"waypoints")}function br(e){return _e(e)&&at(e,"labelTarget")}var jt={width:90,height:20},qi=15;function Wi(e){return N(e,"bpmn:Event")||N(e,"bpmn:Gateway")||N(e,"bpmn:DataStoreReference")||N(e,"bpmn:DataObjectReference")||N(e,"bpmn:DataInput")||N(e,"bpmn:DataOutput")||N(e,"bpmn:SequenceFlow")||N(e,"bpmn:MessageFlow")||N(e,"bpmn:Group")}function Ys(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=Xs(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-=qi:a+=qi,{x:a,y:s}}function Xs(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 Zs(e){return e.waypoints?Ys(e.waypoints):N(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+jt.height/2}:{x:e.x+e.width/2,y:e.y+e.height+jt.height/2}}function Hi(e,t){var n,r,i,o=e.label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(jt.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=Zs(t),r=jt),M({x:n.x-r.width/2,y:n.y-r.height/2},r)}function Qs(e){if(N(e,"bpmn:FlowElement")||N(e,"bpmn:Participant")||N(e,"bpmn:Lane")||N(e,"bpmn:SequenceFlow")||N(e,"bpmn:MessageFlow")||N(e,"bpmn:DataInput")||N(e,"bpmn:DataOutput"))return"name";if(N(e,"bpmn:TextAnnotation"))return"text";if(N(e,"bpmn:Group"))return"categoryValueRef"}function Js(e){var t=e.categoryValueRef;return t&&t.value||""}function $t(e){var t=e.businessObject,n=Qs(t);if(n)return n==="categoryValueRef"?Js(t):t[n]||""}Q();function Mt(e,t){t=!!t,xe(e)||(e=[e]);var n,r,i,o;return P(e,function(a){var s=a;a.waypoints&&!t&&(s=Mt(a.waypoints,!0));var c=s.x,f=s.y,h=s.height||0,y=s.width||0;(c<n||n===void 0)&&(n=c),(f<r||r===void 0)&&(r=f),(c+y>i||i===void 0)&&(i=c+y),(f+h>o||o===void 0)&&(o=f+h)}),{x:n,y:r,height:o-r,width:i-n}}function _n(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Sn(e){return!!(e&&e.isFrame)}var An=7;Q();function eu(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Ki(e,t){return t.appendChild(eu(e,t))}function fe(e,t){return Ki(t,e),e}var _r=2,Yi={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":_r,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":_r,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function tu(e,t){return Yi[t]?e.style[t]:e.getAttributeNS(null,t)}function Xi(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Yi[r];i?(i===_r&&typeof n=="number"&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function nu(e,t){var n=Object.keys(t),r,i;for(r=0,i;i=n[r];r++)Xi(e,i,t[i])}function te(e,t,n){if(typeof t=="string")if(n!==void 0)Xi(e,t,n);else return tu(e,t);else nu(e,t);return e}var ru=Object.prototype.toString;function qe(e){return new St(e)}function St(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}St.prototype.add=function(e){return this.list.add(e),this};St.prototype.remove=function(e){return ru.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};St.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};St.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};St.prototype.array=function(){return Array.from(this.list)};St.prototype.has=St.prototype.contains=function(e){return this.list.contains(e)};function iu(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}var Ar={svg:"http://www.w3.org/2000/svg"},zi='<svg xmlns="'+Ar.svg+'"';function Zi(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Ar.svg)===-1&&(e=zi+e.substring(4)):(e=zi+">"+e+"</svg>",t=!0);var n=ou(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function ou(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function ne(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=Zi(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Ar.svg,e),t&&te(n,t),n}var xr=null;function Sr(){return xr===null&&(xr=ne("svg")),xr}function Ui(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function Qi(e,t,n,r,i,o){var a=Sr().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Ui(a,e);case 6:return Ui(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function Vt(e){return e?Sr().createSVGTransformFromMatrix(e):Sr().createSVGTransform()}var Gi=/([&<>]{1})/g,au=/([&<>\n\r"]{1})/g,su={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function wr(e,t){function n(r,i){return su[i]||i}return e.replace(t,n)}function Ji(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(wr(e.textContent,Gi));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',wr(o.value,au),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,r=a.length;n<r;++n)Ji(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",wr(e.nodeValue,Gi),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function uu(e,t){var n=Zi(t);if(iu(e),!!t){cu(n)||(n=n.documentElement);for(var r=fu(n.childNodes),i=0;i<r.length;i++)Ki(r[i],e)}}function lu(e){for(var t=e.firstChild,n=[];t;)Ji(t,n),t=t.nextSibling;return n.join("")}function cu(e){return e.nodeName==="#document-fragment"}function Rr(e,t){if(t!==void 0){try{uu(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}else return lu(e)}function fu(e){return Array.prototype.slice.call(e)}function Dt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function pu(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function hu(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(pu(e,r))}function Nt(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),hu(n,t)),n.consolidate()}function yt(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function mu(e){return["M",e.x,e.y]}function Cr(e){return["L",e.x,e.y]}function du(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function yu(e,t){let n=e.length,r=[mu(e[0])];for(let i=1;i<n;i++){let o=e[i-1],a=e[i],s=e[i+1];if(!s||!t){r.push(Cr(a));continue}let c=Math.min(t,Pr(a.x-o.x,a.y-o.y),Pr(s.x-a.x,s.y-a.y));if(!c){r.push(Cr(a));continue}let f=Rn(a,o,c),h=Rn(a,o,c*.5),y=Rn(a,s,c),v=Rn(a,s,c*.5);r.push(Cr(f)),r.push(du(h,v,y))}return r}function Rn(e,t,n){let r=t.x-e.x,i=t.y-e.y,o=Pr(r,i),a=n/o;return{x:e.x+r*a,y:e.y+i*a}}function Pr(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function qt(e,t,n){Me(t)&&(n=t,t=null),t||(t={});let r=ne("path",t);return Me(n)&&(r.dataset.cornerRadius=String(n)),kr(r,e)}function kr(e,t){let n=parseInt(e.dataset.cornerRadius,10)||0;return te(e,{d:yt(yu(t,n))}),e}Q();var Cn="hsl(225, 10%, 15%)",gu="white";function rt(e,t){return rn(e.eventDefinitions,function(n){return n.$type===t})}function eo(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function to(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function U(e,t,n){var r=Ze(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||gu}function k(e,t,n){var r=Ze(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||Cn}function Wt(e,t,n,r){var i=Ze(e),o=i.get("label");return r||o&&o.get("color:color")||t||k(e,n)}function no(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 yt(i)}function Tr(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 yt(a)}function ro(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 yt(s)}function io(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 yt(o)}function Ht(e,t={}){return{width:We(e,t),height:Ne(e,t)}}function We(e,t={}){return at(t,"width")?t.width:e.width}function Ne(e,t={}){return at(t,"height")?t.height:e.height}Q();var Ee={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};Ee.td=Ee.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];Ee.option=Ee.optgroup=[1,'<select multiple="multiple">',"</select>"];Ee.thead=Ee.tbody=Ee.colgroup=Ee.caption=Ee.tfoot=[1,"<table>","</table>"];Ee.polyline=Ee.ellipse=Ee.polygon=Ee.circle=Ee.text=Ee.line=Ee.path=Ee.rect=Ee.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ee(e,t=globalThis.document){var f;if(typeof e!="string")throw new TypeError("String expected");let n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);let r=(f=/<([\w:]+)/.exec(e))==null?void 0:f[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let h=t.createElement("html");h.innerHTML=e;let{lastChild:y}=h;return y.remove(),y}let[i,o,a]=Object.hasOwn(Ee,r)?Ee[r]:Ee._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:h}=s;return h.remove(),h}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function vu(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function Pe(e,...t){let n=e.style;return P(t,function(r){r&&P(r,function(i,o){n[o]=i})}),e}function kn(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Eu=Object.prototype.toString;function Bt(e){return new At(e)}function At(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}At.prototype.add=function(e){return this.list.add(e),this};At.prototype.remove=function(e){return Eu.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};At.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};At.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};At.prototype.array=function(){return Array.from(this.list)};At.prototype.has=At.prototype.contains=function(e){return this.list.contains(e)};function Tn(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function bu(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest=="function"&&r.closest(t)||null}function xu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pn={},oo;function wu(){if(oo)return Pn;oo=1;var e,t,n;function r(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n=e!=="addEventListener"?"on":""}return Pn.bind=function(i,o,a,s){return e||r(),i[e](n+o,a,s||!1),a},Pn.unbind=function(i,o,a,s){return t||r(),i[t](n+o,a,s||!1),a},Pn}var ao=wu(),_u=xu(ao),Mn=vu({__proto__:null,default:_u},[ao]),so=["focus","blur"];function Su(e,t,n,r,i){return so.indexOf(n)!==-1&&(i=!0),Mn.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=bu(a,t,!0),o.delegateTarget&&r.call(e,o)},i)}function Au(e,t,n,r){return so.indexOf(t)!==-1&&(r=!0),Mn.unbind(e,t,n,r)}var on={bind:Su,unbind:Au};function He(e,t){return t=t||document,t.querySelector(e)}function uo(e,t){return t=t||document,t.querySelectorAll(e)}function zt(e){e.parentNode&&e.parentNode.removeChild(e)}function Dn(e,t,n,r,i){var o=Vt();o.setTranslate(t,n);var a=Vt();a.setRotate(r||0,0,0);var s=Vt();s.setScale(i||1,i||1),Nt(e,[o,a,s])}function Nn(e,t,n){var r=Vt();r.setTranslate(t,n),Nt(e,r)}function lo(e,t){var n=Vt();n.setRotate(t,0,0),Nt(e,n)}function Ru(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mr={exports:{}},co;function Cu(){if(co)return Mr.exports;co=1;var e=Mr.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var c=Math.pow(n,o),s=Math.floor(Math.random()*c).toString(n);a=s+a}var f=parseInt(a,n);return f!==1/0&&f>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},Mr.exports}var Pu=Cu(),ku=Ru(Pu);function st(e){if(!(this instanceof st))return new st(e);e=e||[128,36,1],this._seed=e.length?ku.rack(e[0],e[1],e[2]):e}st.prototype.next=function(e){return this._seed(e||!0)};st.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};st.prototype.claim=function(e,t){this._seed.set(e,t||!0)};st.prototype.assigned=function(e){return this._seed.get(e)||!1};st.prototype.unclaim=function(e){delete this._seed.hats[e]};st.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var Tu=new st,Mu=10,Bn=3,Du=1.5,On=10,Nu=4,Ut=.95,Bu=1,Ou=.25;function gt(e,t,n,r,i,o,a){Xe.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,f=e&&e.defaultLabelColor;function h(p){return n.computeStyle(p,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Cn,strokeWidth:2,fill:"white"})}function y(p){return n.computeStyle(p,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Cn,strokeWidth:2})}function v(p,l){var{ref:u={x:0,y:0},scale:m=1,element:d,parentGfx:E=i._svg}=l,S=ne("marker",{id:p,viewBox:"0 0 20 20",refX:u.x,refY:u.y,markerWidth:20*m,markerHeight:20*m,orient:"auto"});fe(S,d);var j=He(":scope > defs",E);j||(j=ne("defs"),fe(E,j)),fe(j,S)}function A(p,l,u,m){var d=Tu.nextPrefixed("marker-");return W(p,d,l,u,m),"url(#"+d+")"}function W(p,l,u,m,d){if(u==="sequenceflow-end"){var E=ne("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:d,stroke:d,strokeWidth:1})});v(l,{element:E,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(u==="messageflow-start"){var S=ne("circle",{cx:6,cy:6,r:3.5,...h({fill:m,stroke:d,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:S,ref:{x:6,y:6},parentGfx:p})}if(u==="messageflow-end"){var j=ne("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...h({fill:m,stroke:d,strokeWidth:1,strokeDasharray:[1e4,1]})});v(l,{element:j,ref:{x:8.5,y:5},parentGfx:p})}if(u==="association-start"){var Y=ne("path",{d:"M 11 5 L 1 10 L 11 15",...y({fill:"none",stroke:d,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:Y,ref:{x:1,y:10},scale:.5,parentGfx:p})}if(u==="association-end"){var ge=ne("path",{d:"M 1 5 L 11 10 L 1 15",...y({fill:"none",stroke:d,strokeWidth:1.5,strokeDasharray:[1e4,1]})});v(l,{element:ge,ref:{x:11,y:10},scale:.5,parentGfx:p})}if(u==="conditional-flow-marker"){var he=ne("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...h({fill:m,stroke:d})});v(l,{element:he,ref:{x:-1,y:10},scale:.5,parentGfx:p})}if(u==="conditional-default-flow-marker"){var we=ne("path",{d:"M 6 4 L 10 16",...h({stroke:d,fill:"none"})});v(l,{element:we,ref:{x:0,y:10},scale:.5,parentGfx:p})}}function L(p,l,u,m,d={}){_e(m)&&(d=m,m=0),m=m||0,d=h(d);var E=l/2,S=u/2,j=ne("circle",{cx:E,cy:S,r:Math.round((l+u)/4-m),...d});return fe(p,j),j}function O(p,l,u,m,d,E){_e(d)&&(E=d,d=0),d=d||0,E=h(E);var S=ne("rect",{x:d,y:d,width:l-d*2,height:u-d*2,rx:m,ry:m,...E});return fe(p,S),S}function H(p,l,u,m){var d=l/2,E=u/2,S=[{x:d,y:0},{x:l,y:E},{x:d,y:u},{x:0,y:E}],j=S.map(function(ge){return ge.x+","+ge.y}).join(" ");m=h(m);var Y=ne("polygon",{...m,points:j});return fe(p,Y),Y}function G(p,l,u,m){u=y(u);var d=qt(l,u,m);return fe(p,d),d}function T(p,l,u){return G(p,l,u,5)}function g(p,l,u){u=y(u);var m=ne("path",{...u,d:l});return fe(p,m),m}function w(p,l,u,m){return g(l,u,M({"data-marker":p},m))}function C(p){return je[p]}function V(p){return function(l,u,m){return C(p)(l,u,m)}}var b={"bpmn:MessageEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.235,my:.315}}),E=m?k(l,c,u.stroke):U(l,s,u.fill),S=m?U(l,s,u.fill):k(l,c,u.stroke),j=g(p,d,{fill:E,stroke:S,strokeWidth:1});return j},"bpmn:TimerEventDefinition":function(p,l,u={}){var m=u.width||l.width,d=u.height||l.height,E=u.width?1:2,S=L(p,m,d,.2*d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:E}),j=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m,containerHeight:d,position:{mx:.5,my:.5}});g(p,j,{stroke:k(l,c,u.stroke),strokeWidth:E});for(var Y=0;Y<12;Y++){var ge=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m,containerHeight:d,position:{mx:.5,my:.5}}),he=m/2,we=d/2;g(p,ge,{strokeWidth:1,stroke:k(l,c,u.stroke),transform:"rotate("+Y*30+","+we+","+he+")"})}return S},"bpmn:EscalationEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.2}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(p,l,u={}){var m=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.222}});return g(p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.57,my:.263}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.2,my:.722}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.638,my:-.055}}),E=m?k(l,c,u.stroke):"none",S=g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1});return lo(S,45),S},"bpmn:CompensateEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.22,my:.5}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.5,my:.2}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{strokeWidth:1,fill:E,stroke:k(l,c,u.stroke)})},"bpmn:MultipleEventDefinition":function(p,l,u={},m){var d=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.211,my:.36}}),E=m?k(l,c,u.stroke):U(l,s,u.fill);return g(p,d,{fill:E,stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(p,l,u={}){var m=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:u.width||l.width,containerHeight:u.height||l.height,position:{mx:.458,my:.194}});return g(p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(p,l,u={}){var m=L(p,l.width,l.height,8,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:4});return m}};function D(p,l,u={},m){var d=oe(p),E=eo(d),S=m||p;return d.get("eventDefinitions")&&d.get("eventDefinitions").length>1?d.get("parallelMultiple")?b["bpmn:ParallelMultipleEventDefinition"](l,S,u,E):b["bpmn:MultipleEventDefinition"](l,S,u,E):rt(d,"bpmn:MessageEventDefinition")?b["bpmn:MessageEventDefinition"](l,S,u,E):rt(d,"bpmn:TimerEventDefinition")?b["bpmn:TimerEventDefinition"](l,S,u,E):rt(d,"bpmn:ConditionalEventDefinition")?b["bpmn:ConditionalEventDefinition"](l,S,u,E):rt(d,"bpmn:SignalEventDefinition")?b["bpmn:SignalEventDefinition"](l,S,u,E):rt(d,"bpmn:EscalationEventDefinition")?b["bpmn:EscalationEventDefinition"](l,S,u,E):rt(d,"bpmn:LinkEventDefinition")?b["bpmn:LinkEventDefinition"](l,S,u,E):rt(d,"bpmn:ErrorEventDefinition")?b["bpmn:ErrorEventDefinition"](l,S,u,E):rt(d,"bpmn:CancelEventDefinition")?b["bpmn:CancelEventDefinition"](l,S,u,E):rt(d,"bpmn:CompensateEventDefinition")?b["bpmn:CompensateEventDefinition"](l,S,u,E):rt(d,"bpmn:TerminateEventDefinition")?b["bpmn:TerminateEventDefinition"](l,S,u,E):null}var R={ParticipantMultiplicityMarker:function(p,l,u={}){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2-6)/m,my:(d-15)/d}});w("participant-multiplicity",p,E,{strokeWidth:2,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},SubProcessMarker:function(p,l,u={}){var m=O(p,14,14,0,{strokeWidth:1,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)});Nn(m,l.width/2-7.5,l.height-20);var d=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2-7.5)/l.width,my:(l.height-20)/l.height}});w("sub-process",p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},ParallelMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.parallel)/m,my:(d-20)/d}});w("parallel",p,E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},SequentialMarker:function(p,l,u){var m=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+u.seq)/l.width,my:(l.height-19)/l.height}});w("sequential",p,m,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},CompensationMarker:function(p,l,u){var m=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:(l.width/2+u.compensation)/l.width,my:(l.height-13)/l.height}});w("compensation",p,m,{strokeWidth:1,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})},LoopMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.loop)/m,my:(d-7)/d}});w("loop",p,E,{strokeWidth:1.5,fill:"none",stroke:k(l,c,u.stroke),strokeMiterlimit:.5})},AdhocMarker:function(p,l,u){var m=We(l,u),d=Ne(l,u),E=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:(m/2+u.adhoc)/m,my:(d-15)/d}});w("adhoc",p,E,{strokeWidth:1,fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke)})}};function F(p,l,u,m){R[p](l,u,m)}function B(p,l,u=[],m={}){m={fill:m.fill,stroke:m.stroke,width:We(l,m),height:Ne(l,m)};var d=oe(l),E=u.includes("SubProcessMarker");E?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")&&u.push("CompensationMarker"),N(d,"bpmn:AdHocSubProcess")&&(u.push("AdhocMarker"),E||M(m,{compensation:m.compensation-18}));var S=d.get("loopCharacteristics"),j=S&&S.get("isSequential");S&&(M(m,{compensation:m.compensation-18}),u.includes("AdhocMarker")&&M(m,{seq:-23,loop:-18,parallel:-24}),j===void 0&&u.push("LoopMarker"),j===!1&&u.push("ParallelMarker"),j===!0&&u.push("SequentialMarker")),u.includes("CompensationMarker")&&u.length===1&&M(m,{compensation:-8}),P(u,function(Y){F(Y,p,l,m)})}function I(p,l,u={}){u=M({size:{width:100}},u);var m=o.createText(l||"",u);return qe(m).add("djs-label"),fe(p,m),m}function K(p,l,u,m={}){var d=oe(l),E=Ht({x:l.x,y:l.y,width:l.width,height:l.height},m);return I(p,d.name,{align:u,box:E,padding:7,style:{fill:Wt(l,f,c,m.stroke)}})}function ot(p,l,u={}){var m={width:l.width,height:l.height,x:l.width/2+l.x,y:l.height/2+l.y};return I(p,$t(l),{box:m,style:M({},o.getExternalStyle(),{fill:Wt(l,f,c,u.stroke)})})}function ae(p,l,u,m={}){var d=Er(u),E=I(p,l,{box:{height:30,width:d?Ne(u,m):We(u,m)},align:"center-middle",style:{fill:Wt(u,f,c,m.stroke)}});if(d){var S=-1*Ne(u,m);Dn(E,0,-S,270)}}function Z(p,l,u={}){var{width:m,height:d}=Ht(l,u);return O(p,m,d,On,{...u,fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke)})}function Je(p,l,u={}){var m=oe(l),d=U(l,s,u.fill),E=k(l,c,u.stroke);return(m.get("associationDirection")==="One"||m.get("associationDirection")==="Both")&&(u.markerEnd=A(p,"association-end",d,E)),m.get("associationDirection")==="Both"&&(u.markerStart=A(p,"association-start",d,E)),u=X(u,["markerStart","markerEnd"]),T(p,l.waypoints,{...u,stroke:E,strokeDasharray:"0, 5"})}function et(p,l,u={}){var m=U(l,s,u.fill),d=k(l,c,u.stroke),E=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.474,my:.296}}),S=g(p,E,{fill:m,fillOpacity:Ut,stroke:d}),j=oe(l);if(to(j)){var Y=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:.33,my:(l.height-18)/l.height}});g(p,Y,{strokeWidth:2,fill:m,stroke:d})}return S}function ye(p,l,u={}){return L(p,l.width,l.height,{fillOpacity:Ut,...u,fill:U(l,s,u.fill),stroke:k(l,c,u.stroke)})}function Ge(p,l,u={}){return H(p,l.width,l.height,{fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke)})}function x(p,l,u={}){var m=O(p,We(l,u),Ne(l,u),0,{fill:U(l,s,u.fill),fillOpacity:u.fillOpacity||Ut,stroke:k(l,c,u.stroke),strokeWidth:1.5}),d=oe(l);if(N(d,"bpmn:Lane")){var E=d.get("name");ae(p,E,l,u)}return m}function _(p,l,u={}){var m=Z(p,l,u),d=dt(l);if($i(l)&&(te(m,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!d)){var E=oe(l).flowElements||[],S=E.filter(j=>N(j,"bpmn:StartEvent"));S.length===1&&$(S[0],p,u,l)}return K(p,l,d?"center-top":"center-middle",u),d?B(p,l,void 0,u):B(p,l,["SubProcessMarker"],u),m}function $(p,l,u,m){var d=22,E={fill:U(m,s,u.fill),stroke:k(m,c,u.stroke),width:d,height:d},S=oe(p).isInterrupting,j=S?0:3,Y=S?1:1.2,ge=20,he=(d-ge)/2,we="translate("+he+","+he+")";L(l,ge,ge,{fill:E.fill,stroke:E.stroke,strokeWidth:Y,strokeDasharray:j,transform:we}),D(p,l,E,m)}function re(p,l,u={}){var m=Z(p,l,u);return K(p,l,"center-middle",u),B(p,l,void 0,u),m}var je=this.handlers={"bpmn:AdHocSubProcess":function(p,l,u={}){return dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]),_(p,l,u)},"bpmn:Association":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,u)},"bpmn:BoundaryEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=oe(l),E=d.get("cancelActivity");u={strokeWidth:1.5,fill:U(l,s,u.fill),fillOpacity:Bu,stroke:k(l,c,u.stroke)},E||(u.strokeDasharray="6");var S=ye(p,l,u);return L(p,l.width,l.height,Bn,{...u,fill:"none"}),m&&D(l,p,u),S},"bpmn:BusinessRuleTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),E=g(p,d);te(E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1});var S=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),j=g(p,S);return te(j,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:CallActivity":function(p,l,u={}){return u=X(u,["fill","stroke"]),_(p,l,{strokeWidth:5,...u})},"bpmn:ComplexGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.26}});return g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:DataInput":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getRawPath("DATA_ARROW"),d=et(p,l,u);return g(p,m,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1}),d},"bpmn:DataInputAssociation":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,{...u,markerEnd:A(p,"association-end",U(l,s,u.fill),k(l,c,u.stroke))})},"bpmn:DataObject":function(p,l,u={}){return u=X(u,["fill","stroke"]),et(p,l,u)},"bpmn:DataObjectReference":V("bpmn:DataObject"),"bpmn:DataOutput":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getRawPath("DATA_ARROW"),d=et(p,l,u);return g(p,m,{strokeWidth:1,fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke)}),d},"bpmn:DataOutputAssociation":function(p,l,u={}){return u=X(u,["fill","stroke"]),Je(p,l,{...u,markerEnd:A(p,"association-end",U(l,s,u.fill),k(l,c,u.stroke))})},"bpmn:DataStoreReference":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:l.width,containerHeight:l.height,position:{mx:0,my:.133}});return g(p,m,{fill:U(l,s,u.fill),fillOpacity:Ut,stroke:k(l,c,u.stroke),strokeWidth:2})},"bpmn:EndEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=ye(p,l,{...u,strokeWidth:4});return m&&D(l,p,u),d},"bpmn:EventBasedGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=Ge(p,l,u);L(p,l.width,l.height,l.height*.2,{fill:U(l,"none",u.fill),stroke:k(l,c,u.stroke),strokeWidth:1});var E=m.get("eventGatewayType"),S=!!m.get("instantiate");function j(){var ge=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:l.width,containerHeight:l.height,position:{mx:.36,my:.44}});g(p,ge,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:2})}if(E==="Parallel"){var Y=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:l.width,containerHeight:l.height,position:{mx:.474,my:.296}});g(p,Y,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1})}else E==="Exclusive"&&(S||L(p,l.width,l.height,l.height*.26,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1}),j());return d},"bpmn:ExclusiveGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:l.width,containerHeight:l.height,position:{mx:.32,my:.3}}),E=Ze(l);return E.get("isMarkerVisible")&&g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:Gateway":function(p,l,u={}){return u=X(u,["fill","stroke"]),Ge(p,l,u)},"bpmn:Group":function(p,l,u={}){return u=X(u,["fill","stroke","width","height"]),O(p,l.width,l.height,On,{stroke:k(l,c,u.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:We(l,u),height:Ne(l,u)})},"bpmn:InclusiveGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u);return L(p,l.width,l.height,l.height*.24,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:2.5}),m},"bpmn:IntermediateEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=ye(p,l,{...u,strokeWidth:1.5});return L(p,l.width,l.height,Bn,{fill:"none",stroke:k(l,c,u.stroke),strokeWidth:1.5}),m&&D(l,p,u),d},"bpmn:IntermediateCatchEvent":V("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":V("bpmn:IntermediateEvent"),"bpmn:Lane":function(p,l,u={}){return u=X(u,["fill","stroke","width","height"]),x(p,l,{...u,fillOpacity:Ou})},"bpmn:ManualTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5}),m},"bpmn:MessageFlow":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=Ze(l),E=U(l,s,u.fill),S=k(l,c,u.stroke),j=T(p,l.waypoints,{markerEnd:A(p,"messageflow-end",E,S),markerStart:A(p,"messageflow-start",E,S),stroke:S,strokeDasharray:"10, 11",strokeWidth:1.5});if(m.get("messageRef")){var Y=j.getPointAtLength(j.getTotalLength()/2),ge=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:Y.x,y:Y.y}}),he={strokeWidth:1};d.get("messageVisibleKind")==="initiating"?(he.fill=E,he.stroke=S):(he.fill=S,he.stroke=E);var we=g(p,ge,he),Ke=m.get("messageRef"),ie=Ke.get("name"),mt=I(p,ie,{align:"center-top",fitBox:!0,style:{fill:S}}),gn=we.getBBox(),$e=mt.getBBox(),z=Y.x-$e.width/2,J=Y.y+gn.height/2+Mu;Dn(mt,z,J,0)}return j},"bpmn:ParallelGateway":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=Ge(p,l,u),d=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:l.width,containerHeight:l.height,position:{mx:.46,my:.2}});return g(p,d,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:Participant":function(p,l,u={}){u=X(u,["fill","stroke","width","height"]);var m=x(p,l,u),d=dt(l),E=Er(l),S=oe(l),j=S.get("name");if(d){var Y=E?[{x:30,y:0},{x:30,y:Ne(l,u)}]:[{x:0,y:30},{x:We(l,u),y:30}];G(p,Y,{stroke:k(l,c,u.stroke),strokeWidth:Du}),ae(p,j,l,u)}else{var ge=Ht(l,u);E||(ge.height=We(l,u),ge.width=Ne(l,u));var he=I(p,j,{box:ge,align:"center-middle",style:{fill:Wt(l,f,c,u.stroke)}});if(!E){var we=-1*Ne(l,u);Dn(he,0,-we,270)}}return S.get("participantMultiplicity")&&F("ParticipantMultiplicityMarker",p,l,u),m},"bpmn:ReceiveTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=oe(l),d=re(p,l,u),E;return m.get("instantiate")?(L(p,28,28,20*.22,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),E=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):E=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),g(p,E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),d},"bpmn:ScriptTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:SendTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return g(p,d,{fill:k(l,c,u.stroke),stroke:U(l,s,u.fill),strokeWidth:1}),m},"bpmn:SequenceFlow":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=U(l,s,u.fill),d=k(l,c,u.stroke),E=T(p,l.waypoints,{markerEnd:A(p,"sequenceflow-end",m,d),stroke:d}),S=oe(l),{source:j}=l;if(j){var Y=oe(j);S.get("conditionExpression")&&N(Y,"bpmn:Activity")&&te(E,{markerStart:A(p,"conditional-flow-marker",m,d)}),Y.get("default")&&(N(Y,"bpmn:Gateway")||N(Y,"bpmn:Activity"))&&Y.get("default")===S&&te(E,{markerStart:A(p,"conditional-default-flow-marker",m,d)})}return E},"bpmn:ServiceTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u);L(p,10,10,{fill:U(l,s,u.fill),stroke:"none",transform:"translate(6, 6)"});var d=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});g(p,d,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),L(p,10,10,{fill:U(l,s,u.fill),stroke:"none",transform:"translate(11, 10)"});var E=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return g(p,E,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:1}),m},"bpmn:StartEvent":function(p,l,u={}){var{renderIcon:m=!0}=u;u=X(u,["fill","stroke"]);var d=oe(l);d.get("isInterrupting")||(u={...u,strokeDasharray:"6"});var E=ye(p,l,u);return m&&D(l,p,u),E},"bpmn:SubProcess":function(p,l,u={}){return dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]),_(p,l,u)},"bpmn:Task":function(p,l,u={}){return u=X(u,["fill","stroke"]),re(p,l,u)},"bpmn:TextAnnotation":function(p,l,u={}){u=X(u,["fill","stroke"]);var{width:m,height:d}=Ht(l,u),E=O(p,m,d,0,0,{fill:"none",stroke:"none"}),S=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m,containerHeight:d,position:{mx:0,my:0}});g(p,S,{stroke:k(l,c,u.stroke)});var j=oe(l),Y=j.get("text")||"";return I(p,Y,{align:"left-top",box:Ht(l,u),padding:An,style:{fill:Wt(l,f,c,u.stroke)}}),E},"bpmn:Transaction":function(p,l,u={}){dt(l)?u=X(u,["fill","stroke","width","height"]):u=X(u,["fill","stroke"]);var m=_(p,l,{strokeWidth:1.5,...u}),d=n.style(["no-fill","no-events"],{stroke:k(l,c,u.stroke),strokeWidth:1.5}),E=dt(l);return E||(u={}),O(p,We(l,u),Ne(l,u),On-Bn,Bn,d),m},"bpmn:UserTask":function(p,l,u={}){u=X(u,["fill","stroke"]);var m=re(p,l,u),d=15,E=12,S=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:d,y:E}});g(p,S,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5});var j=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:d,y:E}});g(p,j,{fill:U(l,s,u.fill),stroke:k(l,c,u.stroke),strokeWidth:.5});var Y=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:d,y:E}});return g(p,Y,{fill:k(l,c,u.stroke),stroke:k(l,c,u.stroke),strokeWidth:.5}),m},label:function(p,l,u={}){return ot(p,l,u)}};this._drawPath=g,this._renderer=C}Ce(gt,Xe);gt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"];gt.prototype.canRender=function(e){return N(e,"bpmn:BaseElement")};gt.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};gt.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)};gt.prototype.getShapePath=function(e){return br(e)?Tr(e,Nu):N(e,"bpmn:Event")?no(e):N(e,"bpmn:Activity")?Tr(e,On):N(e,"bpmn:Gateway")?ro(e):io(e)};function X(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}Q();Q();var Lu=0,Iu={width:150,height:50};function Fu(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function ju(e){return _e(e)?M({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var Dr=null;function $u(){return Dr||(Dr=document.createElement("canvas").getContext("2d")),Dr}function Vu(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(po(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function po(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function qu(e,t){var n=$u();if(!n)return{width:0,height:0};n.font=Vu(t),"letterSpacing"in n&&(n.letterSpacing=po(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 Wu(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=qu(i,n),o.width=i?o.width:0,i===" "||i===""||o.width<Math.round(t)||i.length<2)return Hu(e,i,r,o);i=Uu(i,o.width,t)}}function Hu(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 fo="\xAD";function zu(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===fo)&&i.pop();break}var a=i[i.length-1];return a&&a===fo&&(i[i.length-1]="-"),i.join("")}function Uu(e,t,n){var r=Math.max(e.length*(n/t),1),i=zu(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function Gt(e){this._config=M({},{size:Iu,padding:Lu,style:{},align:"center-top"},e||{})}Gt.prototype.createText=function(e,t){return this.layoutText(e,t).element};Gt.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions};Gt.prototype.layoutText=function(e,t){for(var n=M({},this._config.size,t.box),r=M({},this._config.style,t.style),i=Fu(t.align||this._config.align),o=ju(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=Gu(r),c=e.split(/\u00AD?\r?\n/),f=[],h=n.width-o.left-o.right;c.length;)f.push(Wu(c,h,r));i.vertical==="middle"&&(o.top=o.bottom=0);var y=Ve(f,function(O,H,G){return O+(s||H.height)},0)+o.top+o.bottom,v=Ve(f,function(O,H,G){return H.width>O?H.width:O},0),A=o.top;i.vertical==="middle"&&(A+=(n.height-y)/2),A-=(s||f[0].height)/4;var W=ne("text");te(W,r),P(f,function(O){var H;switch(A+=s||O.height,i.horizontal){case"left":H=o.left;break;case"right":H=(a?v:h)-o.right-O.width;break;default:H=Math.max(((a?v:h)-O.width)/2+o.left,0)}var G=ne("tspan");te(G,{x:H,y:A}),G.textContent=O.text,fe(W,G)});var L={width:v,height:y};return{dimensions:L,element:W}};function Gu(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var Ku=12,Yu=1.2,Xu=40;function Ln(e){var t=M({fontFamily:"Arial, sans-serif",fontSize:Ku,fontWeight:"normal",lineHeight:Yu},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=M({},t,{fontSize:n},e&&e.externalStyle||{}),i=new Gt({style:t});this.getExternalLabelBounds=function(a,s){var c={width:Math.max(a.width,jt.width),height:30},f=o(s,c,{style:r});return{x:Math.round(a.x+a.width/2-f.width/2),y:a.y,width:Math.ceil(f.width),height:Math.ceil(f.height)}},this.getTextAnnotationBounds=function(a,s){var c=o(s,a,{style:t,align:"left-top",padding:An});return{x:a.x,y:a.y,width:a.width,height:Math.max(Xu,Math.round(c.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,c){return i.getDimensions(a,M({box:s},c))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}Ln.$inject=["config.textRenderer"];function Nr(){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,f=0;f<r.heightElements.length;f++)a["y"+f]=r.heightElements[f]*s;for(var h=0;h<r.widthElements.length;h++)a["x"+h]=r.widthElements[h]*c}var y=el(r.d,{mx:i,my:o,e:a});return y}}var Zu=/\{([^{}]+)\}/g,Qu=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function Ju(e,t,n){var r=n;return t.replace(Qu,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 el(e,t){return String(e).replace(Zu,function(n,r){return Ju(n,r,t)})}var ho={__init__:["bpmnRenderer"],bpmnRenderer:["type",gt],textRenderer:["type",Ln],pathMap:["type",Nr]};function Br(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,r){return t[r]||"{"+r+"}"})}var In={translate:["value",Br]};Q();var an=Math,Hm=an.PI,zm=an.min,Um=an.max,Gm=an.pow,Km=an.abs;function tl(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function sn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function mo(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function nl(e){return tl({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function rl(e){for(var t=e.waypoints,n=t.reduce(function(f,h,y){var v=t[y-1];if(v){var A=f[f.length-1],W=A&&A.endLength||0,L=il(v,h);f.push({start:v,end:h,startLength:W,endLength:W+L,length:L})}return f},[]),r=n.reduce(function(f,h){return f+h.length},0),i=r/2,o=0,a=n[o];a.endLength<i;)a=n[++o];var s=(i-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function Fn(e){return Vi(e)?rl(e):nl(e)}function il(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Se(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function jn(e,t,n){return M({id:e.id,type:e.$type,businessObject:e,di:t},n)}function ol(e,t,n){var r=e.waypoint;return!r||r.length<2?[Fn(t),Fn(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function yo(e,t,n){return new Error(`element ${Se(t)} referenced by ${Se(e)}#${n} not yet drawn`)}function it(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}it.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"];it.prototype.add=function(e,t,n){var r,i,o;if(N(t,"bpmndi:BPMNPlane")){var a=N(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(jn(e,t,a)),this._canvas.addRootElement(r)}else if(N(t,"bpmndi:BPMNShape")){var s=!dt(e,t),c=sl(e);i=n&&(n.hidden||n.collapsed);var f=t.bounds;r=this._elementFactory.createShape(jn(e,t,{collapsed:s,hidden:i,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:c})),N(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),N(e,"bpmn:Lane")&&(o=0),N(e,"bpmn:DataStoreReference")&&(al(n,Fn(f))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else if(N(t,"bpmndi:BPMNEdge")){var h=this._getSource(e),y=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(jn(e,t,{hidden:i,source:h,target:y,waypoints:ol(t,h,y)})),N(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}else throw new Error(`unknown di ${Se(t)} for element ${Se(e)}`);return Wi(e)&&$t(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r};it.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Se(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw yo(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)};it.prototype.addLabel=function(e,t,n){var r,i,o;return r=Hi(t,n),i=$t(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(jn(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!$t(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)};it.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?yo(e,r,t+"Ref"):new Error(`${Se(e)}#${t} Ref not specified`)};it.prototype._getSource=function(e){return this._getConnectedElement(e,"source")};it.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")};it.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function al(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 sl(e){return N(e,"bpmn:Group")}var go={__depends__:[In],bpmnImporter:["type",it]};var vo={__depends__:[ho,go]};Q();function $n(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}$n.prototype.next=function(){return this._prefix+ ++this._counter};var ul=new $n("ov"),ll=500;function be(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=ul,this._overlayDefaults=M({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=cl(n.getContainer()),this._init()}be.$inject=["config.overlays","eventBus","canvas","elementRegistry"];be.prototype.get=function(e){if(De(e)&&(e={id:e}),De(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?nt(t.overlays,xn({type:e.type})):t.overlays.slice():[]}else return e.type?nt(this._overlays,xn({type:e.type})):e.id?this._overlays[e.id]:null};be.prototype.add=function(e,t,n){if(_e(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=M({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r};be.prototype.remove=function(e){var t=this.get(e)||[];xe(t)||(t=[t]);var n=this;P(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(zt(r.html),zt(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)}})};be.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"};be.prototype.show=function(){Vn(this._overlayRoot)};be.prototype.hide=function(){Vn(this._overlayRoot,!1)};be.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Tn(this._overlayRoot)};be.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=Mt(t);r=o.x,i=o.y}Eo(n,r,i),kn(e.html,"data-container-id",t.id)};be.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=Mt(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=Mt(r).height:s=r.height,o=t.bottom*-1+s}Eo(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())};be.prototype._createOverlayContainer=function(e){var t=ee('<div class="djs-overlays" />');Pe(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n};be.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";bo(this._overlayRoot,n)};be.prototype._getOverlayContainer=function(e,t){var n=ve(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n};be.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)),De(r)&&(r=ee(r)),o=this._getOverlayContainer(n),i=ee('<div class="djs-overlay" data-overlay-id="'+t+'">'),Pe(i,{position:"absolute"}),i.appendChild(r),e.type&&Bt(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Vn(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())};be.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&&(wt(i)&&i>t.scale||wt(o)&&o<t.scale))&&(c=!1),Vn(a,c),this._updateOverlayScale(e,t)};be.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),wt(r)&&t.scale<r&&(a=(1/t.scale||1)*r),wt(i)&&t.scale>i&&(a=(1/t.scale||1)*i)),wt(a)&&(s="scale("+a+","+a+")"),bo(o,s)};be.prototype._updateOverlaysVisibilty=function(e){var t=this;P(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})};be.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});P(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(i);if(a){zt(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",ll,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(P(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&&Bt(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 cl(e){var t=ee('<div class="djs-overlay-container" />');return Pe(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Eo(e,t,n){Pe(e,{left:t+"px",top:n+"px"})}function Vn(e,t){e.style.display=t===!1?"none":""}function bo(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var qn={__init__:["overlays"],overlays:["type",be]};function Wn(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(_n(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)})}Wn.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var xo={__init__:["changeSupport"],changeSupport:["type",Wn]};Q();var fl=1e3;function Ae(e){this._eventBus=e}Ae.$inject=["eventBus"];function pl(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}Ae.prototype.on=function(e,t,n,r,i,o){if((tt(t)||Me(t))&&(o=i,i=r,r=n,n=t,t=null),tt(n)&&(o=i,i=r,r=n,n=fl),_e(i)&&(o=i,i=!1),!tt(r))throw new Error("handlerFn must be a function");xe(e)||(e=[e]);var a=this._eventBus;P(e,function(s){var c=["commandStack",s,t].filter(function(f){return f}).join(".");a.on(c,n,i?pl(r,o):r,o)})};Ae.prototype.canExecute=vt("canExecute");Ae.prototype.preExecute=vt("preExecute");Ae.prototype.preExecuted=vt("preExecuted");Ae.prototype.execute=vt("execute");Ae.prototype.executed=vt("executed");Ae.prototype.postExecute=vt("postExecute");Ae.prototype.postExecuted=vt("postExecuted");Ae.prototype.revert=vt("revert");Ae.prototype.reverted=vt("reverted");function vt(e){return function(n,r,i,o,a){(tt(n)||Me(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function un(e,t){t.invoke(Ae,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)})}Ce(un,Ae);un.$inject=["canvas","injector"];var wo={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",un]};Q();var hl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Et(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return hl[t]})}var ml="_plane";function ln(e){var t=e.id;return N(e,"bpmn:SubProcess")?dl(t):t}function dl(e){return e+ml}var yl="bjs-breadcrumbs-shown";function Hn(e,t,n){var r=ee('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=Bt(i);i.appendChild(r);var a=[];e.on("element.changed",function(c){var f=c.element,h=oe(f),y=ve(a,function(v){return v===h});y&&s()});function s(c){c&&(a=gl(c));var f=a.flatMap(function(y){var v=n.findRoot(ln(y))||n.findRoot(y.id);if(!v&&N(y,"bpmn:Process")){var A=t.find(function(O){var H=oe(O);return H&&H.get("processRef")===y});v=A&&n.findRoot(A.id)}if(!v)return[];var W=Et(y.name||y.id),L=ee('<li><span class="bjs-crumb"><a title="'+W+'">'+W+"</a></span></li>");return L.addEventListener("click",function(){n.setRootElement(v)}),L});r.innerHTML="";var h=f.length>1;o.toggle(yl,h),f.forEach(function(y){r.appendChild(y)})}e.on("root.set",function(c){s(c.element)})}Hn.$inject=["eventBus","elementRegistry","canvas"];function gl(e){for(var t=oe(e),n=[],r=t;r;r=r.$parent)(N(r,"bpmn:SubProcess")||N(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function zn(e,t){var n=null,r=new vl;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,!(!N(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,f=(a.y-s.y)*a.scale;(c!==0||f!==0)&&t.scroll({dx:c,dy:f}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}zn.$inject=["eventBus","canvas"];function vl(){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 _o={x:180,y:160};function bt(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}bt.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)})}};bt.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;N(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),bl(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};bt.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=El(e),r={x:n.x-_o.x,y:n.y-_o.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)})};bt.prototype._moveToDiPlane=function(e,t){var n=So(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)};bt.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};bt.$inject=["eventBus","moddle"];function So(e){return N(e,"bpmndi:BPMNDiagram")?e:So(e.$parent)}function El(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=sn(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),mo(t)}function bl(e,t){var n=e.$parent;return!(!N(n,"bpmn:SubProcess")||n===t.bpmnElement||ji(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Un=250,xl='<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>',wl="bjs-drilldown-empty";function ut(e,t,n,r,i){Ae.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",Un,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Un,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Un,function(a){var s=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(f)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Un,function(a){var s=a.oldParent,c=a.newParent||a.parent,f=a.shape;o._canDrillDown(f)&&o._addOverlay(f),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(f)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}Ce(ut,Ae);ut.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}};ut.prototype._canDrillDown=function(e){var t=this._canvas;return N(e,"bpmn:SubProcess")&&t.findRoot(ln(e))};ut.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=oe(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Bt(r.html).toggle(wl,!i)}};ut.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=oe(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ee('<button type="button" class="bjs-drilldown">'+xl+"</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(ln(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)};ut.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})};ut.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var Ao={__depends__:[qn,xo,wo],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Hn],drilldownCentering:["type",zn],drilldownOverlayBehavior:["type",ut],subprocessCompatibility:["type",bt]};Q();function Or(e){return e.originalEvent||e.srcEvent}function Ro(e,t){return(Or(e)||e).button===t}function Kt(e){return Ro(e,0)}function Co(e){return Ro(e,1)}function Po(e){var t=Or(e)||e;return Kt(e)&&t.shiftKey}function _l(e){return!0}function Gn(e){return Kt(e)||Co(e)}var ko=500;function Kn(e,t,n){var r=this;function i(b,D,R){if(!s(b,D)){var F,B,I;R?B=t.getGraphics(R):(F=D.delegateTarget||D.target,F&&(B=F,R=t.get(B))),!(!B||!R)&&(I=e.fire(b,{element:R,gfx:B,originalEvent:D}),I===!1&&(D.stopPropagation(),D.preventDefault()))}}var o={};function a(b){return o[b]}function s(b,D){var R=f[b]||Kt;return!R(D)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},f={"element.contextmenu":_l,"element.mousedown":Gn,"element.mouseup":Gn,"element.click":Gn,"element.dblclick":Gn};function h(b,D,R){var F=c[b];if(!F)throw new Error("unmapped DOM event name <"+b+">");return i(F,D,R)}var y="svg, .djs-element";function v(b,D,R,F){var B=o[R]=function(I){i(R,I)};F&&(f[R]=F),B.$delegate=on.bind(b,y,D,B)}function A(b,D,R){var F=a(R);F&&on.unbind(b,D,F.$delegate)}function W(b){P(c,function(D,R){v(b,R,D)})}function L(b){P(c,function(D,R){A(b,R,D)})}e.on("canvas.destroy",function(b){L(b.svg)}),e.on("canvas.init",function(b){W(b.svg)}),e.on(["shape.added","connection.added"],function(b){var D=b.element,R=b.gfx;e.fire("interactionEvents.createHit",{element:D,gfx:R})}),e.on(["shape.changed","connection.changed"],ko,function(b){var D=b.element,R=b.gfx;e.fire("interactionEvents.updateHit",{element:D,gfx:R})}),e.on("interactionEvents.createHit",ko,function(b){var D=b.element,R=b.gfx;r.createDefaultHit(D,R)}),e.on("interactionEvents.updateHit",function(b){var D=b.element,R=b.gfx;r.updateDefaultHit(D,R)});var O=w("djs-hit djs-hit-stroke"),H=w("djs-hit djs-hit-click-stroke"),G=w("djs-hit djs-hit-all"),T=w("djs-hit djs-hit-no-move"),g={all:G,"click-stroke":H,stroke:O,"no-move":T};function w(b,D){return D=M({stroke:"white",strokeWidth:15},D||{}),n.cls(b,["no-fill","no-border"],D)}function C(b,D){var R=g[D];if(!R)throw new Error("invalid hit type <"+D+">");return te(b,R),b}function V(b,D){fe(b,D)}this.removeHits=function(b){var D=uo(".djs-hit",b);P(D,Dt)},this.createDefaultHit=function(b,D){var R=b.waypoints,F=b.isFrame,B;return R?this.createWaypointsHit(D,R):(B=F?"stroke":"all",this.createBoxHit(D,B,{width:b.width,height:b.height}))},this.createWaypointsHit=function(b,D){var R=qt(D);return C(R,"stroke"),V(b,R),R},this.createBoxHit=function(b,D,R){R=M({x:0,y:0},R);var F=ne("rect");return C(F,D),te(F,R),V(b,F),F},this.updateDefaultHit=function(b,D){var R=He(".djs-hit",D);if(R)return b.waypoints?kr(R,b.waypoints):te(R,{width:b.width,height:b.height}),R},this.fire=i,this.triggerMouseEvent=h,this.mouseHandler=a,this.registerEvent=v,this.unregisterEvent=A}Kn.$inject=["eventBus","elementRegistry","styles"];var To={__init__:["interactionEvents"],interactionEvents:["type",Kn]};Q();function Rt(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)})}Rt.$inject=["eventBus","canvas"];Rt.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})}};Rt.prototype.get=function(){return this._selectedElements};Rt.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1};Rt.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();xe(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?P(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};Q();var Mo="hover",Do="selected";function Yn(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,Mo)}),t.on("element.out",function(i){r(i.element,Mo)}),t.on("selection.changed",function(i){function o(f){r(f,Do)}function a(f){n(f,Do)}var s=i.oldSelection,c=i.newSelection;P(s,function(f){c.indexOf(f)===-1&&o(f)}),P(c,function(f){s.indexOf(f)===-1&&a(f)})})}Yn.$inject=["canvas","eventBus"];Q();function Xn(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,c=o.hints||{},f=c.autoSelect;if(a){if(f===!1)return;xe(f)?t.select(f):t.select(s.filter(Sl))}}),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=ve(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(i){if(Kt(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Po(i);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Xn.$inject=["eventBus","selection","canvas","elementRegistry"];function Sl(e){return!e.hidden}var No={__init__:["selectionVisuals","selectionBehavior"],__depends__:[To],selection:["type",Rt],selectionVisuals:["type",Yn],selectionBehavior:["type",Xn]};Q();var Al=/^class[ {]/;function Rl(e){return Al.test(e.toString())}function Ir(e){return Array.isArray(e)}function Lr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Zn(...e){e.length===1&&Ir(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var Cl=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Pl=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,kl=/\/\*([^*]*)\*\//m;function Tl(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(Rl(e)?Cl:Pl);if(!t)return[];let n=t[1]||t[2];return n&&n.split(",").map(r=>{let i=r.match(kl);return(i&&i[1]||r).trim()})||[]}function Fr(e,t){let n=t||{get:function(T,g){if(r.push(T),g===!1)return null;throw s(`No provider for "${T}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(T){let g=r.join(" -> ");return r.length=0,new Error(g?`${T} (Resolving: ${g})`:T)};function c(T,g){if(!i[T]&&T.includes(".")){let w=T.split("."),C=c(w.shift());for(;w.length;)C=C[w.shift()];return C}if(Lr(o,T))return o[T];if(Lr(i,T)){if(r.indexOf(T)!==-1)throw r.push(T),s("Cannot resolve circular dependency!");return r.push(T),o[T]=i[T][0](i[T][1]),r.pop(),o[T]}return n.get(T,g)}function f(T,g){if(typeof g=="undefined"&&(g={}),typeof T!="function")if(Ir(T))T=Zn(T.slice());else throw s(`Cannot invoke "${T}". Expected a function!`);let C=(T.$inject||Tl(T)).map(V=>Lr(g,V)?g[V]:c(V));return{fn:T,dependencies:C}}function h(T){let{fn:g,dependencies:w}=f(T),C=Function.prototype.bind.call(g,null,...w);return new C}function y(T,g,w){let{fn:C,dependencies:V}=f(T,w);return C.apply(g,V)}function v(T){return Zn(g=>T.get(g))}function A(T,g){if(g&&g.length){let w=Object.create(null),C=Object.create(null),V=[],b=[],D=[],R,F,B,I;for(let K in i)R=i[K],g.indexOf(K)!==-1&&(R[2]==="private"?(F=V.indexOf(R[3]),F===-1?(B=R[3].createChild([],g),I=v(B),V.push(R[3]),b.push(B),D.push(I),w[K]=[I,K,"private",B]):w[K]=[D[F],K,"private",b[F]]):w[K]=[R[2],R[1]],C[K]=!0),(R[2]==="factory"||R[2]==="type")&&R[1].$scope&&g.forEach(ot=>{R[1].$scope.indexOf(ot)!==-1&&(w[K]=[R[2],R[1]],C[ot]=!0)});g.forEach(K=>{if(!C[K])throw new Error('No provider for "'+K+'". Cannot use provider from the parent!')}),T.unshift(w)}return new Fr(T,a)}let W={factory:y,type:h,value:function(T){return T}};function L(T,g){let w=T.__init__||[];return function(){w.forEach(C=>{typeof C=="string"?g.get(C):g.invoke(C)})}}function O(T){let g=T.__exports__;if(g){let w=T.__modules__,C=Object.keys(T).reduce((F,B)=>(B!=="__exports__"&&B!=="__modules__"&&B!=="__init__"&&B!=="__depends__"&&(F[B]=T[B]),F),Object.create(null)),V=(w||[]).concat(C),b=A(V),D=Zn(function(F){return b.get(F)});g.forEach(function(F){i[F]=[D,F,"private",b]});let R=(T.__init__||[]).slice();return R.unshift(function(){b.init()}),T=Object.assign({},T,{__init__:R}),L(T,b)}return Object.keys(T).forEach(function(w){if(w==="__init__"||w==="__depends__")return;let C=T[w];if(C[2]==="private"){i[w]=C;return}let V=C[0],b=C[1];i[w]=[W[V],Ml(V,b),V]}),L(T,a)}function H(T,g){return T.indexOf(g)!==-1||(T=(g.__depends__||[]).reduce(H,T),T.indexOf(g)!==-1)?T:T.concat(g)}function G(T){let g=T.reduce(H,[]).map(O),w=!1;return function(){w||(w=!0,g.forEach(C=>C()))}}this.get=c,this.invoke=y,this.instantiate=h,this.createChild=A,this.init=G(e)}function Ml(e,t){return e!=="value"&&Ir(t)&&(t=Zn(t.slice())),t}Q();var Dl=1;function lt(e,t){Xe.call(this,e,Dl),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Ce(lt,Xe);lt.prototype.canRender=function(){return!0};lt.prototype.drawShape=function(t,n,r){var i=ne("rect");return te(i,{x:0,y:0,width:n.width||0,height:n.height||0}),Sn(n)?te(i,M({},this.FRAME_STYLE,r||{})):te(i,M({},this.SHAPE_STYLE,r||{})),fe(t,i),i};lt.prototype.drawConnection=function(t,n,r){var i=qt(n.waypoints,M({},this.CONNECTION_STYLE,r||{}));return fe(t,i),i};lt.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,o=t.height,a=[["M",n,r],["l",i,0],["l",0,o],["l",-i,0],["z"]];return yt(a)};lt.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,o=[];for(r=0;i=n[r];r++)i=i.original||i,o.push([r===0?"M":"L",i.x,i.y]);return yt(o)};lt.$inject=["eventBus","styles"];Q();function jr(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var o=this.style(r,i);return M(o,{class:n})},this.style=function(n,r){!xe(n)&&!r&&(r=n,n=[]);var i=Ve(n,function(o,a){return M(o,e[a]||{})},{});return r?M(i,r):i},this.computeStyle=function(n,r,i){return xe(r)||(i=r,r=[]),t.style(r||[],M({},i,n||{}))}}var Bo={__init__:["defaultRenderer"],defaultRenderer:["type",lt],styles:["type",jr]};Q();function Oo(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Lo(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Qn(e,t){return Math.round(e*t)/t}function Io(e){return Me(e)?e+"px":e}function Nl(e){for(;e.parent;)e=e.parent;return e}function Bl(e){e=M({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Pe(n,{position:"relative",overflow:"hidden",width:Io(e.width),height:Io(e.height)}),t.appendChild(n),n}function Fo(e,t,n){let r=ne("g");qe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var Ol="base",jo=0,Ll=1,Il={shape:["x","y","width","height"],connection:["waypoints"]};function q(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}q.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];q.prototype._init=function(e){let t=this._eventBus,n=this._container=Bl(e),r=this._svg=ne("svg");te(r,{width:"100%",height:"100%"}),kn(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),fe(n,r);let i=this._viewport=Fo(r,"viewport");e.deferUpdate&&(this._viewboxChanged=dr(Ye(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};q.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};q.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};q.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=_n(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};q.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};q.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};q.prototype.isFocused=function(){return this._focused};q.prototype.getDefaultLayer=function(){return this.getLayer(Ol,jo)};q.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};q.prototype._getChildIndex=function(e){return Ve(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};q.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=Ll);let n=this._getChildIndex(t);return{group:Fo(this._viewport,"layer-"+e,n),index:t,visible:!0}};q.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};q.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(Dt(n),t.visible=!1),n};q.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Dt(t.group))};q.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};q.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(Nl(e))||{}).rootElement:void 0};q.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};q.prototype._findPlaneForRoot=function(e){return ve(this._planes,function(t){return t.rootElement===e})};q.prototype.getContainer=function(){return this._container};q.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(P([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),qe(i).add(t)):(e.markers.delete(t),qe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};q.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};q.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};q.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};q.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};q.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};q.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,jo);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};q.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};q.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};q.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};q.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};q.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};q.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=Il[e];if(!bn(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};q.prototype._setParent=function(e,t,n){Lo(t.children,e,n),e.parent=t};q.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};q.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};q.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};q.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Oo(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};q.prototype.removeShape=function(e){return this._removeElement(e,"shape")};q.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};q.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};q.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};q.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};q.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,s,c,f;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let h=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Nt(t,h)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Nt(t),i=a?a.matrix:Qi(),s=Qn(i.a,1e3),c=Qn(-i.e||0,1e3),f=Qn(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:f?f/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};q.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=M({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),$o(t,n)}),{x:n.e,y:n.f}};q.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Mt(e),o=sn(i),a=this.viewbox(),s=this.zoom(),c,f;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;let h=sn(a);if(!(i.width<a.width&&i.height<a.height))c=i.x-a.x,f=i.y-a.y;else{let v=Math.max(0,o.right-h.right),A=Math.min(0,o.left-h.left),W=Math.max(0,o.bottom-h.bottom),L=Math.min(0,o.top-h.top);c=v||A,f=W||L}this.scroll({dx:-c*s,dy:-f*s})};q.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,r;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),Qn(r.a,1e3)};function $o(e,t){let n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}q.prototype._fitViewport=function(e){let t=this.viewbox(),n=t.outer,r=t.inner,i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};q.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,s,c,f,h;c=r.getCTM();let y=c.a;return t?(a=M(o,t),s=a.matrixTransform(c.inverse()),f=i.translate(s.x,s.y).scale(1/y*e).translate(-s.x,-s.y),h=c.multiply(f)):h=i.scale(e),$o(this._viewport,h),h};q.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};q.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};q.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Yt="data-element-id";function Be(e){this._elements={},this._eventBus=e}Be.$inject=["eventBus"];Be.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),te(t,Yt,r),n&&te(n,Yt,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Be.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(te(r.gfx,Yt,""),r.secondaryGfx&&te(r.secondaryGfx,Yt,""),delete t[n])};Be.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};Be.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&te(t,Yt,r),t};Be.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&te(e,Yt);var n=this._elements[t];return n&&n.element};Be.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Be.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i],a=o.element,s=o.gfx;if(e(a,s))return a}};Be.prototype.getAll=function(){return this.filter(function(e){return e})};Be.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})};Be.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)};Be.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};Q();function Fl(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,i,r)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a=="undefined"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function jl(e){return e.__refs_collection===!0}function $l(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Vo(e,t,n){var r=Fl(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(i){e.set(i,t.inverse,n)})}function Vl(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(o){if(o!==i){var a=i;i=null,a&&e.unset(a,r,n),i=o,e.set(i,r,n)}}})}function ze(e,t){if(!(this instanceof ze))return new ze(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}ze.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Vo(this,t,e):Vl(this,t,e)};ze.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return jl(n)||Vo(this,t,e),n};ze.prototype.ensureBound=function(e,t){$l(e,t)||this.bind(e,t)};ze.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};ze.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var $r=new ze({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Wo=new ze({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),qo=new ze({name:"attachers",collection:!0},{name:"host"}),Ho=new ze({name:"outgoing",collection:!0},{name:"source"}),zo=new ze({name:"incoming",collection:!0},{name:"target"});function cn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),$r.bind(this,"parent"),Wo.bind(this,"labels"),Ho.bind(this,"outgoing"),zo.bind(this,"incoming")}function fn(){cn.call(this),$r.bind(this,"children"),qo.bind(this,"host"),qo.bind(this,"attachers")}Ce(fn,cn);function Uo(){cn.call(this),$r.bind(this,"children")}Ce(Uo,fn);function Go(){fn.call(this),Wo.bind(this,"labelTarget")}Ce(Go,fn);function Ko(){cn.call(this),Ho.bind(this,"source"),zo.bind(this,"target")}Ce(Ko,cn);var ql={connection:Ko,shape:fn,label:Go,root:Uo};function Yo(e,t){var n=ql[e];if(!n)throw new Error("unknown type: <"+e+">");return M(new n,t)}Q();function Ct(){this._uid=12}Ct.prototype.createRoot=function(e){return this.create("root",e)};Ct.prototype.createLabel=function(e){return this.create("label",e)};Ct.prototype.createShape=function(e){return this.create("shape",e)};Ct.prototype.createConnection=function(e){return this.create("connection",e)};Ct.prototype.create=function(e,t){return t=M({},t||{}),t.id||(t.id=e+"_"+this._uid++),Yo(e,t)};Q();var Jn="__fn",Xo=1e3,Wl=Array.prototype.slice;function ke(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ke.prototype.on=function(e,t,n,r){if(e=xe(e)?e:[e],tt(t)&&(r=n,n=t,t=Xo),!Me(t))throw new Error("priority must be a number");var i=n;r&&(i=Ye(n,r),i[Jn]=n[Jn]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};ke.prototype.once=function(e,t,n,r){var i=this;if(tt(t)&&(r=n,n=t,t=Xo),!Me(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[Jn]=n,this.on(e,t,o)};ke.prototype.off=function(e,t){e=xe(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};ke.prototype.createEvent=function(e){var t=new pn;return t.init(e),t};ke.prototype.fire=function(e,t){var n,r,i,o;if(o=Wl.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof pn?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};ke.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};ke.prototype._destroy=function(){this._listeners={}};ke.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};ke.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=Hl(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};ke.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t};ke.prototype._getListeners=function(e){return this._listeners[e]};ke.prototype._setListeners=function(e,t){this._listeners[e]=t};ke.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,o;if(!t){this._setListeners(e,null);return}for(;n;)r=n.next,o=n.callback,(o===t||o[Jn]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function pn(){}pn.prototype.stopPropagation=function(){this.cancelBubble=!0};pn.prototype.preventDefault=function(){this.defaultPrevented=!0};pn.prototype.init=function(e){M(this,e||{})};function Hl(e,t){return e.apply(null,t)}Q();function Zo(e){return e.childNodes[0]}function Qo(e){return e.parentNode.childNodes[1]}function Oe(e,t){this._eventBus=e,this._elementRegistry=t}Oe.$inject=["eventBus","elementRegistry"];Oe.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Qo(t),n||(n=ne("g"),qe(n).add("djs-children"),fe(t.parentNode,n))):n=t,n};Oe.prototype._clear=function(e){var t=Zo(e);return Tn(t),t};Oe.prototype._createContainer=function(e,t,n,r){var i=ne("g");qe(i).add("djs-group"),typeof n!="undefined"?Jo(i,t,t.childNodes[n]):fe(t,i);var o=ne("g");qe(o).add("djs-element"),qe(o).add("djs-"+e),r&&qe(o).add("djs-frame"),fe(i,o);var a=ne("g");return qe(a).add("djs-visual"),fe(o,a),o};Oe.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,Sn(t))};Oe.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,r;r=Ve(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),P(r,function(i){var o=i.children;if(o){var a=t._getChildrenContainer(i);P(o.slice().reverse(),function(s){var c=n.getGraphics(s);Jo(c.parentNode,a)})}})};Oe.prototype.drawShape=function(e,t,n={}){var r=this._eventBus;return r.fire("render.shape",{gfx:e,element:t,attrs:n})};Oe.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)};Oe.prototype.drawConnection=function(e,t,n={}){var r=this._eventBus;return r.fire("render.connection",{gfx:e,element:t,attrs:n})};Oe.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)};Oe.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e==="shape")this.drawShape(r,t),Nn(n,t.x,t.y);else if(e==="connection")this.drawConnection(r,t);else throw new Error("unknown type: "+e);t.hidden?te(n,"display","none"):te(n,"display","block")}};Oe.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Dt(t.parentNode)};function Jo(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}var ea={__depends__:[Bo],__init__:["canvas"],canvas:["type",q],elementRegistry:["type",Be],elementFactory:["type",Ct],eventBus:["type",ke],graphicsFactory:["type",Oe]};function zl(e){var t=new Fr(e);return t.init(),t}function Ul(e){e=e||{};var t={config:["value",e]},n=[t,ea].concat(e.modules||[]);return zl(n)}function ct(e,t){this._injector=t||Ul(e),this.get("eventBus").fire("diagram.init")}ct.prototype.get=function(e,t){return this._injector.get(e,t)};ct.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)};ct.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")};ct.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};Q();Q();function Wr(){}Wr.prototype.get=function(e){return this.$model.properties.get(this,e)};Wr.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function na(e,t){this.model=e,this.properties=t}na.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(Wr.prototype);P(e.properties,function(a){!a.isMany&&a.default!==void 0&&(r[a.name]=a.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(a){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),P(a,Ye(function(s,c){this.set(c,s)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Gl={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ra={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function er(e,t){var n=ra[e];return n?n(t):t}function Vr(e){return!!Gl[e]}function Hr(e){return!!ra[e]}function Re(e,t){var n=e.split(/:/),r,i;if(n.length===1)r=e,i=t;else if(n.length===2)r=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function Ue(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Ue.prototype.build=function(){return gr(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};Ue.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};Ue.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t};Ue.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Re(i[0],r),a=Re(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};Ue.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};Ue.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};Ue.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};Ue.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};Ue.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};Ue.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};Ue.prototype.hasProperty=function(e){return this.propertiesByName[e]};Ue.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(P(e.properties,Ye(function(o){o=M({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Pt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,P(e,Ye(this.registerPackage,this))}Pt.prototype.getPackage=function(e){return this.packageMap[e]};Pt.prototype.getPackages=function(){return this.packages};Pt.prototype.registerPackage=function(e){e=M({},e);var t=this.packageMap;ta(t,e,"prefix"),ta(t,e,"uri"),P(e.types,Ye(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Pt.prototype.registerType=function(e,t){e=M({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:M(e.meta||{})});var n=Re(e.name,t.prefix),r=n.name,i={};P(e.properties,Ye(function(o){var a=Re(o.name,n.prefix),s=a.name;Vr(o.type)||(o.type=Re(o.type,a.prefix).name),M(o,{ns:a,name:s}),i[s]=o},this)),M(e,{ns:n,name:r,propertiesByName:i}),P(e.extends,Ye(function(o){var a=Re(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Pt.prototype.mapTypes=function(e,t,n){var r=Vr(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,f){var h=Re(c,Vr(c)?"":e.prefix);i.mapTypes(h,t,f)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");P(r.superClass,n?a:s),t(r,!n),P(r.traits,a)};Pt.prototype.getEffectiveDescriptor=function(e){var t=Re(e),n=new Ue(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Pt.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function ta(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Ot(e){this.model=e}Ot.prototype.set=function(e,t,n){if(!De(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;Kl(n)?r?delete e[i]:delete e.$attrs[qr(t)]:r?i in e?e[i]=n:ia(e,r,n):e.$attrs[qr(t)]=n};Ot.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[qr(t)];var r=n.name;return!e[r]&&n.isMany&&ia(e,n,[]),e[r]};Ot.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=M({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Ot.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ot.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ot.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function Kl(e){return typeof e=="undefined"}function ia(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function qr(e){return e.replace(/^:/,"")}function Fe(e,t={}){this.properties=new Ot(this),this.factory=new na(this,this.properties),this.registry=new Pt(e,this.properties),this.typeCache={},this.config=t}Fe.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};Fe.prototype.getType=function(e){var t=this.typeCache,n=De(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};Fe.prototype.createAny=function(e,t,n){var r=Re(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){yr(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),P(n,function(a,s){_e(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};Fe.prototype.getPackage=function(e){return this.registry.getPackage(e)};Fe.prototype.getPackages=function(){return this.registry.getPackages()};Fe.prototype.getElementDescriptor=function(e){return e.$descriptor};Fe.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};Fe.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};Fe.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};Q();var oa=String.fromCharCode,Yl=Object.prototype.hasOwnProperty,Xl=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,hn={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(hn).forEach(function(e){hn[e.toUpperCase()]=hn[e]});function Zl(e,t,n,r){return r?Yl.call(hn,r)?hn[r]:"&"+r+";":oa(t||parseInt(n,16))}function Lt(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Xl,Zl):e}var aa="non-whitespace outside of root node";function Xt(e){return new Error(e)}function sa(e){return"missing namespace for prefix <"+e+">"}function tr(e){return{get:e,enumerable:!0}}function Ql(e){var t={},n;for(n in e)t[n]=e[n];return t}function zr(e){return e+"$uri"}function Jl(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[zr(r)]=n;return t}function ua(){return{line:0,column:0}}function ec(e){throw e}function Ur(e){if(!this)return new Ur(e);var t=e&&e.proxy,n,r,i,o,a=ec,s,c,f,h,y=ua,v=!1,A=!1,W=null,L=!1,O;function H(g){g instanceof Error||(g=Xt(g)),W=g,a(g,y)}function G(g){s&&(g instanceof Error||(g=Xt(g)),s(g,y))}this.on=function(g,w){if(typeof w!="function")throw Xt("required args <name, cb>");switch(g){case"openTag":r=w;break;case"text":n=w;break;case"closeTag":i=w;break;case"error":a=w;break;case"warn":s=w;break;case"cdata":o=w;break;case"attention":h=w;break;case"question":f=w;break;case"comment":c=w;break;default:throw Xt("unsupported event: "+g)}return this},this.ns=function(g){if(typeof g=="undefined"&&(g={}),typeof g!="object")throw Xt("required args <nsMap={}>");var w={},C;for(C in g)w[C]=g[C];return A=!0,O=w,this},this.parse=function(g){if(typeof g!="string")throw Xt("required args <xml=string>");return W=null,T(g),y=ua,L=!1,W},this.stop=function(){L=!0};function T(g){var w=A?[]:null,C=A?Jl(O):null,V,b=[],D=0,R=!1,F=!1,B=0,I=0,K,ot,ae,Z,Je,et,ye,Ge,x,_="",$=0,re;function je(){if(re!==null)return re;var l,u,m,d=A&&C.xmlns,E=A&&v?[]:null,S=$,j=_,Y=j.length,ge,he,we,Ke,ie,mt={},gn={},$e,z,J;e:for(;S<Y;S++)if($e=!1,z=j.charCodeAt(S),!(z===32||z<14&&z>8)){for((z<65||z>122||z>90&&z<97)&&z!==95&&z!==58&&(G("illegal first char attribute name"),$e=!0),J=S+1;J<Y;J++)if(z=j.charCodeAt(J),!(z>96&&z<123||z>64&&z<91||z>47&&z<59||z===46||z===45||z===95)){if(z===32||z<14&&z>8){G("missing attribute value"),S=J;continue e}if(z===61)break;G("illegal attribute name char"),$e=!0}if(ie=j.substring(S,J),ie==="xmlns:xmlns"&&(G("illegal declaration of xmlns"),$e=!0),z=j.charCodeAt(J+1),z===34)J=j.indexOf('"',S=J+2),J===-1&&(J=j.indexOf("'",S),J!==-1&&(G("attribute value quote missmatch"),$e=!0));else if(z===39)J=j.indexOf("'",S=J+2),J===-1&&(J=j.indexOf('"',S),J!==-1&&(G("attribute value quote missmatch"),$e=!0));else for(G("missing attribute value quotes"),$e=!0,J=J+1;J<Y&&(z=j.charCodeAt(J+1),!(z===32||z<14&&z>8));J++);for(J===-1&&(G("missing closing quotes"),J=Y,$e=!0),$e||(we=j.substring(S,J)),S=J;J+1<Y&&(z=j.charCodeAt(J+1),!(z===32||z<14&&z>8));J++)S===J&&(G("illegal character after attribute end"),$e=!0);if(S=J+1,$e)continue e;if(ie in gn){G("attribute <"+ie+"> already defined");continue}if(gn[ie]=!0,!A){mt[ie]=we;continue}if(v){if(he=ie==="xmlns"?"xmlns":ie.charCodeAt(0)===120&&ie.substr(0,6)==="xmlns:"?ie.substr(6):null,he!==null){if(l=Lt(we),u=zr(he),Ke=O[l],!Ke){if(he==="xmlns"||u in C&&C[u]!==l)do Ke="ns"+D++;while(typeof C[Ke]!="undefined");else Ke=he;O[l]=Ke}C[he]!==Ke&&(ge||(C=Ql(C),ge=!0),C[he]=Ke,he==="xmlns"&&(C[zr(Ke)]=l,d=Ke),C[u]=l),mt[ie]=we;continue}E.push(ie,we);continue}if(z=ie.indexOf(":"),z===-1){mt[ie]=we;continue}if(!(m=C[ie.substring(0,z)])){G(sa(ie.substring(0,z)));continue}ie=d===m?ie.substr(z+1):m+ie.substr(z),mt[ie]=we}if(v)for(S=0,Y=E.length;S<Y;S++){if(ie=E[S++],we=E[S],z=ie.indexOf(":"),z!==-1){if(!(m=C[ie.substring(0,z)])){G(sa(ie.substring(0,z)));continue}ie=d===m?ie.substr(z+1):m+ie.substr(z)}mt[ie]=we}return re=mt}function p(){for(var l=/(\r\n|\r|\n)/g,u=0,m=0,d=0,E=I,S,j;B>=d&&(S=l.exec(g),!(!S||(E=S[0].length+S.index,E>B)));)u+=1,d=E;return B==-1?(m=E,j=g.substring(I)):I===0?j=g.substring(I,B):(m=B-d,j=I==-1?g.substring(B):g.substring(B,I+1)),{data:j,line:u,column:m}}for(y=p,t&&(x=Object.create({},{name:tr(function(){return ye}),originalName:tr(function(){return Ge}),attrs:tr(je),ns:tr(function(){return C})}));I!==-1;){if(g.charCodeAt(I)===60?B=I:B=g.indexOf("<",I),B===-1){if(b.length)return H("unexpected end of file");if(I===0)return H("missing start tag");I<g.length&&g.substring(I).trim()&&G(aa);return}if(I!==B){if(b.length){if(n&&(n(g.substring(I,B),Lt,y),L))return}else if(g.substring(I,B).trim()&&(G(aa),L))return}if(Z=g.charCodeAt(B+1),Z===33){if(ae=g.charCodeAt(B+2),ae===91&&g.substr(B+3,6)==="CDATA["){if(I=g.indexOf("]]>",B),I===-1)return H("unclosed cdata");if(o&&(o(g.substring(B+9,I),y),L))return;I+=3;continue}if(ae===45&&g.charCodeAt(B+3)===45){if(I=g.indexOf("-->",B),I===-1)return H("unclosed comment");if(c&&(c(g.substring(B+4,I),Lt,y),L))return;I+=3;continue}}if(Z===63){if(I=g.indexOf("?>",B),I===-1)return H("unclosed question");if(f&&(f(g.substring(B,I+2),y),L))return;I+=2;continue}for(K=B+1;;K++){if(Je=g.charCodeAt(K),isNaN(Je))return I=-1,H("unclosed tag");if(Je===34)ae=g.indexOf('"',K+1),K=ae!==-1?ae:K;else if(Je===39)ae=g.indexOf("'",K+1),K=ae!==-1?ae:K;else if(Je===62){I=K;break}}if(Z===33){if(h&&(h(g.substring(B,I+1),Lt,y),L))return;I+=1;continue}if(re={},Z===47){if(R=!1,F=!0,!b.length)return H("missing open tag");if(K=ye=b.pop(),ae=B+2+K.length,g.substring(B+2,ae)!==K)return H("closing tag mismatch");for(;ae<I;ae++)if(Z=g.charCodeAt(ae),!(Z===32||Z>8&&Z<14))return H("close tag")}else{if(g.charCodeAt(I-1)===47?(K=ye=g.substring(B+1,I-1),R=!0,F=!0):(K=ye=g.substring(B+1,I),R=!0,F=!1),!(Z>96&&Z<123||Z>64&&Z<91||Z===95||Z===58))return H("illegal first char nodeName");for(ae=1,ot=K.length;ae<ot;ae++)if(Z=K.charCodeAt(ae),!(Z>96&&Z<123||Z>64&&Z<91||Z>47&&Z<59||Z===45||Z===95||Z==46)){if(Z===32||Z<14&&Z>8){ye=K.substring(0,ae),re=null;break}return H("invalid nodeName")}F||b.push(ye)}if(A){if(V=C,R&&(F||w.push(V),re===null&&(v=K.indexOf("xmlns",ae)!==-1)&&($=ae,_=K,je(),v=!1)),Ge=ye,Z=ye.indexOf(":"),Z!==-1){if(et=C[ye.substring(0,Z)],!et)return H("missing namespace on <"+Ge+">");ye=ye.substr(Z+1)}else et=C.xmlns;et&&(ye=et+":"+ye)}if(R&&($=ae,_=K,r&&(t?r(x,Lt,F,y):r(ye,je,Lt,F,y),L)))return;if(F){if(i&&(i(t?x:ye,Lt,R,y),L))return;A&&(R?C=V:C=w.pop())}I+=1}}}function la(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Gr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ca="property";function fa(e){return e.xml&&e.xml.serialize}function tc(e){let t=fa(e);return t!==ca&&(t||null)}function nc(e){return e.charAt(0).toUpperCase()+e.slice(1)}function pa(e,t){return la(t)?e.prefix+":"+nc(e.localName):e.name}function rc(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function ic(e,t,n){let r=Re(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Re(i);var a=n.getPackage(o.prefix);return rc(o,a)}function kt(e){return new Error(e)}function xt(e){return e.$descriptor}function oc(e){M(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw kt("expected element");var n=this.elementsById,r=xt(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw kt("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function mn(){}mn.prototype.handleEnd=function(){};mn.prototype.handleText=function(){};mn.prototype.handleNode=function(){};function Kr(){}Kr.prototype=Object.create(mn.prototype);Kr.prototype.handleNode=function(){return this};function Qt(){}Qt.prototype=Object.create(mn.prototype);Qt.prototype.handleText=function(e){this.body=(this.body||"")+e};function dn(e,t){this.property=e,this.context=t}dn.prototype=Object.create(Qt.prototype);dn.prototype.handleNode=function(e){if(this.element)throw kt("expected no sub nodes");return this.element=this.createReference(e),this};dn.prototype.handleEnd=function(){this.element.id=this.body};dn.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Yr(e,t){this.element=t,this.propertyDesc=e}Yr.prototype=Object.create(Qt.prototype);Yr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=er(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function nr(){}nr.prototype=Object.create(Qt.prototype);nr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Te(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Te.prototype=Object.create(nr.prototype);Te.prototype.addReference=function(e){this.context.addReference(e)};Te.prototype.handleText=function(e){var t=this.element,n=xt(t),r=n.bodyProperty;if(!r)throw kt("unexpected body text <"+e+">");Qt.prototype.handleText.call(this,e)};Te.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xt(t),r=n.bodyProperty;r&&e!==void 0&&(e=er(r.type,e),t.set(r.name,e))};Te.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=xt(n),i=this.context,o=new n({}),a=this.model,s;return P(t,function(c,f){var h=r.propertiesByName[f],y;h&&h.isReference?h.isMany?(y=c.split(" "),P(y,function(v){i.addReference({element:o,property:h.ns.name,id:v})})):i.addReference({element:o,property:h.ns.name,id:c}):(h?c=er(h.type,c):f==="xmlns"?f=":"+f:(s=Re(f,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+f+">",element:o,property:f,value:c})),o.set(f,c))}),o};Te.prototype.getPropertyForNode=function(e){var t=e.name,n=Re(t),r=this.type,i=this.model,o=xt(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let f=tc(s);if(f){let h=e.attributes[f];if(h){let y=ic(h,e.ns,i),v=i.getType(y);return M({},s,{effectiveType:xt(v).name})}}return s}var c=i.getPackage(n.prefix);if(c){let f=pa(n,c),h=i.getType(f);if(s=ve(o.properties,function(y){return!y.isVirtual&&!y.isReference&&!y.isAttribute&&h.hasType(y.type)}),s)return M({},s,{effectiveType:xt(h).name})}else if(s=ve(o.properties,function(f){return!f.isReference&&!f.isAttribute&&f.type==="Element"}),s)return s;throw kt("unrecognized element <"+n.name+">")};Te.prototype.toString=function(){return"ElementDescriptor["+xt(this.type).name+"]"};Te.prototype.valueHandler=function(e,t){return new Yr(e,t)};Te.prototype.referenceHandler=function(e){return new dn(e,this.context)};Te.prototype.handler=function(e){return e==="Element"?new Zt(this.model,e,this.context):new Te(this.model,e,this.context)};Te.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Hr(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(M(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Xr(e,t,n){Te.call(this,e,t,n)}Xr.prototype=Object.create(Te.prototype);Xr.prototype.createElement=function(e){var t=e.name,n=Re(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&pa(n,o)||t;if(!i.hasType(a))throw kt("unexpected element <"+e.originalName+">");return Te.prototype.createElement.call(this,e)};function Zt(e,t,n){this.model=e,this.context=n}Zt.prototype=Object.create(nr.prototype);Zt.prototype.createElement=function(e){var t=e.name,n=Re(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};Zt.prototype.handleChild=function(e){var t=new Zt(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};Zt.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function rr(e){e instanceof Fe&&(e={model:e}),M(this,{lax:!1},e)}rr.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Te?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new oc(M({},t,{rootHandler:r})),s=new Ur({proxy:!0}),c=ac();r.context=a,c.push(r);function f(w,C,V){var b=C(),D=b.line,R=b.column,F=b.data;F.charAt(0)==="<"&&F.indexOf(" ")!==-1&&(F=F.slice(0,F.indexOf(" "))+">");var B="unparsable content "+(F?F+" ":"")+`detected