Home
last modified time | relevance | path

Searched refs:UC (Results 1 – 9 of 9) sorted by relevance

/plugin/statistics/vendor/matomo/device-detector/
H A DREADME.md288UC Lite, Fast Explorer, Lightning Browser, Cake Browser, IE Browser Fast, Vegas Browser, OH Browse…
/plugin/vegalite/
H A Dvega.min.js1UC(t){La.call(this,null,t)}UC.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size"…
/plugin/mermaid/
H A Dmermaid.min.js2UC(e,t){var r=bu(["base"],e,t),i=bu(["strut"]);return i.style.height=It(r.height+r.depth),r.depth&… class in t.sanitize.UY
256 …e throw new Lt("Got group of unknown type: '"+t.type+"'")},"buildGroup");o(UC,"buildHTMLUnbreakabl…
/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"?> class
[all...]
/plugin/bpmnio/vendor/bpmn-js/dist/
H A Dbpmn-modeler.production.min.js262 </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,`
/plugin/ol3/
Dscript.js8 …eMatrixSet:Fc(U_),TileMatrixSetLimits:Fc((function(t,e){return Uc([],UC,t,e)}))}),UC=Gc(FC,{TileMa…
/plugin/aichat/vendor/mehrab-wj/tiktoken-php/data/
H A Dvocab.bpe16442 UC K
/plugin/dirtylittlehelper/mermaid/editor/docs/
D3.3.js.map1 …ches for Ruby Markup document as well as in CSS Ruby Module Level 1. [RUBY-UC] [CSSRUBY]\"\n …
/plugin/codemirror/dist/
Dscripts.min.js.map1 …WyoD,SAASz6C,QAAUA,CAC9BhO,GAAWyoD,SAAS2pB,WAAa,SAASjiE,GAAKnC,EAAQmC,EAAI,UC/P7D,SAAUm2C,GACR,SAA…